Spaces:
Sleeping
Sleeping
from transformers import pipeline | |
import gradio as gr | |
import torch | |
pipe = pipeline('sentiment-analysis') | |
def get_sentiment(input_text): | |
return pipe(input_text) | |
app_examples = [ | |
['Não estou em minha melhor versão'], | |
['Nada mais satisfatorio como chegar em casa e relaxar'] | |
] | |
inputs = [ | |
gr.Textbox(label="Text", value=app_examples[0][0]), | |
] | |
iface = gr.Interface(fn=get_sentiment, | |
inputs=inputs, | |
outputs=['text'], | |
title='Sentiment Analysis', | |
description='Obtenha o sentimento do texto digitado 😄|😠', | |
example= app_examples | |
) | |
iface.launch(inline=False) | |