Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,6 +14,15 @@ label_map = {
|
|
| 14 |
3: "tristeza"
|
| 15 |
}
|
| 16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
# Función de predicción
|
| 18 |
def predict_tags(text):
|
| 19 |
# Tokenizar el texto de entrada
|
|
@@ -39,4 +48,5 @@ gr.Interface(
|
|
| 39 |
outputs="text",
|
| 40 |
title="Análisis de emociones de tweets (en inglés)",
|
| 41 |
description="Escribe un tweet en inglés y el modelo te dirá qué emoción transmite.",
|
|
|
|
| 42 |
).launch(share=False)
|
|
|
|
| 14 |
3: "tristeza"
|
| 15 |
}
|
| 16 |
|
| 17 |
+
# Ejemplos predefinidos
|
| 18 |
+
examples = [
|
| 19 |
+
["@user Interesting choice of words... Are you confirming that governments fund #terrorism? Bit of an open door, but still...", "enfado"],
|
| 20 |
+
["love to see them interacting 😸🙏 #itsbeensolong #laughing", "alegría"],
|
| 21 |
+
["Life is too short to hide your feelings. Don't be afraid to say what you feel.", "optimismo"],
|
| 22 |
+
["#GameOfThones how can you top that next week #heartbreaking", "tristeza"]
|
| 23 |
+
]
|
| 24 |
+
|
| 25 |
+
|
| 26 |
# Función de predicción
|
| 27 |
def predict_tags(text):
|
| 28 |
# Tokenizar el texto de entrada
|
|
|
|
| 48 |
outputs="text",
|
| 49 |
title="Análisis de emociones de tweets (en inglés)",
|
| 50 |
description="Escribe un tweet en inglés y el modelo te dirá qué emoción transmite.",
|
| 51 |
+
examples=examples
|
| 52 |
).launch(share=False)
|