MCPcopy Create free account
hub / github.com/modelscope/FunASR / __init__

Method __init__

funasr/models/transducer/model.py:49–188  ·  view source on GitHub ↗

Initialize Transducer. Args: frontend: Audio frontend for feature extraction. frontend_conf: Configuration dict for frontend. specaug: TODO. specaug_conf: Configuration dict for specaug. normalize: T

(
        self,
        frontend: Optional[str] = None,
        frontend_conf: Optional[Dict] = None,
        specaug: Optional[str] = None,
        specaug_conf: Optional[Dict] = None,
        normalize: str = None,
        normalize_conf: Optional[Dict] = None,
        encoder: str = None,
        encoder_conf: Optional[Dict] = None,
        decoder: str = None,
        decoder_conf: Optional[Dict] = None,
        joint_network: str = None,
        joint_network_conf: Optional[Dict] = None,
        transducer_weight: float = 1.0,
        fastemit_lambda: float = 0.0,
        auxiliary_ctc_weight: float = 0.0,
        auxiliary_ctc_dropout_rate: float = 0.0,
        auxiliary_lm_loss_weight: float = 0.0,
        auxiliary_lm_loss_smoothing: float = 0.0,
        input_size: int = 80,
        vocab_size: int = -1,
        ignore_id: int = -1,
        blank_id: int = 0,
        sos: int = 1,
        eos: int = 2,
        lsm_weight: float = 0.0,
        length_normalized_loss: bool = False,
        # report_cer: bool = True,
        # report_wer: bool = True,
        # sym_space: str = "<space>",
        # sym_blank: str = "<blank>",
        # extract_feats_in_collect_stats: bool = True,
        share_embedding: bool = False,
        # preencoder: Optional[AbsPreEncoder] = None,
        # postencoder: Optional[AbsPostEncoder] = None,
        **kwargs,
    )

Source from the content-addressed store, hash-verified

47 """
48
49 def __init__(
50 self,
51 frontend: Optional[str] = None,
52 frontend_conf: Optional[Dict] = None,
53 specaug: Optional[str] = None,
54 specaug_conf: Optional[Dict] = None,
55 normalize: str = None,
56 normalize_conf: Optional[Dict] = None,
57 encoder: str = None,
58 encoder_conf: Optional[Dict] = None,
59 decoder: str = None,
60 decoder_conf: Optional[Dict] = None,
61 joint_network: str = None,
62 joint_network_conf: Optional[Dict] = None,
63 transducer_weight: float = 1.0,
64 fastemit_lambda: float = 0.0,
65 auxiliary_ctc_weight: float = 0.0,
66 auxiliary_ctc_dropout_rate: float = 0.0,
67 auxiliary_lm_loss_weight: float = 0.0,
68 auxiliary_lm_loss_smoothing: float = 0.0,
69 input_size: int = 80,
70 vocab_size: int = -1,
71 ignore_id: int = -1,
72 blank_id: int = 0,
73 sos: int = 1,
74 eos: int = 2,
75 lsm_weight: float = 0.0,
76 length_normalized_loss: bool = False,
77 # report_cer: bool = True,
78 # report_wer: bool = True,
79 # sym_space: str = "<space>",
80 # sym_blank: str = "<blank>",
81 # extract_feats_in_collect_stats: bool = True,
82 share_embedding: bool = False,
83 # preencoder: Optional[AbsPreEncoder] = None,
84 # postencoder: Optional[AbsPostEncoder] = None,
85 **kwargs,
86 ):
87
88 """Initialize Transducer.
89
90 Args:
91 frontend: Audio frontend for feature extraction.
92 frontend_conf: Configuration dict for frontend.
93 specaug: TODO.
94 specaug_conf: Configuration dict for specaug.
95 normalize: TODO.
96 normalize_conf: Configuration dict for normalize.
97 encoder: TODO.
98 encoder_conf: Configuration dict for encoder.
99 decoder: TODO.
100 decoder_conf: Configuration dict for decoder.
101 joint_network: TODO.
102 joint_network_conf: Configuration dict for joint_network.
103 transducer_weight: TODO.
104 fastemit_lambda: TODO.
105 auxiliary_ctc_weight: TODO.
106 auxiliary_ctc_dropout_rate: TODO.

Callers

nothing calls this directly

Calls 2

LabelSmoothingLossClass · 0.90
output_sizeMethod · 0.45

Tested by

no test coverage detected