Downloads · 30 days
0
alexgoldberg/neodictabert-role-classifier-hebrew-manuscripts
neodictabert-role-classifier-hebrew-manuscripts is a machine learning model from alexgoldberg. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Model: alexgoldberg/neodictabert-role-classifier-hebrew-manuscripts
Downloads · 30 days
0
Access
Public
Updated Nov 10, 2025
Repo size
8.7 GB
Likes
0
Public
Click a slice to open those files.
.pt5.8 GB · 67%
From the Hugging Face model README
Model: alexgoldberg/neodictabert-role-classifier-hebrew-manuscripts
State-of-the-art role classification model for Hebrew manuscript persons. Achieves 90.64% accuracy using novel two-input format.
Fine-tuned from dicta-il/neodictabert-bilingual on 4,339 Hebrew manuscript role samples.
Key Innovation: Two-input format with explicit person marking:
Input: [PERSON: person_name] + text
This reduces ambiguity when multiple persons appear in text.
Architecture: NeoBERT (363M parameters, 612B training tokens)
Categories: 6 manuscript roles
Test Set: 545 samples (6 balanced categories)
| Metric | Score |
|---|---|
| Accuracy | 90.64% ⭐ |
| F1 (weighted) | 90.64% |
| Precision (weighted) | 91% |
Per-Category F1 Scores:
Comparison:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
# Load model and tokenizer
model_name = "alexgoldberg/neodictabert-role-classifier-hebrew-manuscripts"
tokenizer = AutoTokenizer.from_pretrained("dicta-il/neodictabert-bilingual")
model = AutoModelForSequenceClassification.from_pretrained(model_name)
# Two-input format: [PERSON: name] + text
person_name = "משה בן יעקב"
text = "נכתב על ידי משה בן יעקב"
# Format input (critical for performance!)
formatted_input = f"[PERSON: {person_name}] {text}"
# Tokenize
inputs = tokenizer(
formatted_input,
return_tensors="pt",
padding=True,
truncation=True,
max_length=128
)
# Predict
with torch.no_grad():
outputs = model(**inputs)
logits = outputs.logits[0]
probabilities = torch.softmax(logits, dim=0)
predicted_class = torch.argmax(probabilities).item()
confidence = probabilities[predicted_class].item()
role = model.config.id2label[predicted_class]
print(f"Person: {person_name}")
print(f"Role: {role}")
print(f"Confidence: {confidence:.2%}")
# Output:
# Person: משה בן יעקב
# Role: TRANSCRIBER
# Confidence: 99%
Important: Always use the two-input format for best results!
Source: 4,339 person-role pairs from Hebrew manuscript catalogs
Method: Extracted from MARC records with validated roles
Format: Two-input with explicit person marking
[PERSON: person_name] + full_text
Role Distribution:
Data Splits:
Hyperparameters:
Hardware: Apple M1 Mac with MPS acceleration
Training time: ~20 minutes
Primary: Role classification for persons extracted from Hebrew manuscripts
Workflow:
[PERSON: name] + textBest practices:
Category limitations:
Domain specificity:
Input format dependency:
[PERSON: name] marking: performance drops ~3%Context requirements:
Multi-person challenges:
Training data bias:
Role distribution bias:
Language bias:
Mitigation strategies:
Carbon footprint: Minimal
Compute efficiency:
@article{goldberg2025classifier,
title={NeoDictaBERT Role Classifier for Hebrew Manuscripts},
author={Goldberg, Alexander},
journal={arXiv preprint arXiv:XXXX.XXXXX},
year={2025},
url={https://huggingface.co/alexgoldberg/neodictabert-role-classifier-hebrew-manuscripts}
}
Base model:
@misc{shmidman2025neodictabert,
title={NeoDictaBERT: Pushing the Frontier of BERT models for Hebrew},
author={Shmidman, Shaltiel and Shmidman, Avi and Koppel, Moshe},
year={2025},
eprint={2510.20386},
archivePrefix={arXiv}
}
MIT License (compatible with NeoDictaBERT's CC-BY-4.0)
Last updated: November 2025