14

I'm using vosk for speech recognition. Does anyone know where the vocabulary dictionary is located and how to edit it to add or remove words?

Some Background on my project:

I'm working on a Linguistic AI project. I needed a speech recognition engine to convert spoken words into text. I started using CMUSphinx. PocketSphinx to be more precise. I like pocketsphinx but I was told that it is obsolete and that vosk is much better. However, pocketsphinx is very easy to use in terms of creating dictionaries from scratch and switching between different dictionaries on the fly programmatically.

I'm trying to move over to vosk as a speech recognizer. And it does seem to decode speech much fast and more accurately. But thus far I haven't been able to find any information on how to modify the vocabulary dictionary. The ability to modify the contents of the dictionary is of paramount importance in my Linguistic AI project. So if anyone can point to information of how to modify the vosk dictionary I would be very grateful. Thus far I haven't been able to find any information on how to do this. There is very little information on vosk to be found, especially in the way of tutorials or detailed instructions.

Thank you.

Edited to Add:

Here's the GitHub page for the vosk API that I'm referring to:

https://github.com/alphacep/vosk-api

Nikolay Shmyrev
  • 24,897
  • 5
  • 43
  • 87
James
  • 181
  • 2
  • 6
  • Any news regarding this? I still need to do that but have not had any success. It seems to be the depending on the model. Small ones have the Gr.fst file where the vocabulary is included. Bigger models have additional words.txt files but I also don't see how this works out. – Tobias Reich Dec 28 '20 at 14:41
  • Aside from that their website https://alphacephei.com/vosk/models offers a short summary of the model structure. Perhaps that might help. – Tobias Reich Dec 28 '20 at 14:51
  • 3
    https://alphacephei.com/vosk/adaptation Here you go! This website contains your query. – imjk May 17 '21 at 01:53
  • More up-to-date and detailed descriptions are on the website. See: alphacephei.com/vosk/lm – bekirbakar Jul 16 '22 at 11:00
  • 1
    The adaptation page only points to this example https://github.com/alphacep/vosk-api/blob/master/python/example/test_words.py concerning runtime modification. But it doesn't help at all. Does SetGrammar completely replace the old grammar? What if I just want to change only parts of the grammar? – Mircode Jan 17 '23 at 09:24

0 Answers0