Text Classification
Transformers
Safetensors
Italian
deberta-v2
Generated from Trainer
subjectivity-detection
deberta-v3
Instructions to use AIWizards/mdeberta-v3-base-subjectivity-italian with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AIWizards/mdeberta-v3-base-subjectivity-italian with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="AIWizards/mdeberta-v3-base-subjectivity-italian")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("AIWizards/mdeberta-v3-base-subjectivity-italian") model = AutoModelForSequenceClassification.from_pretrained("AIWizards/mdeberta-v3-base-subjectivity-italian") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
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
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
model
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 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
|
| 158 |
|
| 159 |
```bibtex
|
| 160 |
-
@misc{
|
| 161 |
-
title={AI Wizards at CheckThat! 2025: Enhancing Transformer-Based Embeddings with Sentiment for Subjectivity Detection in News Articles},
|
| 162 |
-
author={
|
| 163 |
-
year={
|
| 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 |
```
|