π₯ 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
π§ 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
- Downloads last month
- 20
Inference Providers NEW
This model isn't deployed by any Inference Provider. π Ask for provider support