File size: 1,444 Bytes
1637e3d
6d8ea6d
1637e3d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6d8ea6d
 
32dd769
7f33bd0
 
 
 
 
 
6c9dc8c
 
 
 
 
32dd769
 
 
6d8ea6d
97cb487
 
 
 
 
 
 
 
 
 
 
 
65a58b9
 
97cb487
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
---

language: German

tags:

- text-classification

- pytorch

- nli

- de


pipeline_tag: zero-shot-classification

widget:

- text: "Letzte Woche gab es einen Selbstmord in einer nahe gelegenen kolonie"

  candidate_labels: "Verbrechen,Tragödie,Stehlen"

  hypothesis_template: "In deisem geht es um {}." 

---


DESCRIPTION GOES HERE: 
Satz 1:
"Ich habe ein Problem mit meinem Iphone das so schnell wie möglich gelöst werden muss" 
Satz 2: 
"Ich hab ein kleines Problem mit meinem Macbook, und auch wenn die Reparatur nicht eilt, würde ich es gerne addressieren."
Label: 
["Computer", "Handy", "Tablet", "dringend", "nicht dringend"] 

EMOTION EXAMPLE:
"Ich bin entäuscht, dass ich kein Ticket für das Konzert meiner Lieblingsband bekommen habe."
label: ["Frustration", "Freude", "Wut", "Unverständis", "Traurigkeit"]
 
""""""""



```python

from transformers import pipeline

classifier = pipeline("zero-shot-classification",

                      model="Dehnes/zeroshot_gbert")

sequence = "Letzte Woche gab es einen Selbstmord in einer nahe gelegenen Stadt"

candidate_labels = ["Verbrechen","Tragödie","Stehlen"]

#hypothesis_template = "In diesem Satz geht es um das Thema {}."     ## Since monolingual model,its sensitive to hypothesis template. This can be experimented
hypothesis_template = "Dieser Satz drückt ein Gefühl von {} aus."

classifier(sequence, candidate_labels, hypothesis_template=hypothesis_template)

```