Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
# Use a pipeline as a high-level helper
|
4 |
+
from transformers import pipeline
|
5 |
+
|
6 |
+
pipe = pipeline("text-classification", model="monsws/ReviewsLibrosAnalisisSentimientos")
|
7 |
+
|
8 |
+
def get_sentiment(input_text):
|
9 |
+
return pipe(input_text)
|
10 |
+
|
11 |
+
iface = gr.Interface(fn= get_sentiment, inputs="text", outputs=['text'], title='Analisis de Reseñas de Libros', description="Dada una reseña, obten si es positiva/negativa/neutral")
|
12 |
+
|
13 |
+
iface.lauch(inline=False)
|