José Santos
2018-11-17 18:30:54 UTC
Hi there,
I have a model based on doc2vec trained on multiple documents. I would like
to use that model to infer the vectors of another document, which I want to
use as the corpus for comparison. So, when I look for the most similar
sentence to one I introduce, it uses this new document vectors instead of
the trained corpus.
Currently, I am using the infer_vector() to compute the vector for each one
of the sentences of the new document, but I can't use the most_similar()
function. I run into this error: AttributeError: 'numpy.ndarray' object has
no attribute 'most_similar'.
I would like to know if there's any way that I can compute these vectors
for the new document that will allow the use of the most_similar()
function, or if I have to compute the similarity between each one of the
sentences of the new document and the sentence I introduce individually (in
this case, is there any implementation in Gensim that allows me to compute
the cosine similarity between 2 vectors?).
I am new to Gensim and NLP, and I'm open to your suggestions.
Thank you,
José
I have a model based on doc2vec trained on multiple documents. I would like
to use that model to infer the vectors of another document, which I want to
use as the corpus for comparison. So, when I look for the most similar
sentence to one I introduce, it uses this new document vectors instead of
the trained corpus.
Currently, I am using the infer_vector() to compute the vector for each one
of the sentences of the new document, but I can't use the most_similar()
function. I run into this error: AttributeError: 'numpy.ndarray' object has
no attribute 'most_similar'.
I would like to know if there's any way that I can compute these vectors
for the new document that will allow the use of the most_similar()
function, or if I have to compute the similarity between each one of the
sentences of the new document and the sentence I introduce individually (in
this case, is there any implementation in Gensim that allows me to compute
the cosine similarity between 2 vectors?).
I am new to Gensim and NLP, and I'm open to your suggestions.
Thank you,
José
--
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.