Update README.md
Browse files
README.md
CHANGED
@@ -18,20 +18,19 @@ This model is particularly useful for privacy-preserving tasks, such as anonymiz
|
|
18 |
## Usage
|
19 |
Example code:
|
20 |
```python
|
21 |
-
|
22 |
|
23 |
-
|
24 |
-
|
25 |
"token-classification",
|
26 |
model=model_name,
|
27 |
aggregation_strategy="simple",
|
28 |
)
|
29 |
|
30 |
-
|
31 |
-
|
32 |
|
33 |
-
|
34 |
-
[{'entity_group': 'mask', 'score': 0.6855897, 'word': 'Kowalski ,', 'start': 4, 'end': 13}, {'entity_group': 'mask', 'score': 0.65670776, 'word': 'Cichy', 'start': 26, 'end': 31}]
|
35 |
```
|
36 |
|
37 |
## License
|
|
|
18 |
## Usage
|
19 |
Example code:
|
20 |
```python
|
21 |
+
from transformers import pipeline
|
22 |
|
23 |
+
model_name = "NASK-PIB/BANonymizer-PL"
|
24 |
+
ner = pipeline(
|
25 |
"token-classification",
|
26 |
model=model_name,
|
27 |
aggregation_strategy="simple",
|
28 |
)
|
29 |
|
30 |
+
text = "Pan Kowalski, znany jako 'Cichy', mieszka w Warszawie"
|
31 |
+
result = ner(text)
|
32 |
|
33 |
+
print(result)
|
|
|
34 |
```
|
35 |
|
36 |
## License
|