birgermoell commited on
Commit
c0449c4
1 Parent(s): 8119e66

Updated model

Browse files
Files changed (2) hide show
  1. README.md +14 -3
  2. eval_script.py +13 -0
README.md CHANGED
@@ -70,9 +70,9 @@ model-index:
70
 
71
  should probably proofread and complete it, then remove this comment. -->
72
 
73
- # distilroberta-base-ner-wikiann
74
 
75
- This model is a fine-tuned version of [distilroberta-base](https://huggingface.co/distilroberta-base) on the wikiann dataset.
76
 
77
  eval F1-Score: **83,78**
78
 
@@ -127,8 +127,19 @@ It achieves the following results on the evaluation set:
127
  - Loss: 0.3156
128
 
129
  - Precision: 0.8332
 
 
 
 
 
 
 
 
 
130
 
131
- - Recall: 0.8424
 
 
132
 
133
  - F1: 0.8378
134
 
 
70
 
71
  should probably proofread and complete it, then remove this comment. -->
72
 
73
+ # ner-swedish-wikiann
74
 
75
+ This model is a fine-tuned version of [nordic-roberta-wiki](hhttps://huggingface.co/flax-community/nordic-roberta-wiki) trained for NER on the wikiann dataset.
76
 
77
  eval F1-Score: **83,78**
78
 
 
127
  - Loss: 0.3156
128
 
129
  - Precision: 0.8332
130
+ from transformers import AutoTokenizer, AutoModelForTokenClassification
131
+
132
+ from transformers import pipeline
133
+
134
+ tokenizer = AutoTokenizer.from_pretrained("birgermoell/ner-swedish-wikiann")
135
+
136
+ model = AutoModelForTokenClassification.from_pretrained("birgermoell/ner-swedish-wikiann")
137
+
138
+ nlp = pipeline("ner", model=model, tokenizer=tokenizer)
139
 
140
+ example = "Jag heter Per och jag jobbar på KTH"
141
+
142
+ nlp(example)
143
 
144
  - F1: 0.8378
145
 
eval_script.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import AutoTokenizer, AutoModelForTokenClassification
2
+
3
+ from transformers import pipeline
4
+
5
+ tokenizer = AutoTokenizer.from_pretrained("birgermoell/ner-swedish-wikiann")
6
+
7
+ model = AutoModelForTokenClassification.from_pretrained("birgermoell/ner-swedish-wikiann")
8
+
9
+ nlp = pipeline("ner", model=model, tokenizer=tokenizer)
10
+
11
+ example = "Jag heter Per och jag jobbar på KTH"
12
+
13
+ print(nlp(example))