alphacep / vosk-api

Offline speech recognition API for Android, iOS, Raspberry Pi and servers with Python, Java, C# and Node
Apache License 2.0
7.35k stars 1.04k forks source link

ngram_order in language model #1594

Closed YangangCao closed 1 week ago

YangangCao commented 2 weeks ago

Hi, Dear author,

I want to improve the accuracy grammar ASR, so I set ngram_order to 3 in language model , but appear this: ASSERTION_FAILED (VoskAPI:AssignFstStates():language_model.cc:137) Assertion failed: (current_fst_state == num_active_lm_states_) Any idea to set more than 2 ngram_order? Thanks very much!

nshmyrev commented 1 week ago

Please clarify in more details what exact changes have you made. Is it to grammar code?

YangangCao commented 1 week ago

I only change opts.ngram_order from 2 to 3 in LanguageModelOptions in recognize.cc

nshmyrev commented 1 week ago

I pushed the fix for your problem here in commit cc48ff95672f9a04d5ec7afcc4bcab5f70305c1d