Downloads · 30 days
40
22% of all-time downloads
Sefaria/berel-linker-ner
berel-linker-ner is a token classification model from Sefaria. Use it when you need labels on individual words, such as names. The card lists the license as apache-2.0.
A Hebrew Named Entity Recognition (NER) model for Rabbinic literature, fine-tuned from BEREL 3.0 — a BERT-based language model pre-trained on Rabbinic Hebrew texts by DICTA.
Downloads · 30 days
40
22% of all-time downloads
All-time downloads
185
Public
Parameters
184M
735 MB on disk
Likes
3
Public
Click a slice to open those files.
.safetensors735 MB · 99%
From the Hugging Face model README
A Hebrew Named Entity Recognition (NER) model for Rabbinic literature, fine-tuned from BEREL 3.0 — a BERT-based language model pre-trained on Rabbinic Hebrew texts by DICTA.
This model identifies two entity types in Rabbinic Hebrew text:
| Label | Hebrew | Description |
|---|---|---|
Cit (B-מקור / I-מקור) | מקור | Citations — references to Jewish texts and sources |
Per (B-בן-אדם / I-בן-אדם) | בן-אדם | Persons — names of people |
It uses BIO tagging and was trained for the purpose of automatically linking citations and persons in Sefaria's corpus of Rabbinic literature.
BertForTokenClassification (BERT-base, 12 layers, 12 attention heads, hidden size 768)Best checkpoint was saved at epoch 3 (of a possible 10) via early stopping:
| Metric | Score |
|---|---|
| F1 | 87.2% |
| Precision | 85.7% |
| Recall | 88.8% |
| Eval loss | 0.0815 |
from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline
model_id = "Sefaria/berel-linker-ner"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForTokenClassification.from_pretrained(model_id)
ner = pipeline(
"ner",
model=model,
tokenizer=tokenizer,
aggregation_strategy="first",
stride=128,
)
text = "דברי הרמב\"ם בהלכות שבת"
entities = ner(text)
print(entities)
{
"O": 0,
"I-מקור": 1,
"I-בן-אדם": 2,
"B-מקור": 5,
"B-בן-אדם": 6
}
Developed by Sefaria for automated entity linking in classical Jewish texts.