Files
lab_embeddings/wordplay/wordplay.py
Chris Proctor 039a467a9f initial commit
2026-03-09 12:28:21 -04:00

29 lines
540 B
Python

import gensim.downloader
EMBEDDING_MODELS = {
'small': 'glove-wiki-gigaword-100', # ~128 MB
'medium': 'glove-wiki-gigaword-300', # ~376 MB
'large': 'word2vec-google-news-300', # ~1.6 GB
}
def load_embeddings(size='small'):
"Download (if needed) and load the embedding model for the given size."
return gensim.downloader.load(EMBEDDING_MODELS[size])
def synonyms(model, word, n=5):
pass
def average(model, word1, word2):
pass
def outlier(model, words):
pass
def sort(model, words):
pass