EDAplot (VegaChat)
This repository contains a snapshot of the code used for the paper "Generating and Evaluating Declarative Charts Using Large Language Models".
Usage
Set an OpenAI API key as an env variable and install uv first. If you're unfamiliar with it refer to the environment section.
Run the interactive Streamlit prototype locally with:
uv run python -m streamlit run frontend/app.py
To use the code as a library, look into api.py.
Evaluation
Setup
Download evaluation datasets:
- NLV Corpus is included
- chart-llm should be cloned into
./dataset/:cd dataset git clone https://github.com/hyungkwonko/chart-llm.git cd ..
Benchmarks
Example for running the NLV Corpus benchmark:
uv run python -m scripts.run_benchmark nlv_corpus --dataset_dir dataset/nlv_corpus --output_path out/benchmarks
Run the interactive results report with:
uv run python -m streamlit run benchmark/reports/vega_chat_benchmark_report.py out/benchmarks
where out is the path to the directory containing the saved outputs.
Evals
Our set of custom test cases (evals) are defined as yaml files.
Each eval specifies the actions to take and the checks to perform after each action.
Run the evals with:
uv run python -m scripts.run_benchmark evals --output_path out/evals
Run the interactive results report with:
uv run python -m streamlit run benchmark/reports/evals_report.py out/evals
where out is the path to the directory containing the saved outputs.
Update existing results with new checks using:
uv run python -m scripts.run_eval_checks out/evals/
Request Analyzer
Run the request analyzer benchmark with:
uv run python -m scripts.run_request_analyzer_benchmark --dataset_dir dataset/chart-llm --take_n 180 --output_path out/request_analyzer_benchmark/ chart_llm_gold
View the results with:
uv run python -m streamlit run benchmark/reports/request_analyzer_benchmark_report.py out/request_analyzer_benchmark/
LLM as a judge
Vision Judge
The vision judge uses a multimodal LLM to compare the generated image to the reference image. It can be used to compare results from different plotting libraries (e.g., matplotlib and Vega-Lite).
To run the vision judge evaluation on existing outputs use:
uv run python -m scripts.run_vision_judge example.jsonl
or use the --vision_judge flag together with scripts/run_benchmark.py
Vision Judge Benchmark
To evaluate the vision judge, we use a separate benchmark.
Run it with:
uv run python -m scripts.run_vision_judge_benchmark
View the results with:
uv run python -m streamlit run benchmark/reports/vision_judge_benchmark_report.py out/vision_judge_benchmark/
Correlation with Human Judgments
To measure the correlation between the human judgments and different metrics requires running:
- vision_judge_human_eval.py to generate an evaluation dataset
- human_eval_db.py to store the evaluation dataset in a Postgres database
- vision_judge_human_eval_app.py to run the interactive evaluation environment
LIDA Self-Evaluation
LIDA's self-evaluation can be run with:
uv run python -m scripts.run_lida_self_eval example.jsonl
Configuring dev environment
- Install uv
- Install dependencies:
uv sync - Enable pre-commit:
uv run pre-commit install
- Add OpenAI API key to the env variable
OPENAI_API_KEY
Run tests with:
uv run pytest tests -v
uv run pytest tests -v -m "not external_data" # To skip tests that require external data
For some tests you need to first download the Evaluation datasets.
Publishing
To publish a new release to PyPI:
git tag -a v0.1.2 -m v0.1.2andgit push --tags. This sets the package version dynamically.- The publish.yml workflow will trigger when a new version tag is pushed.
Docker
Build the image and run the container:
docker build -f frontend.Dockerfile -t edaplot .
docker run --rm -p 8501:8501 -e OPENAI_API_KEY -t edaplot
Metadata
Release files for edaplot-vl 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| edaplot_vl-0.1.4.tar.gz | 45.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| edaplot_vl-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 99.3 kB
Release files / edaplot_vl-0.1.4.tar.gz
| Download URL | edaplot_vl-0.1.4.tar.gz |
|---|---|
| Size | 45.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9dc6944718fc1512d9949c44898f14c40848e18f78a7d4cae68c5d02d3ae00d8
|
|
BLAKE2b-256 checksum How to use checksums |
d85f18991d7e50ab86c82bfcff2452f967e4f87d68666a23e52731d7779d6a09
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.5
|
Release files / edaplot_vl-0.1.4-py3-none-any.whl
| Download URL | edaplot_vl-0.1.4-py3-none-any.whl |
|---|---|
| Size | 53.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
255a346ce8755ab318295b836b98b088fc9eeb5d492ad7b1754935271b303b49
|
|
BLAKE2b-256 checksum How to use checksums |
a0419fe1d05772b9d8cd2ab6978c80d7fb2946df7c6c198501e29cf9cd670283
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.5
|
Security for edaplot-vl 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.