Reputation: 391
I want to analyze the vectors looking for patterns and stuff, and use SVM on them to complete a classification task between class A and B, the task should be supervised. (I know it may sound odd but it's our homework.) so as a result I really need to know:
1- how to extract the coded vectors of a document using a trained model?
2- how to interpret them and how does word2vec code them?
I'm using gensim's word2vec.
Upvotes: 1
Views: 1874
Reputation: 164
If you have trained word2vec model, you can get word-vector by __getitem__
method
model = gensim.models.Word2Vec(sentences)
print(model["some_word_from_dictionary"])
Unfortunately, embeddings from word2vec/doc2vec not interpreted by a person (in contrast to topic vectors from LdaModel)
P/S If you have texts at the object in your tasks, then you should use Doc2Vec model
Upvotes: 2