cyanwingsbird's picture
Upload folder using huggingface_hub
a6205d4 verified
Raw
History Blame Contribute Delete
1.39 kB
"""Data model. FROZEN — do not modify in the autoresearch loop."""
from dataclasses import dataclass, field
from typing import List
@dataclass
class Option:
letter: str # 'A' | 'B' | 'C'
wav: str # absolute path to the 24 kHz candidate
feats: dict = field(default_factory=dict)
@dataclass
class Question:
subset: str # 'gigaspeech' | 'meld' | 'emovdb'
qid: str # e.g. 'meld_183_2'
group: str # e.g. 'meld_183'
utterance_text: str # transcript (given) — context only, never a match target
utterance_wav: str # the anchor: speaker emotion is read from here
context: str
reference: str # intended response TEXT (given) — context only
options: List[Option]
@property
def is_tone_variant(self) -> bool:
return self.subset == "emovdb"
@dataclass
class TrainItem:
"""One labelled (utterance, good, bad) triple from the training set."""
dialogue_id: str # group for CV (e.g. 'hit_10040_conv_20080')
subset: str # 'multi_context' | 'multi_emotion'
variant: str # context index '1'/'2' or emotion name
utterance_wav: str
good_wav: str
bad_wav: str
context: str
reference: str
emotion: str # the labelled speaker emotion (when known)