Models
Flair is a powerful NLP library. We provide two Flair models for Swedish part-of-speech tagging.
flair_eval is trained on SUC3 with Talbanken_SBX_dev as dev set. The advantage of this model is that it can be evaluated, using Talbanken_SBX_test or SIC2. The evaluation results are reported in the table below.
| Test set | Exact match | POS | MSD |
|---|---|---|---|
| Talbanken_SBX_test | 0.978 | 0.987 | 0.990 |
| SIC2 | 0.926 | 0.940 | 0.964 |
Evaluating POS-tagging
This is a brief description of how the evaluation of POS-tagging was done (relevant for our model descriptions).
There are three measures: exact match (both POS and MSD are correct), POS (POS is correct, MSD does not matter), MSD. The latter measure is slightly more complicated: it's the Jaccard similarity index, i.e. the number of correctly identified category values divided by the total number of different categories in both gold and test tags (=the length of the union of the gold and test category sets). The metric does not depend on whether POS is correctly identified. Here are some examples:
• (NN)NEU.-.-.SMS vs. (NN)UTR.-.-.SMS = 0.75 (four categories, three correct)
• (VB)PRS.SFO vs. (VB)INF.SFO = 0.33 (three categories: verb form (INF), tense (PRS), voice (SFO); one correct)
• (JJ)POS.UTR.SIN.IND.NOM vs. (PC)PRF.UTR.SIN.IND.NOM = 0.67 (six categories, four correct)
• (JJ)POS.UTR+NEU.PLU.IND+DEF.NOM vs. (NN)UTR.SIN.IND.NOM = 0.2 (five categories, one correct)
Read more about the evaluation in Part-of-speech tagging of Swedish texts in the neural era.
flair_full is trained on SUC3 + Talbanken_SBX_test + SIC2 with Talbanken_SBX_dev as dev set. We cannot evaluate the performance of this model, but we expect it to perform better than flair_eval, or at least not worse.
Using the models on your own
Download the model and follow the instructions from Flair. By default, Flair's own embeddings will be used (our experiments show that they provide the best results), but you may use other embeddings instead (or combine them). GPU is strongly recommended.