Arabic NLI Binary Classifier โ s05-mbert-nli
Binary Arabic text classifier (0 = faithful, 1 = unfaithful). Fine-tuned for Arabic NLI-based binary text classification.
Base model
google-bert/bert-base-multilingual-cased
Input format
nli โ [CLS] gold_answer [SEP] model_answer [SEP] (NLI framing: gold_answer as premise,
model_answer as hypothesis)
Dev results
- AUC-ROC (official, full dev n=1300): 0.9594
- AUC-ROC (clean dev, n=800, excludes ~100 questions also seen in train): 0.9310
- Macro F1 (official, threshold=0.50): 0.9171
Note: the official-dev number is inflated by 500 dev rows whose questions also appear in the
training set (near-memorization). The clean-dev AUC-ROC (0.9310) is the honest generalization
estimate and the number to use for ranking against other runs. It sits above the
s01-camelbert-qa baseline
(0.8713) and the s02/s03
NLI models (0.927), but below
s04-arbert-nli (0.9408, current
best single). As a multilingual model (vs the Arabic-specific CAMeLBERT/MARBERT/ARBERT), it adds
architectural diversity to the ensemble and achieves the best dev F1-Macro so far (0.9171). All
far exceed the published CAMeLBERT baseline (0.7093 dev AUC-ROC).
Training data
Arabic training set โ 4,705 Arabic (question, gold_answer, model_answer) triples, 5 source LLMs, 13 knowledge domains.
Usage
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
tokenizer = AutoTokenizer.from_pretrained("HassanB4/s05-mbert-nli")
model = AutoModelForSequenceClassification.from_pretrained("HassanB4/s05-mbert-nli")
inputs = tokenizer(gold_answer, model_answer, return_tensors="pt", truncation=True, max_length=512)
with torch.no_grad():
logits = model(**inputs).logits
score = torch.softmax(logits, dim=-1)[0][1].item() # unfaithfulness score
predicted_label = int(score > 0.5)
- Downloads last month
- -