Structured output and tools
XML validity
Implemented
structured-output.xml_validityDefinition
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
import evalsuite as es
es.xml_validity(xml_outputs)References
- Extensible Markup Language (XML) 1.0, 5th ed. W3C Recommendation. 2008.