|
--- |
|
license: mit |
|
datasets: |
|
- nkjp-ner |
|
language: |
|
- pl |
|
tags: |
|
- poldeepner2 |
|
- ner |
|
--- |
|
## About |
|
|
|
A transformer-based model for named entity recognition for Polish. |
|
The model was trained on the NKJP corpus to recognize 12 categories of NEs. |
|
|
|
|
|
## Usage |
|
|
|
```bash |
|
conda create -n pdn2_demo python=3.8 |
|
``` |
|
|
|
```bash |
|
conda activate pdn2_demo |
|
``` |
|
|
|
```bash |
|
https://pypi.clarin-pl.eu/packages/poldeepner2-0.8.2-py3-none-any.whl |
|
``` |
|
|
|
```bash |
|
git clone https://huggingface.co./CodeNLP/pdn2_v08_nkjp_large |
|
``` |
|
|
|
```python |
|
import poldeepner2 |
|
|
|
ner = poldeepner2.load("pdn2_v08_nkjp_large", device="cpu") |
|
|
|
|
|
text = "Od 15 września 2023 roku premierem Łotwy jest Evika Siliņa" |
|
|
|
for an in ner.process_text(text): |
|
print(f"[{an.start}:{an.end}] {an.text} ({an.label})") |
|
``` |
|
|
|
Expected output: |
|
``` |
|
[3:24] 15 września 2023 roku (date) |
|
[35:40] Łotwy (placeName_country) |
|
[46:58] Evika Siliņa (persName) |
|
[46:51] Evika (persName_forename) |
|
[52:58] Siliņa (persName_surname) |
|
``` |
|
|
|
## Author |
|
|
|
Michał Marcińczuk <[email protected]> |
|
|
|
|
|
## License |
|
|
|
[MIT](https://choosealicense.com/licenses/mit/ |