espnet / espnet/espnet_onnx

Question on stream_asr.end() function for streaming asr

Open
#76 65 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
169
Forks
25
PR merge metrics
No merged PRs in 30d

Description

Hi @Masao-Someki,

In the readme the example for streaming asr shows the use of start() and end() methods:
```
from espnet_onnx import StreamingSpeech2Text

stream_asr = StreamingSpeech2Text(tag_name)

# start streaming asr
stream_asr.start()
while streaming:
wav =
assert len(wav) == stream_asr.hop_size
stream_text = stream_asr(wav)[0][0]

# You can get non-streaming asr result with end function
nbest = stream_asr.end()
```
In a real streaming scenario should the start() and end() methods be called whenever the microphone is opened and closed?

I am asking because I noticed that the end() function in https://github.com/espnet/espnet_onnx/blob/master/espnet_onnx/asr/asr_streaming.py#151 calls the ```self.batch_beam_search()``` function which will restart decoding from postion 0 again causing a rather large delay for longer speech inputs. If I change https://github.com/espnet/espnet_onnx/blob/master/espnet_onnx/asr/asr_streaming.py#151 to use ```self.beam_search()``` method instead it avoids decoding the entire utterance at the end again and thus the delay.

Could you please clarify why ```self.batch_beam_search()``` is used in stream_asr.end() function?

Thanks!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.