Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,80 @@
|
|
1 |
---
|
2 |
license: cc-by-4.0
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: cc-by-4.0
|
3 |
+
language:
|
4 |
+
- he
|
5 |
---
|
6 |
+
# DictaBERT: A State-of-the-Art BERT Suite for Modern Hebrew
|
7 |
+
|
8 |
+
State-of-the-art language model for Hebrew, as released [here](link to arxiv).
|
9 |
+
|
10 |
+
This is the fine-tuned model for the prefix segmentation task.
|
11 |
+
|
12 |
+
Sample usage:
|
13 |
+
|
14 |
+
```
|
15 |
+
from transformers import AutoModel, AutoTokenizer
|
16 |
+
|
17 |
+
tokenizer = AutoTokenizer.from_pretrained('dicta-il/dictabert-seg')
|
18 |
+
model = AutoModel.from_pretrained('dicta-il/dictabert-seg', trust_remote_code=True)
|
19 |
+
|
20 |
+
model.eval()
|
21 |
+
|
22 |
+
sentence = '讘砖谞转 1948 讛砖诇讬诐 讗驻专讬诐 拽讬砖讜谉 讗转 诇讬诪讜讚讬讜 讘驻讬住讜诇 诪转讻转 讜讘转讜诇讚讜转 讛讗诪谞讜转 讜讛讞诇 诇驻专住诐 诪讗诪专讬诐 讛讜诪讜专讬住讟讬讬诐'
|
23 |
+
segmented_sentence = model.predict([sentence], tokenizer)
|
24 |
+
|
25 |
+
import json
|
26 |
+
print(json.dumps(segmented_sentence, indent=2))
|
27 |
+
```
|
28 |
+
|
29 |
+
Output:
|
30 |
+
```json
|
31 |
+
[
|
32 |
+
[
|
33 |
+
[ "[CLS]" ],
|
34 |
+
[ "讘","砖谞转" ],
|
35 |
+
[ "1948" ],
|
36 |
+
[ "讛砖诇讬诐" ],
|
37 |
+
[ "讗驻专讬诐" ],
|
38 |
+
[ "拽讬砖讜谉" ],
|
39 |
+
[ "讗转" ],
|
40 |
+
[ "诇讬诪讜讚讬讜" ],
|
41 |
+
[ "讘","驻讬住讜诇" ],
|
42 |
+
[ "诪转讻转" ],
|
43 |
+
[ "讜讘","转讜诇讚讜转" ],
|
44 |
+
[ "讛","讗诪谞讜转" ],
|
45 |
+
[ "讜","讛讞诇" ],
|
46 |
+
[ "诇驻专住诐" ],
|
47 |
+
[ "诪讗诪专讬诐" ],
|
48 |
+
[ "讛讜诪讜专讬住讟讬讬诐" ],
|
49 |
+
[ "[SEP]" ]
|
50 |
+
]
|
51 |
+
]
|
52 |
+
```
|
53 |
+
|
54 |
+
|
55 |
+
## Citation
|
56 |
+
|
57 |
+
If you use DictaBERT in your research, please cite ```DictaBERT: A State-of-the-Art BERT Suite for Modern Hebrew```
|
58 |
+
|
59 |
+
**BibTeX:**
|
60 |
+
|
61 |
+
To add
|
62 |
+
|
63 |
+
## License
|
64 |
+
|
65 |
+
Shield: [![CC BY 4.0][cc-by-shield]][cc-by]
|
66 |
+
|
67 |
+
This work is licensed under a
|
68 |
+
[Creative Commons Attribution 4.0 International License][cc-by].
|
69 |
+
|
70 |
+
[![CC BY 4.0][cc-by-image]][cc-by]
|
71 |
+
|
72 |
+
[cc-by]: http://creativecommons.org/licenses/by/4.0/
|
73 |
+
[cc-by-image]: https://i.creativecommons.org/l/by/4.0/88x31.png
|
74 |
+
[cc-by-shield]: https://img.shields.io/badge/License-CC%20BY%204.0-lightgrey.svg
|
75 |
+
|
76 |
+
|
77 |
+
|
78 |
+
|
79 |
+
|
80 |
+
`
|