提交 44408e52 编写于 作者: J Junkun

sync the variable name to others

上级 f866059b
......@@ -3,7 +3,7 @@ error_rate_type: char-bleu
decoding_method: fullsentence # 'fullsentence', 'simultaneous'
beam_size: 10
word_reward: 0.7
maxlen_ratio: 0.3
maxlenratio: 0.3
decoding_chunk_size: -1 # decoding chunk size. Defaults to -1.
# <0: for decoding, use full chunk.
# >0: for decoding, use fixed chunk size as set.
......
......@@ -4,7 +4,7 @@ error_rate_type: char-bleu
decoding_method: fullsentence # 'fullsentence', 'simultaneous'
beam_size: 10
word_reward: 0.7
maxlen_ratio: 0.3
maxlenratio: 0.3
decoding_chunk_size: -1 # decoding chunk size. Defaults to -1.
# <0: for decoding, use full chunk.
# >0: for decoding, use fixed chunk size as set.
......
......@@ -408,7 +408,7 @@ class U2STTester(U2STTrainer):
decoding_method=decode_cfg.decoding_method,
beam_size=decode_cfg.beam_size,
word_reward=decode_cfg.word_reward,
maxlen_ratio=decode_cfg.maxlen_ratio,
maxlenratio=decode_cfg.maxlenratio,
decoding_chunk_size=decode_cfg.decoding_chunk_size,
num_decoding_left_chunks=decode_cfg.num_decoding_left_chunks,
simulate_streaming=decode_cfg.simulate_streaming)
......@@ -436,7 +436,7 @@ class U2STTester(U2STTrainer):
decoding_method=decode_cfg.decoding_method,
beam_size=decode_cfg.beam_size,
word_reward=decode_cfg.word_reward,
maxlen_ratio=decode_cfg.maxlen_ratio,
maxlenratio=decode_cfg.maxlenratio,
decoding_chunk_size=decode_cfg.decoding_chunk_size,
num_decoding_left_chunks=decode_cfg.num_decoding_left_chunks,
simulate_streaming=decode_cfg.simulate_streaming)
......
......@@ -264,7 +264,7 @@ class U2STBaseModel(nn.Layer):
speech_lengths: paddle.Tensor,
beam_size: int=10,
word_reward: float=0.0,
maxlen_ratio: float=0.5,
maxlenratio: float=0.5,
decoding_chunk_size: int=-1,
num_decoding_left_chunks: int=-1,
simulate_streaming: bool=False, ) -> paddle.Tensor:
......@@ -274,7 +274,7 @@ class U2STBaseModel(nn.Layer):
speech_length (paddle.Tensor): (batch, )
beam_size (int): beam size for beam search
word_reward (float): word reward used in beam search
maxlen_ratio (float): max length ratio to bound the length of translated text
maxlenratio (float): max length ratio to bound the length of translated text
decoding_chunk_size (int): decoding chunk for dynamic chunk
trained model.
<0: for decoding, use full chunk.
......@@ -297,7 +297,7 @@ class U2STBaseModel(nn.Layer):
num_decoding_left_chunks,
simulate_streaming) # (B, maxlen, encoder_dim)
maxlen = max(int(encoder_out.shape[1] * maxlen_ratio), 5)
maxlen = max(int(encoder_out.shape[1] * maxlenratio), 5)
hyp = {"score": 0.0, "yseq": [self.sos], "cache": None}
hyps = [hyp]
......@@ -475,7 +475,7 @@ class U2STBaseModel(nn.Layer):
decoding_method: str,
beam_size: int,
word_reward: float=0.0,
maxlen_ratio: float=0.5,
maxlenratio: float=0.5,
decoding_chunk_size: int=-1,
num_decoding_left_chunks: int=-1,
simulate_streaming: bool=False):
......@@ -511,7 +511,7 @@ class U2STBaseModel(nn.Layer):
feats_lengths,
beam_size=beam_size,
word_reward=word_reward,
maxlen_ratio=maxlen_ratio,
maxlenratio=maxlenratio,
decoding_chunk_size=decoding_chunk_size,
num_decoding_left_chunks=num_decoding_left_chunks,
simulate_streaming=simulate_streaming)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册