I'm using s3_decode_hypothesis function to get the partial hypothesis result.
Once the result is obtained I want to clear the decoder buffer. For ex: I'm
reading from an audio file at 10k bytes at a time. The buffer is given as in
input to fe_process_utt and then s3_decode_hypothesis function is called. The
decoder gives the partial recognition result. But the next time I read 10k
bytes again if there is a recognition, the partial recognition contains the
concatenated result of the current and previous iteration results. I want only
the current iteration results. How do I achieve this?
For ex: the first iteration the recognition is "ONE" , second iteration is
"TWO" then the decode_hypothesis returns "ONE TWO" as hypothesis string. I
want only "TWO" as the recognized string.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes as in "Yes, ps_set_search will definitely be affected."?
Anyway, can you please give some hints on how to modify the source to be able to clear the buffer? I really need a way of telling the decoder that any sound from timestamp A to B should be ignored. Tearing down and re-initializing the entire recognizer is too slow.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you don't want to process some samples, just don't send them to the decoder. To start new search use ps_start_utt, it will reset recognizer state. You do not need to reinit recognizer for that.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm using s3_decode_hypothesis function to get the partial hypothesis result.
Once the result is obtained I want to clear the decoder buffer. For ex: I'm
reading from an audio file at 10k bytes at a time. The buffer is given as in
input to fe_process_utt and then s3_decode_hypothesis function is called. The
decoder gives the partial recognition result. But the next time I read 10k
bytes again if there is a recognition, the partial recognition contains the
concatenated result of the current and previous iteration results. I want only
the current iteration results. How do I achieve this?
For ex: the first iteration the recognition is "ONE" , second iteration is
"TWO" then the decode_hypothesis returns "ONE TWO" as hypothesis string. I
want only "TWO" as the recognized string.
It is not possible without source code modification. It's also not very easy
given the overall speech recognition algorithm.
then I guess the only way is to modify the source code and keep a pointer to
the data that is sent in each iteration :)
It is not the answer. Partial result may change altogether during the search.
Is this problem also present after a call to ps_set_search? I.e. Does switching between two grammars imply two buffers?
Yes, definitely.
Yes as in "Yes, ps_set_search will definitely be affected."?
Anyway, can you please give some hints on how to modify the source to be able to clear the buffer? I really need a way of telling the decoder that any sound from timestamp A to B should be ignored. Tearing down and re-initializing the entire recognizer is too slow.
If you don't want to process some samples, just don't send them to the decoder. To start new search use ps_start_utt, it will reset recognizer state. You do not need to reinit recognizer for that.
Thanks. So no need to call ps_end_utt first?
You need to end the previous utterance.