alphacep / alphacep/vosk-api

SetGrammar

Ouverte
#1,720 5 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Jupyter Notebook
Étoiles
15.1k
Forks
1.8k
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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!

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.