HuggingFaceFW/fineweb-2
Viewer • Updated • 4.48B • 116k • 901
How to use Horizon-Labs/multilingual-edu-classifier-base with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="Horizon-Labs/multilingual-edu-classifier-base") # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("Horizon-Labs/multilingual-edu-classifier-base")
model = AutoModelForSequenceClassification.from_pretrained("Horizon-Labs/multilingual-edu-classifier-base", device_map="auto")Scores how educational a web page is, from 0 (none) to 5 (excellent, textbook-like), in English and 65 other languages, on the
same scale as FineWeb-Edu. Use it to filter or weight pretraining data,
for example FineWeb-2, the way FineWeb-Edu filtered English (int_score >= 3).
Built on mmBERT-base, Apache-2.0, with ONNX files included.
A smaller, faster version is available as Horizon-Labs/multilingual-edu-classifier-small.
HuggingFaceFW/fineweb-edu-classifier: one regression output; int_score = round(clamp(score, 0, 5)).onnx/model_quantized.onnx (int8 embeddings, 641 MB): scores differ from fp32 by 0.003 on average; the educational / not decision (2.5) agrees for 100.0% of 400 test documents.import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tok = AutoTokenizer.from_pretrained("Horizon-Labs/multilingual-edu-classifier-base")
model = AutoModelForSequenceClassification.from_pretrained("Horizon-Labs/multilingual-edu-classifier-base")
texts = ["La photosynthèse est le processus par lequel les plantes ...", "Buy cheap shoes now! Free shipping ..."]
inputs = tok(texts, return_tensors="pt", padding=True, truncation=True, max_length=512)
with torch.no_grad():
score = model(**inputs).logits.squeeze(-1).float()
int_score = score.clamp(0, 5).round().int()
print(score.tolist(), int_score.tolist())
| model | licence | 65 languages (FineWeb-2): Spearman | per-language mean Spearman | English (Llama-3 labels): Spearman | English: F1, educational (>= 3) | note |
|---|---|---|---|---|---|---|
| this model (308M) | Apache-2.0 | 0.845 | 0.836 | 0.787 | 0.729 | 65+ languages |
| Horizon-Labs/multilingual-edu-classifier-small (141M) | Apache-2.0 | 0.823 | 0.809 | 0.781 | 0.723 | |
| HuggingFaceFW/fineweb-edu-classifier (109M) | Apache-2.0 | 0.313 | 0.355 | 0.781 | 0.717 | English; trained on the Llama-3 annotations used for the English test (in-domain) |
| nvidia/nemocurator-fineweb-mixtral-edu-classifier (109M) | NVIDIA open model licence | 0.282 | 0.339 | 0.718 | 0.615 | English |
| nvidia/nemocurator-fineweb-nemotron-4-edu-classifier (109M) | NVIDIA open model licence | 0.290 | 0.340 | 0.690 | 0.559 | English |
| hotchpotch/fineweb-2-edu-japanese-classifier (279M) | MIT | 0.550 | 0.575 | 0.592 | 0.180 | Japanese (XLM-R) |
| lapa-llm/fineweb-nemotron-edu-score (279M) | MIT | 0.535 | 0.547 | 0.404 | 0.000 | Ukrainian (XLM-R) |
| Qwen3.8-27B, prompted (our teacher, raw scores before calibration; 27B) | Apache-2.0 | 0.881 | 0.873 | 0.702 | 0.527 | for reference |
code/ in this repository.Base model
jhu-clsp/mmBERT-base