Datasets:
Tasks:
Text Classification
Modalities:
Text
Formats:
text
Sub-tasks:
sentiment-classification
Languages:
Spanish
Size:
10K - 100K
License:
import gradio as gr | |
import json | |
import random | |
# Cargar el dataset demo | |
with open("goemotions_es_demo_subset_fixed.json", "r", encoding="utf-8") as f: | |
data = json.load(f) | |
# Función para mostrar una muestra aleatoria | |
def mostrar_muestra(): | |
ejemplo = random.choice(data) | |
return ( | |
ejemplo["persona"], | |
ejemplo["contexto_usuario"], | |
ejemplo["respuesta_asistente"], | |
ejemplo["emotion"], | |
ejemplo["intencion"], | |
ejemplo["tono"], | |
ejemplo["energia"], | |
"✅ Coherente" if ejemplo["coherente"] else "⚠️ Incoherente" | |
) | |
# Interfaz de salida | |
demo = gr.Interface( | |
fn=mostrar_muestra, | |
inputs=[], | |
outputs=[ | |
gr.Textbox(label="🧠 Persona (contexto)"), | |
gr.Textbox(label="💬 Usuario dice"), | |
gr.Textbox(label="🤖 Asistente responde"), | |
gr.Textbox(label="🎭 Emoción principal"), | |
gr.Textbox(label="🎯 Intención"), | |
gr.Textbox(label="🎙️ Tono conversacional"), | |
gr.Number(label="⚡ Nivel de energía"), | |
gr.Textbox(label="📌 Coherencia") | |
], | |
title="GoEmotions-ES Demo (Lucio-Rhapsody)", | |
description="Explora muestras aleatorias del dataset emocional en español curado por Lucio-Rhapsody. Este espacio no utiliza un modelo, sino el dataset demo.", | |
allow_flagging="never", | |
live=False | |
) | |
demo.launch() | |