Safetensors
Hebrew
bert
Shaltiel commited on
Commit
ff06f0d
verified
1 Parent(s): a5aac9e

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +62 -0
README.md ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-4.0
3
+ language:
4
+ - he
5
+ ---
6
+ # DictaBERT-splinter: Splintering Nonconcatenative Languages for Better Tokenization
7
+
8
+ DictaBERT-splinter is a BERT-style language model for Hebrew, release [here](https://arxiv.org/abs/2503.14433).
9
+
10
+ This is the base model pretrained with the masked-language-modeling objective.
11
+
12
+ Sample usage:
13
+
14
+ ```python
15
+ from transformers import AutoModelForMaskedLM, AutoTokenizer
16
+
17
+ tokenizer = AutoTokenizer.from_pretrained('dicta-il/dictabert-splinter', trust_remote_code=True)
18
+ model = AutoModelForMaskedLM.from_pretrained('dicta-il/dictabert-splinter')
19
+
20
+ model.eval()
21
+
22
+ sentence = '讘砖谞转 1948 讛砖诇讬诐 讗驻专讬诐 拽讬砖讜谉 讗转 [MASK] 讘驻讬住讜诇 诪转讻转 讜讘转讜诇讚讜转 讛讗诪谞讜转 讜讛讞诇 诇驻专住诐 诪讗诪专讬诐 讛讜诪讜专讬住讟讬讬诐'
23
+
24
+ output = model(tokenizer.encode(sentence, return_tensors='pt'))
25
+ # the [MASK] is the 7th token (including [CLS])
26
+ import torch
27
+ top_2 = torch.topk(output.logits[0, 7, :], 2)[1]
28
+ print('\n'.join(tokenizer.batch_decode(top_2))) # should print 讛转诪讞讜转讜 / 诇讬诪讜讚讬讜
29
+
30
+ ```
31
+
32
+
33
+ ## Citation
34
+
35
+ If you use DictaBERT-splinter in your research, please cite ```Splintering Nonconcatenative Languages for Better Tokenization```
36
+
37
+ **BibTeX:**
38
+
39
+ ```bibtex
40
+ @misc{gazit2025splinteringnonconcatenativelanguagesbetter,
41
+ title={Splintering Nonconcatenative Languages for Better Tokenization},
42
+ author={Bar Gazit and Shaltiel Shmidman and Avi Shmidman and Yuval Pinter},
43
+ year={2025},
44
+ eprint={2503.14433},
45
+ archivePrefix={arXiv},
46
+ primaryClass={cs.CL},
47
+ url={https://arxiv.org/abs/2503.14433},
48
+ }
49
+ ```
50
+
51
+ ## License
52
+
53
+ Shield: [![CC BY 4.0][cc-by-shield]][cc-by]
54
+
55
+ This work is licensed under a
56
+ [Creative Commons Attribution 4.0 International License][cc-by].
57
+
58
+ [![CC BY 4.0][cc-by-image]][cc-by]
59
+
60
+ [cc-by]: http://creativecommons.org/licenses/by/4.0/
61
+ [cc-by-image]: https://i.creativecommons.org/l/by/4.0/88x31.png
62
+ [cc-by-shield]: https://img.shields.io/badge/License-CC%20BY%204.0-lightgrey.svg