tclopess's picture
Create app.py
020b4ec verified
raw
history blame
474 Bytes
from transformers import pipeline
import gradio as gr
model = "neuralmind/bert-base-portuguese-cased"
pipe = pipeline('sentiment-analysis', model=model)
def get_sentiment(input_text):
return pipe(input_text)
iface = gr.Interface(fn=get_sentiment,
inputs='text',
outputs=['text'],
title='Sentiment Analysis',
description='Obtenha o sentimento do texto de entrada:'
)