{
  "$defs": {
    "CoverFields": {
      "properties": {
        "roll": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Roll"
        },
        "registration": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Registration"
        },
        "subject_code": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Subject Code"
        }
      },
      "title": "CoverFields",
      "type": "object"
    },
    "Element": {
      "properties": {
        "type": {
          "enum": [
            "line",
            "heading",
            "equation",
            "chem",
            "figure",
            "table",
            "label"
          ],
          "title": "Type",
          "type": "string"
        },
        "bbox": {
          "anyOf": [
            {
              "items": {
                "type": "number"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "[x0,y0,x1,y1] normalized 0..1, approximate",
          "title": "Bbox"
        },
        "text": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Verbatim text. For 'heading': the raw label as written.",
          "title": "Text"
        },
        "latex": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Latex"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "For figure/table: what is actually drawn.",
          "title": "Description"
        },
        "table": {
          "anyOf": [
            {
              "items": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Table"
        },
        "lang": {
          "items": {
            "enum": [
              "bn",
              "en",
              "ar"
            ],
            "type": "string"
          },
          "title": "Lang",
          "type": "array"
        },
        "confidence": {
          "maximum": 1,
          "minimum": 0,
          "title": "Confidence",
          "type": "number"
        },
        "flags": {
          "items": {
            "enum": [
              "struck",
              "inserted",
              "uncertain",
              "illegible",
              "rough"
            ],
            "type": "string"
          },
          "title": "Flags",
          "type": "array"
        },
        "candidates": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Up to 3 alternative readings when uncertain",
          "title": "Candidates"
        }
      },
      "required": [
        "type",
        "confidence"
      ],
      "title": "Element",
      "type": "object"
    }
  },
  "properties": {
    "kind": {
      "enum": [
        "cover",
        "answer",
        "supplementary",
        "rough",
        "blank",
        "unreadable"
      ],
      "title": "Kind",
      "type": "string"
    },
    "cover": {
      "anyOf": [
        {
          "$ref": "#/$defs/CoverFields"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "legibility": {
      "maximum": 10,
      "minimum": 0,
      "title": "Legibility",
      "type": "integer"
    },
    "elements": {
      "items": {
        "$ref": "#/$defs/Element"
      },
      "title": "Elements",
      "type": "array"
    },
    "notes": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Notes"
    }
  },
  "required": [
    "kind",
    "legibility"
  ],
  "title": "ExtractionPage",
  "type": "object"
}