after receiving speech input, can I get the rule of the grammar that it matched? For example, I have two rules:
<hello> = hello | hi | hey
<bye> = [ good ] bye
public </bye></hello>
Can I now somehow get the name of the rule ("<hello>" for "hi")? I'm currently using the OpenNLP classifier to classify the input, but I guess I'd get better results with less work if I could just somehow get the rule name.</hello>
Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
after receiving speech input, can I get the rule of the grammar that it matched?
No
Can I now somehow get the name of the rule ("<hello>" for "hi")? I'm currently using the OpenNLP classifier to classify the input, but I guess I'd get better results with less work if I could just somehow get the rule name.</hello>
You can write a regular expression to parse the output
Hi,
after receiving speech input, can I get the rule of the grammar that it matched? For example, I have two rules:
<hello> = hello | hi | hey
<bye> = [ good ] bye
public </bye></hello>
Can I now somehow get the name of the rule ("<hello>" for "hi")? I'm currently using the OpenNLP classifier to classify the input, but I guess I'd get better results with less work if I could just somehow get the rule name.</hello>
Thanks!
No
You can write a regular expression to parse the output
Additional discussion here:
https://github.com/cmusphinx/pocketsphinx/issues/13
If you are interested i have made a small grammar for your purpose https://github.com/goxr3plus/JSFG-Grammar-Rules-Parser-Library-for-Sphinx4-5