File size: 8,406 Bytes
19e161d
c3c1db4
 
fa22072
 
c3c1db4
 
 
082f8b1
c3c1db4
 
 
 
 
 
 
 
3b101a2
 
 
fa22072
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19e161d
c3c1db4
 
 
 
082f8b1
c3c1db4
3d3da24
438506b
c3c1db4
 
 
ede5845
 
 
 
 
 
 
 
 
 
 
ad1aacc
ede5845
 
 
 
 
 
 
 
 
 
 
c3c1db4
 
ede5845
c3c1db4
 
 
ede5845
3d3da24
a6e7a88
 
ede5845
a6e7a88
 
 
 
 
 
 
 
 
 
 
3d3da24
 
 
 
 
 
438506b
 
 
 
 
 
 
 
 
 
 
 
c3c1db4
3d3da24
 
c3c1db4
 
 
 
 
 
 
 
 
 
 
 
 
 
3d3da24
c3c1db4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
747f980
 
fa22072
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
---
tags:
- generated_from_trainer
base_model:
- tartuNLP/EstBERT
metrics:
- accuracy
model-index:
- name: EstBERT128_Rubric
  results:
  - task:
      name: Text Classification
      type: text-classification
    metrics:
    - name: Accuracy
      type: accuracy
      value: 0.8329238295555115
language: et
license: cc-by-4.0
widget:
- text: >-
    Lumesadu ja tuisk levib Kagu-Eestist hommikuks üle maa, päeval läheb sadu
    intensiivsemaks. Nähtavus on halb. Lund lisandub 10, kohati kuni 20 cm.
    Tiheda saju, tugeva tuule ja tuisu tõttu halvenevad liiklustingimused.
  example_title: domestic
- text: >-
    Brüsselis puhkenud korruptsiooniskandaalis kahtlustatakse eurosaadikuid
    Lähis-Idast meelehea vastuvõtmises. Kinnipeetute seas on üks Euroopa
    Parlamendi asepresidente, Belgia prokuratuuri tähelepanu orbiidis teisigi
    eurosaadikuid.
  example_title: world
- text: >-
    Järgmiseks aastaks riigi poolt ette nähtud summa ajakirjanduse
    kojukandetoetuseks on sama mis kaks aastat tagasi. See tähendab
    märkimisväärset hinnatõusu ja reaalset ohtu, et ajakirjandus on muutumas
    luksusteenuseks.
  example_title: opinion
pipeline_tag: text-classification
---

<!-- 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](https://huggingface.co/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](http://peeter.eki.ee:5000/valence/paragraphsquery).
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
- train_batch_size: 16
- eval_batch_size: 16
- seed: 3
- optimizer: Adam with betas=(0.9,0.98) and epsilon=1e-06
- lr_scheduler_type: polynomial
- num_epochs: 100
- mixed_precision_training: Native AMP

### Training results
The final model was taken after 39th epoch.

| Training Loss | Epoch | Step  | Validation Loss | Accuracy |
|:-------------:|:-----:|:-----:|:---------------:|:--------:|
| 1.1147        | 1.0   | 179   | 0.7421          | 0.7445   |
| 0.4323        | 2.0   | 358   | 0.6863          | 0.7813   |
| 0.1442        | 3.0   | 537   | 0.8545          | 0.7838   |
| 0.0496        | 4.0   | 716   | 1.2872          | 0.7494   |
| 0.0276        | 5.0   | 895   | 1.4702          | 0.7641   |
| 0.0202        | 6.0   | 1074  | 1.3764          | 0.7838   |
| 0.0144        | 7.0   | 1253  | 1.5762          | 0.7887   |
| 0.0078        | 8.0   | 1432  | 1.8806          | 0.7666   |
| 0.0177        | 9.0   | 1611  | 1.6159          | 0.7912   |
| 0.0223        | 10.0  | 1790  | 1.5863          | 0.7936   |
| 0.0108        | 11.0  | 1969  | 1.8051          | 0.7912   |
| 0.0201        | 12.0  | 2148  | 1.9344          | 0.7789   |
| 0.0252        | 13.0  | 2327  | 1.7978          | 0.8084   |
| 0.0104        | 14.0  | 2506  | 1.8779          | 0.7887   |
| 0.0138        | 15.0  | 2685  | 1.6456          | 0.8133   |
| 0.0066        | 16.0  | 2864  | 1.9668          | 0.7912   |
| 0.0148        | 17.0  | 3043  | 2.0068          | 0.7813   |
| 0.0128        | 18.0  | 3222  | 2.1539          | 0.7617   |
| 0.0115        | 19.0  | 3401  | 2.2490          | 0.7838   |
| 0.0186        | 20.0  | 3580  | 2.1768          | 0.7666   |
| 0.0051        | 21.0  | 3759  | 1.8859          | 0.7912   |
| 0.001         | 22.0  | 3938  | 2.0132          | 0.7912   |
| 0.0133        | 23.0  | 4117  | 1.8786          | 0.8084   |
| 0.0149        | 24.0  | 4296  | 2.2307          | 0.7961   |
| 0.014         | 25.0  | 4475  | 2.0041          | 0.8206   |
| 0.0132        | 26.0  | 4654  | 1.8872          | 0.8133   |
| 0.0079        | 27.0  | 4833  | 1.9357          | 0.7961   |
| 0.0078        | 28.0  | 5012  | 2.1891          | 0.7936   |
| 0.0126        | 29.0  | 5191  | 2.0207          | 0.8034   |
| 0.0003        | 30.0  | 5370  | 2.1917          | 0.8010   |
| 0.0015        | 31.0  | 5549  | 2.0417          | 0.8157   |
| 0.0056        | 32.0  | 5728  | 2.1172          | 0.8084   |
| 0.0058        | 33.0  | 5907  | 2.1921          | 0.8206   |
| 0.0001        | 34.0  | 6086  | 2.0079          | 0.8206   |
| 0.0031        | 35.0  | 6265  | 2.2447          | 0.8206   |
| 0.0007        | 36.0  | 6444  | 2.1802          | 0.8084   |
| 0.0061        | 37.0  | 6623  | 2.1103          | 0.8157   |
| 0.0           | 38.0  | 6802  | 2.2265          | 0.8084   |
| 0.0035        | 39.0  | 6981  | 2.0549          | 0.8329   |
| 0.0038        | 40.0  | 7160  | 2.1352          | 0.8182   |
| 0.0001        | 41.0  | 7339  | 2.0975          | 0.8108   |
| 0.0           | 42.0  | 7518  | 2.0833          | 0.8256   |
| 0.0           | 43.0  | 7697  | 2.1020          | 0.8280   |
| 0.0           | 44.0  | 7876  | 2.0841          | 0.8305   |
| 0.0           | 45.0  | 8055  | 2.2085          | 0.8182   |
| 0.0           | 46.0  | 8234  | 2.0756          | 0.8329   |
| 0.0           | 47.0  | 8413  | 2.1237          | 0.8305   |
| 0.0           | 48.0  | 8592  | 2.1217          | 0.8280   |
| 0.0052        | 49.0  | 8771  | 2.3567          | 0.8059   |
| 0.0014        | 50.0  | 8950  | 2.1710          | 0.8206   |
| 0.0032        | 51.0  | 9129  | 2.1452          | 0.8206   |
| 0.0           | 52.0  | 9308  | 2.2820          | 0.8133   |
| 0.0001        | 53.0  | 9487  | 2.2279          | 0.8157   |
| 0.0           | 54.0  | 9666  | 2.1841          | 0.8182   |
| 0.0           | 55.0  | 9845  | 2.1208          | 0.8231   |
| 0.0           | 56.0  | 10024 | 2.0967          | 0.8256   |
| 0.0002        | 57.0  | 10203 | 2.1911          | 0.8231   |
| 0.0           | 58.0  | 10382 | 2.2014          | 0.8231   |
| 0.0           | 59.0  | 10561 | 2.2014          | 0.8182   |


### Framework versions

- Transformers 4.14.1
- Pytorch 1.10.1+cu113
- Datasets 1.16.1
- Tokenizers 0.10.3

### Contact
  Kairit Sirts: [email protected]