Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,11 +4,7 @@ import gradio as gr
|
|
| 4 |
classifier = pipeline('text-classification', model='lauragordo/clasificador-rotten-tomatoes')
|
| 5 |
|
| 6 |
def text_classification(text):
|
| 7 |
-
|
| 8 |
-
sentiment_label = result[0]['label']
|
| 9 |
-
sentiment_score = result[0]['score']
|
| 10 |
-
formatted_output = f"This sentiment is {sentiment_label} with the probability {sentiment_score*100:.2f}%"
|
| 11 |
-
return formatted_output
|
| 12 |
|
| 13 |
examples=["This is wonderful movie!", "The movie was really bad; I didn't like it."]
|
| 14 |
|
|
|
|
| 4 |
classifier = pipeline('text-classification', model='lauragordo/clasificador-rotten-tomatoes')
|
| 5 |
|
| 6 |
def text_classification(text):
|
| 7 |
+
return classifier(text)[0]['label']
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
examples=["This is wonderful movie!", "The movie was really bad; I didn't like it."]
|
| 10 |
|