Multimodal emotion recognition engine (audio + text + fusion)
Project description
Multimodal Emotion Recognition Engine combining audio, speech-to-text (ASR), and text-based emotion classification, with a simple CLI and Python API.
This project is designed as a modular engine that can: - ๐๏ธ Listen from microphone - ๐ Analyze audio files - ๐ง Fuse audio + text emotion signals - โก Run locally with pretrained models
โ
Features
Audio emotion recognition - MFCC + pitch based model
Speech-to-text (ASR) - Powered by faster-whisper
Text emotion classification - DistilRoBERTa emotion model
CLI interface - emotion-engine listen - emotion-engine analyze <file>
Python API
PyScaffold-based project structure
Tested with pytest
โ
Project Structure
multimodal_emotion_engine/ โโโ src/multimodal_emotion_engine/ โ โโโ audio/ โ โ โโโ emotion_model.py โ โ โโโ features.py โ โ โโโ mic.py โ โโโ text/ โ โ โโโ asr.py โ โโโ engine.py โ โโโ cli.py โ โโโ config.py โโโ models/ โ โโโ emotion_model.pt โโโ tests/ โโโ pyproject.toml โโโ setup.cfg
โ
Installation
### 1. Clone the repository
git clone https://github.com/satsin06/multimodal_emotion_engine.git
cd multimodal_emotion_engine
โ
### 2. Create and activate a virtual environment (recommended)
python -m venv venv
source venv/bin/activate # macOS / Linux
venv\Scripts\activate # Windows
โ
### 3. Install the package
#### Minimal install
pip install -e .
#### With audio support
pip install -e ".[audio]"
#### With ASR support
pip install -e ".[asr]"
#### Full installation (recommended)
pip install -e ".[full]"
โ
CLI Usage
After installation, the CLI command is available as:
emotion-engine --help
### ๐๏ธ Listen from microphone
emotion-engine listen
This will: - Record audio from your microphone - Run emotion recognition - Print emotion probabilities
Press Ctrl+C to stop recording (microphone is safely closed).
โ
### ๐ Analyze an audio file
emotion-engine analyze path/to/audio.wav
โ
Python API Usage
You can also use the engine programmatically:
from multimodal_emotion_engine.engine import EmotionEngine
engine = EmotionEngine()
result = engine.analyze_file("sample.wav")
print(result)
Example output:
{
"neutral": 0.38,
"happy": 0.10,
"sad": 0.11,
"angry": 0.05
}
โ
Models
Audio emotion model - Stored in: models/emotion_model.pt
Text emotion model - j-hartmann/emotion-english-distilroberta-base (downloaded automatically)
ASR model - Faster-Whisper (downloaded on first use)
Models are cached under:
~/.cache/emotion-engine/
โ
Running Tests
Install test dependencies:
pip install -e ".[dev]"
Run tests:
pytest
โ
Development Notes
Python โฅ 3.9
PyScaffold 4.6
Type hints enabled (Pylance / MyPy friendly)
Modular design for future multimodal fusion
โ
Roadmap
[ ] Real-time streaming emotion detection
[ ] Multilingual ASR
[ ] Emotion fusion weighting
[ ] REST API
[ ] Model retraining pipeline
โ
License
MIT License. See LICENSE.txt for details.
โ
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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
File details
Details for the file multimodal_emotion_engine-0.2.0.tar.gz.
File metadata
- Download URL: multimodal_emotion_engine-0.2.0.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02f95ca8f3d875c6cefd4189454ac02f8ea5bf55c1ec529bdafb760ffc5d2384
|
|
| MD5 |
f8722c87ad23ee0f05febb8a880dd769
|
|
| BLAKE2b-256 |
26813cf0889e5db100f023d9d41bb05df5e28dd494a3babd70618a99062a863d
|
File details
Details for the file multimodal_emotion_engine-0.2.0-py3-none-any.whl.
File metadata
- Download URL: multimodal_emotion_engine-0.2.0-py3-none-any.whl
- Upload date:
- Size: 13.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e450109743e687d7675b3b6d0fd379f5a2178d834ddb2b3d3a0e42b94ef25a4
|
|
| MD5 |
21a3d455530311169bbaaf201eb89bbf
|
|
| BLAKE2b-256 |
b50510526dae99593730527fdd6a19f4f004219d061980d547cb3e733ee49e0a
|