CoolFace
Apppublic

analytics-agents-uncertainty/da-code-trajectories-viewer

sourceHugging Faceupdated 8mo agoView on Hugging Face
0likes
App README

๐Ÿ” DA Code Trajectories Viewer

A Streamlit application for visualizing agent trajectories with token-level confidence highlighting. This viewer loads data from a HuggingFace dataset and provides interactive visualizations of model uncertainty.

Features

  • โ€”Token-level Confidence Visualization: Color-coded tokens based on logprobs, entropy, or probability gaps
  • โ€”Advanced Uncertainty Metrics: Entropy, probability gaps between top-k tokens
  • โ€”Window-based Aggregation Analysis: Sliding window analysis to identify uncertainty hotspots
  • โ€”Multiple View Modes:
  • โ€”Steps View: Collapsible step-by-step exploration
  • โ€”Window Analysis: Identify uncertain regions in responses
  • โ€”Full Trajectory: Linear conversation flow with highlighting

Dataset

This viewer loads data from analytics-agents-uncertainty/da-code-evaluation-results HuggingFace dataset.

Local Development

Setup

  1. 1.Create a virtual environment:
bash
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  1. 1.Install dependencies:
bash
pip install -r requirements.txt
  1. 1.Set up your HuggingFace token (for private datasets):
bash
# Create .env file
echo "HF_TOKEN=your_token_here" > .env

Run Locally

bash
streamlit run src/streamlit_app.py

The app will be available at http://localhost:8501

Deployment on HuggingFace Spaces

  1. 1.Create a new Space on HuggingFace with Docker SDK
  2. 2.Push this repository to the Space
  3. 3.Add HF_TOKEN as a secret in Space settings (for private datasets)

The Space will automatically build and deploy using the provided Dockerfile.

Environment Variables

VariableDescriptionRequired
HF_TOKENHuggingFace token for accessing private datasetsYes (for private datasets)

Visualization Legend

  • โ€”๐ŸŸข Green: High confidence (high logprob / low entropy / high prob gap)
  • โ€”๐ŸŸก Yellow: Medium confidence
  • โ€”๐Ÿ”ด Red: Low confidence (low logprob / high entropy / low prob gap)

Colors are dynamically scaled based on each trajectory's actual metric range.