Twitter Sentiment Analysis with Gensim Word2Vec and Keras Convolutional Networks

Fork Word2Vec ( offers a very interesting alternative to classical NLP based on term-frequency matrices. In particular, as each word is embedded into a high-dimensional vector, it’s possible to consider a sentence like a sequence of points that determine an implicit geometry. For this reason, the idea of considering 1D convolutional classifiers (usually very efficient with images) became a concrete possibility. As you know, a convolutional network trains its kernels so to be able to capture, initially coarse-grained features (like the orientation), and while the kernel-size decreases, more and more detailed elements (like eyes, wheels, hands and so forth). In the same way, a 1D convolution works on 1-dimensional vectors (in general they are temporal sequences), extracting pseudo-geometric features. The rationale is provided by the Word2Vec algorithm: as the vectors are “grouped” according to a semantic criterion so that two similar words have very close representations, a sequence can be […]