SetGrammar
- Lingua principale
- Jupyter Notebook
- Stelle
- 15.1k
- Fork
- 1.8k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
MODEL_PATH = r'D:\Desktop\vsok\vosk-model-small-cn-0.22'
model = Model(MODEL_PATH)
rec = KaldiRecognizer(model, 16000)
grammar_list = ["诺普信", "智慧农业", "悦心健康", "国新能源"]
grammar_json = json.dumps(grammar_list, ensure_ascii=False)
rec.SetGrammar(grammar_json)
LOG (VoskAPI:UpdateGrammarFst():recognizer.cc:287) ["璇烘櫘淇?, "鏅烘収鍐滀笟", "鎮﹀績鍋ュ悍", "鍥芥柊鑳芥簮"]
Report an error. That is, the log cannot display Chinese characters correctly. After using the ensure_ascii=False flag in json.dumps, it seems that what is output is Unicode, rather than UTF-8.
These Chinese words are not in the model's dictionary. I want to add some Chinese words that are not in the dictionary. Roughly speaking, how should I go about doing this? Thank you in advance!
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.