ancebuc's picture
Update app.py
7046e94 verified
raw
history blame
394 Bytes
import gradio as gr
from transformers import pipeline
def greet(tweet):
classifier = pipeline('text-classification', model='ancebuc/tweet-eval-sentiment')
label = classifier(tweet)['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()