MatteoFasulo commited on
Commit
ce3b3a0
·
verified ·
1 Parent(s): e8f4bf4

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +25 -56
README.md CHANGED
@@ -18,6 +18,8 @@ repo_url: https://github.com/MatteoFasulo/clef2025-checkthat
18
  model-index:
19
  - name: mdeberta-v3-base-subjectivity-italian
20
  results: []
 
 
21
  ---
22
 
23
  # mdeberta-v3-base-subjectivity-italian
@@ -100,70 +102,37 @@ The following hyperparameters were used during training:
100
  You can use this model for text classification (subjectivity detection) with the `transformers` library:
101
 
102
  ```python
103
- from transformers import AutoTokenizer, AutoModelForSequenceClassification
104
- import torch
105
-
106
- model_name = "MatteoFasulo/mdeberta-v3-base-subjectivity-italian"
107
- tokenizer = AutoTokenizer.from_pretrained(model_name)
108
- model = AutoModelForSequenceClassification.from_pretrained(model_name)
109
-
110
- # Example 1: Subjective sentence
111
- text_1 = "This is a truly exceptional movie with stunning visuals and a captivating plot."
112
- inputs_1 = tokenizer(text_1, return_tensors="pt")
113
-
114
- with torch.no_grad():
115
- logits_1 = model(**inputs_1).logits
116
-
117
- predicted_class_id_1 = logits_1.argmax().item()
118
- predicted_label_1 = model.config.id2label[predicted_class_id_1]
119
-
120
- print(f"Text: '{text_1}'")
121
- print(f"Predicted label: {predicted_label_1}") # Expected: SUBJ
122
-
123
- # Example 2: Objective sentence
124
- text_2 = "The capital of France is Paris."
125
- inputs_2 = tokenizer(text_2, return_tensors="pt")
126
-
127
- with torch.no_grad():
128
- logits_2 = model(**inputs_2).logits
129
-
130
- predicted_class_id_2 = logits_2.argmax().item()
131
- predicted_label_2 = model.config.id2label[predicted_class_id_2]
132
-
133
- print(f"Text: '{text_2}'")
134
- print(f"Predicted label: {predicted_label_2}") # Expected: OBJ
135
-
136
- # Example 3: Batch processing
137
- texts_to_classify = [
138
- "I believe this decision is a grave mistake for our future.",
139
- "The report indicates a significant decline in quarterly earnings.",
140
- "What an absolutely brilliant performance by the lead actor!",
141
- "The meeting is scheduled for tomorrow at 10 AM in conference room B."
142
- ]
143
- inputs_batch = tokenizer(texts_to_classify, padding=True, truncation=True, return_tensors="pt")
144
-
145
- with torch.no_grad():
146
- logits_batch = model(**inputs_batch).logits
147
-
148
- predicted_class_ids_batch = logits_batch.argmax(dim=1).tolist()
149
- predicted_labels_batch = [model.config.id2label[id] for id in predicted_class_ids_batch]
150
-
151
- for text, label in zip(texts_to_classify, predicted_labels_batch):
152
- print(f"Text: '{text}' -> Label: {label}")
153
  ```
154
 
155
  ## Citation
156
 
157
- If you find this model or the associated work useful, please cite the original paper:
158
 
159
  ```bibtex
160
- @misc{antoun2024camembert20smarterfrench,
161
- title={AI Wizards at CheckThat! 2025: Enhancing Transformer-Based Embeddings with Sentiment for Subjectivity Detection in News Articles},
162
- author={Wissam Antoun and Francis Kulumba and Rian Touchent and Éric de la Clergerie and Benoît Sagot and Djamé Seddah},
163
- year={2024},
164
  eprint={2507.11764},
165
  archivePrefix={arXiv},
166
  primaryClass={cs.CL},
167
- url={https://arxiv.org/abs/2507.11764},
168
  }
169
  ```
 
18
  model-index:
19
  - name: mdeberta-v3-base-subjectivity-italian
20
  results: []
21
+ datasets:
22
+ - MatteoFasulo/clef2025_checkthat_task1_subjectivity
23
  ---
24
 
25
  # mdeberta-v3-base-subjectivity-italian
 
102
  You can use this model for text classification (subjectivity detection) with the `transformers` library:
103
 
104
  ```python
105
+ from transformers import pipeline
106
+
107
+ # Load the text classification pipeline
108
+ classifier = pipeline(
109
+ "text-classification",
110
+ model="MatteoFasulo/mdeberta-v3-base-subjectivity-italian",
111
+ tokenizer="microsoft/mdeberta-v3-base",
112
+ )
113
+
114
+ # Example usage:
115
+ # A subjective sentence
116
+ result_subj = classifier("Questa è una scoperta affascinante e fantastica!")
117
+ print(f"Sentence: 'This is a truly amazing and groundbreaking discovery!' -> {result_subj}")
118
+
119
+ # An objective sentence
120
+ result_obj = classifier("In particolare Volkswagen e Stellantis son o arrivati a cedere il 7% in Borsa.")
121
+ print(f"Sentence: 'The new policy will be implemented next quarter.' -> {result_obj}")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
122
  ```
123
 
124
  ## Citation
125
 
126
+ If you find our work helpful or inspiring, please feel free to cite it:
127
 
128
  ```bibtex
129
+ @misc{fasulo2025aiwizardscheckthat2025,
130
+ title={AI Wizards at CheckThat! 2025: Enhancing Transformer-Based Embeddings with Sentiment for Subjectivity Detection in News Articles},
131
+ author={Matteo Fasulo and Luca Babboni and Luca Tedeschini},
132
+ year={2025},
133
  eprint={2507.11764},
134
  archivePrefix={arXiv},
135
  primaryClass={cs.CL},
136
+ url={https://arxiv.org/abs/2507.11764},
137
  }
138
  ```