MCPcopy Create free account
hub / github.com/espnet/espnet / __init__

Method __init__

espnet2/train/preprocessor.py:2494–2562  ·  view source on GitHub ↗
(
        self,
        train: bool,
        token_type: Optional[str] = None,
        token_list: Union[Path, str, Iterable[str]] = None,
        bpemodel: Union[Path, str, Iterable[str]] = None,
        text_cleaner: Collection[str] = None,
        g2p_type: Optional[str] = None,
        unk_symbol: str = "<unk>",
        space_symbol: str = "<space>",
        non_linguistic_symbols: Union[Path, str, Iterable[str]] = None,
        delimiter: Optional[str] = None,
        rir_scp: Optional[str] = None,
        rir_apply_prob: float = 1.0,
        noise_scp: Optional[str] = None,
        noise_apply_prob: float = 1.0,
        noise_db_range: str = "3_10",
        short_noise_thres: float = 0.5,
        speech_volume_normalize: float = None,
        speech_name: str = "speech",
        text_name: str = "text",
        text_prev_name: str = "text_prev",
        text_ctc_name: str = "text_ctc",
        fs: int = 16000,
        na_symbol: str = "<na>",  # text is not available e.g. for prev or ctc
        speech_length: float = 30,  # pad or trim speech to this value in seconds
        speech_resolution: float = 0.02,  # speech time resolution
        speech_init_silence: float = 1.0,  # max silence before speech for data aug
        text_prev_apply_prob: float = 0.5,  # whether to condition on text_prev
        time_apply_prob: float = 0.5,  # whether to include timestamps
        notime_symbol: str = "<notimestamps>",
        first_time_symbol: str = "<0.00>",
        last_time_symbol: str = "<30.00>",
    )

Source from the content-addressed store, hash-verified

2492
2493class S2TPreprocessor(CommonPreprocessor):
2494 def __init__(
2495 self,
2496 train: bool,
2497 token_type: Optional[str] = None,
2498 token_list: Union[Path, str, Iterable[str]] = None,
2499 bpemodel: Union[Path, str, Iterable[str]] = None,
2500 text_cleaner: Collection[str] = None,
2501 g2p_type: Optional[str] = None,
2502 unk_symbol: str = "<unk>",
2503 space_symbol: str = "<space>",
2504 non_linguistic_symbols: Union[Path, str, Iterable[str]] = None,
2505 delimiter: Optional[str] = None,
2506 rir_scp: Optional[str] = None,
2507 rir_apply_prob: float = 1.0,
2508 noise_scp: Optional[str] = None,
2509 noise_apply_prob: float = 1.0,
2510 noise_db_range: str = "3_10",
2511 short_noise_thres: float = 0.5,
2512 speech_volume_normalize: float = None,
2513 speech_name: str = "speech",
2514 text_name: str = "text",
2515 text_prev_name: str = "text_prev",
2516 text_ctc_name: str = "text_ctc",
2517 fs: int = 16000,
2518 na_symbol: str = "<na>", # text is not available e.g. for prev or ctc
2519 speech_length: float = 30, # pad or trim speech to this value in seconds
2520 speech_resolution: float = 0.02, # speech time resolution
2521 speech_init_silence: float = 1.0, # max silence before speech for data aug
2522 text_prev_apply_prob: float = 0.5, # whether to condition on text_prev
2523 time_apply_prob: float = 0.5, # whether to include timestamps
2524 notime_symbol: str = "<notimestamps>",
2525 first_time_symbol: str = "<0.00>",
2526 last_time_symbol: str = "<30.00>",
2527 ):
2528 super().__init__(
2529 train=train,
2530 token_type=token_type,
2531 token_list=token_list,
2532 bpemodel=bpemodel,
2533 text_cleaner=text_cleaner,
2534 g2p_type=g2p_type,
2535 unk_symbol=unk_symbol,
2536 space_symbol=space_symbol,
2537 non_linguistic_symbols=non_linguistic_symbols,
2538 delimiter=delimiter,
2539 rir_scp=rir_scp,
2540 rir_apply_prob=rir_apply_prob,
2541 noise_scp=noise_scp,
2542 noise_apply_prob=noise_apply_prob,
2543 noise_db_range=noise_db_range,
2544 short_noise_thres=short_noise_thres,
2545 speech_volume_normalize=speech_volume_normalize,
2546 speech_name=speech_name,
2547 text_name=text_name,
2548 fs=fs,
2549 )
2550 self.text_prev_name = text_prev_name
2551 self.text_ctc_name = text_ctc_name

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected