Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ from transformers import pipeline
|
|
5 |
classifier = pipeline("text-classification", model="Emanai/my-finetuned-bert2")
|
6 |
|
7 |
def classify_text(text):
|
8 |
-
return classifier("I am
|
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 |
+
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")
|