Skip to main content

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.2.0.tar.gz (126.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vader_hybrid-0.2.0-py3-none-any.whl (130.8 kB view details)

Uploaded Python 3

File details

Details for the file vader_hybrid-0.2.0.tar.gz.

File metadata

  • Download URL: vader_hybrid-0.2.0.tar.gz
  • Upload date:
  • Size: 126.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.7

File hashes

Hashes for vader_hybrid-0.2.0.tar.gz
Algorithm Hash digest
SHA256 80eb563ec1eb6f822162891dda9914177850e5e09c5e73cddcf02d512e0fcc75
MD5 9c47fa46e3c9b7d3106b2e6b7bbeb285
BLAKE2b-256 a1c082ac87a01253a040ccc749495c9cfa2b7e5a3842defd8eb09b936f2b13d2

See more details on using hashes here.

File details

Details for the file vader_hybrid-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: vader_hybrid-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 130.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.7

File hashes

Hashes for vader_hybrid-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2b906613d46cb59b8e09b176ce7faef78af9690c92e4ecc1aecba9a2e3e49416
MD5 7918d3473ab819c5aca9c228b4844e97
BLAKE2b-256 f12cb43a81e22d673f86f116f7bf8c09d8c2adaec634c2afe3e5cc4a20a96049

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page