Skip to content
Snippets Groups Projects

Add Language Model Decoder

Merged Solene Tarride requested to merge lm-decoder into main
3 files
+ 4
4
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 2
2
@@ -597,8 +597,8 @@ class CTCLanguageDecoder:
) -> Dict[str, List[Union[str, float]]]:
"""
Decode a feature vector using n-gram language modelling.
:param features: Feature vector of size (batch_size, n_tokens, n_frames).
:param batch_sizes: Prediction length of size batch_size.
:param batch_features: Feature vector of size (batch_size, n_tokens, n_frames).
:param batch_frames: Prediction length of size batch_size.
:return: A dictionary containing the hypotheses and their confidences.
"""
# Reshape from (batch_size, n_tokens, n_frames) to (batch_size, n_frames, n_tokens)
Loading