ancebuc's picture
Update app.py
d9418bc verified
raw
history blame contribute delete
395 Bytes
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()