Commit
·
cfc0234
1
Parent(s):
99838ce
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -25,16 +25,15 @@ Here is how to use this model to get the Named Entities in text:
|
|
| 25 |
|
| 26 |
```python
|
| 27 |
from transformers import pipeline
|
| 28 |
-
ner = pipeline('ner', model='clarin-pl/FastPDN')
|
| 29 |
|
| 30 |
text = "Nazywam się Jan Kowalski i mieszkam we Wrocławiu."
|
| 31 |
ner_results = ner(text)
|
| 32 |
for output in ner_results:
|
| 33 |
print(output)
|
| 34 |
|
| 35 |
-
{'
|
| 36 |
-
{'
|
| 37 |
-
{'entity': 'B-nam_loc_gpe_city', 'score': 0.998931, 'index': 9, 'word': 'Wrocławiu</w>', 'start': 39, 'end': 48}
|
| 38 |
```
|
| 39 |
|
| 40 |
Here is how to use this model to get the logits for every token in text:
|
|
|
|
| 25 |
|
| 26 |
```python
|
| 27 |
from transformers import pipeline
|
| 28 |
+
ner = pipeline('ner', model='clarin-pl/FastPDN', aggregation_strategy='simple')
|
| 29 |
|
| 30 |
text = "Nazywam się Jan Kowalski i mieszkam we Wrocławiu."
|
| 31 |
ner_results = ner(text)
|
| 32 |
for output in ner_results:
|
| 33 |
print(output)
|
| 34 |
|
| 35 |
+
{'entity_group': 'nam_liv_person', 'score': 0.9996054, 'word': 'Jan Kowalski', 'start': 12, 'end': 24}
|
| 36 |
+
{'entity_group': 'nam_loc_gpe_city', 'score': 0.998931, 'word': 'Wrocławiu', 'start': 39, 'end': 48}
|
|
|
|
| 37 |
```
|
| 38 |
|
| 39 |
Here is how to use this model to get the logits for every token in text:
|