Update README.md
Browse files
README.md
CHANGED
@@ -50,3 +50,18 @@ Details:
|
|
50 |
| ORG | 0.821 | 0.816 | 0.818 | 28045 |
|
51 |
| Overall | 0.874 | 0.879 | 0.877 | 92307 |
|
52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
| ORG | 0.821 | 0.816 | 0.818 | 28045 |
|
51 |
| Overall | 0.874 | 0.879 | 0.877 | 92307 |
|
52 |
|
53 |
+
## Usage
|
54 |
+
|
55 |
+
```python
|
56 |
+
from transformers import AutoTokenizer, AutoModelForTokenClassification
|
57 |
+
from transformers import pipeline
|
58 |
+
|
59 |
+
tokenizer = AutoTokenizer.from_pretrained("gunghio/xlm-roberta-base-finetuned-panx-ner")
|
60 |
+
model = AutoModelForTokenClassification.from_pretrained("gunghio/xlm-roberta-base-finetuned-panx-ner")
|
61 |
+
|
62 |
+
nlp = pipeline("ner", model=model, tokenizer=tokenizer)
|
63 |
+
example = "My name is Wolfgang and I live in Berlin"
|
64 |
+
|
65 |
+
ner_results = nlp(example)
|
66 |
+
print(ner_results)
|
67 |
+
```
|