Datasets:
Tasks:
Text Classification
Modalities:
Text
Formats:
text
Sub-tasks:
sentiment-classification
Languages:
Spanish
Size:
10K - 100K
License:
File size: 1,367 Bytes
34a454b 04e44e1 34a454b 04e44e1 34a454b 04e44e1 34a454b 04e44e1 34a454b 04e44e1 34a454b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
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()
|