Skip to content

Commit

Permalink
code clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
ddangelov committed Dec 10, 2020
1 parent 072d833 commit c899af8
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions top2vec/Top2Vec.py
Original file line number Diff line number Diff line change
Expand Up @@ -1857,18 +1857,6 @@ def similar_words(self, keywords, num_words, keywords_neg=None, use_index=False,
num_words=num_res,
use_index=use_index,
ef=ef)
# else:
# word_indexes, word_scores = self._search_vectors_by_vector(self._get_word_vectors(),
# combined_vector, num_res)

# do not return words that were searched
# search_word_indexes = [self._word2index(word) for word in list(keywords) + list(keywords_neg)]
# res_indexes = [index for index, word_ind in enumerate(word_indexes)
# if word_ind not in search_word_indexes][:num_words]
# word_indexes = word_indexes[res_indexes]
# word_scores = word_scores[res_indexes]
#
# words = [self._index2word(word_index) for word_index in word_indexes]

res_indexes = [index for index, word in enumerate(words)
if word not in list(keywords) + list(keywords_neg)][:num_words]
Expand Down

0 comments on commit c899af8

Please sign in to comment.