Re-implement LM rescore for online transducer (#1231)

Co-authored-by: Martins Kronis <martins.kuznecovs@tilde.lv>
This commit is contained in:
SilverSulfide
2024-09-06 05:01:25 +03:00
committed by GitHub
parent 1f29e4a1a9
commit 888f74bf3c
11 changed files with 175 additions and 31 deletions

View File

@@ -64,6 +64,7 @@ class OnlineRecognizer(object):
bpe_vocab: str = "",
lm: str = "",
lm_scale: float = 0.1,
lm_shallow_fusion: bool = True,
temperature_scale: float = 2.0,
debug: bool = False,
rule_fsts: str = "",
@@ -274,6 +275,7 @@ class OnlineRecognizer(object):
lm_config = OnlineLMConfig(
model=lm,
scale=lm_scale,
shallow_fusion=lm_shallow_fusion,
)
recognizer_config = OnlineRecognizerConfig(