jayavanth18/cyberbullying-detection-in-telugu

An end‑to‑end NLP system for detecting cyberbullying in Telugu social media comments using BERT‑based transformer models, with support for Telugu script, Tenglish, and code‑mixed Telugu–English text.

Python

2

7 commits

updated Mar 28, 2026

See the code

README

🛡️ Cyberbullying Detection in Telugu using BERT-based Transformer Models

Python PyTorch Transformers Streamlit License

An end-to-end NLP system for detecting cyberbullying in Telugu social media comments using Transformer-based language models.

🎥 Watch Demo Video


📌 Overview

Cyberbullying and abusive language have become a significant problem on social media platforms. While many automated moderation systems exist for English, regional languages such as Telugu remain underrepresented in NLP research and moderation tools.

Telugu social media content presents unique challenges:

  • Mixed scripts (Telugu + Latin)
  • Informal transliterations (Tenglish)
  • Slang and creative spellings
  • Limited labeled datasets for training models

This project develops a machine learning pipeline for detecting cyberbullying in Telugu comments, combining modern Transformer-based NLP models with a custom curated dataset and an interactive prediction interface.

The system aims to assist in automated moderation and toxicity detection for Telugu digital platforms.


🎯 Project Objectives

The primary goals of this project are:

  • Build a curated Telugu cyberbullying dataset
  • Design a clean preprocessing and dataset preparation pipeline
  • Train and evaluate multiple BERT-based transformer models
  • Compare model performance across architectures
  • Develop a real-time prediction system using Streamlit
  • Demonstrate practical applications such as YouTube comment moderation

🧠 Methodology

The system follows a modular NLP pipeline:

Raw Social Media Comments
        │
        ▼
Data Cleaning & Normalization
        │
        ▼
Dataset Balancing
        │
        ▼
Train / Validation / Test Split
        │
        ▼
Transformer Model Training
        │
        ▼
Model Evaluation
        │
        ▼
Real-Time Prediction Interface

Key steps include:

Data Preprocessing

The preprocessing pipeline standardizes noisy social media text using:

  • Unicode normalization (NFC)
  • Removal of URLs, emails, emojis, and noise tokens
  • Handling mixed Telugu-English text
  • Deduplication to prevent training leakage

Dataset Balancing

Social media datasets often contain more non-toxic comments than toxic ones.
To prevent bias toward the majority class, the dataset is balanced using controlled undersampling techniques.

Model Training

Multiple Transformer models are fine-tuned for binary classification:

Toxic (Cyberbullying)
Non-Toxic

Fine-tuning uses:

  • Cross-Entropy Loss
  • AdamW optimizer
  • Tokenized input sequences
  • Pretrained contextual embeddings

🤖 Models Evaluated

The project benchmarks several BERT-family transformer models:

ModelDescription
IndicBERTPretrained on multiple Indic languages
IndicBERTv2Improved Indic multilingual transformer
Multilingual BERT (mBERT)Trained on 100+ languages
DistilBERTLightweight distilled version of BERT
XLM-RoBERTaLarge multilingual transformer trained on massive corpora
BERT-Mini / TinyCompact models for faster inference

These models allow comparison between:

  • multilingual transformers
  • Indic-specific models
  • lightweight deployment models

📊 Evaluation Metrics

Model performance is evaluated using several classification metrics:

  • Accuracy
  • Precision
  • Recall
  • F1 Score
  • Matthews Correlation Coefficient (MCC)
  • AUROC

These metrics provide a balanced evaluation for binary toxicity detection tasks.


📈 Results & Visualizations

Model performance and training behaviour were analyzed using multiple visualizations.

Proposed Pipeline

Proposed System

Training Loss

Training Loss

Confusion Matrices

confusion_matrices

🖥 Application Interface

A Streamlit-based application is provided for interactive predictions.

The interface supports:

  • Real-time text classification
  • Batch CSV prediction
  • Model selection
  • Visualization of prediction confidence

This allows researchers and developers to experiment with cyberbullying detection in real time.


📂 Project Structure

cyberbullying-detection-in-telugu
│
├── app.py                    # Streamlit application entry point
├── README.md                 # Project documentation
├── LICENSE
│
├── utils                     # Utility modules
│   ├── model_utils.py
│   ├── data_balancing.py
│   ├── data_summary.py
│   ├── model_evaluation.py
│   └── recent_words.txt
│
└── images                    # Documentation images
    ├── proposed_system.png
    ├── training_loss.png
    └── confusion_matrices.png

Note:

Dataset and training scripts are temporarily excluded from this repository due to an ongoing research publication.


🚀 Getting Started

Prerequisites

  • Python 3.9+
  • PyTorch
  • HuggingFace Transformers
  • Streamlit

Installation

# Clone repository
git clone https://github.com/jayavanth18/cyberbullying-detection-in-telugu.git
cd cyberbullying-detection-in-telugu

# Create virtual environment (Windows)
python -m venv venv

# Activate environment
venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Run application
streamlit run app.py

⚠️ Dataset Availability

The dataset used in this project is not included in this repository.

Reason:

  • Dataset is part of an ongoing research publication
  • Data release will follow paper acceptance

After publication, the dataset and additional training utilities will be made available.


📄 License

This project is licensed under the MIT License.


👨‍💻 Contributors

🔹 A. Jayavanth

GitHub
LinkedIn


🔹 Pavan Yellathakota

GitHub
LinkedIn


🔹 Mohd Rizwan

GitHub
LinkedIn


⭐ If you found this repository useful, consider giving it a star!

jayavanth18/cyberbullying-detection-in-telugu

An end‑to‑end NLP system for detecting cyberbullying in Telugu social media comments using BERT‑based transformer models, with support for Telugu script, Tenglish, and code‑mixed Telugu–English text.

Python

2

7 commits

updated Mar 28, 2026

See the code

README

🛡️ Cyberbullying Detection in Telugu using BERT-based Transformer Models

Python PyTorch Transformers Streamlit License

An end-to-end NLP system for detecting cyberbullying in Telugu social media comments using Transformer-based language models.

🎥 Watch Demo Video


📌 Overview

Cyberbullying and abusive language have become a significant problem on social media platforms. While many automated moderation systems exist for English, regional languages such as Telugu remain underrepresented in NLP research and moderation tools.

Telugu social media content presents unique challenges:

  • Mixed scripts (Telugu + Latin)
  • Informal transliterations (Tenglish)
  • Slang and creative spellings
  • Limited labeled datasets for training models

This project develops a machine learning pipeline for detecting cyberbullying in Telugu comments, combining modern Transformer-based NLP models with a custom curated dataset and an interactive prediction interface.

The system aims to assist in automated moderation and toxicity detection for Telugu digital platforms.


🎯 Project Objectives

The primary goals of this project are:

  • Build a curated Telugu cyberbullying dataset
  • Design a clean preprocessing and dataset preparation pipeline
  • Train and evaluate multiple BERT-based transformer models
  • Compare model performance across architectures
  • Develop a real-time prediction system using Streamlit
  • Demonstrate practical applications such as YouTube comment moderation

🧠 Methodology

The system follows a modular NLP pipeline:

Raw Social Media Comments
        │
        ▼
Data Cleaning & Normalization
        │
        ▼
Dataset Balancing
        │
        ▼
Train / Validation / Test Split
        │
        ▼
Transformer Model Training
        │
        ▼
Model Evaluation
        │
        ▼
Real-Time Prediction Interface

Key steps include:

Data Preprocessing

The preprocessing pipeline standardizes noisy social media text using:

  • Unicode normalization (NFC)
  • Removal of URLs, emails, emojis, and noise tokens
  • Handling mixed Telugu-English text
  • Deduplication to prevent training leakage

Dataset Balancing

Social media datasets often contain more non-toxic comments than toxic ones.
To prevent bias toward the majority class, the dataset is balanced using controlled undersampling techniques.

Model Training

Multiple Transformer models are fine-tuned for binary classification:

Toxic (Cyberbullying)
Non-Toxic

Fine-tuning uses:

  • Cross-Entropy Loss
  • AdamW optimizer
  • Tokenized input sequences
  • Pretrained contextual embeddings

🤖 Models Evaluated

The project benchmarks several BERT-family transformer models:

ModelDescription
IndicBERTPretrained on multiple Indic languages
IndicBERTv2Improved Indic multilingual transformer
Multilingual BERT (mBERT)Trained on 100+ languages
DistilBERTLightweight distilled version of BERT
XLM-RoBERTaLarge multilingual transformer trained on massive corpora
BERT-Mini / TinyCompact models for faster inference

These models allow comparison between:

  • multilingual transformers
  • Indic-specific models
  • lightweight deployment models

📊 Evaluation Metrics

Model performance is evaluated using several classification metrics:

  • Accuracy
  • Precision
  • Recall
  • F1 Score
  • Matthews Correlation Coefficient (MCC)
  • AUROC

These metrics provide a balanced evaluation for binary toxicity detection tasks.


📈 Results & Visualizations

Model performance and training behaviour were analyzed using multiple visualizations.

Proposed Pipeline

Proposed System

Training Loss

Training Loss

Confusion Matrices

confusion_matrices

🖥 Application Interface

A Streamlit-based application is provided for interactive predictions.

The interface supports:

  • Real-time text classification
  • Batch CSV prediction
  • Model selection
  • Visualization of prediction confidence

This allows researchers and developers to experiment with cyberbullying detection in real time.


📂 Project Structure

cyberbullying-detection-in-telugu
│
├── app.py                    # Streamlit application entry point
├── README.md                 # Project documentation
├── LICENSE
│
├── utils                     # Utility modules
│   ├── model_utils.py
│   ├── data_balancing.py
│   ├── data_summary.py
│   ├── model_evaluation.py
│   └── recent_words.txt
│
└── images                    # Documentation images
    ├── proposed_system.png
    ├── training_loss.png
    └── confusion_matrices.png

Note:

Dataset and training scripts are temporarily excluded from this repository due to an ongoing research publication.


🚀 Getting Started

Prerequisites

  • Python 3.9+
  • PyTorch
  • HuggingFace Transformers
  • Streamlit

Installation

# Clone repository
git clone https://github.com/jayavanth18/cyberbullying-detection-in-telugu.git
cd cyberbullying-detection-in-telugu

# Create virtual environment (Windows)
python -m venv venv

# Activate environment
venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Run application
streamlit run app.py

⚠️ Dataset Availability

The dataset used in this project is not included in this repository.

Reason:

  • Dataset is part of an ongoing research publication
  • Data release will follow paper acceptance

After publication, the dataset and additional training utilities will be made available.


📄 License

This project is licensed under the MIT License.


👨‍💻 Contributors

🔹 A. Jayavanth

GitHub
LinkedIn


🔹 Pavan Yellathakota

GitHub
LinkedIn


🔹 Mohd Rizwan

GitHub
LinkedIn


⭐ If you found this repository useful, consider giving it a star!