# pavithras2022b-bit/multilingual-emotion-detection architecture

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

- Interactive diagram: https://gitdiagram.com/pavithras2022b-bit/multilingual-emotion-detection
- Repository: https://github.com/pavithras2022b-bit/multilingual-emotion-detection

## Overview

This repository’s runnable product is a Streamlit interface for classifying Tamil or Telugu review text into an emotion label and displaying confidence scores. The app loads a fine-tuned transformer and label encoder, tokenizes submitted text, runs inference, and renders the result. The README also describes a broader collection, preprocessing, labeling, training, and evaluation workflow, but its notebook was not inspected and the referenced transformer directory is absent from the file tree; those documented stages are shown as documentation-only context.

Main entry points: [`app.py`](https://github.com/pavithras2022b-bit/multilingual-emotion-detection/blob/main/app.py) (Emotion analyzer), [`README.md`](https://github.com/pavithras2022b-bit/multilingual-emotion-detection/blob/main/README.md) (Text preprocessing), [`mbert_label_encoder.pkl`](https://github.com/pavithras2022b-bit/multilingual-emotion-detection/blob/main/mbert_label_encoder.pkl) (Label encoder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_application["Review application"]
  node_streamlit_app["Emotion analyzer<br/>[app.py]"]
  node_transformer["Transformer classifier<br/>[app.py]"]
  node_confidence_view["Confidence results<br/>[app.py]"]
end

subgraph group_artifacts["Data and models"]
  node_label_encoder["Label encoder"]
  node_model_weights["Fine-tuned weights"]
  node_balanced_data[("Balanced reviews")]
  node_preprocessed_data[("Preprocessed reviews")]
end

subgraph group_documented["Documented workflow"]
  node_data_collection["Review collection<br/>[README.md]"]
  node_preprocessing["Text preprocessing<br/>[README.md]"]
  node_zero_shot["Zero-shot labeling<br/>[README.md]"]
  node_model_training["Model training<br/>[README.md]"]
  node_evaluation["Model evaluation<br/>[README.md]"]
end

node_reviewer(("Review submitter"))

node_reviewer -->|"enters review"| node_streamlit_app
node_streamlit_app -->|"runs inference"| node_transformer
node_streamlit_app -->|"loads labels"| node_label_encoder
node_streamlit_app -->|"loads model"| node_model_weights
node_streamlit_app -->|"renders scores"| node_confidence_view
node_data_collection -->|"feeds reviews"| node_preprocessing
node_preprocessing -->|"prepares text"| node_zero_shot
node_zero_shot -->|"labels data"| node_model_training
node_model_training -->|"produces models"| node_evaluation

click node_streamlit_app "https://github.com/pavithras2022b-bit/multilingual-emotion-detection/blob/main/app.py"
click node_transformer "https://github.com/pavithras2022b-bit/multilingual-emotion-detection/blob/main/app.py"
click node_label_encoder "https://github.com/pavithras2022b-bit/multilingual-emotion-detection/blob/main/mbert_label_encoder.pkl"
click node_confidence_view "https://github.com/pavithras2022b-bit/multilingual-emotion-detection/blob/main/app.py"
click node_balanced_data "https://github.com/pavithras2022b-bit/multilingual-emotion-detection/blob/main/balanced_dataset_light.csv"
click node_preprocessed_data "https://github.com/pavithras2022b-bit/multilingual-emotion-detection/blob/main/preprocessed_dataset.csv"
click node_data_collection "https://github.com/pavithras2022b-bit/multilingual-emotion-detection/blob/main/README.md"
click node_preprocessing "https://github.com/pavithras2022b-bit/multilingual-emotion-detection/blob/main/README.md"
click node_zero_shot "https://github.com/pavithras2022b-bit/multilingual-emotion-detection/blob/main/README.md"
click node_model_training "https://github.com/pavithras2022b-bit/multilingual-emotion-detection/blob/main/README.md"
click node_evaluation "https://github.com/pavithras2022b-bit/multilingual-emotion-detection/blob/main/README.md"

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_streamlit_app,node_transformer,node_confidence_view,node_reviewer toneBlue
class node_label_encoder,node_model_weights,node_balanced_data,node_preprocessed_data toneAmber
class node_data_collection,node_preprocessing,node_zero_shot,node_model_training,node_evaluation toneMint
```

## Components

### Review application

- [Emotion analyzer](https://github.com/pavithras2022b-bit/multilingual-emotion-detection/blob/main/app.py): `app.py`
- [Transformer classifier](https://github.com/pavithras2022b-bit/multilingual-emotion-detection/blob/main/app.py): `app.py`
- [Confidence results](https://github.com/pavithras2022b-bit/multilingual-emotion-detection/blob/main/app.py): `app.py`

### Data and models

- [Label encoder](https://github.com/pavithras2022b-bit/multilingual-emotion-detection/blob/main/mbert_label_encoder.pkl): `mbert_label_encoder.pkl`
- **Fine-tuned weights**
- [Balanced reviews](https://github.com/pavithras2022b-bit/multilingual-emotion-detection/blob/main/balanced_dataset_light.csv): `balanced_dataset_light.csv`
- [Preprocessed reviews](https://github.com/pavithras2022b-bit/multilingual-emotion-detection/blob/main/preprocessed_dataset.csv): `preprocessed_dataset.csv`

### Documented workflow

- [Review collection](https://github.com/pavithras2022b-bit/multilingual-emotion-detection/blob/main/README.md): `README.md`
- [Text preprocessing](https://github.com/pavithras2022b-bit/multilingual-emotion-detection/blob/main/README.md): `README.md`
- [Zero-shot labeling](https://github.com/pavithras2022b-bit/multilingual-emotion-detection/blob/main/README.md): `README.md`
- [Model training](https://github.com/pavithras2022b-bit/multilingual-emotion-detection/blob/main/README.md): `README.md`
- [Model evaluation](https://github.com/pavithras2022b-bit/multilingual-emotion-detection/blob/main/README.md): `README.md`

### Other components

- **Review submitter**

## Connections

- Review submitter → Emotion analyzer: enters review (evidence: `app.py`)
- Emotion analyzer → Transformer classifier: runs inference (evidence: `app.py`)
- Emotion analyzer → Label encoder: loads labels (evidence: `app.py`)
- Emotion analyzer → Fine-tuned weights: loads model (evidence: `app.py`)
- Emotion analyzer → Confidence results: renders scores (evidence: `app.py`)
- Review collection → Text preprocessing: feeds reviews (evidence: `README.md`)
- Text preprocessing → Zero-shot labeling: prepares text (evidence: `README.md`)
- Zero-shot labeling → Model training: labels data (evidence: `README.md`)
- Model training → Model evaluation: produces models (evidence: `README.md`)
