Skip to content
Snippets Groups Projects

Add Language Model Decoder

Merged Solene Tarride requested to merge lm-decoder into main
All threads resolved!
1 file
+ 2
2
Compare changes
  • Side-by-side
  • Inline
+ 2
2
@@ -476,7 +476,7 @@ class CTCLanguageDecoder:
:param tokens_path: Path to a file containing valid tokens. If using a file, the expected
format is for tokens mapping to the same index to be on the same line.
:param language_model_weight: Weight of the language model.
:param temperature_scaling: Temperature for model calibreation.
:param temperature: Temperature for model calibreation.
"""
def __init__(
@@ -495,7 +495,7 @@ class CTCLanguageDecoder:
}
self.index_to_token = {i: token for token, i in self.tokens_to_index.items()}
self.blank_token_id = self.tokens_to_index[self.mapping.ctc.encoded]
# Torchaudio's decoder
# https://pytorch.org/audio/master/generated/torchaudio.models.decoder.ctc_decoder.html
self.decoder = ctc_decoder(
Loading