Open Temicia opened 1 year ago
Thanks for replying. However, the same problem arises.
Please build a small H and LG so that you can visualize them and analyze the result.
There are times when the final state does not exist when the lattice(H) and LG are combined.
You can use k2.connect(HLG)
to trim it.
There are times when the final state does not exist
What do your H and LG look like? Also, are you using compile_hlg.py
from icefall?
No, I don't use compile_hlg.py
I used the fast beam search result of the rnnt model as H.
As follows
H = fast_beam_search(
model=model,
encoder_out=encoder_out,
processed_lens=processed_lens,
rnnt_decoding_config=rnnt_decoding_config,
rnnt_decoding_streams_list=rnnt_decoding_streams_list,
temperature=temperature,
)
lattice = k2.compose(H, LG, inner_labels="tokens")
H H.pdf
The result is empty when I use 'k2.connect' because there is no final state.
What's the purpose of composing fast_beam_search lattice with LG? You can use an LG graph in fast_beam_search directlly.
Since fast_beam_search LG takes a long time to infer online, so I combined the lattice and LG.
Since fast_beam_search LG takes a long time to infer online, so I combined the lattice and LG.
How large is your LG graph? From our previous benchmark fast_beam_search_LG is only slight slower than fast_beam_search.
The size of the LG graph is about 1.1G. When online recognition was performed using Sherpa, hypothesis prediction was delayed due to slow speed.
Ok, 1.1G is not so large. Did you use multiple threads? I think the fast_beam_search decoding methods in Sherpa do not support multiple threads very well because of the GIL in python.
I think the fast_beam_search decoding methods in Sherpa do not support multiple threads very well because of the GIL in python.
We will fix this soon.
Thank you for your kind response.
I try to intersect output lattice (H) and LG and obtained the result using the 'intersect_device' function.
But, sometimes it outputs empty hyp.
Can you give any advice?