womogenes / semantle-bot

8 stars 2 forks source link

Vectorized #4

Closed LuukSuurmeijer closed 2 years ago

LuukSuurmeijer commented 2 years ago

Added if __name__ == "__main__:" syntax so one can import functionalities from main. Added find_possible_vectorized() as a function to compute the possible candidates. I just now found the gen-sim function distances(word_or_vector, other_words=()) (https://radimrehurek.com/gensim/models/keyedvectors.html#gensim.models.keyedvectors.KeyedVectors.get_normed_vectors), which does that same thing and is probably even more optimized. However, that is no fun :-)

womogenes commented 2 years ago

Tested and approved! It looks great and runs much faster now. Thanks!