File size: 3,352 Bytes
c1cec77
 
 
 
 
 
 
 
938806e
c1cec77
 
 
526844d
c1cec77
 
 
f5f063c
 
c1cec77
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8674a69
c1cec77
8674a69
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c1cec77
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f5f063c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
language: "hr"

tags:
- text-classification
- sentiment-analysis

widget:
- text: "Poštovani potpredsjedničke Vlade i ministre hrvatskih branitelja, mislite li da ste zapravo iznevjerili svoje suborce s kojima ste 555 dana prosvjedovali u šatoru protiv tadašnjih dužnosnika jer ste zapravo donijeli zakon koji je neprovediv, a birali ste si suradnike koji nemaju etički integritet."
---
# bcms-bertic-parlasent-bcs-bi

Binary text classification model based on [`classla/bcms-bertic`](https://huggingface.co/classla/bcms-bertic) and fine-tuned on the BCS Political Sentiment dataset (sentence-level data). 

This classifier classifies text into only two categories: Negative vs. Other. For the ternary classifier (Negative, Neutral, Positive) check [this model](https://huggingface.co/classla/bcms-bertic-parlasent-bcs-ter).

For details on the dataset and the finetuning procedure, please see [this paper](https://arxiv.org/abs/2206.00929).


## Fine-tuning hyperparameters

Fine-tuning was performed with `simpletransformers`. Beforehand a brief sweep for the optimal number of epochs was performed and the presumed best value was 9. Other arguments were kept default.

```python

model_args = {
        "num_train_epochs": 9
        }
```

## Performance in comparison with ternary classifier

| model                                     | average macro F1 |
|-------------------------------------------|------------------|
| bcms-bertic-parlasent-bcs-ter             | 0.7941 ± 0.0101  |
| bcms-bertic-parlasent-bcs-bi (this model) | 0.8999 ± 0.012   |

## Use example with `simpletransformers==0.63.7`

```python
from simpletransformers.classification import ClassificationModel

model = ClassificationModel("electra", "classla/bcms-bertic-parlasent-bcs-bi")

predictions, logits = model.predict([
     "Đački autobusi moraju da voze svaki dan", 
     "Vi niste normalni"
     ]
    )

predictions
# Output: array([1, 0])

[model.config.id2label[i] for i in predictions]
# Output: ['Other', 'Negative']
```

## Citation

If you use the model, please cite the following paper on which the original model is based:
```
@inproceedings{ljubesic-lauc-2021-bertic,
    title = "{BERT}i{\'c} - The Transformer Language Model for {B}osnian, {C}roatian, {M}ontenegrin and {S}erbian",
    author = "Ljube{\v{s}}i{\'c}, Nikola  and Lauc, Davor",
    booktitle = "Proceedings of the 8th Workshop on Balto-Slavic Natural Language Processing",
    month = apr,
    year = "2021",
    address = "Kiyv, Ukraine",
    publisher = "Association for Computational Linguistics",
    url = "https://www.aclweb.org/anthology/2021.bsnlp-1.5",
    pages = "37--42",
}
```

and the paper describing the dataset and methods for the current finetuning:

```
@misc{https://doi.org/10.48550/arxiv.2206.00929,
  doi = {10.48550/ARXIV.2206.00929},
  
  url = {https://arxiv.org/abs/2206.00929},
  
  author = {Mochtak, Michal and Rupnik, Peter and Ljubešič, Nikola},
  
  keywords = {Computation and Language (cs.CL), FOS: Computer and information sciences, FOS: Computer and information sciences},
  
  title = {The ParlaSent-BCS dataset of sentiment-annotated parliamentary debates from Bosnia-Herzegovina, Croatia, and Serbia},
  
  publisher = {arXiv},
  
  year = {2022},
  
  copyright = {Creative Commons Attribution Share Alike 4.0 International}
}
```