Abstract base class for dataset loaders. Defines the common interface for all dataset loaders in the evaluation pipeline. Each concrete loader implements dataset-specific logic for loading audio files and their corresponding transcripts. Attributes: root_dir (str): Root dir
| 281 | |
| 282 | |
| 283 | class BaseDatasetLoader(ABC): |
| 284 | """Abstract base class for dataset loaders. |
| 285 | |
| 286 | Defines the common interface for all dataset loaders in the evaluation pipeline. |
| 287 | Each concrete loader implements dataset-specific logic for loading audio files |
| 288 | and their corresponding transcripts. |
| 289 | |
| 290 | Attributes: |
| 291 | root_dir (str): Root directory containing the dataset files |
| 292 | |
| 293 | Methods: |
| 294 | load: Abstract method to load dataset audio files and transcripts |
| 295 | """ |
| 296 | |
| 297 | def __init__(self, root_dir: str): |
| 298 | """Initialize the dataset loader with root directory. |
| 299 | |
| 300 | Args: |
| 301 | root_dir (str): Path to the root directory containing dataset files |
| 302 | """ |
| 303 | self.root_dir = root_dir |
| 304 | |
| 305 | @abstractmethod |
| 306 | def load(self) -> Tuple[list, list]: |
| 307 | """Load audio files and transcripts from the dataset. |
| 308 | |
| 309 | Returns: |
| 310 | Tuple[list, list]: A tuple containing: |
| 311 | - List of audio file paths or AudioSegment objects |
| 312 | - List of corresponding transcript strings |
| 313 | |
| 314 | Raises: |
| 315 | NotImplementedError: If not implemented by concrete subclass |
| 316 | """ |
| 317 | pass |
| 318 | |
| 319 | |
| 320 | class LibrispeechLoader(BaseDatasetLoader): |
nothing calls this directly
no outgoing calls
no test coverage detected