[Resolved] RapidEars + RuleORama

Home Forums OpenEars plugins [Resolved] RapidEars + RuleORama

Viewing 10 posts - 1 through 10 (of 10 total)

  • Author
    Posts
  • #1022990
    adb
    Participant

    I had no problems implementing RapidEars with the simple test array from the OpenEars demo. I can not seem to now add RuleORama to the mix. I am not clear on what method I should use to start up the pocketsphinxController. For OpenEars we used startListeningWithLanguageModelAtPath: and with RapidEars we moved to startRealtimeListeningWithLanguageModelAtPath: and in the documentation for RuleORama it moves back to startListeningWithLanguageModelAtPath: so which should we be using for the combo. When I tried building my rule dict with generateFastGrammarFromDictionary: and loading up pocketsphinxController with startRealtimeListeningWithLanguageModelAtPath: it does not seem to work. I received this message in the console with verbose off “Number of entries reached the size of the hash. Run the program again with a larger has size -hash.”

    #1022991
    adb
    Participant

    Well, interestingly enough it is my rule dictionary that is causing the problem.

    @{ ThisCanBeSaidWithOptionalRepetitions :
    @[
    @{ OneOfTheseWillBeSaidOnce : @[@”1″,@”2″,@”3″,@”4″,@”5″,@”6″,@”7″,@”8″,@”9″,@”10″,
    @”11″,@”12″,@”13″,@”14″,@”15″,@”16″,@”17″,@”18″,@”19″,@”20″,
    @”21″,@”22″,@”23″,@”24″,@”25″,@”26″,@”27″,@”28″,@”29″,@”30″,
    @”31″,@”32″,@”33″,@”34″,@”35″,@”36″,@”37″,@”38″,@”39″,@”40″,
    @”41″,@”42″,@”43″,@”44″,@”45″,@”46″,@”47″,@”48″,@”49″,@”50″,
    @”51″,@”52″,@”53″,@”54″,@”55″,@”56″,@”57″,@”58″,@”59″,@”60″,
    @”61″,@”62″,@”63″,@”64″,@”65″,@”66″,@”67″,@”68″,@”69″,@”70″,
    @”71″,@”72″,@”73″,@”74″,@”75″,@”76″,@”77″,@”78″,@”79″,@”80″,
    @”81″,@”82″,@”83″,@”84″,@”85″,@”86″,@”87″,@”88″,@”89″,@”90″,
    @”91″,@”92″,@”93″,@”94″,@”95″,@”96″,@”97″,@”98″,@”99″,@”100″]},
    @{ OneOfTheseWillBeSaidOnce : @[@”HOUR”, @”HOURS”, @”MINUTE”, @”MINUTES”, @”SECOND”, @”SECONDS”]}
    ]},

    When I cut down the OneOfTheseWillBeSaidOnce to just @[“1”] it works like intended with generateFastGrammarFromDictionary: and startRealtimeListeningWithLanguageModelAtPath:. Any Ideas on this? I didn’t think this was that large.

    #1022992
    Halle Winkler
    Politepix

    Welcome,

    ThisCanBeSaidWithOptionalRepetitions is actually not supported by RuleORama (I think this is mentioned in the docs and headers) so it is supposed to fall back to a single repetition in that case. In the event that it isn’t actually doing so, you may want to try using the supported grammar declarations (basically, everything that doesn’t have optional repetitions since they blow up the possible grammar size enormously).

    For an offline grammar that is actually pretty big – grammars have a much heavier overhead than statistical models so they do need to be smaller in order to perform. RuleORama specifically expects smaller grammars than you could get away with using the stock OpenEars grammar interface, which is a tradeoff in exchange for its faster recognition times.

    #1022993
    Halle Winkler
    Politepix

    By the way, ThisCanBeSaidWithOptionalRepetitions around a single ruleset with two obligatory utterances isn’t actually necessary – it just tells the engine that the ruleset will either not be stated, or it will be stated one or more times, but this is the default expectation for any ruleset or statistical model since the user may not speak, or may say the required utterance, or may say it a few times.

    #1022996
    adb
    Participant

    I see what you are saying about the repetitions but even if I change it to:
    @{ OneOfTheseCanBeSaidOnce : @[@”1″,@”2″,@”3″,@”4″,@”5″,@”6″,@”7″,@”8″,@”9″,@”10″,
    @”11″,@”12″,@”13″,@”14″,@”15″,@”16″,@”17″,@”18″,@”19″,@”20″,
    @”21″,@”22″,@”23″,@”24″,@”25″,@”26″,@”27″,@”28″,@”29″,@”30″,
    @”31″,@”32″,@”33″,@”34″,@”35″,@”36″,@”37″,@”38″,@”39″,@”40″,
    @”41″,@”42″,@”43″,@”44″,@”45″,@”46″,@”47″,@”48″,@”49″,@”50″,
    @”51″,@”52″,@”53″,@”54″,@”55″,@”56″,@”57″,@”58″,@”59″,@”60″,
    @”61″,@”62″,@”63″,@”64″,@”65″,@”66″,@”67″,@”68″,@”69″,@”70″,
    @”71″,@”72″,@”73″,@”74″,@”75″,@”76″,@”77″,@”78″,@”79″,@”80″,
    @”81″,@”82″,@”83″,@”84″,@”85″,@”86″,@”87″,@”88″,@”89″,@”90″,
    @”91″,@”92″,@”93″,@”94″,@”95″,@”96″,@”97″,@”98″,@”99″,@”100″]},
    @{ OneOfTheseCanBeSaidOnce : @[@”HOUR”, @”HOURS”, @”MINUTE”, @”MINUTES”, @”SECOND”, @”SECONDS”]}

    it will still not create the rule set.

    #1022997
    Halle Winkler
    Politepix

    Yes, RuleORama was envisioned for smaller grammars than the stock OpenEars grammar tool can handle due to the fact that it provides more speed. This one has > 800 potential utterances so it isn’t a small grammar for RuleORama.

    It might work better as a stock OpenEars grammar assuming that you change it so that the numbers equal to and greater than 20 are formed with a rule declaring the base 10 number (i.e.”20″) followed by the numbers 1-9, which lets you avoid a single rule with 100 entries.

    #1022998
    Halle Winkler
    Politepix

    Is it correct that OneOfTheseCanBeSaidOnce is being used for both, or does a valid utterance for this grammar actually have to be OneOfTheseWillBeSaidOnce (meaning they are both required)? Having them both be OneOfTheseWillBeSaidOnce will reduce the number of variations a bit. Another thing that might help is reducing to 72 rather than 100, since none of those time measurements (hour, minutes, seconds) are generally dictated in numbers larger than 72.

    I would also consider dropping the SECOND/SECONDS plural variations since it doubles the grammar size.

    #1022999
    adb
    Participant

    All valid points. The rule set was just something I slapped together quickly to try out JSGF. Yes, unfortunately the idea is that they could for example say 1 hour 30 seconds (with a few other commands leading up to that). Can different be rule sets be swapped out for the pocketsphinxController in the rapidEarsDidReceiveFinshedSpeechHypothesis like was done in the OpenEars demo app? Maybe I can tackle this with splitting the rules up. Btw, the response time is great with pairing the two.

    #1023002
    Halle Winkler
    Politepix

    Yes, you can dynamically switch between rulesets, but I would also recommend trying out my suggestions at the end of the previous post (limit numbers to 72, get rid of the plural word variations, and change OneOfTheseCanBeSaidOnce to OneOfTheseWillBeSaidOnce) and see if it ends up with few enough combinations to work. I think that should reduce the ~800 combinations to ~200 which might be small enough to work without a notable impact on the usability of the grammars.

    #1023003
    adb
    Participant

    Yeah. The problem was is that they needed to be optional not required so I could not change it that way. I did split up the rules and built one with 72#s and minus the plurals. Thanks for the help on clearing this up. I will just have to keep playing with smaller subsets of rules.

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.