In pocketsphinx 0.7 (release version) in batch.c in the function
write_nbest(ps_decoder_t ps, char const nbestdir, char const uttid)
an error condition is not being checked which leads to some crashes.
Original code:
_ for (i = 0; i < n; i++)
{
ps_nbest_next(nbest); // This may sometimes return a NULL and hence lead to a
crash in the next statement
hyp = ps_nbest_hyp(nbest, &score);
fprintf(fh, "%s %d\n", hyp, score);
}
ps_nbest_free(nbest); *_
I think the code should be something like this: *{
ps_nbest_t next
for (i = 0; i < n; i++)
{
next = ps_nbest_next(nbest);
if (next)
{
hyp = ps_nbest_hyp(nbest, &score);
fprintf(fh, "%s %d\n", hyp, score);
}
else
break;
}
if (next)
ps_nbest_free(nbest);
}**
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Should the ps_get_hyp result match with one of the results in the nbest list??
1. In the latest subversion trunk code (when used with FSG search) it is being observed that the ps_get_hyp doesn't matches with any of the results in the nbest list.
2. Most of the times all the results in the nbest list are identical.
For eg an audio clip with the word ADI was decoded as "NULL (ADI -3983)".
While the nbest list contained four identical strings.
ADITI -5104
ADITI -5104
ADITI -5104
ADITI -5104
Is this normal?
Regards
Pankaj
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In the latest subversion trunk code (when used with FSG search) it is
being observed that the ps_get_hyp doesn't matches with any of the results in
the nbest list.
This issue might be a bug and require investigation. In theory it should match
in practice there could be differences in scores which cause that.
Most of the times all the results in the nbest list are identical.
Current implementation unfortunately doesn't check for identical strings in
n-best results. They should be filtered by application. With diverse grammar
this is less an issue.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
In pocketsphinx 0.7 (release version) in batch.c in the function
write_nbest(ps_decoder_t ps, char const nbestdir, char const uttid)
an error condition is not being checked which leads to some crashes.
Original code:
_ for (i = 0; i < n; i++)
{
ps_nbest_next(nbest); // This may sometimes return a NULL and hence lead to a
crash in the next statement
hyp = ps_nbest_hyp(nbest, &score);
fprintf(fh, "%s %d\n", hyp, score);
}
ps_nbest_free(nbest);
*_
I think the code should be something like this:
*{
ps_nbest_t next
for (i = 0; i < n; i++)
{
next = ps_nbest_next(nbest);
if (next)
{
hyp = ps_nbest_hyp(nbest, &score);
fprintf(fh, "%s %d\n", hyp, score);
}
else
break;
}
if (next)
ps_nbest_free(nbest);
}**
Thanks, this bug was already fixed in subversion trunk.
Hi Nicole
Should the ps_get_hyp result match with one of the results in the nbest list??
1. In the latest subversion trunk code (when used with FSG search) it is being observed that the ps_get_hyp doesn't matches with any of the results in the nbest list.
2. Most of the times all the results in the nbest list are identical.
For eg an audio clip with the word ADI was decoded as "NULL (ADI -3983)".
While the nbest list contained four identical strings.
ADITI -5104
ADITI -5104
ADITI -5104
ADITI -5104
Is this normal?
Regards
Pankaj
This issue might be a bug and require investigation. In theory it should match
in practice there could be differences in scores which cause that.
Current implementation unfortunately doesn't check for identical strings in
n-best results. They should be filtered by application. With diverse grammar
this is less an issue.