Spaces:
Sleeping
Sleeping
| from dataclasses import dataclass | |
| from typing import Protocol, runtime_checkable | |
| class ASRResult: | |
| text: str | |
| confidence: float | |
| class GlossaryEntry: | |
| term_vi: str | |
| term_en: str | |
| kind: str | |
| lasa_group: str | None = None | |
| class MTResult: | |
| text: str | |
| confidence: float | |
| class CriticalEntity: | |
| kind: str | |
| source_text: str | |
| translated_text: str | |
| class Review: | |
| back_translation: str | |
| entities: list[CriticalEntity] | |
| flags: list[str] | |
| class ProviderOutputError(RuntimeError): | |
| """Provider returned malformed or unsafe output.""" | |
| class ASRProvider(Protocol): | |
| def transcribe(self, audio: bytes, lang: str) -> ASRResult: ... | |
| class MTProvider(Protocol): | |
| def translate( | |
| self, | |
| text: str, | |
| src: str, | |
| tgt: str, | |
| glossary_hits: list[GlossaryEntry], | |
| ) -> MTResult: ... | |
| class ReviewerProvider(Protocol): | |
| def review(self, source: str, translation: str, src: str, tgt: str) -> Review: ... | |