toshalpatel / StanfordCoreNLP_SentimentAnalysis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sentiment Analysis using Stanford CoreNLP

This project involves training the Stanford NLP's Sentiment Model, on our dataset of News Articles.

SentimentTrainingInitModel

This class allows to load a pre-trained model giving a path. This is compiled in the stanford-corenlp-2020-05-21.jar file

--initModelPath path/to/sentiment/model

Hence the command for training will be:

java -cp "classpath/here" -mx8g edu.stanford.nlp.sentiment.SentimentTrainingInitModel -initModelPath edu/stanford/nlp/models/sentiment/sentiment.ser.gz -numHid 25 -epochs 200 -trainPath path/training/file -devPath path/validation/file -train -model path/to/save/new/trained/model/

And the evaluation command, to test the test data will be:

java -cp "classpath/here" edu.stanford.nlp.sentiment.Evaluate -model path/to/saved/model -treebank path/test/file

References

https://nlp.stanford.edu/sentiment/

https://github.com/stanfordnlp/CoreNLP/

About


Languages

Language:Jupyter Notebook 99.6%Language:Python 0.4%