CoolFace
Modelpublic

kaixkhazaki/german-zeroshot

sourceHugging Facemitupdated 2y agoView on Hugging Face
0likes42downloads
Model Card

<!-- This model card has been generated automatically according to the information the Trainer had access to. You should probably proofread and complete it, then remove this comment. -->

german-zeroshot

This model is a fine-tuned version of deepset/gbert-large on facebook/xnli de dataset. It achieves the following results on the evaluation set:

  • Loss: 0.4592
  • Accuracy: 0.8486

Usage

python
# Use a pipeline as a high-level helper

pipe = pipeline(
    "zero-shot-classification",
    model="kaixkhazaki/german-zeroshot",
    tokenizer="kaixkhazaki/german-zeroshot",
    device=0 if torch.cuda.is_available() else -1  # Use GPU if available
)

#Enter your text and possible candidates of classification
sequence = "Können Sie mir die Schritte zur Konfiguration eines VPN auf einem Linux-Server erklären?"
candidate_labels = [
    "Technische Dokumentation", 
    "IT-Support", 
    "Netzwerkadministration", 
    "Linux-Konfiguration", 
    "VPN-Setup"
]
pipe(sequence,candidate_labels)
>>
{'sequence': 'Können Sie mir die Schritte zur Konfiguration eines VPN auf einem Linux-Server erklären?',
'labels': ['VPN-Setup', 'Linux-Konfiguration', 'Netzwerkadministration', 'IT-Support', 'Technische Dokumentation'],
'scores': [0.53142249584198, 0.26030370593070984, 0.09126164764165878, 0.06451434642076492, 0.052497804164886475]}


#example 2
sequence = "Wie lautet die Garantiezeit für dieses Produkt?"
candidate_labels = [
    "Garantiebedingungen", 
    "Kundendienst", 
    "Produktdetails", 
    "Reklamation", 
    "Kaufberatung"
]
pipe(sequence,candidate_labels)
>>
{'sequence': 'Wie lautet die Garantiezeit für dieses Produkt?',
'labels': ['Garantiebedingungen', 'Kundendienst', 'Produktdetails', 'Reklamation', 'Kaufberatung'],
'scores': [0.414899080991745, 0.2377401739358902, 0.1381743848323822, 0.12171833217144012, 0.08746808022260666]}

Model description

More information needed

Intended uses & limitations

More information needed

Training and evaluation data

More information needed

Training procedure

Training hyperparameters

The following hyperparameters were used during training:

  • learning_rate: 5e-05
  • trainbatchsize: 64
  • evalbatchsize: 32
  • seed: 42
  • optimizer: Use adamwtorch with betas=(0.9,0.999) and epsilon=1e-08 and optimizerargs=No additional optimizer arguments
  • lrschedulertype: cosine
  • lrschedulerwarmup_steps: 500
  • num_epochs: 3

Training results

Training LossEpochStepValidation LossAccuracyF1PrecisionRecall
0.64290.163010000.52030.80040.80060.80090.8004
0.57150.325920000.52090.79640.79680.80050.7964
0.58970.488930000.54350.79240.79400.80390.7924
0.57010.651940000.52420.78800.78840.80780.7880
0.52380.814950000.48160.82330.82260.82630.8233
0.52850.977860000.44830.82650.82730.83030.8265
0.43021.140870000.47510.82090.82140.82770.8209
0.41631.303880000.45600.82850.82890.83440.8285
0.39421.466890000.43300.84140.84220.84540.8414
0.38751.6297100000.41710.84300.84320.84550.8430
0.36391.7927110000.41940.84420.84470.84870.8442
0.37681.9557120000.42150.84740.84770.84920.8474
0.24432.1186130000.47500.83900.83980.84520.8390
0.24042.2816140000.45920.84860.84870.85050.8486
0.21542.4446150000.49140.84180.84240.84660.8418
0.21572.6076160000.48040.84540.84580.84880.8454
0.22492.7705170000.48090.84660.84710.85070.8466
0.22042.9335180000.47770.84660.84700.85020.8466

Framework versions

  • Transformers 4.48.0.dev0
  • Pytorch 2.4.1+cu121
  • Datasets 3.1.0
  • Tokenizers 0.21.0