Datasets:
Tasks:
Text Classification
Modalities:
Text
Formats:
text
Sub-tasks:
sentiment-classification
Languages:
Spanish
Size:
10K - 100K
License:
Upload 6 files
Browse files- LICENSE +12 -0
- LICENSE.txt +11 -0
- README.md +22 -17
- app.py +29 -0
- goemotions_es.py +48 -0
- goemotions_es_demo_subset.json +0 -0
LICENSE
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Creative Commons Attribution 4.0 International
|
| 2 |
+
|
| 3 |
+
You are free to:
|
| 4 |
+
|
| 5 |
+
- Share — copy and redistribute the material in any medium or format
|
| 6 |
+
- Adapt — remix, transform, and build upon the material for any purpose, even commercially.
|
| 7 |
+
|
| 8 |
+
Under the following terms:
|
| 9 |
+
|
| 10 |
+
- Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner.
|
| 11 |
+
|
| 12 |
+
License: https://creativecommons.org/licenses/by/4.0/
|
LICENSE.txt
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Creative Commons Attribution-NonCommercial 4.0 International
|
| 2 |
+
|
| 3 |
+
You are free to:
|
| 4 |
+
- Share — copy and redistribute the material in any medium or format
|
| 5 |
+
- Adapt — remix, transform, and build upon the material
|
| 6 |
+
|
| 7 |
+
Under the following terms:
|
| 8 |
+
- Attribution — You must give appropriate credit.
|
| 9 |
+
- NonCommercial — You may not use the material for commercial purposes.
|
| 10 |
+
|
| 11 |
+
More info: https://creativecommons.org/licenses/by-nc/4.0/
|
README.md
CHANGED
|
@@ -1,23 +1,28 @@
|
|
| 1 |
-
|
| 2 |
|
| 3 |
-
Este es
|
| 4 |
-
Contiene
|
|
|
|
| 5 |
|
| 6 |
-
##
|
| 7 |
|
| 8 |
-
-
|
| 9 |
-
-
|
| 10 |
-
-
|
| 11 |
-
- Propósito: Entrenamiento de modelos conversacionales emocionalmente sensibles.
|
| 12 |
|
| 13 |
-
##
|
| 14 |
|
| 15 |
-
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
|
|
|
|
|
|
|
|
| 1 |
+
# GoEmotions_ES (Versión Pública)
|
| 2 |
|
| 3 |
+
Este dataset es una versión traducida, corregida y adaptada de GoEmotions al español.
|
| 4 |
+
Contiene ejemplos emocionalmente variados, curados manualmente para garantizar coherencia
|
| 5 |
+
lingüística y cultural en español.
|
| 6 |
|
| 7 |
+
## 🧠 Características
|
| 8 |
|
| 9 |
+
- Traducción de emociones desde el original en inglés a español.
|
| 10 |
+
- Corrección de frases para naturalidad en contexto hispano.
|
| 11 |
+
- Etiquetas manuales como intención, energía, contexto y emociones básicas.
|
|
|
|
| 12 |
|
| 13 |
+
## 📄 Estructura
|
| 14 |
|
| 15 |
+
Cada ejemplo contiene:
|
| 16 |
+
- `text`: texto original en inglés
|
| 17 |
+
- `text_es`: traducción directa
|
| 18 |
+
- `text_corregido`: versión final corregida en español
|
| 19 |
+
- `metadatos`: contiene campos como intención, energía, tema contextual, etc.
|
| 20 |
|
| 21 |
+
## ⚖️ Licencia
|
| 22 |
+
|
| 23 |
+
Distribuido bajo la licencia **CC BY-NC 4.0** — uso no comercial permitido con atribución.
|
| 24 |
+
|
| 25 |
+
## 📬 Contacto
|
| 26 |
+
|
| 27 |
+
Para dudas, sugerencias o colaboración, contactar a través de:
|
| 28 |
+
**Inspirado por el trabajo de Lucio-Rhapsody**
|
app.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import json
|
| 3 |
+
|
| 4 |
+
# Cargar subset de demo
|
| 5 |
+
with open("goemotions_es_demo_subset.json", "r", encoding="utf-8") as f:
|
| 6 |
+
data = json.load(f)
|
| 7 |
+
|
| 8 |
+
def analizar_texto(texto):
|
| 9 |
+
for entrada in data:
|
| 10 |
+
if entrada["text_corregido"].strip().lower() == texto.strip().lower():
|
| 11 |
+
meta = entrada["metadatos"]
|
| 12 |
+
return {
|
| 13 |
+
"Texto": entrada["text_corregido"],
|
| 14 |
+
"Intención": meta.get("intent", "N/A"),
|
| 15 |
+
"Tema": meta.get("context_topic", "N/A"),
|
| 16 |
+
"Emoción manual": meta.get("emotion_manual", "N/A"),
|
| 17 |
+
"Nivel de energía": meta.get("energy_level", "N/A")
|
| 18 |
+
}
|
| 19 |
+
return {"Resultado": "Frase no encontrada en el demo."}
|
| 20 |
+
|
| 21 |
+
demo = gr.Interface(
|
| 22 |
+
fn=analizar_texto,
|
| 23 |
+
inputs=gr.Textbox(label="Ingresa una frase del demo en español"),
|
| 24 |
+
outputs="json",
|
| 25 |
+
title="GoEmotions_ES Demo",
|
| 26 |
+
description="Ingresa una frase para ver su análisis emocional según el dataset traducido de GoEmotions al español."
|
| 27 |
+
)
|
| 28 |
+
|
| 29 |
+
demo.launch()
|
goemotions_es.py
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import json
|
| 2 |
+
import datasets
|
| 3 |
+
|
| 4 |
+
class GoEmotionsESConfig(datasets.BuilderConfig):
|
| 5 |
+
def __init__(self, **kwargs):
|
| 6 |
+
super(GoEmotionsESConfig, self).__init__(**kwargs)
|
| 7 |
+
|
| 8 |
+
class GoEmotionsES(datasets.GeneratorBasedBuilder):
|
| 9 |
+
BUILDER_CONFIGS = [
|
| 10 |
+
GoEmotionsESConfig(name="default", version=datasets.Version("1.0.0"), description="GoEmotions en español")
|
| 11 |
+
]
|
| 12 |
+
|
| 13 |
+
def _info(self):
|
| 14 |
+
return datasets.DatasetInfo(
|
| 15 |
+
description="GoEmotions traducido y adaptado al español, por Lucio-Rhapsody",
|
| 16 |
+
features=datasets.Features({
|
| 17 |
+
"persona": datasets.Sequence(datasets.Value("string")),
|
| 18 |
+
"historia": datasets.Sequence({
|
| 19 |
+
"from": datasets.Value("string"),
|
| 20 |
+
"value": datasets.Value("string")
|
| 21 |
+
}),
|
| 22 |
+
"metadatos": {
|
| 23 |
+
"coherente": datasets.Value("bool"),
|
| 24 |
+
"perplexity": datasets.Value("float"),
|
| 25 |
+
"emotion_manual": datasets.Value("string"),
|
| 26 |
+
"energy_level": datasets.Value("int32"),
|
| 27 |
+
"context_topic": datasets.Value("string"),
|
| 28 |
+
"memory_reference": datasets.Value("string"),
|
| 29 |
+
"intent": datasets.Value("string"),
|
| 30 |
+
"nivel_reflexion": datasets.Value("string"),
|
| 31 |
+
"tipo_vinculo": datasets.Value("string"),
|
| 32 |
+
"tono_conversacional": datasets.Value("string"),
|
| 33 |
+
"inspiracion_lucio": datasets.Value("bool")
|
| 34 |
+
}
|
| 35 |
+
}),
|
| 36 |
+
license="CC-BY-4.0",
|
| 37 |
+
homepage="https://huggingface.co/datasets/Lucio-Rhapsody/goemotions-es",
|
| 38 |
+
)
|
| 39 |
+
|
| 40 |
+
def _split_generators(self, dl_manager):
|
| 41 |
+
path = dl_manager.download_and_extract("goemotions_es_unificadoDefinitivo.json")
|
| 42 |
+
return [datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": path})]
|
| 43 |
+
|
| 44 |
+
def _generate_examples(self, filepath):
|
| 45 |
+
with open(filepath, encoding="utf-8") as f:
|
| 46 |
+
data = json.load(f)
|
| 47 |
+
for idx, row in enumerate(data):
|
| 48 |
+
yield idx, row
|
goemotions_es_demo_subset.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|