analytics-agents-uncertainty/da-code-trajectories-viewer
0
๐ 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
- Create a virtual environment:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Set up your HuggingFace token (for private datasets):
# Create .env file
echo "HF_TOKEN=your_token_here" > .envRun Locally
streamlit run src/streamlit_app.pyThe app will be available at http://localhost:8501
Deployment on HuggingFace Spaces
- Create a new Space on HuggingFace with Docker SDK
- Push this repository to the Space
- Add
HF_TOKENas a secret in Space settings (for private datasets)
The Space will automatically build and deploy using the provided Dockerfile.
Environment Variables
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.
