Menu

Grammar instead?

Help
Long Yan
2011-02-23
2012-09-22
  • Long Yan

    Long Yan - 2011-02-23

    Hello

    I have just used a language model for Pocketsphinx yet.
    Is it possible to use a grammar instead?

     
  • Nickolay V. Shmyrev

    Yes, you can use grammar in JSGF format. See -jsgf option of
    pocketsphinx_continuous as well as fsg_set* part of the API.

     
  • Long Yan

    Long Yan - 2011-02-23

    Hi Nicholay
    I recognized if I use both options -lm and -jsgf together for starting
    pocketsphinx_continuous, only the grammar gets comprised.
    Does that mean you can't use a grammar and a language model for pocketsphinx
    at the same time?

     
  • Nickolay V. Shmyrev

    Does that mean you can't use a grammar and a language model for pocketsphinx
    at the same time?

    It means exactly that.

     
  • Long Yan

    Long Yan - 2011-03-14

    My recognizer is supposed to recognize the read aloud continuous text.
    Until now I only used a language model with Spinx.
    If Sphinx can't use a language model and a grammar at the same time, how can
    it recognize an arbitrary number inside the text?
    I need an idea to solve the numbers problem within the speech recognition.
    Thank you in advance for a fast answer.

     
  • Nickolay V. Shmyrev

    Hello

    To do such things people usually employ class-based models where trigram lm
    describes classes probabilities and each class can be represented by grammar.
    Pocketsphinx and sphinx4 support class-based lm in some degree. It's possible
    to use classes with word lists. For numbers it should be enough.

    If you need more complex grammars embedded into open language model you need
    to implement this feature.

     
  • Long Yan

    Long Yan - 2011-03-18

    Hi Nicholay
    Thank you for your proposal.
    But I don't understand how I should implement this.
    Let's make a little example.
    I have a corpus which consists of only a single sentence:
    there is NUM_CLASS cars
    I generate a Trigram language model "test.arpa" out of this corpus.

    I write a grammar for the class "NUM_CLASS"
    grammar NUM_CLASS;
    public < num > = (one | two | three| four);

    How can I integrate these two things, language model "test.arpa" and the
    grammar which represents the class "NUM_CLASS", into my recognizer during
    decoding?

     
  • Nickolay V. Shmyrev

    Hello

    You can't integrate jsgf grammar right now, only the list of words. Please see
    ClassBased demo in sphinx4 sources for details.

     

Log in to post a comment.