SenTop
SenTop combines sentiment analysis and topic modeling into a single capability allowing for sentiments to be derived per topic and for topics to be derived per sentiment.
Installation
To install with pypi, use:
pip install sentop
Quick Start
Create a SenTop object and pass your list of documents to run_analysis().
st = SenTop()
st.run_analysis(docs, annotation="My dataset")
Sentiment Analysis
Sentiment analysis is performed using AdaptNLP with state-of-the-art (SOTA) Hugging Face Transformers. SenTop provides multiple sentiment analyses (confidence scores also available):
- RoBERTa Base Sentiment for 3-class sentiment -- based on Facebook AI's RoBERTa
- BERT Base Multilingual Uncased Sentiment for 5-class sentiment -- based on Google's Bidirectional Encoder Representations from Transformers (BERT)
- Twitter roBERTa-base for Emotion Recognition for 4-class emotion recognition
- BERT-base-cased Geomotions (Original) for 28-class emotion recognition
- Twitter roBERTa-base for Offensive Language Identification for 2-class offensive language detection
Topic Modeling
SenTop provides two types of topic modeling: Latent Dirichlet Allocation (LDA) using Tomotopy and transformer-based BERTopic. While LDA provides de facto, statistical-based topic modeling, BERTopic provides SOTA-level performance using Hugging Face Transformers. Transformers that have been tested include:
- BERT Base Uncased -- based on Google's Bidirectional Encoder Representations from Transformers (BERT)
- XLM RoBERTa Base -- based on XLM-RoBERTa
Combining Sentiment Analysis and Topic Modeling
SenTop combines sentiment analysis and topic modeling by copmuting both at the document level for a corpus, the results of which can then be represented by a table as shown below.
| Document | BERT Topic | LDA Topic | 3-Class Sentiment | 5-Class Sentiment |
|---|---|---|---|---|
| "Having to report to work without being provided PPE." | 3 | 0 | negative | 1_star |
| "Teleworking at home." | 1 | 2 | neutral | 3_stars |
| "Things are good. Im ready to do the mission." | 2 | 1 | positive | 4_stars |
Metadata
Release files for sentop 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sentop-0.2.2-py3-none-any.whl | Python 3 | none | any | Details for sentop-0.2.2-py3-none-any.whl |
Release files / sentop-0.2.2-py3-none-any.whl
| Download URL | sentop-0.2.2-py3-none-any.whl |
|---|---|
| Size | 3.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
98b8dca24f7af214deacbf4b78abe5ae8fb1b4bd1e76d4ac72351cef172e432e
|
|
BLAKE2b-256 checksum How to use checksums |
26c7babdba61a32d42355aae3898aefbf445a5345b440b227763f48a3a346b4c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/3.10.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.7
|
Security for sentop 0.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.