Update README.md
Browse files
README.md
CHANGED
|
@@ -34,6 +34,50 @@ It achieves the following results on the evaluation set:
|
|
| 34 |
- epoch: 0.4889
|
| 35 |
- step: 3000
|
| 36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
## Model description
|
| 38 |
|
| 39 |
More information needed
|
|
|
|
| 34 |
- epoch: 0.4889
|
| 35 |
- step: 3000
|
| 36 |
|
| 37 |
+
```python
|
| 38 |
+
# Use a pipeline as a high-level helper
|
| 39 |
+
|
| 40 |
+
pipe = pipeline(
|
| 41 |
+
"zero-shot-classification",
|
| 42 |
+
model="kaixkhazaki/german-zeroshot",
|
| 43 |
+
tokenizer="kaixkhazaki/german-zeroshot",
|
| 44 |
+
device=0 if torch.cuda.is_available() else -1 # Use GPU if available
|
| 45 |
+
)
|
| 46 |
+
|
| 47 |
+
#Enter your text and possible candidates of classification
|
| 48 |
+
sequence = "Können Sie mir die Schritte zur Konfiguration eines VPN auf einem Linux-Server erklären?"
|
| 49 |
+
candidate_labels = [
|
| 50 |
+
"Technische Dokumentation",
|
| 51 |
+
"IT-Support",
|
| 52 |
+
"Netzwerkadministration",
|
| 53 |
+
"Linux-Konfiguration",
|
| 54 |
+
"VPN-Setup"
|
| 55 |
+
]
|
| 56 |
+
pipe(
|
| 57 |
+
sequence,
|
| 58 |
+
candidate_labels,
|
| 59 |
+
)
|
| 60 |
+
|
| 61 |
+
>>
|
| 62 |
+
{'sequence': 'Können Sie mir die Schritte zur Konfiguration eines VPN auf einem Linux-Server erklären?',
|
| 63 |
+
'labels': ['VPN-Setup', 'Linux-Konfiguration', 'Netzwerkadministration', 'IT-Support', 'Technische Dokumentation'],
|
| 64 |
+
'scores': [0.3245040476322174, 0.32373329997062683, 0.16423103213310242, 0.09850211441516876, 0.08902951329946518]}
|
| 65 |
+
|
| 66 |
+
#example 2
|
| 67 |
+
sequence = "Können Sie mir die Schritte zur Konfiguration eines VPN auf einem Linux-Server erklären?"
|
| 68 |
+
candidate_labels = [
|
| 69 |
+
"Technische Dokumentation",
|
| 70 |
+
"IT-Support",
|
| 71 |
+
"Netzwerkadministration",
|
| 72 |
+
"Linux-Konfiguration",
|
| 73 |
+
"VPN-Setup"
|
| 74 |
+
]
|
| 75 |
+
{'sequence': 'Wie lautet die Garantiezeit für dieses Produkt?',
|
| 76 |
+
'labels': ['Garantiebedingungen', 'Produktdetails', 'Reklamation', 'Kundendienst', 'Kaufberatung'],
|
| 77 |
+
'scores': [0.4313304126262665, 0.2905466556549072, 0.10058070719242096, 0.09384352713823318, 0.08369863778352737]}
|
| 78 |
+
|
| 79 |
+
```
|
| 80 |
+
|
| 81 |
## Model description
|
| 82 |
|
| 83 |
More information needed
|