initial commit
This commit is contained in:
28
wordplay/wordplay.py
Normal file
28
wordplay/wordplay.py
Normal file
@@ -0,0 +1,28 @@
|
||||
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
|
||||
Reference in New Issue
Block a user