UniversalLabeler / schemas /universal-translation.schema.json
itspublu's picture
Release UniversalLabeler 1.0 data, schemas, examples, and rubrics
d4558b2 verified
Raw
History Blame Contribute Delete
8.76 kB
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://huggingface.co/datasets/egobowwow/egobowwow-1k/resolve/v1.1.0/schemas/universal-translation.schema.json",
"title": "EgoBowWow UniversalLabeler translation envelope",
"description": "A source-preserving translation, grounded universal event graph, projection-loss audit, deterministic trace, and optional provider-neutral teacher proposal.",
"type": "object",
"additionalProperties": false,
"required": [
"$schema",
"schema_version",
"profile_bundle_id",
"profile_bundle_digest",
"source_language_id",
"target_language_id",
"status",
"requires_review",
"target_label",
"universal_semantics",
"loss_report",
"translation_trace",
"teacher_proposal",
"translation_id"
],
"properties": {
"$schema": {"const": "../../schemas/universal-translation.schema.json"},
"schema_version": {"const": "1.1.0"},
"profile_bundle_id": {"$ref": "#/$defs/id"},
"profile_bundle_digest": {"$ref": "#/$defs/sha256"},
"source_language_id": {"$ref": "#/$defs/id"},
"target_language_id": {"$ref": "#/$defs/id"},
"status": {"enum": ["translated", "abstained"]},
"requires_review": {"type": "boolean"},
"target_label": {"type": "object"},
"universal_semantics": {"$ref": "#/$defs/universalSemantics"},
"loss_report": {
"type": "array",
"items": {"$ref": "#/$defs/lossItem"}
},
"translation_trace": {
"type": "array",
"items": {"$ref": "#/$defs/traceItem"}
},
"teacher_proposal": {
"oneOf": [
{"type": "null"},
{"$ref": "#/$defs/teacherProposal"}
]
},
"translation_id": {
"type": "string",
"pattern": "^translation:sha256:[0-9a-f]{64}$"
}
},
"$defs": {
"id": {"type": "string", "pattern": "^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$"},
"sha256": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"},
"mappingRelation": {
"enum": [
"exact_match",
"close_match",
"broad_match",
"narrow_match",
"related_match",
"composite",
"contextual",
"unmapped"
]
},
"predicate": {
"type": "object",
"additionalProperties": false,
"required": ["source_surface", "concept_id", "mapping_relation"],
"properties": {
"source_surface": {"type": ["string", "null"]},
"concept_id": {
"oneOf": [
{"type": "null"},
{"$ref": "#/$defs/id"}
]
},
"mapping_relation": {"$ref": "#/$defs/mappingRelation"}
}
},
"argument": {
"type": "object",
"additionalProperties": false,
"required": ["role", "surface", "concept_id", "mapping_relation"],
"properties": {
"role": {"enum": ["patient", "instrument", "source", "destination"]},
"surface": {},
"concept_id": {
"oneOf": [{"type": "null"}, {"$ref": "#/$defs/id"}]
},
"mapping_relation": {"$ref": "#/$defs/mappingRelation"}
}
},
"temporal": {
"type": "object",
"additionalProperties": false,
"required": ["interval_semantics", "start_ns", "end_ns"],
"properties": {
"interval_semantics": {"const": "half_open"},
"start_ns": {"type": "integer", "minimum": 0},
"end_ns": {"type": "integer", "minimum": 1}
}
},
"stateTransition": {
"type": "object",
"additionalProperties": false,
"required": ["before", "after"],
"properties": {"before": {}, "after": {}}
},
"event": {
"type": "object",
"additionalProperties": false,
"required": [
"predicate",
"arguments",
"goal",
"task",
"state_transition",
"outcome",
"correctness",
"error",
"hands",
"temporal"
],
"properties": {
"predicate": {"$ref": "#/$defs/predicate"},
"arguments": {"type": "array", "items": {"$ref": "#/$defs/argument"}},
"goal": {},
"task": {},
"state_transition": {
"oneOf": [{"type": "null"}, {"$ref": "#/$defs/stateTransition"}]
},
"outcome": {},
"correctness": {},
"error": {},
"hands": {"type": "array"},
"temporal": {
"oneOf": [{"type": "null"}, {"$ref": "#/$defs/temporal"}]
}
}
},
"speech": {
"type": "object",
"additionalProperties": false,
"required": [
"verbatim",
"language_tag",
"speech_act",
"register",
"manner",
"purpose",
"polarity",
"aspect",
"modality",
"politeness",
"honorific",
"code_switch_spans"
],
"properties": {
"verbatim": {},
"language_tag": {"type": ["string", "null"]},
"speech_act": {},
"register": {},
"manner": {},
"purpose": {},
"polarity": {},
"aspect": {},
"modality": {},
"politeness": {},
"honorific": {},
"code_switch_spans": {"type": "array"}
}
},
"preservation": {
"type": "object",
"additionalProperties": false,
"required": ["source_language_id", "source_label", "source_label_digest"],
"properties": {
"source_language_id": {"$ref": "#/$defs/id"},
"source_label": {"type": "object", "minProperties": 1},
"source_label_digest": {"$ref": "#/$defs/sha256"}
}
},
"universalSemantics": {
"type": "object",
"additionalProperties": false,
"required": ["uls_version", "event", "speech", "grounding", "preservation"],
"properties": {
"uls_version": {"const": "1.1.0"},
"event": {"$ref": "#/$defs/event"},
"speech": {"$ref": "#/$defs/speech"},
"grounding": {"type": ["object", "null"]},
"preservation": {"$ref": "#/$defs/preservation"}
},
"allOf": [
{
"if": {"properties": {"grounding": {"type": "object"}}},
"then": {"properties": {"grounding": {"$ref": "grounded-label-graph.schema.json"}}}
}
]
},
"lossItem": {
"type": "object",
"additionalProperties": false,
"required": ["dimension", "severity", "kind", "detail"],
"properties": {
"dimension": {
"enum": [
"accuracy",
"terminology",
"speech",
"temporal",
"provenance",
"linguistic_conventions",
"style",
"locale"
]
},
"severity": {"enum": ["info", "warning", "blocking"]},
"kind": {"$ref": "#/$defs/id"},
"source_slot": {"$ref": "#/$defs/id"},
"source_field": {"type": "string", "minLength": 1},
"detail": {"type": "string", "minLength": 1}
}
},
"traceItem": {
"type": "object",
"additionalProperties": false,
"required": ["operation"],
"properties": {
"operation": {
"enum": [
"extract",
"shallow_text_parse",
"controlled_text_parse",
"canonical_packet_ingest",
"lexical_map",
"entity_lexical_map",
"surface_generate",
"teacher_escalation"
]
},
"slot": {"$ref": "#/$defs/id"},
"source_paths": {"type": "array", "items": {"type": "string"}},
"value_digest": {"$ref": "#/$defs/sha256"},
"method": {"type": "string"},
"source_lexeme": {"type": "string"},
"concept_id": {"$ref": "#/$defs/id"},
"mapping_relation": {"$ref": "#/$defs/mappingRelation"},
"rule_id": {"$ref": "#/$defs/id"},
"decision": {"enum": ["map", "abstain"]},
"response_digest": {"$ref": "#/$defs/sha256"}
}
},
"teacherProposal": {
"type": "object",
"additionalProperties": false,
"required": [
"decision",
"concept_id",
"confidence",
"rationale",
"model",
"response_digest",
"authority",
"target_text"
],
"properties": {
"decision": {"enum": ["map", "abstain"]},
"concept_id": {
"oneOf": [{"type": "null"}, {"$ref": "#/$defs/id"}]
},
"confidence": {"type": "number", "minimum": 0, "maximum": 1},
"rationale": {"type": "string", "minLength": 1},
"model": {"type": "string", "minLength": 1},
"response_digest": {"$ref": "#/$defs/sha256"},
"authority": {"const": "proposal_only_requires_independent_review"},
"target_text": {"type": ["string", "null"], "minLength": 1}
}
}
}
}