NVIDIA / OpenSeq2Seq

Toolkit for efficient experimentation with Speech Recognition, Text2Speech and NLP
https://nvidia.github.io/OpenSeq2Seq
Apache License 2.0
1.54k stars 372 forks source link

Streaming example output stuck words #560

Closed fabianoluzbr closed 3 years ago

fabianoluzbr commented 3 years ago

Hi folks, can anyone tell me why the words that come out of the streaming examples stick together? For example:

Hi guyshow are you

Thanks

fabianoluzbr commented 3 years ago

def greedy_merge(self, s, prev_char=''): s_merged = '' count = 0 for i in range(len(s)): if s[i] != prev_char: prev_char = s[i] if prev_char != '_': if count > 20: s_merged += " "+prev_char else: s_merged += prev_char count = 0 else: if s[i] == '_': count = count + 1 return " ".join(s_merged.split())