Emotion Shift Detector π§ π
EmotionShiftDetector is an AI system that detects subtle emotional transitions across conversations, not just isolated sentiment in individual messages.
Instead of answering βWhat emotion is this message?β, it answers:
βHow is the emotion changing over time?β
The model is designed for conversation analysis, mental-health tools, customer support analytics, and emotion-aware AI agents.
π What Problem Does It Solve?
Traditional sentiment analysis treats messages independently.
EmotionShiftDetector focuses on emotional dynamics by identifying:
- Emotional escalation or de-escalation
- Mood shifts across dialogue turns
- Sudden emotional changes that indicate risk, frustration, or recovery
β¨ Key Features
- π§ Emotion classification per conversation turn
- π Detection of emotional shifts over time
- π£οΈ Human-readable explanations for each shift
- π§© Modular and explainable design
- π€ Hugging Faceβready pipeline
- ποΈ Gradio demo included
- π§ͺ Test-covered core components
π Project Structure
emotion-shift-detector/
βββ config/
βββ data/
βββ src/
βββ training/
βββ pipelines/
βββ scripts/
βββ tests/
βββ notebooks/
βββ app.py
βββ README.md
βββ model_card.md
βββ requirements.txt
βββ LICENSE
βοΈ Installation
pip install -r requirements.txt
π Quick Usage
from src.inference import EmotionShiftPipeline
pipeline = EmotionShiftPipeline()
conversation = [
"I am feeling okay today",
"This is getting frustrating",
"Now I am really angry"
]
result = pipeline(conversation)
print(result)
ποΈ Gradio Demo
python app.py
π§ How It Works
- Text Preprocessing
- Emotion Classification
- Shift Detection
- Explanation Engine