sentiment_analysis
A hybrid sentiment analysis library combining VADER (fast, rule-based) with an optional transformer backend (slower, more accurate). VADER handles most text; only ambiguous/low-confidence cases get escalated to the transformer.
Install
pip install -e .
pip install -e ".[transformer]"
Quick Start
from sentiment_analysis import SentimentAnalyzer
analyzer = SentimentAnalyzer(backend="auto", escalation_threshold=0.4)
result = analyzer.analyze("It is what it is.")
print(result)
results, stats = analyzer.analyze_batch(list_of_texts, return_stats=True)
print(stats)
Backend Modes
| Mode | Behavior |
|---|---|
| lexicon | Always uses VADER. Fastest. |
| transformer | Always uses the transformer. Most accurate. |
| auto | VADER first; escalates low-confidence texts only. |
Known Limitations
- Confidence is derived from VADER's compound score and neutral proportion — not a calibrated probability.
- The transformer backend can be overconfident on hedged/qualified language (e.g. "only kind of good"), since it wasn't trained specifically for that nuance.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
vader_hybrid-0.1.0.tar.gz
(124.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
vader_hybrid-0.1.0-py3-none-any.whl
(128.7 kB
view details)
File details
Details for the file vader_hybrid-0.1.0.tar.gz.
File metadata
- Download URL: vader_hybrid-0.1.0.tar.gz
- Upload date:
- Size: 124.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e2a10757cab62ac45d8c19e30430763b295ab477344f7f3394dfa338f2ed1fe
|
|
| MD5 |
84b453bb4988a3dbd46ec2956e23fdd5
|
|
| BLAKE2b-256 |
ff93b370614fdef49bac34dd1cbbd32d71ff731b6a9117bb9009cd3f34301401
|
File details
Details for the file vader_hybrid-0.1.0-py3-none-any.whl.
File metadata
- Download URL: vader_hybrid-0.1.0-py3-none-any.whl
- Upload date:
- Size: 128.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31b33a5b5b6ff8accae58359a386291ccbdcfbb614602a0e1840af661a5ae7e9
|
|
| MD5 |
f4f7d85262282e812286ab761580885d
|
|
| BLAKE2b-256 |
8e7e2c1539ab6ff136c0ad964777848d7b7085a77a34f1f5c708738527c7ff45
|