afriberta-large fine-tuned on sib200 (multilingual)
Fine-tuned from castorini/afriberta_large on sib200, multilingual protocol, over 60 language(s):
aeb_Arab, afr_Latn, aka_Latn, amh_Ethi, arb_Arab, arb_Latn, ary_Arab, arz_Arab, bam_Latn, bem_Latn, cjk_Latn, dik_Latn, dyu_Latn, eng_Latn, ewe_Latn, fon_Latn, fra_Latn, fuv_Latn, gaz_Latn, hau_Latn, ibo_Latn, kab_Latn, kam_Latn, kbp_Latn, kea_Latn, kik_Latn, kin_Latn, kmb_Latn, knc_Arab, knc_Latn, kon_Latn, lin_Latn, lua_Latn, lug_Latn, luo_Latn, mos_Latn, nso_Latn, nus_Latn, nya_Latn, plt_Latn, run_Latn, sag_Latn, sna_Latn, som_Latn, sot_Latn, ssw_Latn, swh_Latn, taq_Latn, taq_Tfng, tir_Ethi, tsn_Latn, tso_Latn, tum_Latn, twi_Latn, tzm_Tfng, umb_Latn, wol_Latn, xho_Latn, yor_Latn, zul_Latn
| setting | value |
|---|---|
| epochs | 20 |
| learning rate | 5e-05 |
| batch size | 32 |
| max length | 256 |
| metric | weighted_f1 |
| mean score | 0.5214 |
Per-language scores are in metrics.json.
Loading
This is a mean-pooling classifier, not a stock AutoModelForSequenceClassification:
the base encoder's <cls> token was never trained, so pooling over the attention mask
is what the head expects. The encoder is saved in the usual format and the head is a
single linear layer in head.pt.
import json, torch, torch.nn as nn
from transformers import AutoTokenizer, AutoModel
tok = AutoTokenizer.from_pretrained("BeardedMonster/afriberta-large-sib200-multilingual")
enc = AutoModel.from_pretrained("BeardedMonster/afriberta-large-sib200-multilingual")
labels = json.load(open("labels.json")) # hf_hub_download(repo, "labels.json")
head = nn.Linear(enc.config.hidden_size, len(labels))
head.load_state_dict(torch.load("head.pt")) # hf_hub_download(repo, "head.pt")
def predict(texts):
b = tok(texts, return_tensors="pt", padding=True, truncation=True, max_length=256)
h = enc(**b).last_hidden_state
m = b["attention_mask"].unsqueeze(-1).float()
pooled = (h * m).sum(1) / m.sum(1).clamp(min=1e-9) # mean pooling
return [labels[i] for i in head(pooled).argmax(-1).tolist()]
Provenance and limits
Produced by this project's benchmark harness, which reproduces the published MasakhaNER 2.0 baselines to within ~0.25 F1, so these numbers are calibrated rather than ad hoc. Scores come from a single run; the baseline papers average over 5, so treat small differences as noise.
The base model's own licence and terms govern any derivative use — check castorini/afriberta_large
before relying on this checkpoint.
- Downloads last month
- 12
Model tree for BeardedMonster/afriberta-large-sib200-multilingual
Base model
castorini/afriberta_large