Use raspberryPi and julus (speech recognition). ① Microphone Use julius (speech recognition) on raspberry Pi. ② Installation Use raspberry Pi and Julius (speech recognition). ③ Dictionary creation Use raspberry Pi and Julius (speech recognition). ④ L Chika Use raspberry Pi and Julius (speech recognition). ⑤ i2c character display
First, create a directory for creating a dictionary file.
$ cd julius
$ mkdr dict
$ cd dict
The hierarchy looks like this.
~/julius
|--dict
|--julius-4.6
|--julius-kit
|--dictation-kit-4.5
|--grammer-kit-4.3.1
Use the vim command to create and edit files. Install vim.
$ apt-get install vim
$ vim --version
Create a reading kana file
$ sudo vim test.yomi
Click the keyboard mark on the upper right to enable Japanese input. ↓↓
Word → tab → reading kana (hiragana) I will write below. The word can be kanji. Be careful not to insert extra spaces as it will cause an error. Do not start a new line after entering the last word. Be careful not to empty the last line.
When you have a wordbook, quit the vim editor with ctrl + C → ZZ. See this article for how to use vim. Frequently used Vim command summary
$ sudo iconv -f utf8 -t eucjp
So run it with the following code.
$ perl ~/julius/julius-4.6/gramtools/yomi2voca/yomi2voca.pl test.yomi > ~/julius/dict/test.phone
Since it is not displayed in the terminal, check that the file is created and display it.
$ ls
$ sudo vim test.phone
It's OK if the .yomi file is converted to romaji, so close it without touching it.
S : NS_B TEST NS_E
TEST:ARIGATOU
TEST:KONNICHIWA
The S part on the first line of the syntax file shows the syntax definition, NS_B is the beginning of the sentence, and NS_E is the end of the sentence. The TEST part on the second and subsequent lines is a character string to be recognized, and the reading of the "phoneme" file (hello.phone) generated earlier is capitalized. Partially modified and quoted
Exit the editor after writing.
$ sudo cp test.phone test.voca
$ sudo vim test.voca
Align the format for each word and add it so that it has the following code format. The word and the romaji are separated by a tab, and it worked as it is, but it seems better to make it a space.
% ARIGATOU
Thank you a r i g a t o u
% KONNICHIHA
Hello k o N n i ch i w a
% NS_B
[s] silB
% NS_E
[/s] silE
$ cd julius/julius-4.6/gramtools/mkdfa
Execute the following code at the destination.
$ mkdfa.pl ~/julius/dict/test
If successful, ".dfa", ".term" and ".dict" files will be generated in the dict file. (For some reason, a file called .dfatmp was created, so I renamed it. The .tmp file was also created abruptly, but I'm not sure, so I left it.)
$ cd
Execute the following code.
$ julius -C ~/julius/julius-4.6/julius-kit/dictation-kit-4.5/am-gmm.jconf -nostrip -gram ~/julius/dict/test -input mic
Also recognizes what you say "Thank you", "Hello" just a intently. did it.
Recommended Posts