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