abhisheky127 commited on
Commit
80aea0d
1 Parent(s): be1b3ee

updating labels striping

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -10,7 +10,8 @@ classifier = pipeline("zero-shot-classification",
10
 
11
  #define a function to process your input and output
12
  def zero_shot(doc, candidates):
13
- given_labels = candidates.split(", ")
 
14
  dictionary = classifier(doc, given_labels)
15
  labels = dictionary['labels']
16
  scores = dictionary['scores']
@@ -54,7 +55,7 @@ transactions_and_tags = [
54
  gui = gr.Interface(title=title,
55
  description=description,
56
  fn=zero_shot,
57
- inputs=[preprocess(input1), input2],
58
  outputs=[output],
59
  examples=transactions_and_tags)
60
 
 
10
 
11
  #define a function to process your input and output
12
  def zero_shot(doc, candidates):
13
+ given_labels = candidates.split(",")
14
+ given_labels = list(map(strip,given_labels))
15
  dictionary = classifier(doc, given_labels)
16
  labels = dictionary['labels']
17
  scores = dictionary['scores']
 
55
  gui = gr.Interface(title=title,
56
  description=description,
57
  fn=zero_shot,
58
+ inputs=[input1, input2],
59
  outputs=[output],
60
  examples=transactions_and_tags)
61