CoolFace
Modelpublic

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

sourceHugging Facelgpl-3.0updated 3y agoView on Hugging Face
0likes20downloads
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-cposes-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.0458
  • —Precision: 0.9913
  • —Recall: 0.9912
  • —F1: 0.9913
  • —Accuracy: 0.9889

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-cposes-tagging")

nlp("Ale dzisiaj leje")

Model description

This model is a coarse-part-of-speech tagger for the Polish language based on sdadas/polish-roberta-base-v2. It support 13 classes representing coarse part of speech):

{
 0: 'A',
 1: 'Adv',
 2: 'Comp',
 3: 'Conj',
 4: 'Dig',
 5: 'Interj',
 6: 'N',
 7: 'Num',
 8: 'Part',
 9: 'Prep',
 10: 'Punct',
 11: 'V',
 12: 'X'
}

Tags meaning is the same as in nkjp1m dataset:

TagDescription in EnglishDescription in PolishExample in Polish
AAdjectiveprzymiotnikszybki
AdvAdverbprzysłówekszybko
CompComparative / Complementizerstopień porównawczy / spójnik podrzędnylepszy / że
ConjConjunctionspójniki
DigDigitcyfra5, 3
InterjInterjectionwykrzyknikoch!
NNounrzeczownikdom
NumNumeralliczebnikjeden
PartParticlepartykułaby
PrepPrepositionprzyimekw
PunctPunctuationinterpunkcja., !, ?
VVerbczasownikbiegać
XUnknown / Otherniesklasyfikowanexxx

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.04711.021550.04910.98960.99000.98980.9873
0.02912.043100.04670.99010.99050.99030.9884
0.01913.064650.04580.99130.99120.99130.9889

Framework versions

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