Last active
February 10, 2018 22:21
-
-
Save amn41/1589dd6a6dfd6d0b6d1e921d5a9d6c21 to your computer and use it in GitHub Desktop.
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
vocab_file ="/path/to/vocab_file" | |
vectors_file ="/path/to/vectors_file" | |
embed = Embedding(vocab_file,vectors_file) | |
cuisine_refs = ["mexican","chinese","french","british","american"] | |
threshold = 0.2 | |
text = "I want to find an indian restaurant" | |
cuisines = find_similar_words(embed,cuisine_refs,text,threshold) | |
print(cuisines) | |
# >>> ['indian'] |
I was unable to replicate your result. I downloaded a vocab file with 10000 most common words and skipped words not in the GloVe file. For me, this script prints ['want', 'to', 'find', 'an', 'indian', 'restaurant']
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how do I get the files vocab_file and vectors_file?