Tanor commited on
Commit
198055e
·
verified ·
1 Parent(s): f3e4f32

Document Serbian WordNet sentiment classifier and research paper

Browse files

Expand model card with task, labels, original base model, paper citation, paired classifiers, inference example, archived results and provenance. Preserve historical training records and declared license. README-only update; no model artifacts or repository visibility changes.

Files changed (1) hide show
  1. README.md +229 -67
README.md CHANGED
@@ -1,67 +1,229 @@
1
- ---
2
- license: cc-by-sa-4.0
3
- base_model: jerteh/Jerteh-355
4
- tags:
5
- - generated_from_trainer
6
- metrics:
7
- - f1
8
- model-index:
9
- - name: Jerteh355SENTPOS6
10
- results: []
11
- ---
12
-
13
- <!-- This model card has been generated automatically according to the information the Trainer had access to. You
14
- should probably proofread and complete it, then remove this comment. -->
15
-
16
- # Jerteh355SENTPOS6
17
-
18
- This model is a fine-tuned version of [jerteh/Jerteh-355](https://huggingface.co/jerteh/Jerteh-355) on the None dataset.
19
- It achieves the following results on the evaluation set:
20
- - Loss: 0.1035
21
- - F1: 0.4375
22
-
23
- ## Model description
24
-
25
- More information needed
26
-
27
- ## Intended uses & limitations
28
-
29
- More information needed
30
-
31
- ## Training and evaluation data
32
-
33
- More information needed
34
-
35
- ## Training procedure
36
-
37
- ### Training hyperparameters
38
-
39
- The following hyperparameters were used during training:
40
- - learning_rate: 2e-05
41
- - train_batch_size: 64
42
- - eval_batch_size: 16
43
- - seed: 42
44
- - gradient_accumulation_steps: 4
45
- - total_train_batch_size: 256
46
- - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
47
- - lr_scheduler_type: linear
48
- - num_epochs: 32
49
-
50
- ### Training results
51
-
52
- | Training Loss | Epoch | Step | Validation Loss | F1 |
53
- |:-------------:|:------:|:----:|:---------------:|:------:|
54
- | No log | 0.9843 | 47 | 0.0603 | 0.24 |
55
- | No log | 1.9895 | 95 | 0.0514 | 0.4 |
56
- | No log | 2.9948 | 143 | 0.0512 | 0.5581 |
57
- | No log | 4.0 | 191 | 0.0637 | 0.2759 |
58
- | No log | 4.9843 | 238 | 0.0570 | 0.5294 |
59
- | No log | 5.9895 | 286 | 0.1035 | 0.4375 |
60
-
61
-
62
- ### Framework versions
63
-
64
- - Transformers 4.40.1
65
- - Pytorch 2.2.2
66
- - Datasets 2.19.0
67
- - Tokenizers 0.19.1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-sa-4.0
3
+ base_model: jerteh/Jerteh-355
4
+ tags:
5
+ - serbian
6
+ - sentiment-analysis
7
+ - wordnet
8
+ - sentiwordnet
9
+ - lexicon-induction
10
+ metrics:
11
+ - f1
12
+ model-index:
13
+ - name: Jerteh355SENTPOS6
14
+ results: []
15
+ language:
16
+ - sr
17
+ library_name: transformers
18
+ pipeline_tag: text-classification
19
+ base_model_relation: finetune
20
+ widget:
21
+ - text: koji oseća radost i zadovoljstvo
22
+ example_title: Illustrative Serbian gloss
23
+ ---
24
+
25
+ # Jerteh355SENTPOS6
26
+
27
+ This is a **positive-polarity classifier for Serbian WordNet synset glosses**, fine-tuned from the Jerteh-355 model family. It is a component of the **S7 sentiment-lexicon construction method** described in:
28
+
29
+ Saša Petalinkar, Ranka M. Stanković, and Milica Ikonić Nešić (2025). **Comparative analysis of methods for creating a sentiment lexicon of the Serbian WordNet.** *The Electronic Library*, 43(4), 547–577. [Paper and DOI](https://doi.org/10.1108/EL-08-2024-0253).
30
+
31
+ [Companion code and sentiment lexicons](https://github.com/sasa5linkar/Serbian-WordNet-Sentiment-Lexicon-Analysis) · [Paired classifier](https://huggingface.co/Tanor/Jerteh355SENTNEG6) · [Original base model](https://huggingface.co/jerteh/Jerteh-355)
32
+
33
+ ## Model identity and task
34
+
35
+ | Field | Value |
36
+ |---|---|
37
+ | Model ID | `Tanor/Jerteh355SENTPOS6` |
38
+ | Architecture | `RobertaForSequenceClassification` |
39
+ | Original base model | [`jerteh/Jerteh-355`](https://huggingface.co/jerteh/Jerteh-355) |
40
+ | Input | A Serbian synset gloss, representing one lexical meaning |
41
+ | Target | Positive vs non-positive polarity |
42
+ | Dataset expansion iteration | **6** (`T6`) |
43
+ | Label 0 | `NON-POSITIVE` |
44
+ | Label 1 | `POSITIVE` |
45
+ | Derived lexicon family | **S7** |
46
+ | Paired classifier, same iteration | [`Tanor/Jerteh355SENTNEG6`](https://huggingface.co/Tanor/Jerteh355SENTNEG6) |
47
+
48
+ The linked training script initializes the classifier from `jerteh/Jerteh-355`.
49
+
50
+ A non-positive label is the complement of the target class. It does not by itself mean that the gloss has the opposite polarity. A separate classifier handles that polarity.
51
+
52
+ ## Training data and construction method
53
+
54
+ The paper constructs polarity-labeled synsets from Serbian WordNet, starting from curated positive, negative, and objective seed sets and expanding through semantic relations. The initial sets reported in the paper contain 149 positive, 219 negative, and 19,475 objective synsets. Polarity-preserving relations expand the corresponding set; antonymy contributes to the opposite polarity. The selected datasets are `T0`, `T2`, `T4`, and `T6`, after zero, two, four, and six expansion iterations.
55
+
56
+ This checkpoint is associated with **T6 and the POS classification task**. Its numerical suffix is a dataset-expansion iteration, not an epoch count or a lexicon identifier.
57
+
58
+ The [training script](https://github.com/sasa5linkar/Serbian-WordNet-Sentiment-Lexicon-Analysis/blob/833582dbbf561a902fc5b872248db12bf529b3d9/trainJerteh355.py) reads `Sysnet` from `X_train_UPPOS6.csv` and the target `POS` from `y_train_UPPOS6.csv`, replaces missing text with an empty string, and creates a stratified validation subset of **10% of that training CSV**, with `random_state=42`. The `UP` inputs are the non-lemmatized gloss variant in the [dataset-generation script](https://github.com/sasa5linkar/Serbian-WordNet-Sentiment-Lexicon-Analysis/blob/833582dbbf561a902fc5b872248db12bf529b3d9/create_sets.py).
59
+
60
+ The paper and code snapshot have different split descriptions: the paper describes an 80/10/10 split for neural models, while the scripts split existing training CSV files and `create_sets.py` leaves the initial split size at the library default. Exact checkpoint-specific sample assignments are not supplied in the public revision. The `train_sets/` files referenced by the scripts are absent from that revision. Reconstructing the experiment requires the relevant lexical resources and saved preparation/split information; the paper's proportions alone do not establish this checkpoint's split.
61
+
62
+ ## Use in sentiment lexicon S7
63
+
64
+ For each iteration, the POS model estimates positive-class probability `p_pos` and the NEG model estimates negative-class probability `p_neg`. The [lexicon-building code](https://github.com/sasa5linkar/Serbian-WordNet-Sentiment-Lexicon-Analysis/blob/833582dbbf561a902fc5b872248db12bf529b3d9/sentiwordnet_calculator.py) combines them as:
65
+
66
+ ```text
67
+ POS = p_pos * (1 - p_neg)
68
+ NEG = p_neg * (1 - p_pos)
69
+ OBJ = 1 - POS - NEG
70
+ ```
71
+
72
+ It averages each score across the four iteration-specific pairs. A single checkpoint is one component of this construction; its two class probabilities are not the final three lexicon scores.
73
+
74
+ | Iteration | POS classifier | NEG classifier |
75
+ |---|---|---|
76
+ | 0 | [Jerteh355SENTPOS0](https://huggingface.co/Tanor/Jerteh355SENTPOS0) | [Jerteh355SENTNEG0](https://huggingface.co/Tanor/Jerteh355SENTNEG0) |
77
+ | 2 | [Jerteh355SENTPOS2](https://huggingface.co/Tanor/Jerteh355SENTPOS2) | [Jerteh355SENTNEG2](https://huggingface.co/Tanor/Jerteh355SENTNEG2) |
78
+ | 4 | [Jerteh355SENTPOS4](https://huggingface.co/Tanor/Jerteh355SENTPOS4) | [Jerteh355SENTNEG4](https://huggingface.co/Tanor/Jerteh355SENTNEG4) |
79
+ | 6 | [Jerteh355SENTPOS6](https://huggingface.co/Tanor/Jerteh355SENTPOS6) | [Jerteh355SENTNEG6](https://huggingface.co/Tanor/Jerteh355SENTNEG6) |
80
+
81
+ ## Usage
82
+
83
+ This example reads one gloss and returns both class probabilities. It pins the model to the weights revision present before the documentation update.
84
+
85
+ ```python
86
+ import torch
87
+ from transformers import AutoModelForSequenceClassification, AutoTokenizer
88
+
89
+ MODEL_ID = "Tanor/Jerteh355SENTPOS6"
90
+ WEIGHTS_REVISION = "f3e4f32f2981333095a3b491ace53c112a161278"
91
+ tokenizer = AutoTokenizer.from_pretrained(MODEL_ID, revision=WEIGHTS_REVISION)
92
+ model = AutoModelForSequenceClassification.from_pretrained(
93
+ MODEL_ID, revision=WEIGHTS_REVISION
94
+ )
95
+ model.eval()
96
+
97
+ # An illustrative gloss, not a benchmark item or a claimed prediction.
98
+ inputs = tokenizer(
99
+ "koji oseća radost i zadovoljstvo",
100
+ return_tensors="pt", truncation=True, max_length=300,
101
+ )
102
+ with torch.inference_mode():
103
+ probabilities = model(**inputs).logits.softmax(dim=-1)[0]
104
+ scores = {model.config.id2label[i]: float(p) for i, p in enumerate(probabilities)}
105
+ print(scores)
106
+ ```
107
+
108
+ The model uses standard PyTorch/Transformers sequence-classification classes, without custom remote code. The example requires PyTorch and Transformers. Where a Trainer record is available below, it includes software versions from the original run. No example prediction or benchmark score was generated for this documentation update.
109
+
110
+ ## Evaluation and provenance
111
+
112
+ ### Archived test report
113
+
114
+ The companion repository contains an [evaluation report for Jerteh355, POS, T6](https://github.com/sasa5linkar/Serbian-WordNet-Sentiment-Lexicon-Analysis/blob/833582dbbf561a902fc5b872248db12bf529b3d9/reports/Jerteh355/report_UPPOS6.csv.txt). It is preserved below, with class 0 = `NON-POSITIVE` and class 1 = `POSITIVE`. Metric values retain the source's rounding; support values are sample counts. The confusion matrix uses that class order.
115
+
116
+ ```text
117
+ [[4418 20]
118
+ [ 40 33]]
119
+
120
+ precision recall f1-score support
121
+
122
+ 0 0.99 1.00 0.99 4438
123
+ 1 0.62 0.45 0.52 73
124
+
125
+ accuracy 0.99 4511
126
+ macro avg 0.81 0.72 0.76 4511
127
+ weighted avg 0.99 0.99 0.99 4511
128
+ ```
129
+
130
+ This is an archived experiment artifact, not a new evaluation. The report does not record a model-weight SHA, so its exact correspondence to the currently hosted weights has not been independently re-established. These binary-classification metrics are separate from evaluation of the derived lexicon and from sentiment evaluation of full sentences.
131
+
132
+ ### Preserved Trainer record
133
+
134
+ The following validation summary and training log are retained from the [previous model card](https://huggingface.co/Tanor/Jerteh355SENTPOS6/blob/f3e4f32f2981333095a3b491ace53c112a161278/README.md), without recomputing them. The recorded F1 is a training-validation metric, separate from the archived test report above and from lexicon or sentence-level sentiment evaluation. The source training code uses binary F1 for target label 1 when `eval="f1"` is selected.
135
+
136
+ - Loss: 0.1035
137
+ - F1: 0.4375
138
+
139
+ #### Training hyperparameters
140
+
141
+ The following hyperparameters were used during training:
142
+ - learning_rate: 2e-05
143
+ - train_batch_size: 64
144
+ - eval_batch_size: 16
145
+ - seed: 42
146
+ - gradient_accumulation_steps: 4
147
+ - total_train_batch_size: 256
148
+ - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
149
+ - lr_scheduler_type: linear
150
+ - num_epochs: 32
151
+
152
+ #### Training results
153
+
154
+ | Training Loss | Epoch | Step | Validation Loss | F1 |
155
+ |:-------------:|:------:|:----:|:---------------:|:------:|
156
+ | No log | 0.9843 | 47 | 0.0603 | 0.24 |
157
+ | No log | 1.9895 | 95 | 0.0514 | 0.4 |
158
+ | No log | 2.9948 | 143 | 0.0512 | 0.5581 |
159
+ | No log | 4.0 | 191 | 0.0637 | 0.2759 |
160
+ | No log | 4.9843 | 238 | 0.0570 | 0.5294 |
161
+ | No log | 5.9895 | 286 | 0.1035 | 0.4375 |
162
+
163
+
164
+ #### Framework versions
165
+
166
+ - Transformers 4.40.1
167
+ - Pytorch 2.2.2
168
+ - Datasets 2.19.0
169
+ - Tokenizers 0.19.1
170
+
171
+ The Trainer record and the linked source script are separate provenance sources. In particular, the recorded optimizer may differ from the script's `adafactor` setting; the historical record is retained without asserting that the linked script reproduces that exact run.
172
+
173
+ ## Settings in the archived training source
174
+
175
+ These settings describe the linked code revision, not a replacement for the per-run Trainer record.
176
+
177
+ | Setting | Source-code value |
178
+ |---|---|
179
+ | Maximum tokenized input length | 300 |
180
+ | Learning rate | 2e-5 |
181
+ | Training batch size per device | 64 |
182
+ | Evaluation batch size per device | 16 |
183
+ | Gradient accumulation | 4 steps |
184
+ | Optimizer | Adafactor |
185
+ | Weight decay | 0.01 |
186
+ | Validation split seed | 42 |
187
+ | Evaluation and saving | Each epoch |
188
+ | Early stopping patience | 5 evaluation calls |
189
+ | Epoch budget in experiment notebooks | Up to 32 |
190
+
191
+ The paper reports early-stopping patience of 3. The preserved Jerteh355 script uses 5; this discrepancy is recorded rather than merged into one run description.
192
+
193
+ ## Intended use and limitations
194
+
195
+ - Intended for research on polarity of Serbian WordNet meanings and construction or analysis of Serbian sentiment lexicons.
196
+ - Training inputs are glosses. Performance on reviews, news, social media, and documents requires separate evaluation; this checkpoint is not documented as a general sentence-sentiment benchmark model.
197
+ - Class imbalance is visible in the archived report. Read accuracy and weighted averages alongside target-class precision, recall, F1, and support.
198
+ - Labels depend on seed selection and semantic-relation expansion. Polysemy, domain-specific polarity, and propagation errors can affect predictions. English-to-Serbian alignment alone does not establish polarity in Serbian.
199
+ - Softmax outputs are model scores; probability calibration is not established by this card.
200
+ - The model performs no sense selection for a word in context. Applying the lexicon to text requires a separate choice or aggregation of meanings.
201
+
202
+ ## License
203
+
204
+ The existing model-card license declaration is `cc-by-sa-4.0` and has been preserved. The base model is linked above; data and external lexical resources have their own terms.
205
+
206
+ ## Citation
207
+
208
+ When using this model family or the resulting lexicon-construction method, cite the paper and record the model ID and revision used.
209
+
210
+ ```bibtex
211
+ @article{petalinkar2025sentimentlexicon,
212
+ author = {Petalinkar, Saša and Stanković, Ranka M. and Ikonić Nešić, Milica},
213
+ title = {Comparative analysis of methods for creating a sentiment lexicon of the Serbian WordNet},
214
+ journal = {The Electronic Library},
215
+ year = {2025},
216
+ volume = {43},
217
+ number = {4},
218
+ pages = {547--577},
219
+ doi = {10.1108/EL-08-2024-0253},
220
+ url = {https://doi.org/10.1108/EL-08-2024-0253}
221
+ }
222
+ ```
223
+
224
+ ## Version and documentation sources
225
+
226
+ - Weights/configuration revision documented here: [`f3e4f32f2981333095a3b491ace53c112a161278`](https://huggingface.co/Tanor/Jerteh355SENTPOS6/tree/f3e4f32f2981333095a3b491ace53c112a161278). This pins the hosted checkpoint; it does not prove which weights produced every table in the paper.
227
+ - Companion code revision: [`833582dbbf561a902fc5b872248db12bf529b3d9`](https://github.com/sasa5linkar/Serbian-WordNet-Sentiment-Lexicon-Analysis/tree/833582dbbf561a902fc5b872248db12bf529b3d9).
228
+ - BERTić initialization is recorded in [Prepare and load models.ipynb](https://github.com/sasa5linkar/Serbian-WordNet-Sentiment-Lexicon-Analysis/blob/833582dbbf561a902fc5b872248db12bf529b3d9/Prepare%20and%20load%20models.ipynb); GPT2-Orao and Jerteh-355 initialization is recorded in their training scripts.
229
+ - Documentation expanded on 23 September 2026 using the paper, model configuration, repository source, archived evaluation report, and any pre-existing Trainer record. Weights, tokenizer files, and model configuration were not changed by this documentation update.