MsBERT: A New Model for the Reconstruction of Lacunae in Hebrew Manuscripts
A new pretrained dedicated BERT model, dubbed MsBERT (short for: Manuscript BERT), designed from the ground up to handle Hebrew manuscript text.
MsBERT substantially outperforms all existing Hebrew BERT models regarding the prediction of missing words in fragmentary Hebrew manuscript transcriptions in multiple genres, as well as regarding the task of differentiating between quoted passages and exegetical elaborations.
We provide MsBERT for free download and unrestricted use, and we also provide an interactive and user-friendly website to allow manuscript scholars to leverage the power of MsBERT in their scholarly work of reconstructing fragmentary Hebrew manuscripts.
from transformers import AutoModelForMaskedLM, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained('dicta-il/MsBERT')
model = AutoModelForMaskedLM.from_pretrained('dicta-il/MsBERT')
model.eval()
text = '''ויצפהו זהב [MASK] מרכבו ארגמן ר' [MASK] א' [MASK] פרוכת הסמוכה לה ר' ביבי א' זו [MASK] שזהבה דומה לארגמן'''
output = model(tokenizer.encode(text, return_tensors='pt'))
# the first [MASK] is the token #4 (including [CLS])import torch
top_2 = torch.topk(output.logits[0, 4, :], 2)[1]
print('\n'.join(tokenizer.convert_ids_to_tokens(top_2))) # should print טהור / סגור
Citation
If you use MsBERT in your research, please cite
MsBERT: A New Model for the Reconstruction of Lacunae in Hebrew Manuscripts
BibTeX:
@inproceedings{msbert-2024,
title = "MsBERT: A New Model for the Reconstruction of Lacunae in Hebrew Manuscripts",
author = "Shmidman, Avi and Shmidman, Ometz and Gershuni, Hillel and Koppel, Moshe",
booktitle = "Proceedings of the 1st Machine Learning for Ancient Language Workshop (ML4AL 2024)",
year = "2024",
address = "Bangkok, Thailand",
publisher = "Association for Computational Linguistics",
}
MsBERT huggingface.co is an AI model on huggingface.co that provides MsBERT's model effect (), which can be used instantly with this dicta-il MsBERT model. huggingface.co supports a free trial of the MsBERT model, and also provides paid use of the MsBERT. Support call MsBERT model through api, including Node.js, Python, http.
MsBERT huggingface.co is an online trial and call api platform, which integrates MsBERT's modeling effects, including api services, and provides a free online trial of MsBERT, you can try MsBERT online for free by clicking the link below.
dicta-il MsBERT online free url in huggingface.co:
MsBERT is an open source model from GitHub that offers a free installation service, and any user can find MsBERT on GitHub to install. At the same time, huggingface.co provides the effect of MsBERT install, users can directly use MsBERT installed effect in huggingface.co for debugging and trial. It also supports api for free installation.