File size: 2,158 Bytes
46e27b5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
"""
Canonical data models for Vox Dictation Refinement dataset.
Governed by GOAL.md and AGENTS.md.
Single-model non-autoregressive span extraction with single label: "speech disfluency".
"""

from typing import List, Literal, Optional, Tuple
from pydantic import BaseModel, Field


class RawCandidate(BaseModel):
    """Raw output from Generator LLM: only the corrupted sentence and added disfluent spans."""
    raw_text: str = Field(description="The full corrupted spoken utterance")
    clean_text: str = Field(description="The original clean sentence")
    disfluent_spans: List[str] = Field(
        default_factory=list,
        description="Exact substrings added into raw_text (fillers, false starts, retractions) to excise"
    )


class Span(BaseModel):
    """Character-level span representation with verified offsets."""
    label: Literal["speech disfluency"] = "speech disfluency"
    span: Tuple[int, int] = Field(description="Exact [start, end] character offsets in raw_text")
    text: str = Field(description="Exact substring in raw_text slice")
    confidence: float = Field(default=1.0, ge=0.0, le=1.0)
    origin: Optional[str] = Field(
        default=None,
        description=(
            "PROVENANCE ONLY, never a training signal. Which gold annotation produced "
            "this span: 'region:D' (disfluency), 'region:E' (edit/self-repair), "
            "'region:F' (Tier-1 filled pause), 'correction' (the '[A, +B]' spurious->"
            "repair group), 'synthetic:<archetype>' (LLM corruption), or None for "
            "hand-written data. Used to stratify and audit the dataset mixture."
        ),
    )


class DatasetExample(BaseModel):
    """Canonical Unified JSONL Example for Training and Evaluation."""
    id: str
    category: Literal["CLEAN", "DISFLUENCY"]
    raw_text: str
    clean_text: str
    spans: List[Span] = Field(default_factory=list)


class AuditVerdict(BaseModel):
    """Zero-temperature Judge audit result for an individual candidate."""
    id: str
    verdict: Literal["PASS", "FAIL"]
    category_accurate: bool
    no_false_deletions: bool
    number_entity_preserved: bool
    reason: str