Update README.md
Browse files
README.md
CHANGED
@@ -35,19 +35,23 @@ It achieves the following results on the evaluation set:
|
|
35 |
- Loss: 0.1343
|
36 |
- F1: 0.8608
|
37 |
|
38 |
-
|
39 |
|
40 |
-
|
41 |
|
42 |
-
|
|
|
|
|
43 |
|
44 |
-
|
|
|
45 |
|
46 |
-
|
|
|
47 |
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
|
52 |
### Training hyperparameters
|
53 |
|
|
|
35 |
- Loss: 0.1343
|
36 |
- F1: 0.8608
|
37 |
|
38 |
+
#### How to use
|
39 |
|
40 |
+
You can use this model with Transformers *pipeline* for NER.
|
41 |
|
42 |
+
```python
|
43 |
+
from transformers import AutoTokenizer, AutoModelForTokenClassification
|
44 |
+
from transformers import pipeline
|
45 |
|
46 |
+
tokenizer = AutoTokenizer.from_pretrained("Tirendaz/roberta-base-NER")
|
47 |
+
model = AutoModelForTokenClassification.from_pretrained("Tirendaz/roberta-base-NER")
|
48 |
|
49 |
+
nlp = pipeline("ner", model=model, tokenizer=tokenizer)
|
50 |
+
example = "My name is Wolfgang and I live in Berlin"
|
51 |
|
52 |
+
ner_results = nlp(example)
|
53 |
+
print(ner_results)
|
54 |
+
```
|
55 |
|
56 |
### Training hyperparameters
|
57 |
|