Spaces:
Build error
Build error
| import gradio as gr | |
| from transformers import pipeline | |
| def greet(tweet): | |
| classifier = pipeline('text-classification', model='ancebuc/tweet-eval-sentiment') | |
| label = classifier(tweet)[0]['label'] | |
| labels = {'LABEL_0': 'Negativo :(', 'LABEL_1': 'Neutro :/', 'LABEL_2': 'Positivo :)'} | |
| return labels[label] | |
| iface = gr.Interface(fn=greet, inputs="text", outputs="text") | |
| iface.launch() |