nordlys.logic.features.word2vec module

Word2vec

Implements functionalities over the 300-dim GoogleNews word2vec semantic representations of words.

Author:Dario Garigliotti
class nordlys.logic.features.word2vec.Word2Vec(mongo)[source]

Bases: object

get_centroid_vector(s)[source]

Returns the normalized sum of the word2vec vectors corresponding to the terms in s.

Parameters:s (str) – a phrase.
Returns:Centroid vector of the terms in s.
get_vector(word)[source]

Gets the w2v vector corresponding to the word, or a zero-valued vector if not present.

Parameters:word (str) – a word.
Returns:
nordlys.logic.features.word2vec.arg_parser()[source]
nordlys.logic.features.word2vec.main(args)[source]