Skip to content

Latest commit

Β 

History

21 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” Offensive Language Classification

A multi-label classification project to detect various forms of offensive content in user feedback using Machine Learning, Deep Learning, and Transformer-based models.


πŸ“š Dataset

  • Train: English feedback texts with 6 binary labels:
    toxic, abusive, vulgar, menace, offense, bigotry
  • Validation and Test: Multilingual texts
    Only the toxic label is available for evaluation.

βš™οΈ Approaches & Models

βœ… Machine Learning

  • Models: Logistic Regression (LR), Random Forest (RF)
  • Features: TF-IDF, multilingual sentence embeddings
  • Tuning: Grid Search & Random Search

πŸ€– Deep Learning

  • Models: LSTM, GRU
  • Tokenized and padded sequences with Embedding layers

🧠 Transformer Models

  • Models: BERT, XLM-RoBERTa
  • Fine-tuned with dropout + dense layers

πŸ“ˆ Results Summary

Model Accuracy F1-Score
LR βœ… High ⚠️ Moderate
RF ❌ Low ❌ Low
LSTM βœ… High βœ… Better
GRU βœ… High βœ… Better
BERT βœ… High πŸ† Best
XLM-R βœ… High πŸ† Best

πŸ› οΈ Steps to Run the Code

  1. Clone the Repository:
    git clone https://github.com/Sajid064/Offensive-Language-Classification.git
    cd Offensive-Language-Classification
    
  2. Install dependencies:
    pip install -r requirements.txt
    
  3. Run the notebooks:
    • Execute cells in task/model1_implementation.ipynb
    • Execute cells in task/model2_implementation.ipynb

⚠️ Key Challenges and Observations

  • Class Imbalance: High accuracy but relatively lower F1-score
  • Train-Test Mismatch: Language difference affected performance
  • Label Availability: Only toxic label provided for test set

About

Multi-label classification of offensive language using Machine Learning, Deep Learning, and Transformer-based models

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages