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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: cc-by-4.0
|
3 |
+
language:
|
4 |
+
- he
|
5 |
+
inference: false
|
6 |
---
|
7 |
+
# DictaBERT: A State-of-the-Art BERT Suite for Modern Hebrew
|
8 |
+
|
9 |
+
State-of-the-art language model for Hebrew, released [here](https://arxiv.org/abs/2308.16687).
|
10 |
+
|
11 |
+
This is the fine-tuned BERT-tiny model for the joint parsing of the following tasks:
|
12 |
+
|
13 |
+
- Prefix Segmentation
|
14 |
+
- Morphological Disabmgiuation
|
15 |
+
- Lexicographical Analysis (Lemmatization)
|
16 |
+
- Syntactical Parsing (Dependency-Tree)
|
17 |
+
- Named-Entity Recognition
|
18 |
+
|
19 |
+
For the bert-base models for other tasks, see [here](https://huggingface.co/collections/dicta-il/dictabert-6588e7cc08f83845fc42a18b).
|
20 |
+
|
21 |
+
Sample usage:
|
22 |
+
|
23 |
+
```python
|
24 |
+
from transformers import AutoModel, AutoTokenizer
|
25 |
+
|
26 |
+
tokenizer = AutoTokenizer.from_pretrained('dicta-il/dictabert-tiny-joint')
|
27 |
+
model = AutoModel.from_pretrained('dicta-il/dictabert-tiny-joint', trust_remote_code=True)
|
28 |
+
|
29 |
+
model.eval()
|
30 |
+
|
31 |
+
sentence = 'ืืฉื ืช 1948 ืืฉืืื ืืคืจืื ืงืืฉืื ืืช ืืืืืืื ืืคืืกืื ืืชืืช ืืืชืืืืืช ืืืื ืืช ืืืื ืืคืจืกื ืืืืจืื ืืืืืจืืกืืืื'
|
32 |
+
print(model.predict([sentence], tokenizer))
|
33 |
+
```
|
34 |
+
|
35 |
+
Output:
|
36 |
+
```json
|
37 |
+
[
|
38 |
+
{
|
39 |
+
"text": "ืืฉื ืช 1948 ืืฉืืื ืืคืจืื ืงืืฉืื ืืช ืืืืืืื ืืคืืกืื ืืชืืช ืืืชืืืืืช ืืืื ืืช ืืืื ืืคืจืกื ืืืืจืื ืืืืืจืืกืืืื",
|
40 |
+
"tokens": [
|
41 |
+
{
|
42 |
+
"token": "ืืฉื ืช",
|
43 |
+
"syntax": {
|
44 |
+
"word": "ืืฉื ืช",
|
45 |
+
"dep_head_idx": 2,
|
46 |
+
"dep_func": "obl",
|
47 |
+
"dep_head": "ืืฉืืื"
|
48 |
+
},
|
49 |
+
"seg": [
|
50 |
+
"ื",
|
51 |
+
"ืฉื ืช"
|
52 |
+
],
|
53 |
+
"lex": "ืฉื ื",
|
54 |
+
"morph": {
|
55 |
+
"token": "ืืฉื ืช",
|
56 |
+
"pos": "NOUN",
|
57 |
+
"feats": {
|
58 |
+
"Gender": "Fem",
|
59 |
+
"Number": "Sing"
|
60 |
+
},
|
61 |
+
"prefixes": [
|
62 |
+
"ADP"
|
63 |
+
],
|
64 |
+
"suffix": false
|
65 |
+
}
|
66 |
+
},
|
67 |
+
{
|
68 |
+
"token": "1948",
|
69 |
+
"syntax": {
|
70 |
+
"word": "1948",
|
71 |
+
"dep_head_idx": 0,
|
72 |
+
"dep_func": "compound",
|
73 |
+
"dep_head": "ืืฉื ืช"
|
74 |
+
},
|
75 |
+
"seg": [
|
76 |
+
"1948"
|
77 |
+
],
|
78 |
+
"lex": "1948",
|
79 |
+
"morph": {
|
80 |
+
"token": "1948",
|
81 |
+
"pos": "NUM",
|
82 |
+
"feats": {},
|
83 |
+
"prefixes": [],
|
84 |
+
"suffix": false
|
85 |
+
}
|
86 |
+
},
|
87 |
+
{
|
88 |
+
"token": "ืืฉืืื",
|
89 |
+
"syntax": {
|
90 |
+
"word": "ืืฉืืื",
|
91 |
+
"dep_head_idx": -1,
|
92 |
+
"dep_func": "root",
|
93 |
+
"dep_head": "ืืืืืจืืกืืืื"
|
94 |
+
},
|
95 |
+
"seg": [
|
96 |
+
"ืืฉืืื"
|
97 |
+
],
|
98 |
+
"lex": "ืืฉืืื",
|
99 |
+
"morph": {
|
100 |
+
"token": "ืืฉืืื",
|
101 |
+
"pos": "VERB",
|
102 |
+
"feats": {
|
103 |
+
"Gender": "Masc",
|
104 |
+
"Number": "Sing",
|
105 |
+
"Person": "3",
|
106 |
+
"Tense": "Past"
|
107 |
+
},
|
108 |
+
"prefixes": [],
|
109 |
+
"suffix": false
|
110 |
+
}
|
111 |
+
},
|
112 |
+
{
|
113 |
+
"token": "ืืคืจืื",
|
114 |
+
"syntax": {
|
115 |
+
"word": "ืืคืจืื",
|
116 |
+
"dep_head_idx": 2,
|
117 |
+
"dep_func": "nsubj",
|
118 |
+
"dep_head": "ืืฉืืื"
|
119 |
+
},
|
120 |
+
"seg": [
|
121 |
+
"ืืคืจืื"
|
122 |
+
],
|
123 |
+
"lex": "ืืคืจืื",
|
124 |
+
"morph": {
|
125 |
+
"token": "ืืคืจืื",
|
126 |
+
"pos": "PROPN",
|
127 |
+
"feats": {},
|
128 |
+
"prefixes": [],
|
129 |
+
"suffix": false
|
130 |
+
}
|
131 |
+
},
|
132 |
+
{
|
133 |
+
"token": "ืงืืฉืื",
|
134 |
+
"syntax": {
|
135 |
+
"word": "ืงืืฉืื",
|
136 |
+
"dep_head_idx": 3,
|
137 |
+
"dep_func": "flat",
|
138 |
+
"dep_head": "ืืคืจืื"
|
139 |
+
},
|
140 |
+
"seg": [
|
141 |
+
"ืงืืฉืื"
|
142 |
+
],
|
143 |
+
"lex": "ืงืืฉืื",
|
144 |
+
"morph": {
|
145 |
+
"token": "ืงืืฉืื",
|
146 |
+
"pos": "PROPN",
|
147 |
+
"feats": {},
|
148 |
+
"prefixes": [],
|
149 |
+
"suffix": false
|
150 |
+
}
|
151 |
+
},
|
152 |
+
{
|
153 |
+
"token": "ืืช",
|
154 |
+
"syntax": {
|
155 |
+
"word": "ืืช",
|
156 |
+
"dep_head_idx": 6,
|
157 |
+
"dep_func": "case",
|
158 |
+
"dep_head": "ืืืืืืื"
|
159 |
+
},
|
160 |
+
"seg": [
|
161 |
+
"ืืช"
|
162 |
+
],
|
163 |
+
"lex": "ืืช",
|
164 |
+
"morph": {
|
165 |
+
"token": "ืืช",
|
166 |
+
"pos": "ADP",
|
167 |
+
"feats": {},
|
168 |
+
"prefixes": [],
|
169 |
+
"suffix": false
|
170 |
+
}
|
171 |
+
},
|
172 |
+
{
|
173 |
+
"token": "ืืืืืืื",
|
174 |
+
"syntax": {
|
175 |
+
"word": "ืืืืืืื",
|
176 |
+
"dep_head_idx": 2,
|
177 |
+
"dep_func": "obj",
|
178 |
+
"dep_head": "ืืฉืืื"
|
179 |
+
},
|
180 |
+
"seg": [
|
181 |
+
"ืืืืืืื"
|
182 |
+
],
|
183 |
+
"lex": "ืืืืื",
|
184 |
+
"morph": {
|
185 |
+
"token": "ืืืืืืื",
|
186 |
+
"pos": "NOUN",
|
187 |
+
"feats": {
|
188 |
+
"Gender": "Masc",
|
189 |
+
"Number": "Plur"
|
190 |
+
},
|
191 |
+
"prefixes": [],
|
192 |
+
"suffix": "PRON",
|
193 |
+
"suffix_feats": {
|
194 |
+
"Gender": "Masc",
|
195 |
+
"Number": "Sing",
|
196 |
+
"Person": "3"
|
197 |
+
}
|
198 |
+
}
|
199 |
+
},
|
200 |
+
{
|
201 |
+
"token": "ืืคืืกืื",
|
202 |
+
"syntax": {
|
203 |
+
"word": "ืืคืืกืื",
|
204 |
+
"dep_head_idx": 6,
|
205 |
+
"dep_func": "nmod",
|
206 |
+
"dep_head": "ืืืืืืื"
|
207 |
+
},
|
208 |
+
"seg": [
|
209 |
+
"ื",
|
210 |
+
"ืคืืกืื"
|
211 |
+
],
|
212 |
+
"lex": "ืคืืกืื",
|
213 |
+
"morph": {
|
214 |
+
"token": "ืืคืืกืื",
|
215 |
+
"pos": "NOUN",
|
216 |
+
"feats": {
|
217 |
+
"Gender": "Masc",
|
218 |
+
"Number": "Sing"
|
219 |
+
},
|
220 |
+
"prefixes": [
|
221 |
+
"ADP"
|
222 |
+
],
|
223 |
+
"suffix": false
|
224 |
+
}
|
225 |
+
},
|
226 |
+
{
|
227 |
+
"token": "ืืชืืช",
|
228 |
+
"syntax": {
|
229 |
+
"word": "ืืชืืช",
|
230 |
+
"dep_head_idx": 7,
|
231 |
+
"dep_func": "compound",
|
232 |
+
"dep_head": "ืืคืืกืื"
|
233 |
+
},
|
234 |
+
"seg": [
|
235 |
+
"ืืชืืช"
|
236 |
+
],
|
237 |
+
"lex": "ืืชืืช",
|
238 |
+
"morph": {
|
239 |
+
"token": "ืืชืืช",
|
240 |
+
"pos": "NOUN",
|
241 |
+
"feats": {
|
242 |
+
"Gender": "Fem",
|
243 |
+
"Number": "Sing"
|
244 |
+
},
|
245 |
+
"prefixes": [],
|
246 |
+
"suffix": false
|
247 |
+
}
|
248 |
+
},
|
249 |
+
{
|
250 |
+
"token": "ืืืชืืืืืช",
|
251 |
+
"syntax": {
|
252 |
+
"word": "ืืืชืืืืืช",
|
253 |
+
"dep_head_idx": 7,
|
254 |
+
"dep_func": "conj",
|
255 |
+
"dep_head": "ืืคืืกืื"
|
256 |
+
},
|
257 |
+
"seg": [
|
258 |
+
"ืื",
|
259 |
+
"ืชืืืืืช"
|
260 |
+
],
|
261 |
+
"lex": "ืชืืืื",
|
262 |
+
"morph": {
|
263 |
+
"token": "ืืืชืืืืืช",
|
264 |
+
"pos": "NOUN",
|
265 |
+
"feats": {
|
266 |
+
"Gender": "Fem",
|
267 |
+
"Number": "Plur"
|
268 |
+
},
|
269 |
+
"prefixes": [
|
270 |
+
"CCONJ",
|
271 |
+
"ADP"
|
272 |
+
],
|
273 |
+
"suffix": false
|
274 |
+
}
|
275 |
+
},
|
276 |
+
{
|
277 |
+
"token": "ืืืื ืืช",
|
278 |
+
"syntax": {
|
279 |
+
"word": "ืืืื ืืช",
|
280 |
+
"dep_head_idx": 9,
|
281 |
+
"dep_func": "compound",
|
282 |
+
"dep_head": "ืืืชืืืืืช"
|
283 |
+
},
|
284 |
+
"seg": [
|
285 |
+
"ื",
|
286 |
+
"ืืื ืืช"
|
287 |
+
],
|
288 |
+
"lex": "ืืืื ืืช",
|
289 |
+
"morph": {
|
290 |
+
"token": "ืืืื ืืช",
|
291 |
+
"pos": "NOUN",
|
292 |
+
"feats": {
|
293 |
+
"Gender": "Fem",
|
294 |
+
"Number": "Sing"
|
295 |
+
},
|
296 |
+
"prefixes": [
|
297 |
+
"DET"
|
298 |
+
],
|
299 |
+
"suffix": false
|
300 |
+
}
|
301 |
+
},
|
302 |
+
{
|
303 |
+
"token": "ืืืื",
|
304 |
+
"syntax": {
|
305 |
+
"word": "ืืืื",
|
306 |
+
"dep_head_idx": 2,
|
307 |
+
"dep_func": "conj",
|
308 |
+
"dep_head": "ืืฉืืื"
|
309 |
+
},
|
310 |
+
"seg": [
|
311 |
+
"ื",
|
312 |
+
"ืืื"
|
313 |
+
],
|
314 |
+
"lex": "ืืื",
|
315 |
+
"morph": {
|
316 |
+
"token": "ืืืื",
|
317 |
+
"pos": "VERB",
|
318 |
+
"feats": {
|
319 |
+
"Gender": "Masc",
|
320 |
+
"Number": "Sing",
|
321 |
+
"Person": "3",
|
322 |
+
"Tense": "Past"
|
323 |
+
},
|
324 |
+
"prefixes": [
|
325 |
+
"CCONJ"
|
326 |
+
],
|
327 |
+
"suffix": false
|
328 |
+
}
|
329 |
+
},
|
330 |
+
{
|
331 |
+
"token": "ืืคืจืกื",
|
332 |
+
"syntax": {
|
333 |
+
"word": "ืืคืจืกื",
|
334 |
+
"dep_head_idx": 11,
|
335 |
+
"dep_func": "xcomp",
|
336 |
+
"dep_head": "ืืืื"
|
337 |
+
},
|
338 |
+
"seg": [
|
339 |
+
"ืืคืจืกื"
|
340 |
+
],
|
341 |
+
"lex": "ืคืจืกื",
|
342 |
+
"morph": {
|
343 |
+
"token": "ืืคืจืกื",
|
344 |
+
"pos": "VERB",
|
345 |
+
"feats": {},
|
346 |
+
"prefixes": [],
|
347 |
+
"suffix": false
|
348 |
+
}
|
349 |
+
},
|
350 |
+
{
|
351 |
+
"token": "ืืืืจืื",
|
352 |
+
"syntax": {
|
353 |
+
"word": "ืืืืจืื",
|
354 |
+
"dep_head_idx": 12,
|
355 |
+
"dep_func": "obj",
|
356 |
+
"dep_head": "ืืคืจืกื"
|
357 |
+
},
|
358 |
+
"seg": [
|
359 |
+
"ืืืืจืื"
|
360 |
+
],
|
361 |
+
"lex": "ืืืืจ",
|
362 |
+
"morph": {
|
363 |
+
"token": "ืืืืจืื",
|
364 |
+
"pos": "NOUN",
|
365 |
+
"feats": {
|
366 |
+
"Gender": "Masc",
|
367 |
+
"Number": "Plur"
|
368 |
+
},
|
369 |
+
"prefixes": [],
|
370 |
+
"suffix": false
|
371 |
+
}
|
372 |
+
},
|
373 |
+
{
|
374 |
+
"token": "ืืืืืจืืกืืืื",
|
375 |
+
"syntax": {
|
376 |
+
"word": "ืืืืืจืืกืืืื",
|
377 |
+
"dep_head_idx": 13,
|
378 |
+
"dep_func": "amod",
|
379 |
+
"dep_head": "ืืืืจืื"
|
380 |
+
},
|
381 |
+
"seg": [
|
382 |
+
"ืืืืืจืืกืืืื"
|
383 |
+
],
|
384 |
+
"lex": "ืืืืืจืืกืื",
|
385 |
+
"morph": {
|
386 |
+
"token": "ืืืืืจืืกืืืื",
|
387 |
+
"pos": "ADJ",
|
388 |
+
"feats": {
|
389 |
+
"Gender": "Masc",
|
390 |
+
"Number": "Plur"
|
391 |
+
},
|
392 |
+
"prefixes": [],
|
393 |
+
"suffix": false
|
394 |
+
}
|
395 |
+
}
|
396 |
+
],
|
397 |
+
"root_idx": 2,
|
398 |
+
"ner_entities": [
|
399 |
+
{
|
400 |
+
"phrase": "1948",
|
401 |
+
"label": "TIMEX"
|
402 |
+
},
|
403 |
+
{
|
404 |
+
"phrase": "ืืคืจืื ืงืืฉืื",
|
405 |
+
"label": "PER"
|
406 |
+
}
|
407 |
+
]
|
408 |
+
}
|
409 |
+
]
|
410 |
+
```
|
411 |
+
|
412 |
+
|
413 |
+
## Citation
|
414 |
+
|
415 |
+
If you use DictaBERT in your research, please cite ```DictaBERT: A State-of-the-Art BERT Suite for Modern Hebrew```
|
416 |
+
|
417 |
+
**BibTeX:**
|
418 |
+
|
419 |
+
```bibtex
|
420 |
+
@misc{shmidman2023dictabert,
|
421 |
+
title={DictaBERT: A State-of-the-Art BERT Suite for Modern Hebrew},
|
422 |
+
author={Shaltiel Shmidman and Avi Shmidman and Moshe Koppel},
|
423 |
+
year={2023},
|
424 |
+
eprint={2308.16687},
|
425 |
+
archivePrefix={arXiv},
|
426 |
+
primaryClass={cs.CL}
|
427 |
+
}
|
428 |
+
```
|
429 |
+
|
430 |
+
## License
|
431 |
+
|
432 |
+
Shield: [![CC BY 4.0][cc-by-shield]][cc-by]
|
433 |
+
|
434 |
+
This work is licensed under a
|
435 |
+
[Creative Commons Attribution 4.0 International License][cc-by].
|
436 |
+
|
437 |
+
[![CC BY 4.0][cc-by-image]][cc-by]
|
438 |
+
|
439 |
+
[cc-by]: http://creativecommons.org/licenses/by/4.0/
|
440 |
+
[cc-by-image]: https://i.creativecommons.org/l/by/4.0/88x31.png
|
441 |
+
[cc-by-shield]: https://img.shields.io/badge/License-CC%20BY%204.0-lightgrey.svg
|