View Notebook like a boss.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View word2vec_tf_idf_load.py
from gensim.corpora.wikicorpus import WikiCorpus | |
from gensim.models import TfidfModel | |
wiki = WikiCorpus.load('wiki.corpus') | |
tfidf = TfidfModel.load("wiki.gensim.tfidfmodel") | |
# transform sentence in bow | |
sentence = "hi my name is" | |
sentence = wiki.dictionary.doc2bow(sentence.lower().split()) # [(662762, 1), (1271346, 1), (1756375, 1), (1770642, 1)] | |
# tfidf for that sentence |
View word2vec_tf_idf_from_wikipeida.py
import multiprocessing | |
from gensim.corpora.wikicorpus import WikiCorpus | |
from gensim.models.word2vec import Word2Vec | |
from gensim.models import TfidfModel | |
# logging is important to get the state of the functions | |
import logging | |
logging.basicConfig(format='%(asctime)s: %(levelname)s: %(message)s') | |
logging.root.setLevel(level=logging.INFO) |
View report.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View get_lat_lon_exif_pil.py
import PIL.Image | |
get_float = lambda x: float(x[0]) / float(x[1]) | |
def convert_to_degrees(value): | |
d = get_float(value[0]) | |
m = get_float(value[1]) | |
s = get_float(value[2]) | |
return d + (m / 60.0) + (s / 3600.0) | |
def get_lat_lon(info): |