Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added jsgf/fsg tags extraction #84

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

CarloBenussi
Copy link

Together with the pull request on sphinxbase, with this update it would be possible to extract tags from jsgf grammars.
Two functions on pocketsphinx.h/c were added, one to get the result not just as a simple const char* hyp, but as a complex glist_t (ps_get_hyp_with_tags), which would then be accessed through the other function on pocketsphinx (ps_get_word_and_tags).

@nshmyrev
Copy link
Contributor

Thank you, did you read #13 ?

@CarloBenussi
Copy link
Author

Hi,
I read it, actually I was using regular expressions too before implementing this. But I needed to have a direct link between words in hyp and tags, in order to extract easily parameters from the recognized phrase. I hope this could be of some help.
By now I just implemented a quick way (and not that elegant let's say) to access tags defined in a jsgf grammar by {} expression; in the future I will probably improve this part on my forked project, if you decide not to merge.
Thanks

@nshmyrev
Copy link
Contributor

Ok, I'll leave it open for now

@KiAlexander
Copy link

when I type "make clean all", I encounter the following error “../../src/libpocketsphinx/.libs/libpocketsphinx.so: undefined reference to `fsg_link_tag'

sphinxbase is also downloaded from github.

@@ -1048,8 +1137,16 @@ fsg_search_hyp(ps_search_t *search, int32 *out_score)
--c;
*c = ' ';
}

ps_hyptags_t *r = (ps_hyptags_t *)ckd_calloc(1, sizeof(ps_hyptags_t));
strncpy(r->tag,fsg_link_tag(fl),MAX_TAG_SIZE);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fsg_link_tag isn't defined

@dhdaines
Copy link
Contributor

dhdaines commented Jul 22, 2022

Hi! This is a good idea, the tags never were completely implemented.

The discussion in #13 is interesting. Commercial ASR aplications have been moving away (slowly) from grammar-based recognition for the last decade or so, because combining LVCSR using a language model (or perhaps some horrific end-to-end blob of Derp Learning) with a robust parser is generally more, well, robust, and also more accurate.

All this is true under the assumption that recognition is Done In The Cloud on some constantly expanding farm of servers. It's less obvious for the sort of environments and applications for which PocketSphinx was originally designed.

Unfortunately this PR doesn't quite work with the current layout of the codebase :) if you have the time to update it I would appreciate that...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants