pietruszkowiec
commited on
Commit
•
93864f6
1
Parent(s):
5804d70
Update README.md
Browse files
README.md
CHANGED
@@ -21,12 +21,12 @@ It has been trained to recognize three types of entities: person (PER), location
|
|
21 |
|
22 |
Specifically, this model is an [*allegro/herbert-base-cased*](https://huggingface.co/allegro/herbert-base-cased) model that was fine-tuned on the Polish subset of *wikiann* dataset.
|
23 |
|
24 |
-
It achieves the following results on the
|
25 |
-
- Loss: 0.
|
26 |
-
- Precision: 0.
|
27 |
-
- Recall: 0.
|
28 |
-
- F1: 0.
|
29 |
-
- Accuracy: 0.
|
30 |
|
31 |
|
32 |
## Intended uses & limitations
|
@@ -38,10 +38,15 @@ You can use this model with Transformers *pipeline* for NER.
|
|
38 |
```python
|
39 |
from transformers import AutoTokenizer, AutoModelForTokenClassification
|
40 |
from transformers import pipeline
|
41 |
-
|
42 |
-
|
|
|
|
|
|
|
43 |
nlp = pipeline("ner", model=model, tokenizer=tokenizer)
|
44 |
-
example = "Nazywam się Grzegorz Brzęszczyszczykiewicz, pochodzę
|
|
|
|
|
45 |
ner_results = nlp(example)
|
46 |
print(ner_results)
|
47 |
```
|
|
|
21 |
|
22 |
Specifically, this model is an [*allegro/herbert-base-cased*](https://huggingface.co/allegro/herbert-base-cased) model that was fine-tuned on the Polish subset of *wikiann* dataset.
|
23 |
|
24 |
+
It achieves the following results on the test subset of *wikitest/pl* set:
|
25 |
+
- Loss: 0.1937
|
26 |
+
- Precision: 0.8857
|
27 |
+
- Recall: 0.9070
|
28 |
+
- F1: 0.8962
|
29 |
+
- Accuracy: 0.9581
|
30 |
|
31 |
|
32 |
## Intended uses & limitations
|
|
|
38 |
```python
|
39 |
from transformers import AutoTokenizer, AutoModelForTokenClassification
|
40 |
from transformers import pipeline
|
41 |
+
|
42 |
+
model_checkpoint = "pietruszkowiec/herbert-base-ner"
|
43 |
+
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
|
44 |
+
model = AutoModelForTokenClassification.from_pretrained(model_checkpoint)
|
45 |
+
|
46 |
nlp = pipeline("ner", model=model, tokenizer=tokenizer)
|
47 |
+
example = "Nazywam się Grzegorz Brzęszczyszczykiewicz, pochodzę "\
|
48 |
+
"z Chrząszczyżewoszczyc, pracuję w Łękołodzkim Urzędzie Powiatowym"
|
49 |
+
|
50 |
ner_results = nlp(example)
|
51 |
print(ner_results)
|
52 |
```
|