Spaces:
Sleeping
Sleeping
Create app.py
Browse files
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 |
+
)
|