imvladikon
commited on
Commit
·
a760f3b
1
Parent(s):
84a1fea
Update README.md
Browse files
README.md
CHANGED
@@ -101,53 +101,12 @@ This is a [SpanMarker](https://github.com/tomaarsen/SpanMarkerNER) model trained
|
|
101 |
from span_marker import SpanMarkerModel
|
102 |
|
103 |
# Download from the 🤗 Hub
|
104 |
-
model = SpanMarkerModel.from_pretrained("
|
105 |
# Run inference
|
106 |
entities = model.predict("יו\"ר ועדת ה נוער נתן סלובטיק אמר ש ה שחקנים של אנחנו לא משתלבים ב אירופה.")
|
|
|
107 |
```
|
108 |
|
109 |
-
### Downstream Use
|
110 |
-
You can finetune this model on your own dataset.
|
111 |
-
|
112 |
-
<details><summary>Click to expand</summary>
|
113 |
-
|
114 |
-
```python
|
115 |
-
from span_marker import SpanMarkerModel, Trainer
|
116 |
-
|
117 |
-
# Download from the 🤗 Hub
|
118 |
-
model = SpanMarkerModel.from_pretrained("span_marker_model_id")
|
119 |
-
|
120 |
-
# Specify a Dataset with "tokens" and "ner_tag" columns
|
121 |
-
dataset = load_dataset("conll2003") # For example CoNLL2003
|
122 |
-
|
123 |
-
# Initialize a Trainer using the pretrained model & dataset
|
124 |
-
trainer = Trainer(
|
125 |
-
model=model,
|
126 |
-
train_dataset=dataset["train"],
|
127 |
-
eval_dataset=dataset["validation"],
|
128 |
-
)
|
129 |
-
trainer.train()
|
130 |
-
trainer.save_model("span_marker_model_id-finetuned")
|
131 |
-
```
|
132 |
-
</details>
|
133 |
-
|
134 |
-
<!--
|
135 |
-
### Out-of-Scope Use
|
136 |
-
|
137 |
-
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
|
138 |
-
-->
|
139 |
-
|
140 |
-
<!--
|
141 |
-
## Bias, Risks and Limitations
|
142 |
-
|
143 |
-
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
|
144 |
-
-->
|
145 |
-
|
146 |
-
<!--
|
147 |
-
### Recommendations
|
148 |
-
|
149 |
-
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
|
150 |
-
-->
|
151 |
|
152 |
## Training Details
|
153 |
|
@@ -170,36 +129,26 @@ trainer.save_model("span_marker_model_id-finetuned")
|
|
170 |
- num_epochs: 4
|
171 |
- mixed_precision_training: Native AMP
|
172 |
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
|
177 |
-
|
178 |
-
|
|
179 |
-
|
|
180 |
-
|
|
181 |
-
|
|
182 |
-
|
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
|
187 |
-
|
188 |
-
|
|
189 |
-
|
|
190 |
-
|
|
191 |
-
|
|
192 |
-
|
|
193 |
-
| 3.6630 | 9000 | 0.0082 | 0.6989 | 0.7049 | 0.7019 | 0.9526 |
|
194 |
-
| 0.4070 | 1000 | 0.0080 | 0.7109 | 0.7124 | 0.7117 | 0.9535 |
|
195 |
-
| 0.8140 | 2000 | 0.0074 | 0.7577 | 0.7114 | 0.7338 | 0.9567 |
|
196 |
-
| 1.2210 | 3000 | 0.0083 | 0.7183 | 0.7414 | 0.7297 | 0.9554 |
|
197 |
-
| 1.6280 | 4000 | 0.0088 | 0.6987 | 0.7339 | 0.7159 | 0.9510 |
|
198 |
-
| 2.0350 | 5000 | 0.0086 | 0.7135 | 0.7296 | 0.7215 | 0.9541 |
|
199 |
-
| 2.4420 | 6000 | 0.0086 | 0.7167 | 0.7382 | 0.7273 | 0.9559 |
|
200 |
-
| 2.8490 | 7000 | 0.0088 | 0.7133 | 0.7554 | 0.7337 | 0.9541 |
|
201 |
-
| 3.2560 | 8000 | 0.0085 | 0.7165 | 0.7511 | 0.7334 | 0.9551 |
|
202 |
-
| 3.6630 | 9000 | 0.0083 | 0.7263 | 0.7489 | 0.7375 | 0.9561 |
|
203 |
|
204 |
### Framework Versions
|
205 |
- Python: 3.10.12
|
|
|
101 |
from span_marker import SpanMarkerModel
|
102 |
|
103 |
# Download from the 🤗 Hub
|
104 |
+
model = SpanMarkerModel.from_pretrained("iahlt/span-marker-alephbert-small-nemo-mt-he")
|
105 |
# Run inference
|
106 |
entities = model.predict("יו\"ר ועדת ה נוער נתן סלובטיק אמר ש ה שחקנים של אנחנו לא משתלבים ב אירופה.")
|
107 |
+
entities
|
108 |
```
|
109 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
|
111 |
## Training Details
|
112 |
|
|
|
129 |
- num_epochs: 4
|
130 |
- mixed_precision_training: Native AMP
|
131 |
|
132 |
+
|
133 |
+
### Evaluation results
|
134 |
+
|
135 |
+
| | 0 |
|
136 |
+
|:-----------------------|-----------:|
|
137 |
+
| eval_loss | 0.00487611 |
|
138 |
+
| eval_overall_precision | 0.822917 |
|
139 |
+
| eval_overall_recall | 0.791583 |
|
140 |
+
| eval_overall_f1 | 0.806946 |
|
141 |
+
| eval_overall_accuracy | 0.969029 |
|
142 |
+
|
143 |
+
### Test results
|
144 |
+
|
145 |
+
| | 0 |
|
146 |
+
|:-----------------------|-----------:|
|
147 |
+
| test_loss | 0.00652107 |
|
148 |
+
| test_overall_precision | 0.747289 |
|
149 |
+
| test_overall_recall | 0.73927 |
|
150 |
+
| test_overall_f1 | 0.743258 |
|
151 |
+
| test_overall_accuracy | 0.960126 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
|
153 |
### Framework Versions
|
154 |
- Python: 3.10.12
|