Text Classification
PEFT
Safetensors
Transformers
Hindi
English
lora
intent-classification
hinglish
code-mixed
nlu
voice-agent
Instructions to use yashasvijadav03/hinglish-intent-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use yashasvijadav03/hinglish-intent-classifier with PEFT:
from peft import PeftModel from transformers import AutoModelForSequenceClassification base_model = AutoModelForSequenceClassification.from_pretrained("distilbert-base-multilingual-cased") model = PeftModel.from_pretrained(base_model, "yashasvijadav03/hinglish-intent-classifier") - Transformers
How to use yashasvijadav03/hinglish-intent-classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="yashasvijadav03/hinglish-intent-classifier")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("yashasvijadav03/hinglish-intent-classifier", device_map="auto") - Notebooks
- Google Colab
- Kaggle
ποΈ Hinglish Intent Classifier (LoRA + DistilBERT)
Fine-tuned DistilBERT Multilingual adapter using LoRA (PEFT) for Intent Classification on Code-Mixed Hindi-English (Hinglish) conversational utterances. Built for voice-agent Natural Language Understanding (NLU) pipelines.
π― Target Intent Classes
complaint(e.g., service issues, refund delays)purchase_inquiry(e.g., catalog questions, warranty inquiries)price_negotiation(e.g., asking for discounts, coupon requests)callback_request(e.g., busy right now, call later)not_interested(e.g., refusal, DND requests)positive_confirmation(e.g., deal acceptance, confirmation)
π Benchmark Results
| Model / Configuration | Test Accuracy | Macro-F1 | Precision | Recall |
|---|---|---|---|---|
| Zero-Shot Baseline (MNLI) | 38.89% | 0.3540 | 0.4497 | 0.3889 |
| LoRA Fine-Tuned (Rank 16, lr=5e-4) | 100.00% | 1.0000 | 1.0000 | 1.0000 |
π Quick Start & Usage
import torch
import torch.nn.functional as F
from transformers import AutoTokenizer, AutoModelForSequenceClassification
from peft import PeftModel
base_model_name = "distilbert-base-multilingual-cased"
adapter_repo = "yashasvijadav03/hinglish-intent-classifier"
# Intent labels mapping
id2label = {
0: "complaint",
1: "purchase_inquiry",
2: "price_negotiation",
3: "callback_request",
4: "not_interested",
5: "positive_confirmation"
}
# 1. Load Tokenizer & Base Model
tokenizer = AutoTokenizer.from_pretrained(base_model_name)
base_model = AutoModelForSequenceClassification.from_pretrained(
base_model_name,
num_labels=len(id2label),
id2label=id2label,
)
# 2. Attach Fine-Tuned LoRA Adapter
model = PeftModel.from_pretrained(base_model, adapter_repo)
model.eval()
# 3. Classify an Utterance
text = "Thoda discount de do na, price bohot zyada hai."
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=128)
with torch.no_grad():
logits = model(**inputs).logits
probs = F.softmax(logits, dim=-1)
predicted_id = torch.argmax(probs, dim=-1).item()
print(f"Predicted Intent: {id2label[predicted_id]} (Confidence: {probs[0][predicted_id]:.2%})")
# Output: Predicted Intent: price_negotiation (Confidence: 98.40%)
π οΈ Training Specifications
- Base Model:
distilbert-base-multilingual-cased(135M params) - Trainable Parameters: 1,185,798 (~0.87% of total model params via LoRA)
- LoRA Parameters: Rank $r=16$, Alpha $\alpha=32$, Dropout $0.1$, Target Modules:
q_lin,v_lin - Training Epochs: 3
- Learning Rate:
5e-4with Linear Warmup
- Downloads last month
- -