Title : Sentiment Classification using Document Embeddings trained with Cosine Similarity
This code was downloaded from the original work : Code for the ACL-SRW 2019 paper: "Sentiment Classification using Document Embeddings trained with Cosine Similarity".
This repository contains Java code to train document embeddings using cosine similarity, simply run the project in order to do so. All hyperparameters that need adjusting are in the top of the file NeuralNetwork.java, default hyperparameters are the same as in the paper.
There are also options to train them using dot product and L2-regularized dot product.
1 - To run the original work done on the IMDB dataset the datase needs to be downloaded:
Run ensemble.py in order to test the combination of document embeddings with NB-weighted bag of ngrams.
IMDB data: unigrams, unigrams+bigrams, unigrams+bigrams+trigrams
Trained embeddings (using cosine similarity): train vectors, test vectors
2 - To run our testing on the Amazon dataset the files need to be downloaed from :
Amazon Reviews data: unigrams, unigrams+bigrams, unigrams+bigrams+trigrams
Trained embeddings (using cosine similarity): train vectors, test vectors