
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
An off-the-rack NLP sentiment classifier- upload your own corpus or use the pre-installed ones
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.FAQs
An off-the-rack NLP sentiment classifier- upload your own corpus or use the pre-installed ones
We found that empythy demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.