Downloads · 30 days
209
0% of all-time downloads
Sahajtomar/German_Zeroshot
German_Zeroshot is a zero-shot classification model from Sahajtomar. Use it when you need labels you did not train the model on. It is set up for transformers.
This model has GBERT Large as base model and fine-tuned it on xnli de dataset. The default hypothesis template is in English: This text is {}. While using this model , change it to "In deisem geht es um {}." or someth…
Downloads · 30 days
209
0% of all-time downloads
All-time downloads
1.4M
Public
Repo size
5.4 GB
Likes
26
Public
Click a slice to open those files.
.bin1.3 GB · 50%
From the Hugging Face model README
This model has GBERT Large as base model and fine-tuned it on xnli de dataset.
The default hypothesis template is in English: This text is {}. While using this model , change it to "In deisem geht es um {}." or something different. While inferencing through huggingface api may give poor results as it uses by default english template. Since model is monolingual and not multilingual, hypothesis template needs to be changed accordingly.
Accuracy: 85.5
Accuracy: 83.6
from transformers import pipeline
classifier = pipeline("zero-shot-classification",
model="Sahajtomar/German_Zeroshot")
sequence = "Letzte Woche gab es einen Selbstmord in einer nahe gelegenen kolonie"
candidate_labels = ["Verbrechen","Tragödie","Stehlen"]
hypothesis_template = "In deisem geht es um {}." ## Since monolingual model,its sensitive to hypothesis template. This can be experimented
classifier(sequence, candidate_labels, hypothesis_template=hypothesis_template)
"""{'labels': ['Tragödie', 'Verbrechen', 'Stehlen'],
'scores': [0.8328856854438782, 0.10494536352157593, 0.06316883927583696],
'sequence': 'Letzte Woche gab es einen Selbstmord in einer nahe gelegenen Kolonie'}"""