paddlespeech.s2t.decoders.utils module

paddlespeech.s2t.decoders.utils.add_results_to_json(js, nbest_hyps, char_list)[source]

Add N-best results to json.

Args:

js (dict[str, Any]): Groundtruth utterance dict. nbest_hyps_sd (list[dict[str, Any]]):

List of hypothesis for multi_speakers: nutts x nspkrs.

char_list (list[str]): List of characters.

Returns:

dict[str, Any]: N-best results added utterance dict.

paddlespeech.s2t.decoders.utils.end_detect(ended_hyps, i, M=3, D_end=-10.0)[source]

End detection.

described in Eq. (50) of S. Watanabe et al "Hybrid CTC/Attention Architecture for End-to-End Speech Recognition"

Parameters:
  • ended_hyps -- dict

  • i -- int

  • M -- int

  • D_end -- float

Returns:

bool

paddlespeech.s2t.decoders.utils.parse_hypothesis(hyp, char_list)[source]

Parse hypothesis.

Args:

hyp (list[dict[str, Any]]): Recognition hypothesis. char_list (list[str]): List of characters.

Returns:

tuple(str, str, str, float)