I am playing around with FastText
, https://pypi.python.org/pypi/fasttext,which is quite similar to Word2Vec
. Since it seems to be a pretty new library with not to many built in functions yet, I was wondering how to extract morphological similar words.
For eg: model.similar_word("dog")
-> dogs. But there is no function built-in.
If I type
model["dog"]
I only get the vector, that might be used to compare cosine similarity.
model.cosine_similarity(model["dog"], model["dogs"]])
.
Do I have to make some sort of loop and do cosine_similarity
on all possible pairs in a text? That would take time ...!!!