Skip to content
EvalSuite
Documentation menu

Structured output and tools

XML validity

Implementedstructured-output.xml_validity

Definition

Share of outputs that are well-formed XML (one root element); document type declarations are rejected so that untrusted output cannot trigger entity expansion.

Formula

well-formed outputs / outputs

Range: [0, 1]

Inputs and outputs

  • outputs: model outputs (strings)

Returns: MetricResult (float, or per-example array with average=None)

Assumptions

No assumptions beyond valid, aligned inputs of the documented types.

Limitations

No metric-specific limitations are documented yet. Interpret the value alongside the task, data, and other metrics.

Python API

PythonSince v0.4.0
import evalsuite as es

es.xml_validity(xml_outputs)

References

  1. Extensible Markup Language (XML) 1.0, 5th ed. W3C Recommendation. 2008.

Implementation status