gensim.models.Doc2Vec.n_similarity¶
-
Doc2Vec.
n_similarity
(ws1, ws2)¶ Compute cosine similarity between two sets of words.
Example:
>>> trained_model.n_similarity(['sushi', 'shop'], ['japanese', 'restaurant']) 0.61540466561049689 >>> trained_model.n_similarity(['restaurant', 'japanese'], ['japanese', 'restaurant']) 1.0000000000000004 >>> trained_model.n_similarity(['sushi'], ['restaurant']) == trained_model.similarity('sushi', 'restaurant') True