提交 04881fac 编写于 作者: Y Yibing Liu

tiny adjust

上级 c26dab9f
"""Contains various CTC decoder.""" """Contains various CTC decoders."""
from __future__ import absolute_import from __future__ import absolute_import
from __future__ import division from __future__ import division
from __future__ import print_function from __future__ import print_function
...@@ -103,7 +103,7 @@ def ctc_beam_search_decoder(probs_seq, ...@@ -103,7 +103,7 @@ def ctc_beam_search_decoder(probs_seq,
beam_size to find many paths to one label, return beam_size labels in beam_size to find many paths to one label, return beam_size labels in
the descending order of probabilities. The implementation is based on Prefix the descending order of probabilities. The implementation is based on Prefix
Beam Search(https://arxiv.org/abs/1408.2873), and the unclear part is Beam Search(https://arxiv.org/abs/1408.2873), and the unclear part is
redesigned, need to be verified. redesigned.
:param probs_seq: 2-D list with length num_time_steps, each element :param probs_seq: 2-D list with length num_time_steps, each element
is a list of normalized probabilities over vocabulary is a list of normalized probabilities over vocabulary
...@@ -262,9 +262,7 @@ def ctc_beam_search_decoder_nproc(probs_split, ...@@ -262,9 +262,7 @@ def ctc_beam_search_decoder_nproc(probs_split,
:type num_processes: int :type num_processes: int
:return: Decoding log probabilities and result sentences in descending order. :return: Decoding log probabilities and result sentences in descending order.
:rtype: list :rtype: list
''' '''
if num_processes is None: if num_processes is None:
num_processes = multiprocessing.cpu_count() num_processes = multiprocessing.cpu_count()
if not num_processes > 0: if not num_processes > 0:
......
...@@ -151,7 +151,6 @@ def infer(): ...@@ -151,7 +151,6 @@ def infer():
## decode and print ## decode and print
# best path decode # best path decode
wer_sum, wer_counter = 0, 0 wer_sum, wer_counter = 0, 0
total_time = 0.0
if args.decode_method == "best_path": if args.decode_method == "best_path":
for i, probs in enumerate(probs_split): for i, probs in enumerate(probs_split):
target_transcription = ''.join([ target_transcription = ''.join([
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册