# anmolrawat990/emotion-recogniton architecture

> Architecture diagram of the GitHub repository anmolrawat990/emotion-recogniton, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anmolrawat990/emotion-recogniton
- Repository: https://github.com/anmolrawat990/emotion-recogniton

## Overview

This repository implements a Discord bot that reacts to messages with an emoji representing their detected emotion. At startup, the program trains a TF-IDF and logistic-regression classifier from the GoEmotions CSV and saves it as a model artifact. The bot translates text messages to English before classification; for attachments, it downloads audio, transcribes it, and translates the transcript. It adds a reaction when confidence exceeds a threshold. The sampled source shows these main stages in one file; training, Discord, speech-recognition, and translation integrations are not separate repository modules.

Main entry points: [`MINI_PROJECT_S-T-E-R/MINI_PROJECT_ANMOL_S-T-E-R/Code/multilingualfinal_discord.py`](https://github.com/anmolrawat990/emotion-recogniton/blob/main/MINI_PROJECT_S-T-E-R/MINI_PROJECT_ANMOL_S-T-E-R/Code/multilingualfinal_discord.py) (Discord bot), [`MINI_PROJECT_S-T-E-R/MINI_PROJECT_ANMOL_S-T-E-R/Go_Emotion_cleaned_dataset/cleaned_goemotions.csv`](https://github.com/anmolrawat990/emotion-recogniton/blob/main/MINI_PROJECT_S-T-E-R/MINI_PROJECT_ANMOL_S-T-E-R/Go_Emotion_cleaned_dataset/cleaned_goemotions.csv) (Emotion dataset), [`MINI_PROJECT_S-T-E-R/MINI_PROJECT_ANMOL_S-T-E-R/model/emotion_model.pkl`](https://github.com/anmolrawat990/emotion-recogniton/blob/main/MINI_PROJECT_S-T-E-R/MINI_PROJECT_ANMOL_S-T-E-R/model/emotion_model.pkl) (Saved model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Bot runtime"]
  node_main["Startup"]
  node_bot["Discord bot"]
end

subgraph group_ml["Emotion classification"]
  node_dataset["Emotion dataset"]
  node_classifier["Emotion classifier"]
  node_model["Saved model<br/>[emotion_model.pkl]"]
end

subgraph group_voice["Voice processing"]
  node_voice["Voice processor"]
end

node_discord(("Discord users"))
node_speech["Speech recognition"]
node_translator["Google Translator"]

node_main -->|"trains"| node_classifier
node_main -->|"starts"| node_bot
node_classifier -->|"reads"| node_dataset
node_classifier -->|"saves and loads"| node_model
node_bot -->|"receives and reacts"| node_discord
node_bot -->|"translates text"| node_translator
node_bot -->|"predicts emotion"| node_classifier
node_bot -->|"processes attachments"| node_voice
node_voice -->|"transcribes audio"| node_speech
node_voice -->|"translates transcript"| node_translator
node_voice -->|"supplies transcript"| node_classifier

click node_main "https://github.com/anmolrawat990/emotion-recogniton/blob/main/MINI_PROJECT_S-T-E-R/MINI_PROJECT_ANMOL_S-T-E-R/Code/multilingualfinal_discord.py"
click node_bot "https://github.com/anmolrawat990/emotion-recogniton/blob/main/MINI_PROJECT_S-T-E-R/MINI_PROJECT_ANMOL_S-T-E-R/Code/multilingualfinal_discord.py"
click node_dataset "https://github.com/anmolrawat990/emotion-recogniton/blob/main/MINI_PROJECT_S-T-E-R/MINI_PROJECT_ANMOL_S-T-E-R/Go_Emotion_cleaned_dataset/cleaned_goemotions.csv"
click node_classifier "https://github.com/anmolrawat990/emotion-recogniton/blob/main/MINI_PROJECT_S-T-E-R/MINI_PROJECT_ANMOL_S-T-E-R/Code/multilingualfinal_discord.py"
click node_model "https://github.com/anmolrawat990/emotion-recogniton/blob/main/MINI_PROJECT_S-T-E-R/MINI_PROJECT_ANMOL_S-T-E-R/model/emotion_model.pkl"
click node_voice "https://github.com/anmolrawat990/emotion-recogniton/blob/main/MINI_PROJECT_S-T-E-R/MINI_PROJECT_ANMOL_S-T-E-R/Code/multilingualfinal_discord.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_bot,node_discord toneBlue
class node_dataset,node_classifier,node_model toneAmber
class node_voice toneMint
class node_speech,node_translator toneIndigo
```

## Components

### Bot runtime

- [Startup](https://github.com/anmolrawat990/emotion-recogniton/blob/main/MINI_PROJECT_S-T-E-R/MINI_PROJECT_ANMOL_S-T-E-R/Code/multilingualfinal_discord.py): `MINI_PROJECT_S-T-E-R/MINI_PROJECT_ANMOL_S-T-E-R/Code/multilingualfinal_discord.py`
- [Discord bot](https://github.com/anmolrawat990/emotion-recogniton/blob/main/MINI_PROJECT_S-T-E-R/MINI_PROJECT_ANMOL_S-T-E-R/Code/multilingualfinal_discord.py): `MINI_PROJECT_S-T-E-R/MINI_PROJECT_ANMOL_S-T-E-R/Code/multilingualfinal_discord.py`

### Emotion classification

- [Emotion dataset](https://github.com/anmolrawat990/emotion-recogniton/blob/main/MINI_PROJECT_S-T-E-R/MINI_PROJECT_ANMOL_S-T-E-R/Go_Emotion_cleaned_dataset/cleaned_goemotions.csv): `MINI_PROJECT_S-T-E-R/MINI_PROJECT_ANMOL_S-T-E-R/Go_Emotion_cleaned_dataset/cleaned_goemotions.csv`
- [Emotion classifier](https://github.com/anmolrawat990/emotion-recogniton/blob/main/MINI_PROJECT_S-T-E-R/MINI_PROJECT_ANMOL_S-T-E-R/Code/multilingualfinal_discord.py): `MINI_PROJECT_S-T-E-R/MINI_PROJECT_ANMOL_S-T-E-R/Code/multilingualfinal_discord.py`
- [Saved model](https://github.com/anmolrawat990/emotion-recogniton/blob/main/MINI_PROJECT_S-T-E-R/MINI_PROJECT_ANMOL_S-T-E-R/model/emotion_model.pkl): `MINI_PROJECT_S-T-E-R/MINI_PROJECT_ANMOL_S-T-E-R/model/emotion_model.pkl`

### Voice processing

- [Voice processor](https://github.com/anmolrawat990/emotion-recogniton/blob/main/MINI_PROJECT_S-T-E-R/MINI_PROJECT_ANMOL_S-T-E-R/Code/multilingualfinal_discord.py): `MINI_PROJECT_S-T-E-R/MINI_PROJECT_ANMOL_S-T-E-R/Code/multilingualfinal_discord.py`

### Other components

- **Discord users**
- **Speech recognition**
- **Google Translator**

## Connections

- Startup → Emotion classifier: trains (evidence: `MINI_PROJECT_S-T-E-R/MINI_PROJECT_ANMOL_S-T-E-R/Code/multilingualfinal_discord.py`)
- Startup → Discord bot: starts (evidence: `MINI_PROJECT_S-T-E-R/MINI_PROJECT_ANMOL_S-T-E-R/Code/multilingualfinal_discord.py`)
- Emotion classifier → Emotion dataset: reads (evidence: `MINI_PROJECT_S-T-E-R/MINI_PROJECT_ANMOL_S-T-E-R/Code/multilingualfinal_discord.py`)
- Emotion classifier → Saved model: saves and loads (evidence: `MINI_PROJECT_S-T-E-R/MINI_PROJECT_ANMOL_S-T-E-R/Code/multilingualfinal_discord.py`)
- Discord bot → Discord users: receives and reacts (evidence: `MINI_PROJECT_S-T-E-R/MINI_PROJECT_ANMOL_S-T-E-R/Code/multilingualfinal_discord.py`)
- Discord bot → Google Translator: translates text (evidence: `MINI_PROJECT_S-T-E-R/MINI_PROJECT_ANMOL_S-T-E-R/Code/multilingualfinal_discord.py`)
- Discord bot → Emotion classifier: predicts emotion (evidence: `MINI_PROJECT_S-T-E-R/MINI_PROJECT_ANMOL_S-T-E-R/Code/multilingualfinal_discord.py`)
- Discord bot → Voice processor: processes attachments (evidence: `MINI_PROJECT_S-T-E-R/MINI_PROJECT_ANMOL_S-T-E-R/Code/multilingualfinal_discord.py`)
- Voice processor → Speech recognition: transcribes audio (evidence: `MINI_PROJECT_S-T-E-R/MINI_PROJECT_ANMOL_S-T-E-R/Code/multilingualfinal_discord.py`)
- Voice processor → Google Translator: translates transcript (evidence: `MINI_PROJECT_S-T-E-R/MINI_PROJECT_ANMOL_S-T-E-R/Code/multilingualfinal_discord.py`)
- Voice processor → Emotion classifier: supplies transcript (evidence: `MINI_PROJECT_S-T-E-R/MINI_PROJECT_ANMOL_S-T-E-R/Code/multilingualfinal_discord.py`)
