CoolFace
Modelpublic

tartuNLP/EstBERT128_Rubric

sourceHugging Facecc-by-4.0updated 2y agoView on Hugging Face
0likes10downloads
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. -->

EstBERT128_Rubric

This model is a fine-tuned version of tartuNLP/EstBERT. It achieves the following results on the test set:

  • —Loss: 2.0552
  • —Accuracy: 0.8329

How to use?

You can use this model with the Transformers pipeline for text classification.

from transformers import AutoTokenizer, AutoModelForSequenceClassification
from transformers import pipeline

tokenizer = AutoTokenizer.from_pretrained("tartuNLP/EstBERT128_Rubric")
model = AutoModelForSequenceClassification.from_pretrained("tartuNLP/EstBERT128_Rubric")

nlp = pipeline("text-classification", model=model, tokenizer=tokenizer)
text = "Kaia Kanepi (WTA 57.) langes USA-s Charlestonis toimuval WTA 500 kategooria tenniseturniiril konkurentsist kaheksandikfinaalis, kaotades poolatarile Magda Linette'ile (WTA 64.) 3 : 6, 6 : 4, 2 : 6."
result = nlp(text)

print(result)
[{'label': 'SPORT', 'score': 0.9999998807907104}]

Model description

A single linear layer classifier is fit on top of the last layer [CLS] token representation of the EstBERT model. The model is fully fine-tuned during training.

Intended uses & limitations

This model is intended to be used as it is. We hope that it can prove to be useful to somebody but we do not guarantee that the model is useful for anything or that the predictions are accurate on new data.

Citation information

If you use this model, please cite:

@inproceedings{tanvir2021estbert,
  title={EstBERT: A Pretrained Language-Specific BERT for Estonian},
  author={Tanvir, Hasan and Kittask, Claudia and Eiche, Sandra and Sirts, Kairit},
  booktitle={Proceedings of the 23rd Nordic Conference on Computational Linguistics (NoDaLiDa)},
  pages={11--19},
  year={2021}
}

Training and evaluation data

The model was trained and evaluated on the rubric categories of the Estonian Valence dataset. The data was split into train/dev/test parts with 70/10/20 proportions.

The nine rubric labels in the Estonian Valence dataset are:

  • —ARVAMUS (opinion)
  • —EESTI (domestic)
  • —ELU-O (life)
  • —KOMM-O-ELU (comments)
  • —KOMM-P-EESTI (comments)
  • —KRIMI (crime)
  • —KULTUUR (culture)
  • —SPORT (sports)
  • —VALISMAA (world)

It probably makes sense to treat the two comments categories (KOMM-O-ELU and KOMM-P-EESTI) as a single category.

Training procedure

The model was trained for maximu 100 epochs using early stopping procedure. After every epoch, the accuracy was calculated on the development set. If the development set accuracy did not improve for 20 epochs, the training was stopped.

Training hyperparameters

The following hyperparameters were used during training:

  • —learning_rate: 5e-05
  • —trainbatchsize: 16
  • —evalbatchsize: 16
  • —seed: 3
  • —optimizer: Adam with betas=(0.9,0.98) and epsilon=1e-06
  • —lrschedulertype: polynomial
  • —num_epochs: 100
  • —mixedprecisiontraining: Native AMP

Training results

The final model was taken after 39th epoch.

Training LossEpochStepValidation LossAccuracy
1.11471.01790.74210.7445
0.43232.03580.68630.7813
0.14423.05370.85450.7838
0.04964.07161.28720.7494
0.02765.08951.47020.7641
0.02026.010741.37640.7838
0.01447.012531.57620.7887
0.00788.014321.88060.7666
0.01779.016111.61590.7912
0.022310.017901.58630.7936
0.010811.019691.80510.7912
0.020112.021481.93440.7789
0.025213.023271.79780.8084
0.010414.025061.87790.7887
0.013815.026851.64560.8133
0.006616.028641.96680.7912
0.014817.030432.00680.7813
0.012818.032222.15390.7617
0.011519.034012.24900.7838
0.018620.035802.17680.7666
0.005121.037591.88590.7912
0.00122.039382.01320.7912
0.013323.041171.87860.8084
0.014924.042962.23070.7961
0.01425.044752.00410.8206
0.013226.046541.88720.8133
0.007927.048331.93570.7961
0.007828.050122.18910.7936
0.012629.051912.02070.8034
0.000330.053702.19170.8010
0.001531.055492.04170.8157
0.005632.057282.11720.8084
0.005833.059072.19210.8206
0.000134.060862.00790.8206
0.003135.062652.24470.8206
0.000736.064442.18020.8084
0.006137.066232.11030.8157
0.038.068022.22650.8084
0.003539.069812.05490.8329
0.003840.071602.13520.8182
0.000141.073392.09750.8108
0.042.075182.08330.8256
0.043.076972.10200.8280
0.044.078762.08410.8305
0.045.080552.20850.8182
0.046.082342.07560.8329
0.047.084132.12370.8305
0.048.085922.12170.8280
0.005249.087712.35670.8059
0.001450.089502.17100.8206
0.003251.091292.14520.8206
0.052.093082.28200.8133
0.000153.094872.22790.8157
0.054.096662.18410.8182
0.055.098452.12080.8231
0.056.0100242.09670.8256
0.000257.0102032.19110.8231
0.058.0103822.20140.8231
0.059.0105612.20140.8182

Framework versions

  • —Transformers 4.14.1
  • —Pytorch 1.10.1+cu113
  • —Datasets 1.16.1
  • —Tokenizers 0.10.3

Contact

Kairit Sirts: kairit.sirts@ut.ee