readability
Is the output readable for the intended audience?
YAML config
yaml
assertions:
- type: readabilityTypeScript usage
typescript
import { runEvaluation } from "@evalguard/core";
const result = await runEvaluation({
model: "gpt-4o",
prompt: "{{input}}",
cases: [
{ input: "..." },
],
scorers: ["readability"],
callLLM: async (prompt) => callYourModel(prompt),
});When to use
Use the readability scorer when assessing text intended for a general audience, particularly in educational or informational contexts. It is ideal for evaluating content aimed at middle to high school students, contrasting with more specialized scorers like 'technical' or 'academic' which cater to expert audiences.
False-positive patterns
- Highly technical documents may receive a low readability score despite being well-structured for their audience. To handle this, consider using the 'technical' scorer for such content.
- Creative writing or poetry may also score poorly on readability due to stylistic choices. In these cases, it's advisable to use the 'creative' scorer to better reflect the intended audience engagement.
Threshold guidance
Aim for a score of 1.0 for texts within the grade 6-12 range. If the score drops below 0.5 or exceeds 1.5, consider revising the text for clarity or complexity based on your target audience.
Worked example
This example demonstrates how to evaluate a simple sentence for its readability score.
yaml
- text: 'This is a sample sentence to evaluate.'
expected: 1.0typescript
import { runEvaluation } from '@evalguard/core';
const result = await runEvaluation({
model: 'gpt-4o',
prompt: '{{input}}',
cases: [{ input: '...', expectedOutput: '...' }],
scorers: ['readability'],
callLLM: async (prompt) => callYourModel(prompt),
});LLM-generated (llm-gpt-4o) · 2026-05-23