<jupyter_start><jupyter_text>[Word2vec](https://code.google.com/archive/p/word2vec/) modelDownload here : https://drive.google.com/file/d/0B7XkCwpI5KDYNlNUTTlSS21pQmM/edit<jupyter_code># Loading the model with gensim
from gensim.models import KeyedVectors
import os

MODEL_PATH = '/home/b/Downloads/GoogleNews-vectors-negative300.bin.gz'

if not os.path.exists(MODEL_PATH):
    raise ValueError("SKIP: You need to download the google news model")
    
model = KeyedVectors.load_word2vec_format(MODEL_PATH, binary=True)
sentence_obama = 'Obama speaks to the media in Illinois'
sentence_president = 'The president greets the press in Chicago'
sentence_obama = sentence_obama.lower().split()
sentence_president = sentence_president.lower().split()


from nltk.corpus import stopwords
stop_words = stopwords.words('english')
sentence_obama = [w for w in sentence_obama if w not in stop_words]
sentence_president = [w for w in sentence_president if w not in stop_words]

model.wmdistance(sentence_obama, sentence_president)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09446564885496184, 'fraction_numerical': 0.01049618320610687, 'mean_word_length': 6.387323943661972, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '506239', 'license': 'MIT', 'n_tokens_mistral': 373, 'n_tokens_neox': 350, 'n_words': 83, 'path': '.ipynb_checkpoints/wmd_experiments-checkpoint.ipynb', 'repo_name': 'py-ranoid/FAQ-Bot-Notebooks', 'size': '1048'}