QFrBLiMa
CamemBERTv2 — French dialect classifier
2 min readupdated
The chaouin/qfrblima-camembertv2 model is a specialized text classifier built on CamemBERTv2 (0.11B parameters), trained to distinguish between Metropolitan French and Quebec French. The model outputs probability scores for each language variant. This tool is designed for linguistic research, contrastive analysis of language markers, and helps process texts across different dialects.
Key features
- Built on CamemBERTv2: A compact model (0.11B parameters) for text classification tasks.
- Dialect distinction: Accurately determines the difference between standard European and Quebec French.
- Research base: Evaluated on the QFrBLiMa contrastive linguistic markers dataset.
- High metrics: Macro-F1 of 97.07% on the internal test dataset.
What you can do
- Use in Python scripts to automatically classify French-language texts by region.
- Conduct contrastive analysis of linguistic features and markers in research projects.
- Integrate into natural language processing pipelines (transformers) for content analysis.
Example
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification
model_id = "chaouin/qfrblima-camembertv2"
tokenizer = AutoTokenizer.from_pretrained(model_id, use_fast=True)
model = AutoModelForSequenceClassification.from_pretrained(model_id)
model.eval()
texts = [
"J'ai terminé le puzzle hier soir.",
"J'ai terminé le casse-tête hier soir.",
]
inputs = tokenizer(texts, padding=True, truncation=True,
max_length=128, return_tensors="pt")
with torch.inference_mode():
scores = model(**inputs).logits.softmax(dim=-1)[:, 1]
print(scores.tolist()) # QFr scores
print("QFr sentence ranked higher:", (scores[1] > scores[0]).item())
Read more
DetailsBenchmarks: internal test macro-F1 — 97.07%, QFrBLiMa accuracy — 57.39%, pairwise accuracy — 70.37%.
Hardware requirements: Compact 0.11B parameter model, runs on standard CPUs and GPUs.
Training: 3 epochs, batch size 32, learning rate 2e-5, dataset of 938,484 examples.
License: MIT.










Comments