Commit
·
d67a90d
1
Parent(s):
3ac30bd
Update README.md
Browse files
README.md
CHANGED
|
@@ -50,6 +50,24 @@ It achieves the following results on the evaluation set:
|
|
| 50 |
- F1: 0.9371
|
| 51 |
- Accuracy: 0.9859
|
| 52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
## Model description
|
| 54 |
|
| 55 |
More information needed
|
|
|
|
| 50 |
- F1: 0.9371
|
| 51 |
- Accuracy: 0.9859
|
| 52 |
|
| 53 |
+
# Usage
|
| 54 |
+
```
|
| 55 |
+
from transformers import pipeline
|
| 56 |
+
import json
|
| 57 |
+
|
| 58 |
+
model_checkpoint = "./bert-finetuned-ner4"
|
| 59 |
+
token_classifier = pipeline(
|
| 60 |
+
"token-classification", model=model_checkpoint, aggregation_strategy="simple"
|
| 61 |
+
)
|
| 62 |
+
|
| 63 |
+
with open('./assets/test2.json', 'r') as json_file:
|
| 64 |
+
data = json.load(json_file)
|
| 65 |
+
|
| 66 |
+
for item in data:
|
| 67 |
+
print(item)
|
| 68 |
+
print(token_classifier(item))
|
| 69 |
+
```
|
| 70 |
+
|
| 71 |
## Model description
|
| 72 |
|
| 73 |
More information needed
|