Genesis most_similar find synonym only (not antonyms)

Is there a way to let model.wv.most_similar in gensim return positive-meaning words only (i.e. that shows synonyms but not antonyms)?

For example, if I do:

import fasttext.util
from gensim.models.fasttext import load_facebook_model
from gensim.models.fasttext import FastTextKeyedVectors
fasttext.util.download_model('en', if_exists='ignore')  # English
model = load_facebook_model('cc.en.300.bin')
model.wv.most_similar(positive=['honest'], topn=2000)

Then the mode is also going to return words such as dishonest.

('dishonest', 0.5542981028556824),

However, what if I want words with the positive-meaning only?

I have tried the following - subtracting not from honest in the vector space:

import fasttext.util
from gensim.models.fasttext import load_facebook_model
from gensim.models.fasttext import FastTextKeyedVectors
fasttext.util.download_model('en', if_exists='ignore')  # English
model = load_facebook_model('cc.en.300.bin')
model.wv.most_similar(positive=['honest'], negative=['not'], topn=2000)

But somehow it is still returning dishonest somehow.

('dishonest', 0.23721608519554138)
('dishonesties', 0.16536088287830353)

Any idea how to do this in a better way?

Topic fasttext gensim word2vec nlp python

Category Data Science

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.