File size: 703 Bytes
020b4ec
 
f74d5e4
020b4ec
cde25ed
020b4ec
 
 
 
0b95675
 
 
 
 
 
 
 
 
 
 
e5b3a4d
0b95675
b879baa
e5b3a4d
0b95675
 
e5b3a4d
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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)