Spaces:
Runtime error
Runtime error
first commit
Browse files- .gitignore +1 -0
- app.py +17 -0
- requirements.txt +1 -0
.gitignore
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
venv/
|
app.py
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from pysentimiento import create_analyzer
|
2 |
+
|
3 |
+
|
4 |
+
import gradio as gr
|
5 |
+
|
6 |
+
analyzer = create_analyzer(task="sentiment", lang="es")
|
7 |
+
|
8 |
+
def sentiment_analysis(text):
|
9 |
+
|
10 |
+
sent = analyzer.predict(text).probas
|
11 |
+
return sent
|
12 |
+
|
13 |
+
iface = gr.Interface(sentiment_analysis, "textbox", "label", interpretation="default")
|
14 |
+
|
15 |
+
iface.test_launch()
|
16 |
+
if __name__ == "__main__":
|
17 |
+
iface.launch()
|
requirements.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
pysentimiento
|