tclopess commited on
Commit
020b4ec
·
verified ·
1 Parent(s): 4f06de3

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -0
app.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+ import gradio as gr
3
+
4
+ model = "neuralmind/bert-base-portuguese-cased"
5
+ pipe = pipeline('sentiment-analysis', model=model)
6
+
7
+ def get_sentiment(input_text):
8
+ return pipe(input_text)
9
+
10
+ iface = gr.Interface(fn=get_sentiment,
11
+ inputs='text',
12
+ outputs=['text'],
13
+ title='Sentiment Analysis',
14
+ description='Obtenha o sentimento do texto de entrada:'
15
+ )