Shaltiel commited on
Commit
7bf8ed2
โ€ข
1 Parent(s): aec7889

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +60 -0
README.md CHANGED
@@ -1,3 +1,63 @@
1
  ---
2
  license: cc-by-4.0
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: cc-by-4.0
3
+ language:
4
+ - he
5
  ---
6
+ # DictaBERT-Large: A State-of-the-Art BERT-Large Suite for Modern Hebrew
7
+
8
+ State-of-the-art language model for Hebrew, released [here](https://arxiv.org/abs/2308.16687).
9
+
10
+ This is the BERT-tiny base model pretrained with the masked-language-modeling objective.
11
+
12
+ For the bert models for other tasks, see [here](https://huggingface.co/collections/dicta-il/dictabert-6588e7cc08f83845fc42a18b).
13
+
14
+ Sample usage:
15
+
16
+ ```python
17
+ from transformers import AutoModelForMaskedLM, AutoTokenizer
18
+
19
+ tokenizer = AutoTokenizer.from_pretrained('dicta-il/dictabert-tiny')
20
+ model = AutoModelForMaskedLM.from_pretrained('dicta-il/dictabert-tiny')
21
+
22
+ model.eval()
23
+
24
+ sentence = 'ื‘ืฉื ืช 1948 ื”ืฉืœื™ื ืืคืจื™ื ืงื™ืฉื•ืŸ ืืช [MASK] ื‘ืคื™ืกื•ืœ ืžืชื›ืช ื•ื‘ืชื•ืœื“ื•ืช ื”ืืžื ื•ืช ื•ื”ื—ืœ ืœืคืจืกื ืžืืžืจื™ื ื”ื•ืžื•ืจื™ืกื˜ื™ื™ื'
25
+
26
+ output = model(tokenizer.encode(sentence, return_tensors='pt'))
27
+ # the [MASK] is the 7th token (including [CLS])
28
+ import torch
29
+ top_2 = torch.topk(output.logits[0, 7, :], 2)[1]
30
+ print('\n'.join(tokenizer.convert_ids_to_tokens(top_2))) # should print ืœื™ืžื•ื“ื™ื• / ืžื—ืงืจื™ื•
31
+
32
+ ```
33
+
34
+
35
+ ## Citation
36
+
37
+ If you use DictaBERT in your research, please cite ```DictaBERT: A State-of-the-Art BERT Suite for Modern Hebrew```
38
+
39
+ **BibTeX:**
40
+
41
+ ```bibtex
42
+ @misc{shmidman2023dictabert,
43
+ title={DictaBERT: A State-of-the-Art BERT Suite for Modern Hebrew},
44
+ author={Shaltiel Shmidman and Avi Shmidman and Moshe Koppel},
45
+ year={2023},
46
+ eprint={2308.16687},
47
+ archivePrefix={arXiv},
48
+ primaryClass={cs.CL}
49
+ }
50
+ ```
51
+
52
+ ## License
53
+
54
+ Shield: [![CC BY 4.0][cc-by-shield]][cc-by]
55
+
56
+ This work is licensed under a
57
+ [Creative Commons Attribution 4.0 International License][cc-by].
58
+
59
+ [![CC BY 4.0][cc-by-image]][cc-by]
60
+
61
+ [cc-by]: http://creativecommons.org/licenses/by/4.0/
62
+ [cc-by-image]: https://i.creativecommons.org/l/by/4.0/88x31.png
63
+ [cc-by-shield]: https://img.shields.io/badge/License-CC%20BY%204.0-lightgrey.svg