Definition
The JSON score test measures how close the output is to a valid JSON format, evaluating the structural correctness of generated JSON data.Taxonomy
- Task types: LLM.
- Availability: and .
Why it matters
- JSON score is crucial for applications that require structured data output, such as API responses, configuration files, or data extraction tasks.
- This metric helps ensure that your LLM generates properly formatted JSON that can be parsed and used by downstream systems.
- It’s particularly important for applications where malformed JSON could cause system failures or data processing errors.
Required columns
To compute this metric, your dataset must contain the following columns:- Outputs: The generated text from your LLM (expected to be JSON format)
This metric evaluates the structural validity of JSON output and doesn’t
require ground truth data for comparison.
Test configuration examples
If you are writing atests.json
, here are a few valid configurations for the JSON score test:
Related
- Exact match test - Assess identical string matches.
- Edit distance test - Measure character-level similarity.
- Aggregate metrics - Overview of all available metrics.