Emanai commited on
Commit
854dea4
·
verified ·
1 Parent(s): f7e4f03

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -5,7 +5,8 @@ from transformers import pipeline
5
  classifier = pipeline("text-classification", model="Emanai/my-finetuned-bert2")
6
 
7
  def classify_text(text):
8
- return '{} - {}'.format(classifier("I am very sad")[0]['score'], classifier("I am happy")[0]['label'])
 
9
 
10
  # Create a simple Gradio interface
11
  iface = gr.Interface(fn=classify_text, inputs="text", outputs="label")
 
5
  classifier = pipeline("text-classification", model="Emanai/my-finetuned-bert2")
6
 
7
  def classify_text(text):
8
+ result=classifier(text)
9
+ return '{} - {}'.format(result[0]['score'], result[0]['label'])
10
 
11
  # Create a simple Gradio interface
12
  iface = gr.Interface(fn=classify_text, inputs="text", outputs="label")