I want to construct word embeddings for documents using word2vec tool. I know how to find a vector embedding corresponding to a single word(unigram). Now, I want to find a vector for a bigram. Is it possible to do using word2vec? If yes, how?
相关问题
- How to get a list of antonyms lemmas using Python,
- How to match dependency patterns with spaCy?
- LUIS - Can we use phrases list for new values in t
- Convert Python dictionary to Word2Vec object
- How to initialize a `Doc` in textacy 0.6.2?
相关文章
- What's the difference between WordNet 3.1 and
- How should I vectorize the following list of lists
- What created `maxent_treebank_pos_tagger/english.p
- How to determine if a sentence is talking about a
- Triple extraction from a sentance
- How to use Mallet for NER [closed]
- How to translate words in NTLK swadesh corpus rega
- In Keras elmo embedding layer has 0 parameters? is
The following snippet will get you the vector representation of a bigram. Note that the bigram you want to convert to a vector needs to have an underscore instead of a space between the words, e.g.
bigram2vec(unigrams, "this report")
is wrong, it should bebigram2vec(unigrams, "this_report")
. For more details on generating the unigrams, please see thegensim.models.word2vec.Word2Vec
class here.