Skip to content

Commit

Permalink
Convert some leftover LabelsToString usage (fixup Alphabet API)
Browse files Browse the repository at this point in the history
  • Loading branch information
reuben committed Jun 28, 2020
1 parent 7687f71 commit f947ba5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions native_client/ctcdecode/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def ctc_beam_search_decoder(probs_seq,
beam_results = swigwrapper.ctc_beam_search_decoder(
probs_seq, alphabet, beam_size, cutoff_prob, cutoff_top_n,
scorer)
beam_results = [(res.confidence, alphabet.LabelsToString(res.tokens)) for res in beam_results]
beam_results = [(res.confidence, alphabet.Decode(res.tokens)) for res in beam_results]
return beam_results


Expand Down Expand Up @@ -119,7 +119,7 @@ def ctc_beam_search_decoder_batch(probs_seq,
"""
batch_beam_results = swigwrapper.ctc_beam_search_decoder_batch(probs_seq, seq_lengths, alphabet, beam_size, num_processes, cutoff_prob, cutoff_top_n, scorer)
batch_beam_results = [
[(res.confidence, alphabet.LabelsToString(res.tokens)) for res in beam_results]
[(res.confidence, alphabet.Decode(res.tokens)) for res in beam_results]
for beam_results in batch_beam_results
]
return batch_beam_results

0 comments on commit f947ba5

Please sign in to comment.