Rhaosody commited on
Commit
34a454b
·
verified ·
1 Parent(s): 9babfc9

Upload 6 files

Browse files
Files changed (6) hide show
  1. LICENSE +12 -0
  2. LICENSE.txt +11 -0
  3. README.md +22 -17
  4. app.py +29 -0
  5. goemotions_es.py +48 -0
  6. 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
- --# GoEmotionEsp (Español) — por Rhaosody
2
 
3
- Este es un subconjunto de muestra del dataset GoEmotions traducido y enriquecido al español.
4
- Contiene anotaciones emocionales, etiquetas de reflexión, energía, intención y tono conversacional.
 
5
 
6
- ## 📚 Descripción
7
 
8
- - Idioma: Español
9
- - Emociones: alegría, tristeza, enojo, esperanza, sorpresa, entre otras.
10
- - Metadatos: `energy_level`, `tono_conversacional`, `nivel_reflexion`, `tipo_vinculo`, `intent`, etc.
11
- - Propósito: Entrenamiento de modelos conversacionales emocionalmente sensibles.
12
 
13
- ## 🔓 Licencia
14
 
15
- Este dataset se publica bajo la licencia **Creative Commons Attribution 4.0 International (CC BY 4.0)**.
16
- Puedes reutilizarlo con atribución al autor: **Rhaosody**.
 
 
 
17
 
18
- Basado en el dataset original [GoEmotions (Google)](https://github.com/google-research/goemotions).
19
- -
20
- license: cc-by-4.0
21
- language:
22
- - es
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