81melody/algerianDeBERTa-realestate-intent
algerianDeBERTa-realestate-intent
A 3-class intent classifier (BUYER / SELLER / IRRELEVANT) for Algerian real-estate posts scraped from Facebook groups and marketplaces.
Built on `81melody/algerianDeBERTa`, a DeBERTa-v2 model pre-trained from scratch on Algerian web text (Darja, Arabizi, French, code-switching). This classifier is the second stage of the DZ Pulse data-curation pipeline: once `81melody/algerian-realestate-ner` extracts structured fields from a post, this model decides whether the post is a genuine buyer lead, a seller listing, or irrelevant noise (chit-chat, spam, unrelated content).
Model Highlights
Labels:
Quick Start
from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipeline
clf = pipeline(
"text-classification",
model="81melody/algerianDeBERTa-realestate-intent",
top_k=None,
)
print(clf("نبيع شقة F3 في درارية واتساب فقط"))
print(clf("نحوس على فيلا في حيدرة 4 غرف ميزانية 8 مليار"))Or load directly with AutoModelForSequenceClassification — the id2label / label2id maps are already baked into config.json:
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification
MODEL = "81melody/algerianDeBERTa-realestate-intent"
tokenizer = AutoTokenizer.from_pretrained(MODEL)
model = AutoModelForSequenceClassification.from_pretrained(MODEL)
model.eval()
inputs = tokenizer("نبيع شقة F3 في درارية", return_tensors="pt", truncation=True, max_length=192)
with torch.no_grad():
probs = torch.softmax(model(**inputs).logits, dim=-1)[0]
for i, p in enumerate(probs):
print(model.config.id2label[i], round(p.item(), 3))Training Data
Sourced from real-estate posts scraped from public Algerian Facebook groups (DZ Pulse scraper pipeline).
Label distribution (full set): BUYER 6,565 (50%) · IRRELEVANT 3,495 (27%) · SELLER 3,070 (23%)
Sensitive entities (price, phone, city, surface, etc.) are normalized/masked before classification so the model learns intent from phrasing rather than memorizing specific listing details — this masking is handled upstream by the companion NER model.
Training Details
base_model: algerianDeBERTa (DeBERTa-v2)
architecture: DebertaV2ForSequenceClassification
num_labels: 3 (BUYER, SELLER, IRRELEVANT)
max_seq_len: 192
optimizer: AdamW
peak_lr: 2e-5
llrd_factor: 0.9
weight_decay: 0.01
max_grad_norm: 1.0
grad_accum_steps: 2
epochs: up to 10 (early stop, patience=3)
warmup_ratio: 0.1
schedule: cosine with warmup
label_smoothing: 0.05
dropout: 0.1
model_selection: best checkpoint by macro-F1 on the validation splitLayerwise Learning Rate Decay (LLRD): as with the companion NER model, the classifier head trains at peak_lr=2e-5 while each successive DeBERTa layer underneath is scaled down by 0.9×, preserving the base model's general language representations while adapting the top layers to the intent task.
Note on metrics: this checkpoint (best_of2) was selected as the production model based on validation macro-F1 during training and is the version hardcoded in the DZ Pulse production pipeline (intent_classifier.py). A separate archived metrics file for this exact run was not retained, so no held-out test-set numbers are reported here — treat reported confidence scores as relative, and re-validate on your own data before using as a hard filter.
Limitations
- Trained on Facebook posts only — casual, informal register; may underperform on formal listings (real-estate portals, classified-ad websites with structured formats).
- Buyer/seller class imbalance — SELLER is the rarer class on Facebook groups relative to BUYER/IRRELEVANT in this dataset; double-check precision on SELLER posts for your use case.
- No explicit metrics archived for this checkpoint — validate on a held-out sample from your own data before deploying as an automated filter.
- Domain-specific — trained exclusively on real-estate text; not a general-purpose intent classifier.
Intended Use
Citation
@misc{himeur2026algeriandeberta_intent,
title = {algerianDeBERTa-realestate-intent: Buyer/Seller/Irrelevant
Intent Classification for Algerian Real Estate Text},
author = {Himeur, Ayoub},
year = {2026},
publisher = {Hugging Face},
url = {https://huggingface.co/81melody/algerianDeBERTa-realestate-intent},
note = {Fine-tuned DeBERTa-v2 on Algerian Facebook real estate posts, 3-class intent}
}