inverse operation of word2vec - vec2word

229 views
Skip to first unread message

Julien Petot

unread,
Feb 9, 2023, 5:17:05 AM2/9/23
to Gensim
I use word2vec to get the coordinates of words.

I would like to know if it is possible to do the inverse operation of word2vec, i.e. get some words from some new synthetic vector (vec2word).


thanks

Andrey Kutuzov

unread,
Feb 9, 2023, 8:14:27 AM2/9/23
to gen...@googlegroups.com
Hi,

The task you are describing is a subset of what is called "definition
modeling". Check this paper for an introduction:
https://ojs.aaai.org/index.php/AAAI/article/view/10996
> --
> You received this message because you are subscribed to the Google
> Groups "Gensim" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to gensim+un...@googlegroups.com
> <mailto:gensim+un...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/gensim/726c6dbc-df0a-4c5d-9c8a-b8194381dbf8n%40googlegroups.com <https://groups.google.com/d/msgid/gensim/726c6dbc-df0a-4c5d-9c8a-b8194381dbf8n%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
Solve et coagula!
Andrey

Gordon Mohr

unread,
Feb 9, 2023, 5:44:43 PM2/9/23
to Gensim
Gensim's `.most_similar()` method will accept arbitrary vectors as the 'origin' from which it searches for nearby neighbor known words. To avoid confusing its type-detection, such vectors should be passd as part of the explicit `positive` argument's expected list-of-targets (rather than just an ordered argument). For example:

    my_origin = ...  # some properly-dimensioned vector
    similar_words = kv_model.most_similar(positive=[my_origin])

- Gordon

Reply all
Reply to author
Forward
0 new messages