readme: ---
  tags:
  - generated_from_trainer
  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"
  ---
  
  <!-- 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 