Instructions to use iDEM-Project/mBERT-ReadMe-CEFR-fold-1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use iDEM-Project/mBERT-ReadMe-CEFR-fold-1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="iDEM-Project/mBERT-ReadMe-CEFR-fold-1")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("iDEM-Project/mBERT-ReadMe-CEFR-fold-1") model = AutoModelForSequenceClassification.from_pretrained("iDEM-Project/mBERT-ReadMe-CEFR-fold-1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
iDEM — Multilingual Text Difficulty Classifier (mBERT–ReadMe++)
Model description
This checkpoint belongs to a series of five multilingual BERT models developed at the University of Leeds within iDEM (Innovative and Inclusive Democratic Spaces for Deliberation and Participation), for automatic text difficulty assessment. The models use bert-base-multilingual-uncased and the BertForSequenceClassification architecture with four output scores. The series was obtained through five-fold cross-validation. This repository contains fold 1.
The research background is described in To Predict or Not to Predict? Towards Reliable Uncertainty Estimation in the Presence of Noise (Khallaf and Sharoff, 2026).
Training data and evaluation
The training resource is ReadMe++ (Naous et al., 2024), a multilingual, multi-domain resource with 9,757 CEFR-annotated sentences across Arabic, English, French, Hindi and Russian. D3.5 additionally reports evaluation on Vikidia/Wikipedia and the iDEM corpus, including Catalan, Italian and Spanish, to examine cross-language and cross-domain transfer. The full source dataset size is not the number of examples used to train each fold.
Binary task in D3.5
The reference categories described in Section 2.2 are:
| CEFR level | Binary reference class |
|---|---|
| A1, A2, B1 | Simple (0) |
| B2 | Excluded from the original binary task |
| C1, C2 | Complex (1) |
Checkpoint outputs and operational conversion
The saved configuration exposes generic labels LABEL_0 through LABEL_3. The operational conversion used in the recovered iDEM subset evaluation is shown below. The proposed CEFR names are not independently verified against the original training encoder and must not be interpreted as validated CEFR predictions.
| Output index | Proposed CEFR interpretation | Operational binary class |
|---|---|---|
| 0 | A1–A2 | Simple (0) |
| 1 | B1 | Simple (0) |
| 2 | B2 | Complex (1) |
| 3 | C1–C2 | Complex (1) |
This operational mapping is distinct from the D3.5 reference-label exclusion of B2. Do not interpret a predicted output index 2 as a verified B2 prediction or discard it on that basis. The original training label encoder and exact decision rule should be checked before treating the operational mapping as a validated CEFR conversion or deploying it for production.
How to use
Install dependencies:
pip install torch transformers
Load a single checkpoint and convert its highest-scoring output index into the operational binary label. The example uses fold 1; the same interface applies to the other folds. It is an illustrative inference implementation, not a claim that the exact historical evaluation decision rule has been recovered.
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification
model_id = "iDEM-Project/mBERT-ReadMe-CEFR-fold-1"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSequenceClassification.from_pretrained(model_id)
model.eval()
ID_TO_BINARY = {0: 0, 1: 0, 2: 1, 3: 1}
BINARY_LABELS = {0: "simple", 1: "complex"}
def predict_difficulty(text):
inputs = tokenizer(text, return_tensors="pt", truncation=True,
max_length=512)
with torch.inference_mode():
logits = model(**inputs).logits
probs = logits.softmax(dim=-1)[0]
if probs.numel() != 4:
raise ValueError("Expected four checkpoint outputs")
output_id = int(probs.argmax().item())
binary_id = ID_TO_BINARY[output_id]
return {
"output_id": output_id,
"label": BINARY_LABELS[binary_id],
"binary_id": binary_id,
"output_probabilities": probs.tolist(),
}
print(predict_difficulty("El ayuntamiento ha publicado una nueva propuesta."))
Optional probability-based conversion
For future application integration, binary scores can also be obtained by summing the softmax probabilities for indices 0–1 and 2–3 respectively. These are uncalibrated scores. Selecting the larger sum is a different decision rule from mapping the highest-scoring individual index and may change the results. It should be evaluated separately rather than substituted into the reported evaluation.
p_simple = probs[0] + probs[1]
p_complex = probs[2] + probs[3]
Here probs is the four-element probability tensor in the inference function above.
Evaluation results
The following are model-series results reported in the D3.5 draft, not standalone fold-1 scores. ReadMe++ uses cross-validation; the external test sets are evaluated across the checkpoints.
| Dataset | Macro F1 |
|---|---|
| ReadMe++ | 0.83 ± 0.014 |
| Vikidia/Wikipedia | 0.68 ± 0.040 |
| iDEM | 0.59 ± 0.021 |
Intended use and limitations
The models are intended to support multilingual text difficulty assessment, text simplification workflows and research into accessible communication. CEFR readability and Easy-to-Read compliance are distinct constructs. In particular, the iDEM target is closer to A2, whereas the original binary task includes B1 in the simple category. The model does not certify accessibility, and its scores are not calibrated probabilities of comprehension. Performance may decline on unfamiliar languages, domains, short segments and specialised administrative texts. Human review and target-reader validation remain necessary. The associated LREC paper investigates uncertainty estimation and selective prediction; abstention is not enabled by the inference example above.
Citation
Khallaf, Nouran, and Serge Sharoff. 2026. To Predict or Not to Predict? Towards Reliable Uncertainty Estimation in the Presence of Noise. Proceedings of LREC 2026, pp. 152–168. Research code.
Naous, Tarek, Michael J. Ryan, Anton Lavrouk, Mohit Chandra, and Wei Xu. 2024. ReadMe++: Benchmarking Multilingual Language Models for Multi-Domain Readability Assessment. Proceedings of EMNLP 2024, pp. 12230–12266. Dataset and code.
Funding
This work was developed within iDEM, funded by the European Union’s Horizon Europe research and innovation programme under Grant Agreement No. 101132431.
- Downloads last month
- 29
Model tree for iDEM-Project/mBERT-ReadMe-CEFR-fold-1
Base model
google-bert/bert-base-multilingual-uncased