Metadata-Version: 2.4
Name: my-sentiment
Version: 0.2.0
Summary: A modular Python sentiment analysis library
Author: Mohammed Sinan K
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: spacy
Dynamic: author
Dynamic: description
Dynamic: description-content-type
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# My Sentiment

A modular Python sentiment analysis library that analyzes text using lexicon-based sentiment scoring, negation, modifiers, emphasis, emojis, emoticons, and contextual expressions.

## Features

- Lexicon-based sentiment analysis
- Tokenization
- Negation handling
- Intensifiers and deintensifiers
- Capitalization and punctuation emphasis
- Emoji sentiment analysis
- Emoticon sentiment analysis
- Context-aware sentiment analysis
- Batch sentiment analysis
- Streaming sentiment analysis
- Parallel batch processing
- Sentiment confidence scoring
- Modular architecture

## Installation

Install the library:

```bash
pip install my-sentiment
```

Install the required spaCy English model:

```bash
python -m spacy download en_core_web_sm
```

## Basic Usage

```python
from my_sentiment import sentiment

result = sentiment("I absolutely love this product!")

print(result)
```

## Batch Analysis

```python
from my_sentiment import sentiment_batch

texts = [
    "I love this product!",
    "This is terrible.",
    "The product is good but expensive."
]

results = sentiment_batch(texts)

for result in results:
    print(result)
```

## Streaming Analysis

```python
from my_sentiment import sentiment_stream

texts = [
    "I love this!",
    "This is terrible.",
    "This is amazing!"
]

for result in sentiment_stream(texts):
    print(result)
```

## Parallel Batch Analysis

```python
from my_sentiment import sentiment_parallel_batch

texts = [
    "I love this!",
    "This is terrible.",
    "This is amazing!"
]

results = sentiment_parallel_batch(texts)

for result in results:
    print(result)
```

## SentimentResult

Each analysis returns a `SentimentResult` containing:

- `label` — Positive, Negative, Neutral, or Mixed
- `score` — normalized sentiment score
- `positive_score` — positive sentiment evidence
- `negative_score` — negative sentiment evidence
- `confidence` — confidence based on sentiment evidence

The result can also be converted to a dictionary:

```python
result = sentiment("I love this!")

print(result.to_dict())
```

## Requirements

- Python 3.8 or later
- spaCy
- `en_core_web_sm` spaCy model

## Testing

The project uses `pytest` for automated testing.

```bash
python -m pytest -q
```
