File size: 16,099 Bytes
b1cf69c
ee62028
5fc3c37
 
 
 
 
 
 
 
 
 
 
 
b1cf69c
 
 
 
 
e04d885
053b1f5
 
b1cf69c
 
 
 
 
 
 
 
 
 
053b1f5
 
d939c80
053b1f5
 
b1cf69c
 
 
 
 
053b1f5
b1cf69c
 
 
 
 
 
 
 
 
 
 
c53504a
b1cf69c
 
 
 
29e480c
629c902
 
f078667
251b469
810e068
e3e68a9
 
f078667
bb0dd24
f078667
 
e3e68a9
 
1b80a26
e3e68a9
 
 
 
 
cf12a06
 
 
 
bb0d83d
 
 
 
 
 
 
 
 
e3e68a9
 
bb0d83d
 
 
 
 
72057dc
bb0d83d
 
 
 
cf12a06
 
bb0d83d
cf12a06
 
 
 
 
 
 
 
 
 
 
 
e3e68a9
cf12a06
f078667
cf12a06
629c902
b1cf69c
e3e68a9
b1cf69c
 
 
 
 
 
904d6ae
b1cf69c
e8b3405
0c0c772
 
 
00b8d15
 
0c0c772
24ce2de
0c0c772
 
 
 
e8b3405
b1cf69c
e8b3405
ed7b94d
 
 
 
 
 
 
 
 
 
904d6ae
24ce2de
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b1cf69c
 
 
15eeaa1
 
 
 
 
 
 
b1cf69c
 
 
 
 
 
 
 
 
 
 
904d6ae
b1cf69c
 
 
 
 
 
449ff76
b1cf69c
904d6ae
b1cf69c
5205797
089a6cc
5205797
 
 
 
 
904d6ae
b1cf69c
 
 
 
 
 
 
 
 
a5370f7
d569ab4
bb0dd24
 
 
 
a5370f7
b1cf69c
629c902
b1cf69c
 
8b5da4b
 
 
 
 
b1cf69c
 
be7f82d
b1cf69c
 
 
 
 
53772cb
 
 
 
 
 
 
 
b1cf69c
 
 
53772cb
b1cf69c
 
 
 
53772cb
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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
---
library_name: peft
tags:
- argumentation
license: apache-2.0
datasets:
- Kleo/ArgKP_2021_GR
language:
- el
metrics:
- precision
base_model:
- ilsp/Meltemi-7B-v1
pipeline_tag: text-classification
---

# Model Card for Model ID

<!-- Provide a quick summary of what the model is/does. -->
This is a Meltemi-7b-v1 PEFT(LoRa) model for a sequence classification task. 
It classifies keypoint-argument pairs as Matching/Non-matching. It was developed in the process of the KeyPoint Matching subtask of the [Key Point Analysis|Quantitative Argument Summarization Shared Task](https://github.com/IBM/KPA_2021_shared_task) as a solution for a low-resource language, Greek. 
The classifier was trained on the official shared task's dataset (ArgKP-2021) in a machine translated version for Greek with madlad-400-3b. For details refer to ArgKP-2021-GR dataset. 


## Model Details

### Model Description

<!-- Provide a longer summary of what this model is. -->

This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.

- **Developed by:** https://huggingface.co/Kleo
- **Shared by [optional]:** https://huggingface.co/Kleo
- **Model type:** [PEFT checkpoint file](https://huggingface.co/docs/peft/developer_guides/checkpoint)
- **Language(s) (NLP):** el/GR
- **License:** Apache license 2.0

### Model Sources [optional]

<!-- Provide the basic links for the model. -->

- **Repository:**  https://github.com/Kleo-Karap/KPA_thesis
- **Paper [optional]:** [More Information Needed]

## Uses

<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->


## Bias, Risks, and Limitations

<!-- This section is meant to convey both technical and sociotechnical limitations. -->

The model has been finetuned on the train set of the ArgKP-2021-GR dataset, which is the result of machine translation.

## How to Get Started with the Model

Use the code below to get started with the model.
In the following demonstration series, we show examples of matching and non-matching text predictions of our model for the key point "Social media regulation harms privacy" of the debatable topic "Social media platforms should be regulated by the government" and the focus is on arguments contesting the topic.
```
import torch
from transformers import AutoModelForSequenceClassification, AutoTokenizer
from peft import PeftModel
huggingface-cli login


base_model_id="ilsp/Meltemi-7B-v1"
peft_model_id = "Kleo/meltemi_arg2kp_matcher"
model = AutoModelForSequenceClassification.from_pretrained(base_model_id,"device_map='auto')
tokenizer = AutoTokenizer.from_pretrained(base_model_id)

# Load the Lora model
model = PeftModel.from_pretrained(model, peft_model_id)

tokenizer.pad_token_id = tokenizer.eos_token_id
tokenizer.pad_token = tokenizer.eos_token

model.eval()

# Get the device used by the model
device = next(model.parameters()).device
# List of texts to process
matching_texts = [
    "Keypoint: Η θέσπιση κανονισμών για τα μέσα κοινωνικής δικτύωσης βλάπτει την ιδιωτική ζωή; Argument: Σε καμία περίπτωση δεν μπορούμε να επιτρέψουμε στην κυβέρνηση να ρυθμίζει τα κοινωνικά μας δίκτυα, καθώς αυτά είναι ένας μέσο επικοινωνίας, όπου επιβάλλεται να υπάρχει αρκετή ιδιωτικότητα",
    "Keypoint: Η θέσπιση κανονισμών για τα μέσα κοινωνικής δικτύωσης βλάπτει την ιδιωτική ζωή; Argument: Δεν θα έπρεπε, διότι είναι κάτι ιδιωτικό όπου οι άνθρωποι μπορούν να εκφραστούν και να μοιραστούν ιδέες",
    "Keypoint: Η θέσπιση κανονισμών για τα μέσα κοινωνικής δικτύωσης βλάπτει την ιδιωτική ζωή; Argument: Οι πλατφόρμες κοινωνικής δικτύωσης δεν χρειάζεται να ρυθμίζονται από την κυβέρνηση, επειδή ορισμένοι άνθρωποι μπορούν να αποκρύπτουν τα προσωπικά τους στοιχεία στο διαδίκτυο",
    "Keypoint: Η θέσπιση κανονισμών για τα μέσα κοινωνικής δικτύωσης βλάπτει την ιδιωτική ζωή; Argument: Οι πλατφόρμες κοινωνικής δικτύωσης δεν θα πρέπει να ρυθμίζονται από την κυβέρνηση, διότι πολλοί άνθρωποι δεν θα αισθάνονται ασφαλείς όταν γνωρίζουν ότι οι αναρτήσεις τους παρακολουθούνται.",
    "Keypoint: Η θέσπιση κανονισμών για τα μέσα κοινωνικής δικτύωσης βλάπτει την ιδιωτική ζωή; Argument: Οι πλατφόρμες κοινωνικής δικτύωσης δεν θα πρέπει να ρυθμίζονται από την κυβέρνηση, διότι αυτό αποτελεί παραβίαση της ιδιωτικής ζωής",
    "Keypoint: Η θέσπιση κανονισμών για τα μέσα κοινωνικής δικτύωσης βλάπτει την ιδιωτική ζωή; Argument: Η πλατφόρμα κοινωνικής δικτύωσης δεν θα πρέπει να ρυθμίζεται από την κυβέρνηση, γιατί έτσι εισβάλλει στην ιδιωτική ζωή",
    "Keypoint: Η θέσπιση κανονισμών για τα μέσα κοινωνικής δικτύωσης βλάπτει την ιδιωτική ζωή; Argument: θα είναι λίγο περίεργο να έχεις την κυβέρνηση από πίσω σου να σε κοιτάει και να ελέγχει ό,τι κάνεις",
    "Keypoint: Η θέσπιση κανονισμών για τα μέσα κοινωνικής δικτύωσης βλάπτει την ιδιωτική ζωή; Argument: στα κοινωνικά δίκτυα κυκλοφορούν προσωπικές πληροφορίες, τις οποίες η κυβέρνηση δεν πρέπει να ελέγχει"
]

nonmatching_texts = [
    "Keypoint: Η θέσπιση κανονισμών για τα μέσα κοινωνικής δικτύωσης βλάπτει την ιδιωτική ζωή; Argument: Ζητώντας από τις κυβερνήσεις και τα θεσμικά όργανα να είναι πιο ενεργά στη θέσπιση ειδικών κανονισμών για το διαδίκτυο, ανοίγει ο δρόμος προς την καταστροφή.",
    "Keypoint: Η θέσπιση κανονισμών για τα μέσα κοινωνικής δικτύωσης βλάπτει την ιδιωτική ζωή; Argument: Δεν πρέπει να μας αφαιρεθεί η ελευθερία λόγου.",
    "Keypoint: Η θέσπιση κανονισμών για τα μέσα κοινωνικής δικτύωσης βλάπτει την ιδιωτική ζωή; Argument: Η ρύθμιση των κοινωνικών μέσων από την κυβέρνηση θα έβλαπτε τη δημοκρατία",
    "Keypoint: Η θέσπιση κανονισμών για τα μέσα κοινωνικής δικτύωσης βλάπτει την ιδιωτική ζωή; Argument: Δεν συμφωνώ, γιατί η κυβέρνηση είναι πολύ διεφθαρμένη και θα μπορούσε να το εκμεταλλευτεί αυτό, για να επωφεληθεί σε πολλούς τομείς",
    "Keypoint: Η θέσπιση κανονισμών για τα μέσα κοινωνικής δικτύωσης βλάπτει την ιδιωτική ζωή; Argument: Τα μέσα κοινωνικής δικτύωσης είναι απλώς μια αβλαβής διασκέδαση, η οποία ψυχαγωγεί τον κόσμο και δεν πρέπει να ρυθμίζεται.",
    "Keypoint: Η θέσπιση κανονισμών για τα μέσα κοινωνικής δικτύωσης βλάπτει την ιδιωτική ζωή; Argument: Ρυθμίσεις της κυβέρνησης στα μέσα κοινωνικής δικτύωσης θα ήταν επιζήμιες για την ελευθερία του λόγου παγκοσμίως. Πρόκειται άλλωστε για ιδιωτικές εταιρείες που θα πρέπει να έχουν τη δυνατότητα να τρέχουν τις διαδικασίες τους όπως αυτοί επιθυμούν",
    "Keypoint: Η θέσπιση κανονισμών για τα μέσα κοινωνικής δικτύωσης βλάπτει την ιδιωτική ζωή; Argument: Οι πλατφόρμες κοινωνικής δικτύωσης δεν πρέπει να ρυθμίζονται από την κυβέρνηση, επειδή τα εγκλήματα δεν μπορούν να διαπραχθούν διαδικτυακά",
    "Keypoint: Η θέσπιση κανονισμών για τα μέσα κοινωνικής δικτύωσης βλάπτει την ιδιωτική ζωή; Argument: η κυβέρνηση είναι διεφθαρμένη και μπορεί να το εκμεταλλευτεί"
]
# Perform inference on the list of texts
results = []
for text in matching_texts:
    # Tokenize input and move to the same device as the model
    inputs = tokenizer(text, return_tensors="pt", padding=True, truncation=True).to(device)

    # Perform inference
    with torch.no_grad():
        logits = model(**inputs).logits

    # Get the predicted label ID
    predicted_class_id = logits.argmax().item()

    # Store the result
    results.append(predicted_class_id)

# Print the results
for idx, (text, label_id) in enumerate(zip(matching_texts, results), start=1):
    print(f"Text {idx}: Predicted Label ID: {label_id}")
```


## Training Details

### Training Data

<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->

Machine translated train set of [ArgKP_2021_GR](https://huggingface.co/datasets/Kleo/ArgKP_2021_GR)

### PEFT (LoRa)

|Hyperparameter  |   Value                             |
|----------------|-------------------------------------|
|LoRA r          |  8                                  |
|LoRA alpha      |  8                                  | 
|LoRA dropout    |0.0                                  |
|LoRA bias       |'none'                               |
|target_modules  |q_proj, v_proj                       |
|task_type       |"SEQ_CLS"                            |
|Loss            |BCE                                  |
|trainable params|3,416,064 (~5% of the original model)|

### Training Procedure

#### Preprocessing 
Social media text removal
-Remove URLs, HTML tags, emojis and certain symbols


#### Training Hyperparameters

- **Training regime:**  bf16 Mixed Precision <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->

The following hyperparameters were used during training:

|Hyperparameter              |   Value                             |
|----------------------------|-------------------------------------|
|l_r                         |  1e-4                               |
|lr_scheduler_type           |linear                               |
|train_batch_size            |  16                                 | 
|eval_batch_size             |16                                   |
|seed                        |42                                   |
|num_devices                 |1                                    |
|gradient_accumulation_steps |2                                    |
|optimizer                   |paged Adam                           |
|Weight Decay                |  0.01                               |
|max grad norm               | 0.3                                 |   
|max_seq_length              |512                                  |
|num_epochs                  |1                                    |    

#### Speeds, Sizes, Times [optional]

<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|                                |               |
|--------------------------------|---------------|
|Num checkpoints                 |  5            |
|Checkpoint size                 |36,5 MB        |
|Training duration per checkpoint|4.15 hours     |
 


## Evaluation

<!-- This section describes the evaluation protocols and provides the results. -->

### Testing Data, Factors & Metrics

#### Testing Data

<!-- This should link to a Dataset Card if possible. -->

Human translated test set of [ArgKP_2021_GR](https://huggingface.co/datasets/Kleo/ArgKP_2021_GR)


#### Metrics

<!-- These are the evaluation metrics being used, ideally with a description of why. -->

mean Average Precision (mAP)--> For details on the metric calculation refer to the relevant section of the paper :[Overview of the 2021 Key Point Analysis Shared Task](https://aclanthology.org/2021.argmining-1.16.pdf) 


### Results
For details on [Enigma](https://aclanthology.org/2021.argmining-1.21/) and [SmatchToPR](https://aclanthology.org/2021.argmining-1.19/) solutions, refer to my thesis project, as well as  relevant papers. 
On the labelled test set of [ArgKP_2021_GR](https://huggingface.co/datasets/Kleo/ArgKP_2021_GR)
|model                                    |mAP   |
|-----------------------------------------|------|
|Enigma(GreekBERT)                        |82.42 |
|SmatchtoPR(GreekBERT)                    |88.32 |
|Meltemi (kp+arg) weighted (Ours)         |93.09 |


#### Summary

## Environmental Impact

<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->

Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).

- **Hardware Type:** Tesla P100
- **Hours used:** 21 hours
- **GPU memory**: 16GB
- **Number of nodes**: 1
- **Number of GPUs per node**: 1
- **Cloud Provider:** [Kaggle](https://www.kaggle.com/)
- **Carbon Emitted:** 0.1

## Technical Specifications

### Model Architecture and Objective
This is a classification finetuned model, that aims to identify matching/ non-matching argument-key point pairs.
The model is loaded with its classification head through the Transformers 
library, meaning it outputs two class labels, out of which the matching score is 
extracted. We consider as scores the probabilities of the class_1, meaning the 
probability of a key point to match the argument.


## Citation

<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->

**BibTeX:**

```
@masterthesis{3456844,
    title = "Key Point Analysis in Greek: A New Dataset and Baselines",
    authorField = "Καραπαναγιώτου, Κλεοπάτρα",
    year = "2025",
    school = "ΠΜΣ Γλωσσική Τεχνολογία, Εθνικό και Καποδιστριακό Πανεπιστήμιο Αθηνών"
}
```

**APA:**

Karapanagiotou, K. (2025). Key Point Analysis in Greek: A New Dataset and Baselines [MSc Thesis, National and Kapodistrian University of Athens]. Pergamos.https://pergamos.lib.uoa.gr/uoa/dl/frontend/el/browse/3456844


## Model Card Contact

https://huggingface.co/Kleo