Automated NLP sentiment predictions- batteries included, or use your own data
MIT License
A standalone NLP sentiment classifier you can import as a module
pip install empythy
from empythy import EmpathyMachines
nlp_classifier = EmpathyMachines()
nlp_classifier.train()
nlp_classifier.predict(text_string)
The classic sentiment corpus, 2000 movie reviews already gathered by NLTK.
CrowdFlower hosts a number of Twitter corpora that have already been graded for sentiment by panels of humans.
I aggregated together 6 of their corpora into a single, aggregated and cleaned corpus, with consistent scoring labels across the entire corpus. The cleaned corpus contains over 45,000 documents, with positive, negative, and neutral sentiments.
Feel free to train a classifier on your own corpus!
Two ways to do this
nlp_classifier.train(corpus='custom', corpus_path='path/to/custom/corpus.csv')
nlp_classifier.train(corpus='custom', corpus_array=my_array_of_texts)
corpus='custom'
, and corpus_array=my_variable_holding_the_documents
.nlp_classifier.train(verbose=False)
to turn off print status statements while training.nlp_classifier.train(print_analytics_results=True)
to print out results of training the classifier.