Instructions to use UMCU/PII_RobBERT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use UMCU/PII_RobBERT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="UMCU/PII_RobBERT", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("UMCU/PII_RobBERT", trust_remote_code=True) model = AutoModelForTokenClassification.from_pretrained("UMCU/PII_RobBERT", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -355,3 +355,34 @@ End2End scores (answering the question: *given a text, what are the spans **and*
|
|
| 355 |
}
|
| 356 |
}
|
| 357 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 355 |
}
|
| 356 |
}
|
| 357 |
```
|
| 358 |
+
|
| 359 |
+
Usage:
|
| 360 |
+
|
| 361 |
+
```python
|
| 362 |
+
|
| 363 |
+
> pipe = pipeline("token-classification", model="UMCU/PII_RobBERT", trust_remote_code=True, aggregation_strategy="simple", dtype=torch.float32,)
|
| 364 |
+
|
| 365 |
+
> pipe("De patient Henk de Vries is geboren op 12-03-1980 en woont in Amsterdam.")
|
| 366 |
+
|
| 367 |
+
> [{'entity_group': 'GIVENNAME',
|
| 368 |
+
'score': np.float32(0.9999993),
|
| 369 |
+
'word': ' Henk',
|
| 370 |
+
'start': 12,
|
| 371 |
+
'end': 15},
|
| 372 |
+
{'entity_group': 'SURNAME',
|
| 373 |
+
'score': np.float32(0.99999994),
|
| 374 |
+
'word': ' de Vries',
|
| 375 |
+
'start': 17,
|
| 376 |
+
'end': 24},
|
| 377 |
+
{'entity_group': 'DATE',
|
| 378 |
+
'score': np.float32(1.0),
|
| 379 |
+
'word': ' 12 - 03 - 1980',
|
| 380 |
+
'start': 40,
|
| 381 |
+
'end': 49},
|
| 382 |
+
{'entity_group': 'CITY',
|
| 383 |
+
'score': np.float32(0.99999917),
|
| 384 |
+
'word': ' Amsterdam',
|
| 385 |
+
'start': 63,
|
| 386 |
+
'end': 71}]
|
| 387 |
+
|
| 388 |
+
```
|