Skip to content
OATSCHEMA

Documentation

OATS (Open Annotation Task Schemas) is a collection of strict, versioned JSON schemas, defining and validating the structured outputs of machine learning models, workflow steps and annotation.

Why OATS suits model outputs

Quick start

Install the package for your language and validate a record. Every package bundles the schemas, so validation never touches the network.

1Install

pip install 'oatschema[validate]'

The validate extra adds native validation with jsonschema-rs. Without it, pip install oatschema gives you the schemas alone, with no dependencies.

2Validate a record

Python
import oatschemarecord = {"labels": [{"label": "cat", "score": 0.92}]}oatschema.validate(record, "classification")  # passesbad = {"labels": [{"label": "cat", "score": 1.5}]}oatschema.is_valid(bad, "classification")  # Falseoatschema.validate(bad, "classification")# raises oatschema.ValidationError: classification 0.8.0 at /labels/0/score: … is greater than the maximum of 1

Read the Python guide

Reference

audio-transcriptionclassificationdocument-extractionembeddingentity-extractiongenericgeolocationllm-outputobject-detectionrankingregressiontemporal-segmentation