Weksa/schemas/cultnet/weksa.corpus_item.schema.json

247 lines
5.7 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "CorpusItem",
"description": "Key: `item:<source-slug>:<n>`.",
"type": "object",
"properties": {
"admitted_on": {
"type": "string"
},
"group": {
"description": "The unit the split hashes: a scene, a fixture, a work.",
"type": "string"
},
"id": {
"type": "string"
},
"language": {
"type": "string"
},
"names": {
"description": "Which entities the text names, and where. Fixed with the text at intake.",
"type": "array",
"items": {
"$ref": "#/$defs/NameSpan"
}
},
"prior_turns": {
"type": "array",
"items": {
"$ref": "#/$defs/Turn"
}
},
"source": {
"$ref": "#/$defs/Source"
},
"speaker": {
"$ref": "#/$defs/EntityId"
},
"supersedes": {
"description": "Key of the item this one corrects.",
"type": [
"string",
"null"
]
},
"text": {
"type": "string"
},
"withdrawn": {
"type": "boolean"
}
},
"required": [
"id",
"text",
"language",
"speaker",
"group",
"prior_turns",
"source",
"admitted_on",
"withdrawn",
"names"
],
"$defs": {
"EntityId": {
"type": "string",
"pattern": "^entity:[a-z0-9]([a-z0-9-]{0,46}[a-z0-9])?$"
},
"ModelFamily": {
"description": "The family of the model that wrote a line.",
"oneOf": [
{
"type": "string",
"enum": [
"Anthropic",
"OpenAi",
"Google",
"Alibaba",
"Meta",
"Mistral"
]
},
{
"description": "Nothing records which family wrote the line.",
"type": "string",
"const": "Unrecorded"
}
]
},
"NameSpan": {
"description": "A byte range `[start, end)` of an item's text that names an entity. The\nstore admits it only when both ends sit on extended grapheme cluster\nboundaries (UAX #29) of the NFC text and the range's bytes equal one of the\nentity's forms in the item's language.",
"type": "object",
"properties": {
"end": {
"type": "integer",
"format": "uint32",
"minimum": 0
},
"entity": {
"$ref": "#/$defs/EntityId"
},
"start": {
"type": "integer",
"format": "uint32",
"minimum": 0
}
},
"required": [
"entity",
"start",
"end"
]
},
"Source": {
"oneOf": [
{
"type": "string",
"enum": [
"OperatorWritten"
]
},
{
"description": "A line from a cast member's hand-authored fixture.",
"type": "object",
"properties": {
"CastAuthored": {
"type": "object",
"properties": {
"fixture": {
"type": "string"
},
"persona": {
"type": "string"
}
},
"required": [
"persona",
"fixture"
]
}
},
"additionalProperties": false,
"required": [
"CastAuthored"
]
},
{
"type": "object",
"properties": {
"OperatorApproved": {
"type": "object",
"properties": {
"note": {
"type": "string"
}
},
"required": [
"note"
]
}
},
"additionalProperties": false,
"required": [
"OperatorApproved"
]
},
{
"type": "object",
"properties": {
"PublicDomain": {
"type": "object",
"properties": {
"author": {
"type": "string"
},
"edition_url": {
"type": "string"
},
"work": {
"type": "string"
}
},
"required": [
"work",
"author",
"edition_url"
]
}
},
"additionalProperties": false,
"required": [
"PublicDomain"
]
},
{
"description": "Labelled model output; never in the test split, never judged by its own family.\n`family` is `Unrecorded` when nothing records one. `generator` is the\nstring the fixture or run wrote, kept verbatim.",
"type": "object",
"properties": {
"ModelWritten": {
"type": "object",
"properties": {
"family": {
"$ref": "#/$defs/ModelFamily"
},
"generator": {
"type": [
"string",
"null"
]
},
"prompt_digest": {
"type": [
"string",
"null"
]
}
},
"required": [
"family"
]
}
},
"additionalProperties": false,
"required": [
"ModelWritten"
]
}
]
},
"Turn": {
"type": "object",
"properties": {
"speaker": {
"$ref": "#/$defs/EntityId"
},
"text": {
"type": "string"
}
},
"required": [
"speaker",
"text"
]
}
}
}