CoolFace
Modelpublic

wkaminski/polish-roberta-base-v2-pos-tagging

sourceHugging Facelgpl-3.0updated 3y agoView on Hugging Face
0likes18downloads
Model Card

<!-- This model card has been generated automatically according to the information the Trainer had access to. You should probably proofread and complete it, then remove this comment. -->

polish-roberta-base-v2-pos-tagging

This model is a fine-tuned version of sdadas/polish-roberta-base-v2 on the nkjp1m dataset. It achieves the following results on the evaluation set:

  • —Loss: 0.0508
  • —Precision: 0.9853
  • —Recall: 0.9858
  • —F1: 0.9856
  • —Accuracy: 0.9884

You can find the training notebook here: https://github.com/WikKam/roberta-pos-finetuning

Usage

from transformers import pipeline

nlp = pipeline("token-classification", "wkaminski/polish-roberta-base-v2-pos-tagging")

nlp("Ale dzisiaj leje")

Model description

This model is a part-of-speech tagger for the Polish language based on sdadas/polish-roberta-base-v2.

It support 40 classes representing flexemic class (detailed part of speech):

{
 0: 'adj',
 1: 'adja',
 2: 'adjc',
 3: 'adjp',
 4: 'adv',
 5: 'aglt',
 6: 'bedzie',
 7: 'brev',
 8: 'comp',
 9: 'conj',
 10: 'depr',
 11: 'dig',
 12: 'fin',
 13: 'frag',
 14: 'ger',
 15: 'imps',
 16: 'impt',
 17: 'inf',
 18: 'interj',
 19: 'interp',
 20: 'num',
 21: 'numcomp',
 22: 'pact',
 23: 'pacta',
 24: 'pant',
 25: 'part',
 26: 'pcon',
 27: 'ppas',
 28: 'ppron12',
 29: 'ppron3',
 30: 'praet',
 31: 'pred',
 32: 'prep',
 33: 'romandig',
 34: 'siebie',
 35: 'subst',
 36: 'sym',
 37: 'winien',
 38: 'xxs',
 39: 'xxx'
}

Tags meaning is the same as in nkjp1m dataset:

flexemeabbreviationbase formexample
nounsubstsingular nominativeprofesor
depreciative formdeprsingular nominative form of the corresponding nounprofesor
main numeralnuminanimate masculine nominative formpięć, dwa
collective numeralnumcolinanimate masculine nominative form of the main numeralpięć, dwa
adjectiveadjsingular nominative masculine positive formpolski
ad-adjectival adjectiveadjasingular nominative masculine positive form of the adjectivepolski
post-prepositional adjectiveadjpsingular nominative masculine positive form of the adjectivepolski
predicative adjectiveadjcsingular nominative masculine positive form of the adjectivezdrowy, ciekawy
adverbadvpositive formdobrze, bardzo
non-3rd person pronounppron12singular nominativeja
3rd-person pronounppron3singular nominativeon
pronoun siebiesiebieaccusativesiebie
non-past formfininfinitiveczytać
future byćbedzieinfinitivebyć
agglutinate byćagltinfinitivebyć
l-participlepraetinfinitiveczytać
imperativeimptinfinitiveczytać
impersonalimpsinfinitiveczytać
infinitiveinfinfinitiveczytać
contemporary adv. participlepconinfinitiveczytać
anterior adv. participlepantinfinitiveczytać
gerundgerinfinitiveczytać
active adj. participlepactinfinitiveczytać
passive adj. participleppasinfinitiveczytać
winienwiniensingular masculine formpowinien, rad
predicativepredthe only form of that flexemewarto
prepositionprepthe non-vocalic form of that flexemena, przez, w
coordinating conjunctionconjthe only form of that flexemeoraz
subordinating conjunctioncompthe only form of that flexemeże
particle-adverbqubthe only form of that flexemenie, -że, się
abbreviationbrevthe full dictionary formrok, i tak dalej
bound wordburkthe only form of that flexemetrochu, oścież
interjectioninterjthe only form of that flexemeech, kurde
punctuationinterpthe only form of that flexeme;, ., (, ]
alienxxxthe only form of that flexemecool , nihil

Intended uses & limitations

Even though we have some nice tools for pos-tagging in polish (http://morfeusz.sgjp.pl/), I needed a pos tagger for polish that could be easily loaded inside the browser. Huggingface supports such functionality and that's why I created this model.

Training and evaluation data

Model was trained on a half of test data of the nkjp1m dataset (~0.5 milion tokens).

Training procedure

Training hyperparameters

The following hyperparameters were used during training:

  • —learning_rate: 2e-05
  • —trainbatchsize: 16
  • —evalbatchsize: 16
  • —seed: 42
  • —optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
  • —lrschedulertype: linear
  • —num_epochs: 3

Training results

Training LossEpochStepValidation LossPrecisionRecallF1Accuracy
0.06651.021550.06290.98350.98360.98360.9867
0.03692.043100.05390.98420.98480.98450.9876
0.02433.064650.05080.98530.98580.98560.9884

Framework versions

  • —Transformers 4.36.0
  • —Pytorch 2.1.0+cu118
  • —Datasets 2.15.0
  • —Tokenizers 0.15.0