Upload README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,69 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# HeBERT Finetuned Legal Clauses
|
2 |
+
|
3 |
+
This model fine-tunes avichr/heBERT model on LevMuchnik/SupremeCourtOfIsrael dataset.
|
4 |
+
|
5 |
+
|
6 |
+
## Training and evaluation data
|
7 |
+
|
8 |
+
|
9 |
+
| Dataset | Split | # samples |
|
10 |
+
| -------- | ----- | --------- |
|
11 |
+
| SupremeCourtOfIsrael | train | 147,946 |
|
12 |
+
| SupremeCourtOfIsrael | validation | 36,987 |
|
13 |
+
|
14 |
+
|
15 |
+
## Training procedure
|
16 |
+
|
17 |
+
### Training hyperparameters
|
18 |
+
|
19 |
+
The following hyperparameters were used during training:
|
20 |
+
- evaluation_strategy: "epoch"
|
21 |
+
- learning_rate: 2e-5
|
22 |
+
- train_batch_size: 16
|
23 |
+
- eval_batch_size: 16
|
24 |
+
- num_train_epochs: 3
|
25 |
+
- weight_decay: 0.01
|
26 |
+
|
27 |
+
|
28 |
+
### Framework versions
|
29 |
+
|
30 |
+
- Transformers 4.17.0
|
31 |
+
- Pytorch 1.10.0+cu111
|
32 |
+
- Datasets 1.18.4
|
33 |
+
- Tokenizers 0.11.6
|
34 |
+
|
35 |
+
### Results
|
36 |
+
|
37 |
+
| Metric | # Value |
|
38 |
+
| ------ | --------- |
|
39 |
+
| **Accuracy** | **0.96** |
|
40 |
+
| **F1** | **0.96** |
|
41 |
+
|
42 |
+
|
43 |
+
## Example Usage
|
44 |
+
|
45 |
+
```python
|
46 |
+
from transformers import pipeline
|
47 |
+
|
48 |
+
model_checkpoint = "shay681/HeBERT_finetuned_Legal_Clauses"
|
49 |
+
qa_pipeline = pipeline(
|
50 |
+
"question-answering",
|
51 |
+
model=model_checkpoint,
|
52 |
+
)
|
53 |
+
|
54 |
+
predictions = qa_pipeline({
|
55 |
+
'context': "ื ืืืช ืืืฉืคื ืืขืืืื ืืืจืืฉืืื ืจืข"ื 2225/01 ืืคื ื: ืืืื ืืฉืืคืืช ื' ืฉืืจืกืืจื-ืืื ืืืืงืฉืช: ืฉืืจืืชื ืืจืืืืช ืืืืืช ื ืื ืืืฉืื ื : ืื ืืชื ืืืืืืก, ืขื"ื ืืงืฉืช ืจืฉืืช ืขืจืขืืจ ืขื ืืืืืช ืืืช ืืืฉืคื ืืืืืื ืืชื-ืืืื-ืืคื ืืืื 21.2.01 ืื"ืค 11571/99 ืื"ืค 11243/99 ืฉื ืืชื ื ืขื ืืื ืืืื ืืฉืืคื ื' ืกืืจืฉื ืื ืืืืื 1. ืืืืื ืฉืืืงืฉื ืืฆืจืืื ืชืฉืืื. 2. ืืืฉืืื ืชืืืฉ ืชืฉืืืชื ืืืงืฉื ืืชืื 15 ืืืื ืืืืขื ืืืืฆืื. 3. ืขื ื ืืกื ืืชืฉืืื ืืืืื ืืืจืืืชืื ืฉื ืชืงื ื 406(ื) ืืชืงื ืืช ืกืืจ ืืืื ืืืืจืื, ืชืฉื"ื1984-. 4. ืืชืฉืืื ืชืืืฉ ืืืงืืื, ืื ืืืืช-ืืฉืคื ืื, ืืื ืืืืฉืจืื ืืืืงืฉืช. 5. ืืชืฉืืื ืชืืืื ืืชืืืืกืืช ืืืคืฉืจืืช ืฉืืืช-ืืืฉืคื ืืืงืฉ ืืคืขืื ืขื-ืคื ืกืืืืชื ืืคื ืชืงื ื 410 ืืชืงื ืืช ืกืืจ ืืืื ืืืืจืื, ืชืฉื"ื1984-. ืืชืืงืฉืช ืืชืืืืกืืช ืืฉืืื ืื ืืืงืจื ืืื ื ืืชื ืืืื ืืจืืืช ืืืืจื ืืชืืืื ืกืืืืืื ืืืชื. ืืขืืจ ืืชืืืืกืืช ืืืืื ืืืกืืื. ืืขืืจ ืชืืืื ืืืืื ืืื-ืืชืืืฆืืืช, ืขื ืืืจืื ืืื. ื ืืชื ื ืืืื, ื"ื ืืกืืืื ืชืฉืก"ื (4.6.01). ืฉ ื ืค ื ืช _________________ ืืขืชืง ืืชืืื ืืืงืืจ 01022250. J01 ื ืืกื ืื ืืคืืฃ ืืฉืื ืืื ืขืจืืื ืืจื ืคืจืกืืื ืืงืืืฅ ืคืกืงื ืืืื ืฉื ืืืช ืืืฉืคื ืืขืืืื ืืืฉืจืื. ืฉืืจืืื ืืื - ืืืืืจ ืจืืฉื ืืืืช ืืืฉืคื ืืขืืืื ืคืืขื ืืจืื ืืืืข, ืื' 02-6750444",
|
56 |
+
|
57 |
+
'question': "ืืืื ืกืขืืคืื\ืืืงืื\ืชืงื ืืช ืืฆืืืื ืื ืืืกืื ?"
|
58 |
+
})
|
59 |
+
|
60 |
+
print(predictions)
|
61 |
+
# output:
|
62 |
+
# {'score': 0.9999890327453613, 'start': 0, 'end': 7, 'answer': 'ืชืงื ื 406(ื) ืืชืงื ืืช ืกืืจ ืืืื ืืืืจืื, ืชืฉื"ื1984'}
|
63 |
+
```
|
64 |
+
|
65 |
+
### About Me
|
66 |
+
Created by Shay Doner.
|
67 |
+
This is my final project as part of intelligent systems M.Sc studies at Afeka College in Tel-Aviv.
|
68 |
+
For more cooperation, please contact email:
|
69 |
+
shay681@gmail.com
|