explosion / sense2vec

🦆 Contextually-keyed word vectors
https://explosion.ai/blog/sense2vec-reloaded
MIT License
1.62k stars 240 forks source link

Get most similar senses on multiple senses. #146

Open mirfan899 opened 2 years ago

mirfan899 commented 2 years ago

Is there a way to get multiple most similar senses using array of senses?

I believe current solution gives average to multiple senses. For example I want to get most similar senses on two or more senses i.e.

from sense2vec import Sense2Vec

s2v = Sense2Vec().from_disk("./s2v_reddit_2015_md")
query = ["bot|NOUN", "think|VERB" ]
# gives averaged senses
s2v.most_similar(query, n=10)
[('sup(This|ADV', 0.7275), ('idontbelieveyou.gif|NOUN', 0.7244), ('TLDR|NOUN', 0.6689), ('Original_Post|NOUN', 0.6167)]

# But I want to get separate most similar senses for each sense. Like this.
[[('sup(This|ADV', 0.7137), ('Original_Post|NOUN', 0.6189), ('TLDR|NOUN', 0.6129)], [('but|CONJ', 0.9187), ('obviously|ADV', 0.9084), ('honestly|ADV', 0.9006)]]
zanek commented 2 years ago

I have the same question too !

zanek commented 2 years ago

Bump ~ Please answer someone