Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,62 @@
|
|
| 1 |
---
|
| 2 |
license: cc-by-nc-4.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: cc-by-nc-4.0
|
| 3 |
+
datasets:
|
| 4 |
+
- Babelscape/wikineural
|
| 5 |
+
language:
|
| 6 |
+
- de
|
| 7 |
+
- fr
|
| 8 |
+
- it
|
| 9 |
+
- rm
|
| 10 |
+
- multilingual
|
| 11 |
+
widget:
|
| 12 |
+
- text: Mein Name sei Gantenbein.
|
| 13 |
+
example_title: "German example"
|
| 14 |
+
inference:
|
| 15 |
+
parameters:
|
| 16 |
+
default_language: "de_CH"
|
| 17 |
+
tags:
|
| 18 |
+
- named-entity-recognition
|
| 19 |
---
|
| 20 |
+
|
| 21 |
+
The [SwissBERT](https://huggingface.co/ZurichNLP/swissbert) model fine-tuned on the [WikiNEuRal](https://huggingface.co/datasets/Babelscape/wikineural) dataset for multilingual NER.
|
| 22 |
+
|
| 23 |
+
Supports German, French and Italian as supervised languages and Romansh Grischun as a zero-shot language.
|
| 24 |
+
|
| 25 |
+
## Usage
|
| 26 |
+
|
| 27 |
+
```python
|
| 28 |
+
from transformers import pipeline
|
| 29 |
+
|
| 30 |
+
token_classifier = pipeline(
|
| 31 |
+
model="ZurichNLP/swissbert-ner",
|
| 32 |
+
aggregation_strategy="simple",
|
| 33 |
+
)
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
### German example
|
| 37 |
+
```python
|
| 38 |
+
token_classifier.model.set_default_language("de_CH")
|
| 39 |
+
token_classifier("Mein Name sei Gantenbein.")
|
| 40 |
+
```
|
| 41 |
+
Output:
|
| 42 |
+
```
|
| 43 |
+
[{'entity_group': 'PER',
|
| 44 |
+
'score': 0.5002625,
|
| 45 |
+
'word': 'Gantenbein',
|
| 46 |
+
'start': 13,
|
| 47 |
+
'end': 24}]
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
### French example
|
| 51 |
+
```python
|
| 52 |
+
token_classifier.model.set_default_language("fr_CH")
|
| 53 |
+
token_classifier("J'habite à Lausanne.")
|
| 54 |
+
```
|
| 55 |
+
Output:
|
| 56 |
+
```
|
| 57 |
+
[{'entity_group': 'LOC',
|
| 58 |
+
'score': 0.99955386,
|
| 59 |
+
'word': 'Lausanne',
|
| 60 |
+
'start': 10,
|
| 61 |
+
'end': 19}]
|
| 62 |
+
```
|