πŸ”₯ ALFAAZ β€” Punjabi Hate Speech & Sarcasm Detection

ALFAAZ is an AI-powered Punjabi NLP system designed to classify Punjabi text into:

  • βœ… Non-Toxic Content
  • ⚠️ Toxic / Hate Speech
  • 🎭 Sarcastic Content

The system uses a fine-tuned MuRIL transformer model for contextual Punjabi text understanding and real-time inference.


🌐 Live Demo

Frontend Website

https://alfaaz-ai.vercel.app/


🧠 Model Overview

Parameter Value
Base Model google/muril-base-cased
Architecture Transformer (12 Layers)
Classes Non-Toxic, Toxic, Sarcastic
Dataset Size 2,820 Punjabi Entries
Max Sequence Length 128
Optimizer AdamW
Accuracy 88.4%
Weighted F1 Score 0.883

βš™οΈ Pipeline

Punjabi Input Text
        ↓
Language Validation
        ↓
Preprocessing Pipeline
        ↓
MuRIL Tokenization
        ↓
Fine-Tuned MuRIL Model
        ↓
Softmax Classification
        ↓
Prediction Response

🧹 Preprocessing Steps

The preprocessing pipeline includes:

  • Unicode normalization
  • URL removal
  • Mention removal
  • Noise cleaning
  • Stopword filtering
  • Token preparation

The system also supports limited Punjabi-English code-mixed text.


πŸš€ API Usage

Endpoint

POST /predict

Example Request

{
  "text": "਀ੂੰ ਬਿਲਕੁਲ ਬੇਕਾਰ ΰ¨Ήΰ©ˆΰ¨‚"
}

Example Response

{
  "label": "Toxic",
  "confidence": 96.4,
  "probabilities": {
    "Non-Toxic": 1.2,
    "Toxic": 96.4,
    "Sarcastic": 2.4
  }
}

πŸ’» Tech Stack

Machine Learning

  • PyTorch
  • HuggingFace Transformers
  • MuRIL

Backend

  • Flask API
  • Docker

NLP Libraries

  • IndicNLP
  • NLTK
  • NumPy
  • Pandas

⚠️ Important Notes

  • The model is optimized for Punjabi Gurmukhi text.
  • Unsupported scripts such as Hindi Devanagari, Arabic, and Urdu are rejected.
  • Predictions may vary for highly ambiguous sarcastic expressions.

πŸ“Œ Research Objective

The project aims to address the lack of advanced moderation systems for Punjabi regional language content and contribute toward safer multilingual social media environments.


πŸ‘¨β€πŸ’» Author

Amandeep Singh

AI/ML Developer β€’ NLP Enthusiast β€’ Full Stack Developer


⭐ Support

If you found this project useful:

  • ⭐ Star the GitHub repository
  • πŸš€ Share the project
  • 🧠 Contribute improvements

πŸ”— GitHub Repository

https://github.com/DevxAman/Alfaaz-AI

Downloads last month
17
Safetensors
Model size
0.2B params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Space using DevxAman/punjabi-hate-speech-muril 1