Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
|
|
|
| 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")
|