noeminaepli
commited on
Commit
•
f4343c5
1
Parent(s):
7ce8fe2
Update README.md
Browse files
README.md
CHANGED
@@ -17,6 +17,55 @@ The **swiss_german_pos_model** is a part-of-speech tagging model for Swiss Germa
|
|
17 |
- Accuracy on Swiss German NOAH test split: 0.9587
|
18 |
- Accuracy on German UD_German-HDT test set after GSW fine-tuning: 0.9553 (vs. 0.9814 at step 3 before GSW fine-tuning)
|
19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
|
22 |
|
|
|
17 |
- Accuracy on Swiss German NOAH test split: 0.9587
|
18 |
- Accuracy on German UD_German-HDT test set after GSW fine-tuning: 0.9553 (vs. 0.9814 at step 3 before GSW fine-tuning)
|
19 |
|
20 |
+
### Usage
|
21 |
+
|
22 |
+
```
|
23 |
+
from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline
|
24 |
+
|
25 |
+
model = AutoModelForTokenClassification.from_pretrained("noeminaepli/swiss_german_pos_model")
|
26 |
+
tokenizer = AutoTokenizer.from_pretrained("noeminaepli/swiss_german_pos_model")
|
27 |
+
|
28 |
+
pos_tagger = pipeline('ner', model=model, tokenizer=tokenizer, aggregation_strategy="simple")
|
29 |
+
tokens = pos_tagger("Worum söu mes ned chönne?")
|
30 |
+
|
31 |
+
```
|
32 |
+
|
33 |
+
Output:
|
34 |
+
|
35 |
+
```
|
36 |
+
[{'entity_group': 'ADV',
|
37 |
+
'score': 0.9627313,
|
38 |
+
'word': 'Worum',
|
39 |
+
'start': 0,
|
40 |
+
'end': 5},
|
41 |
+
{'entity_group': 'VERB',
|
42 |
+
'score': 0.98772717,
|
43 |
+
'word': 'söu',
|
44 |
+
'start': 6,
|
45 |
+
'end': 9},
|
46 |
+
{'entity_group': 'PRON',
|
47 |
+
'score': 0.99970305,
|
48 |
+
'word': 'mes',
|
49 |
+
'start': 10,
|
50 |
+
'end': 13},
|
51 |
+
{'entity_group': 'PART',
|
52 |
+
'score': 0.9999368,
|
53 |
+
'word': 'ned',
|
54 |
+
'start': 14,
|
55 |
+
'end': 17},
|
56 |
+
{'entity_group': 'VERB',
|
57 |
+
'score': 0.99841064,
|
58 |
+
'word': 'chönne',
|
59 |
+
'start': 18,
|
60 |
+
'end': 24},
|
61 |
+
{'entity_group': 'PUNCT',
|
62 |
+
'score': 0.9999957,
|
63 |
+
'word': '?',
|
64 |
+
'start': 24,
|
65 |
+
'end': 25}]
|
66 |
+
|
67 |
+
```
|
68 |
+
|
69 |
|
70 |
|
71 |
|