This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pyttsx3 | |
import PyPDF2 | |
path = open('resume.pdf', 'rb') | |
pdf_reader = PyPDF2.PdfFileReader(path) | |
from_page = pdfReader.getPage(0) | |
text = from_page.extractText() | |
speak = pyttsx3.init() | |
speak.say(text) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#1st snippet | |
from keras import backend as K | |
cfg = K.tf.ConfigProto() | |
cfg.gpu_options.allow_growth = True | |
K.set_session(K.tf.Session(config=cfg)) | |
#2nd snippet | |
def limit_mem(): | |
K.get_session().close() | |
cfg = K.tf.ConfigProto() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
# Disable all GPUS | |
tf.config.set_visible_devices([], 'GPU') | |
visible_devices = tf.config.get_visible_devices() | |
for device in visible_devices: | |
assert device.device_type != 'GPU' | |
except: | |
# Invalid device or cannot modify virtual devices once initialized. | |
pass | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## How to activate anaconda from terminal? | |
1. open terminal and write: | |
``` | |
conda activate | |
``` | |
It will show base activated succesfully. | |
## How to deactivate anaconda from terminal? | |
``` | |
conda deactivate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pydub import AudioSegment | |
mysound = AudioSegment.from_wav("stereo_infile.wav") | |
# set mono channel | |
mysound = mysound.set_channels(1) | |
# save the result | |
mysound.export("mono_outfile.wav", format="wav") It was originally published on https://www.apriorit.com/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import noisereduce as nr | |
from scipy.io import wavfile | |
# load data | |
rate, data = wavfile.read("voice_with_noise.wav") | |
# perform noise reduction | |
reduced_noise = nr.reduce_noise(y=data, sr=rate) It was originally published on https://www.apriorit.com/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
"""Toxicity Classifier NLP.ipynb | |
Automatically generated by Colaboratory. | |
Original file is located at | |
https://colab.research.google.com/drive/1UUZzQgrRUcLujGxbmhE30AlQALMsYXCm | |
""" | |
# Commented out IPython magic to ensure Python compatibility. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fastapi import FastAPI | |
import pickle | |
import numpy as np | |
from sklearn.feature_extraction.text import TfidfVectorizer | |
from sklearn.naive_bayes import MultinomialNB | |
app = FastAPI() | |
# Load the Tfidf and Naive Bayes models | |
tfidf = pickle.load(open("tf_idf.pkt", "rb")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTML_WRAPPER = """<div style="overflow-x: auto; border: 1px solid #e6e9ef; border-radius: 0.25rem; padding: 1rem">{}</div>""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
"""Reverse SD.ipynb | |
Automatically generated by Colaboratory. | |
Original file is located at | |
https://colab.research.google.com/drive/1ci11cstH7uM9SPb6q2hb7f-IiZHYvcDq | |
""" | |
!pip install clip-interrogator==0.6.0 |
OlderNewer