Skip to content
OATSCHEMA

Docs / Schemas / classification / 0.7.0

Classification 0.7.0

Represent the result of a classification. Supports predicted labels, confidence scores, and vocabulary.

This is an older version of classification.

The latest version is 0.8.0.

$id
https://oatschema.org/0.7.0/classification
Latest
https://oatschema.org/classification
Versions
Source
v0.7.0 on GitHub

Schema

classification.json Raw
{    "x-license": {        "id": "Apache-2.0",        "notice": "Copyright 2025-2026 Dorsal Hub LTD",        "url": "https://github.com/oatschema/oats/blob/main/LICENSE"    },    "$schema": "https://json-schema.org/draft/2020-12/schema",    "$id": "https://oatschema.org/0.7.0/classification",    "title": "Classification",    "version": "0.7.0",    "description": "Represent the result of a classification. Supports predicted labels, confidence scores, and vocabulary.",    "type": "object",    "properties": {        "target": {            "type": "string",            "description": "The name of or a reference to the variable being classified (e.g., 'sentiment', 'topic').",            "maxLength": 256        },        "producer": {            "type": "string",            "description": "The creator (model, tool or author) of this classification.",            "maxLength": 1024        },        "score_explanation": {            "type": "string",            "description": "A brief explanation of what the score represents (e.g., 'Model confidence probability [0, 1]', 'Sentiment score [-1, 1]').",            "maxLength": 256        },        "vocabulary": {            "type": "array",            "description": "A list of the possible labels in this classification scheme. For more than 100 labels, use 'vocabulary_url'.",            "maxItems": 100,            "uniqueItems": true,            "items": {                "type": "string",                "description": "A single valid label from the vocabulary.",                "maxLength": 128            }        },        "vocabulary_url": {            "type": "string",            "description": "A URL pointing to a more detailed external vocabulary or ontology.",            "format": "uri",            "maxLength": 2048        },        "labels": {            "type": "array",            "description": "An array of labels applied to the file. Can be empty if no labels match.",            "maxItems": 10000,            "minItems": 0,            "items": {                "type": "object",                "properties": {                    "label": {                        "type": "string",                        "description": "The predicted label. Must be a member of 'vocabulary' when it is present.",                        "maxLength": 128                    },                    "score": {                        "type": "number",                        "description": "A normalized score for this label (-1.0 to 1.0). Depending on the use case, this may represent a probability (0 to 1) or a bipolar metric like sentiment (-1 to 1).",                        "minimum": -1,                        "maximum": 1                    },                    "timestamp": {                        "type": "string",                        "format": "date-time",                        "maxLength": 128,                        "description": "The specific time this label applies to. Used for discrete time-series or state logging."                    },                    "attributes": {                        "type": "object",                        "description": "Additional metadata about this specific label.",                        "maxProperties": 16,                        "propertyNames": {                            "maxLength": 128                        },                        "additionalProperties": {                            "anyOf": [                                {                                    "type": "string",                                    "maxLength": 1024                                },                                {                                    "type": "number"                                },                                {                                    "type": "boolean"                                },                                {                                    "type": "null"                                }                            ]                        }                    }                },                "required": [                    "label"                ],                "additionalProperties": false            }        },        "attributes": {            "type": "object",            "description": "Arbitrary metadata relevant to this classification.",            "maxProperties": 16,            "propertyNames": {                "maxLength": 128            },            "additionalProperties": {                "anyOf": [                    {                        "type": "string",                        "maxLength": 1024                    },                    {                        "type": "number"                    },                    {                        "type": "boolean"                    },                    {                        "type": "null"                    }                ]            }        }    },    "required": [        "labels"    ],    "allOf": [        {            "if": {                "properties": {                    "labels": {                        "maxItems": 0                    }                },                "required": [                    "labels"                ]            },            "then": {                "anyOf": [                    {                        "required": [                            "vocabulary"                        ]                    },                    {                        "required": [                            "vocabulary_url"                        ]                    },                    {                        "required": [                            "producer"                        ]                    }                ]            }        }    ],    "additionalProperties": false}

Examples

Records that pass validation against this schema.

classification-1
classification-1.json
{  "score_explanation": "Model confidence probability, where 1.0 is 100% confident.",  "vocabulary": [      "animal",      "cat",      "dog",      "house",      "vehicle"  ],  "labels": [    {      "label": "animal",      "score": 0.98    },    {      "label": "cat",      "score": 0.95    },    {      "label": "house",      "score": 0.75    }  ]}

Fields

  • target string

    The name of or a reference to the variable being classified (e.g., 'sentiment', 'topic').

    • at most 256 characters
  • producer string

    The creator (model, tool or author) of this classification.

    • at most 1024 characters
  • score_explanation string

    A brief explanation of what the score represents (e.g., 'Model confidence probability [0, 1]', 'Sentiment score [-1, 1]').

    • at most 256 characters
  • vocabulary array of string

    A list of the possible labels in this classification scheme. For more than 100 labels, use 'vocabulary_url'.

    Each item: A single valid label from the vocabulary.

    • at most 100 items
    • items must be unique
    • each at most 128 characters
  • vocabulary_url string

    A URL pointing to a more detailed external vocabulary or ontology.

    • at most 2048 characters
    • format uri
  • labels array of object required

    An array of labels applied to the file. Can be empty if no labels match.

    • 0 to 10000 items
    • label string required

      The predicted label. Must be a member of 'vocabulary' when it is present.

      • at most 128 characters
    • score number

      A normalized score for this label (-1.0 to 1.0). Depending on the use case, this may represent a probability (0 to 1) or a bipolar metric like sentiment (-1 to 1).

      • -1 to 1
    • timestamp string

      The specific time this label applies to. Used for discrete time-series or state logging.

      • at most 128 characters
      • format date-time
    • attributes object

      Additional metadata about this specific label.

      • at most 16 properties
      • keys at most 128 characters
      • * string | number | boolean | null

        Any other key.

        • string: at most 1024 characters
  • attributes object

    Arbitrary metadata relevant to this classification.

    • at most 16 properties
    • keys at most 128 characters
    • * string | number | boolean | null

      Any other key.

      • string: at most 1024 characters

Rules:

  • When labels is empty: at least one of vocabulary, vocabulary_url, producer must be present.
    Show the JSON Schema
    {  "if": {    "properties": {      "labels": {        "maxItems": 0      }    },    "required": [      "labels"    ]  },  "then": {    "anyOf": [      {        "required": [          "vocabulary"        ]      },      {        "required": [          "vocabulary_url"        ]      },      {        "required": [          "producer"        ]      }    ]  }}

Copyright 2025-2026 Dorsal Hub LTD. Licensed under Apache-2.0.