Metadata-Version: 2.5
Name: vader_hybrid
Version: 0.1.0
Summary: Hybrid VADER + transformer sentiment analysis with speed/accuracy tradeoff control
Author: shahala fathima
License: MIT
Requires-Python: >=3.8
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == 'dev'
Provides-Extra: transformer
Requires-Dist: torch>=2.0; extra == 'transformer'
Requires-Dist: transformers>=4.30; extra == 'transformer'
Description-Content-Type: text/markdown


# 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.