Simone Tedeschi
commited on
Commit
·
c981bc5
1
Parent(s):
4cc3026
added "how to use"
Browse files
README.md
CHANGED
@@ -46,10 +46,13 @@ You can use this model with Transformers *pipeline* for NER.
|
|
46 |
```python
|
47 |
from transformers import AutoTokenizer, AutoModelForTokenClassification
|
48 |
from transformers import pipeline
|
|
|
49 |
tokenizer = AutoTokenizer.from_pretrained("Babelscape/wikineural-multilingual-ner")
|
50 |
model = AutoModelForTokenClassification.from_pretrained("Babelscape/wikineural-multilingual-ner")
|
|
|
51 |
nlp = pipeline("ner", model=model, tokenizer=tokenizer)
|
52 |
example = "My name is Wolfgang and I live in Berlin"
|
|
|
53 |
ner_results = nlp(example)
|
54 |
print(ner_results)
|
55 |
```
|
|
|
46 |
```python
|
47 |
from transformers import AutoTokenizer, AutoModelForTokenClassification
|
48 |
from transformers import pipeline
|
49 |
+
|
50 |
tokenizer = AutoTokenizer.from_pretrained("Babelscape/wikineural-multilingual-ner")
|
51 |
model = AutoModelForTokenClassification.from_pretrained("Babelscape/wikineural-multilingual-ner")
|
52 |
+
|
53 |
nlp = pipeline("ner", model=model, tokenizer=tokenizer)
|
54 |
example = "My name is Wolfgang and I live in Berlin"
|
55 |
+
|
56 |
ner_results = nlp(example)
|
57 |
print(ner_results)
|
58 |
```
|