I have a corpus on which I want to perform sentiment analysis using LSTM and word embeddings. I have converted the words in the documents to word vectors using word2vec. My question is how to input these word vectors as input to keras? I don't want to use the Embeddings provided by keras. Thanks in advance.
2 Answers
Maybe "From Words to Paragraphs, Attempt 2: Clustering" section of this article help you. It's using word embeddings as inputs to the K-means clustering algorithm.
You'll have to describe your problem a bit more But generally speaking, once you have "dense" vectors using an embedding method like Word2Vec, go ahead and use them as you would for any general input.
Neural Nets (and Deep Learning architectures, as well as ML algorithms in general) simply try their best to match one vector (i.e. an ordered series of numbers; INPUT) to another (LABELS).
Once you are done with training, use the "inverse" Word2Vec operation if you want to convert that dense vector to one-hot encoded vector i.e. actual words