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