gilramos commited on
Commit
ef34b99
1 Parent(s): be4ba0f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -34,8 +34,9 @@ def predict(text, chosen_model):
34
  model_pipeline = pipeline("text-classification", model=chosen_model)
35
  result = model_pipeline(text)
36
  label = result[0]['label']
 
37
 
38
- return label
39
 
40
  inputs = [
41
  gr.Textbox(label="Text", value= app_examples[0][0]),
@@ -43,7 +44,8 @@ inputs = [
43
  ]
44
 
45
  outputs = [
46
- gr.Label(label="Result"),
 
47
  ]
48
 
49
 
 
34
  model_pipeline = pipeline("text-classification", model=chosen_model)
35
  result = model_pipeline(text)
36
  label = result[0]['label']
37
+ score = result[0]['score']
38
 
39
+ return label, score
40
 
41
  inputs = [
42
  gr.Textbox(label="Text", value= app_examples[0][0]),
 
44
  ]
45
 
46
  outputs = [
47
+ gr.Label(label="Result"),
48
+ gr.Markdown()
49
  ]
50
 
51