File size: 9,576 Bytes
b1cf69c
 
5fc3c37
 
 
 
 
 
 
 
 
 
 
 
b1cf69c
 
 
 
 
053b1f5
 
 
b1cf69c
 
 
 
 
 
 
 
 
 
053b1f5
 
 
 
 
 
b1cf69c
 
 
 
 
053b1f5
b1cf69c
 
 
 
 
 
 
 
 
 
 
c53504a
b1cf69c
 
 
 
 
629c902
 
e3e68a9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
629c902
b1cf69c
e3e68a9
b1cf69c
 
 
 
 
 
904d6ae
b1cf69c
 
904d6ae
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b1cf69c
c53504a
 
 
b1cf69c
 
 
 
c53504a
b1cf69c
 
 
 
904d6ae
 
 
b1cf69c
 
 
 
 
 
 
 
 
 
 
904d6ae
b1cf69c
 
 
 
 
 
629c902
b1cf69c
904d6ae
 
b1cf69c
 
904d6ae
 
 
 
b1cf69c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
629c902
b1cf69c
 
 
 
 
 
c53504a
 
 
 
 
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
---
library_name: transformers
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 adapter 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:** adapter
- **Language(s) (NLP):** el/GR
- **License:** Apache license 2.0
- **Finetuned from model [optional]:**  [ilsp/Meltemi-7B-v1](https://huggingface.co/ilsp/Meltemi-7B-v1)

### 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.

```
import torch
from transformers import pipeline, AutoModelForSequenceClassification, AutoTokenizer, BitsAndBytesConfig
from peft import PeftModel, PeftConfig

bnb_config = BitsAndBytesConfig(
    load_in_4bit=True,
    bnb_4bit_use_double_quant=True,
    bnb_4bit_quant_type="nf4",
    bnb_4bit_compute_dtype=torch.bfloat16)


peft_model_id = "Kleo/meltemi_base_finetuning_kpm_kp_arg"
config = PeftConfig.from_pretrained(peft_model_id)
model = AutoModelForSequenceClassification.from_pretrained(config.base_model_name_or_path, return_dict=True, quantization_config=bnb_config, device_map='auto')
tokenizer = AutoTokenizer.from_pretrained(config.base_model_name_or_path)

# 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()
# Initialize the classifier pipeline
classifier = pipeline(
    "text-classification",
    model=model,
    tokenizer=tokenizer,
    device_map="auto"
)

# List of inputs
texts = [
    "Keypoint: Ο εμβολιασμός μπορεί να έχει απρόβλεπτες παρενέργειες; Argument: Οι παιδικοί εμβολιασμοί ρουτίνας δεν θα πρέπει να είναι υποχρεωτικοί, καθώς τα παιδιά μπορεί να μην είναι σε θέση να αντέξουν τις επιπτώσεις τους",
    "Keypoint: Ο εμβολιασμός μπορεί να έχει απρόβλεπτες παρενέργειες; Argument: Ένα εμβόλιο, το οποίο δεν έχει ελεγχθεί επαρκώς και του οποίου οι επιπτώσεις δεν είναι γνωστές, δεν ενδείκνυται για τα παιδιά",
    "Keypoint: Ο εμβολιασμός μπορεί να έχει απρόβλεπτες παρενέργειες; Argument: Ο παιδικός εμβολιασμός δεν είναι απαραίτητος και μπορεί να επιφέρει άλλες ασθένειες στα παιδιά",
    "Keypoint: Στις Ηνωμένες Πολιτείες δεν υπάρχει ασφάλεια; Argument: σε ορισμένες πολιτείες εξακολουθούν να υπάρχουν πολλές ληστείες και εγκλήματα στα οποία εμπλέκονται αθώοι άνθρωποι",
    "Keypoint: Στις Ηνωμένες Πολιτείες δεν υπάρχει ασφάλεια; Argument: η κουλτούρα των ΗΠΑ προωθεί τον υλισμό",
    "Keypoint: Στις Ηνωμένες Πολιτείες δεν υπάρχει ασφάλεια; Argument: όχι, επειδή οι φόροι είναι υψηλοί και δαπανηροί",
    "Keypoint: Στις Ηνωμένες Πολιτείες δεν υπάρχει ασφάλεια; Argument: η υγειονομική περίθαλψη και η εκπαίδευση είναι υπερβολικά ακριβές για τη μεσαία τάξη",
    "Keypoint: Στις Ηνωμένες Πολιτείες δεν υπάρχει ασφάλεια; Argument: δεν είναι όλα όπως τις ταινίες, η Αμερική έχει πολλή ανισότητα"
]

# Perform inference for multiple inputs
results = classifier(texts)

# Print results with sentence numbers
for idx, result in enumerate(results, start=1):
    print(f"Sentence {idx}: Predicted Label: {result['label']}, Score: {result['score']:.4f}")
```


## 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)

### Training Procedure
The following hyperparameters were used during training:
learning_rate:  1e-4
train_batch_size: 16
eval_batch_size: 16
seed: 42
num_devices: 1
gradient_accumulation_steps: 2
optimizer: paged Adam optimizer
lr_scheduler_type: linear
Weight Decay: 0.01
M. G. Norm: 0.3
max_seq_length: 512 
num_epochs: 1
##################################################################
LoRa Hyperparameters
LoRA r :8
LoRA alpha: 8
LoRA dropout: 0.0
LoRA bias: ‘none'
target_modules: q_proj, v_proj
task_type: "SEQ_CLS"
Loss: Binary Cross Entropy
trainable parameters: 3,416,064 (~5% of the original model)


#### Training hyperparameters

#### 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 -->

#### 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)

μήπως να χρησιμοποιήσω το test set του hf δατασετ μου poy einai mono labelled?

### Results

|mAP strict| mAP relaxed | avgmAP |
|----------|-------------|--------|
|83.86     |94.27        |89.06   | 


#### 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:** [More Information Needed]
- **Hours used:** [More Information Needed]
- **Cloud Provider:** [More Information Needed]
- **Compute Region:** [More Information Needed]
- **Carbon Emitted:** [More Information Needed]

## Technical Specifications

### Model Architecture and Objective

[More Information Needed]

### Compute Infrastructure
The model has been trained with the available [Kaggle](https://www.kaggle.com/) resources:
- Number of nodes: 1
- Number of GPUs per node: 1
- GPU type: NVIDIA P100
- GPU memory: 16GB


## 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