Sahajtomar commited on
Commit
229b168
1 Parent(s): 30edf18

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +4 -15
README.md CHANGED
@@ -25,27 +25,16 @@ This model has [GBERT Large](https://huggingface.co/deepset/gbert-large) as base
25
  from transformers import pipeline
26
  classifier = pipeline("zero-shot-classification",
27
  model="Sahajtomar/German_Zeroshot")
 
28
 
29
- # we will classify the Russian translation of, "Who are you voting for in 2020?"
30
  sequence = "Letzte Woche gab es einen Selbstmord in einer nahe gelegenen kolonie"
31
  candidate_labels = ["Verbrechen","Tragödie","Stehlen"]
32
  hypothesis_template = "In deisem geht es um {}." ## Since monolingual model,its sensitive to hypothesis template. This can be experimented
33
 
34
  classifier(sequence, candidate_labels, hypothesis_template=hypothesis_template)
35
- # {'labels': ['politics', 'Europe', 'public health'],
36
- # 'scores': [0.9048484563827515, 0.05722189322113991, 0.03792969882488251],
37
- # 'sequence': 'За кого вы голосуете в 2020 году?'}
38
- ```
39
-
40
- The default hypothesis template is the English, `This text is {}`. If you are working strictly within one language, it
41
- may be worthwhile to translate this to the language you are working with:
42
-
43
- ```python
44
- sequence_to_classify = "¿A quién vas a votar en 2020?"
45
- candidate_labels = ["Europa", "salud pública", "política"]
46
- hypothesis_template = "Este ejemplo es {}."
47
- classifier(sequence_to_classify, candidate_labels, hypothesis_template=hypothesis_template)
48
  """{'labels': ['Tragödie', 'Verbrechen', 'Stehlen'],
49
  'scores': [0.8328856854438782, 0.10494536352157593, 0.06316883927583696],
50
  'sequence': 'Letzte Woche gab es einen Selbstmord in einer nahe gelegenen Kolonie'}"""
51
- ```
 
 
 
25
  from transformers import pipeline
26
  classifier = pipeline("zero-shot-classification",
27
  model="Sahajtomar/German_Zeroshot")
28
+ ##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.
29
 
 
30
  sequence = "Letzte Woche gab es einen Selbstmord in einer nahe gelegenen kolonie"
31
  candidate_labels = ["Verbrechen","Tragödie","Stehlen"]
32
  hypothesis_template = "In deisem geht es um {}." ## Since monolingual model,its sensitive to hypothesis template. This can be experimented
33
 
34
  classifier(sequence, candidate_labels, hypothesis_template=hypothesis_template)
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  """{'labels': ['Tragödie', 'Verbrechen', 'Stehlen'],
36
  'scores': [0.8328856854438782, 0.10494536352157593, 0.06316883927583696],
37
  'sequence': 'Letzte Woche gab es einen Selbstmord in einer nahe gelegenen Kolonie'}"""
38
+ ```
39
+
40
+