Downloads · 30 days
0
sandh/Gemma-4-31B-it_DimABSA-German
Gemma-4-31B-it_DimABSA-German is a text generation model from sandh. Use it when you need the model to write or continue text. It is set up for peft.
sandh/Gemma 4 31B it, finetuned for performing Dimensional Aspect-Based Sentiment Analysis on political texts in German. This repository contains two revisions: - Stage1: The base model, finetuned using human-annotate…
Downloads · 30 days
0
Access
Public
Updated Jul 19, 2026
Repo size
125 GB
Likes
0
Public
Click a slice to open those files.
.md5.6 KB · 79%
From the Hugging Face model README
sandh/Gemma 4 31B it, finetuned for performing Dimensional Aspect-Based Sentiment Analysis on political texts in German. This repository contains two revisions:
Stage1: The base model, finetuned using human-annotated data only.Stage2: The base model, finetuned using human-annotated and synthetically annotated data.Use the code below to get started with the model.
from transformers import pipeline
text_to_annotate = (
"Solange Berlin - nach 25 Jahren sozialdemokratischer Schulsenatoren - in aller Regel einen "
"der Schlussplätze im Bildungsvergleich belegt, müssen sich Schulen auf ihre Kernaufgabe "
"konzentrieren. Kindern muss vermittelt werden, dass Menschen andersartig, aber gleichwertig "
"sind."
)
generator = pipeline(
"text-generation",
model="sandh/sandh/Gemma-4-31B-it_DimABSA-German",
revision="Stage1", # or "Stage2"
device="cuda"
)
output = generator(
[
{
"role": "system",
"content": "Du bist ein spezialisiertes Modell zur Sentimentanalyse politischer Texte.\n"
"Das Ausgabeformat ist ein JSON-Array aus 0 oder mehr Objekten, wobei jedes Objekt genau die "
"folgenden Felder enthält:\n"
"- Aspekt (string oder 'NULL'): Das genaue Wort oder die genaue Phrase im Text, das/ die "
"eine bestimmte Entität/ Idee oder ein bestimmtes Ereignis/ Thema bezeichnet, die/ das von "
"öffentlichem Interesse ist. Der Aspektbegriff ist 'NULL', falls kein expliziter Aspekt "
"vorhanden ist.\n"
"- Sentimentbegriff (string oder 'NULL'): Das genaue Wort oder die genaue Phrase im Text, "
"das/ die das Sentiment/ die Einstellung/ Haltung gegenüber dem Aspekt zum Ausdruck bringt. "
"Der Sentimentbegriff ist 'NULL', falls das Sentiment/ die Einstellung/ Haltung nicht explizit "
"ausgedrückt wird.\n"
"- Valenz (Zahl): Wert, der den den Grad der Positivität oder Negativität misst. Ein Wert von "
"1.00 steht für eine extrem negative Valenz, 9.00 für eine extrem positive Valenz und 5.00 für "
"eine neutrale Valenz. Der Valenzwert muss auf genau zwei Dezimalstellen gerundet sein.\n"
"- Erregung (Zahl): Wert, der die Intensität des Sentiments/ der Emotion misst. Ein Wert von "
"1.00 steht für sehr geringe Erregung, 9.00 für sehr hohe Erregung und 5.00 für mittlere "
"Erregung. Der Erregungswert muss auf genau zwei Dezimalstellen gerundet sein.\n"
"Gib NUR das JSON-Array zurück und formatiere es NICHT als Codeblock (```json ... ```)."
},
{
"role": "user",
"content": f"Text: {text_to_annotate}"
}
],
max_new_tokens=512,
return_full_text=False,
)
print(output["generated_text"])
# [{"Aspect": "Schulen",
# "Opinion": "auf ihre Kernaufgabe konzentrieren",
# "Valence": 5.40,
# "Arousal": 3.80}]
Stage1: The train-split of the sandh/SemEval-2026 dataset was used for finetuning. The training data exclusively contains human-annotated German political texts.Stage2: Additionally, the train-split of the sandh/AfD-CCC dataset was used for finetuning. This data exclusively contains synthetically labeled German texts, which are focused on the stance of members of the AfD party regarding climate change.This model was trained with SFT.
rank: 16alpha: 32dropout: 0.05bias: nonetarget_modules: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_projuse_rslora: Truetask_type: CAUSAL_LMseed: 42max_length: 1024packing: Trueassistant_only_loss: Falsegradient_checkpointing: Trueper_device_train_batch_size: 2gradient_accumulation_steps: 4num_train_epochs: 1learning_rate: 2e-05lr_scheduler_type: linearweight_decay: 0.001warmup_steps: 5optim: adamw_8bit