--- license: cc-by-4.0 language: - he --- # 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. You can try out the website here: [https://msbert.dicta.org.il](https://msbert.dicta.org.il). Sample usage: ```python 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:** ```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", } ``` ## License Shield: [![CC BY 4.0][cc-by-shield]][cc-by] This work is licensed under a [Creative Commons Attribution 4.0 International License][cc-by]. [![CC BY 4.0][cc-by-image]][cc-by] [cc-by]: http://creativecommons.org/licenses/by/4.0/ [cc-by-image]: https://i.creativecommons.org/l/by/4.0/88x31.png [cc-by-shield]: https://img.shields.io/badge/License-CC%20BY%204.0-lightgrey.svg