dialog-emo-demo / docs /PLAN.md
Mike
feat: support softmax emotion distributions
da2e76a

A newer version of the Gradio SDK is available: 6.16.0

Upgrade

Dialog Emotion Timeline Demo Plan

Goal

Build a readable Gradio demo for Hugging Face Spaces that tracks emotional color across a dialogue over time.

The interface reads model-like outputs from CSV instead of calling a model directly. The default demo uses synthetic Russian messenger-style data, and users can upload another CSV with the same contract.

Decisions

  • Chunk unit: one dialogue message per CSV row.
  • Data mode: bundled synthetic CSV plus optional CSV upload.
  • Refresh mode: static viewer, no live polling in v1.
  • Probability semantics: six probabilities in [0, 1]; each row must sum to 1.
  • Emotions: joy, warmth, sadness, anger, anxiety, neutral.
  • UI language: Russian.
  • Chunk details: shown inside each message block on hover/focus.

CSV Contract

Required columns:

  • turn_index
  • timestamp
  • sender
  • text
  • joy
  • warmth
  • sadness
  • anger
  • anxiety
  • neutral

Checklist

  • Add dependencies and HF Spaces metadata.
  • Generate deterministic synthetic dialogue CSV.
  • Implement CSV loading and validation.
  • Implement smoothing and Plotly figure generation.
  • Build Gradio Blocks UI.
  • Add focused tests.
  • Run local verification.
  • Commit changes in logical steps.

Commit Log

  • Done: docs: add project plan
  • Done: chore: add gradio dependencies and space config
  • Done: feat: add csv contract and synthetic dialogue
  • Done: feat: build emotion timeline ui
  • Done: test: cover data loading and smoothing
  • Done: docs: update implementation tracker
  • Done: style: refine emotion timeline interface
  • Current: graph supports line/stacked area modes, emotion focus, and a per-message slice chart.

Verification

  • uv run pytest
  • uv run python -m compileall app.py main.py dialog_emo_demo scripts tests
  • uv run python app.py
  • Browser smoke test at http://127.0.0.1:7860

Non-goals For v1

  • Model inference inside the UI.
  • Automatic CSV refresh or file watching.
  • Plot-hover to message-block synchronization.
  • Authentication, persistence, or multi-session state.