alphacep / alphacep/vosk-api

SetGrammar

Abierto
#1,720 5 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Jupyter Notebook
Estrellas
15.1k
Forks
1.8k
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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!

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.