Skip to content
Snippets Groups Projects
Commit fb98378d authored by Jim Hoekstra's avatar Jim Hoekstra :wave_tone1:
Browse files

word is made lowercase before it is fed to the word2vec model

parent 955640cd
No related branches found
No related tags found
2 merge requests!17Develop,!15word is made lowercase before it is fed to the word2vec model
......@@ -10,9 +10,10 @@ class AssociatedWords:
print(" Word2Vec model is ready. Enjoy!!!\n")
def get_associated_words(self, word, top_n=10):
gensim_result = self.model.most_similar(word, topn=top_n)
lowercase_word = word.lower()
gensim_result = self.model.most_similar(lowercase_word, topn=top_n)
# gensim_result = [('apple', 1.0), ('banana', 1.0), ('strawberry', 1.0)]
words = self.filter_results(gensim_result, word)
words = self.filter_results(gensim_result, lowercase_word)
return words
def filter_results(self, gensim_result, base_word):
......
......@@ -2,4 +2,4 @@ from dash_app.index import app
if __name__ == '__main__':
app.run_server(debug=True)
app.run_server(debug=False)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment