Skip to content

Adding Italian model in pocketsphinx for offline recognition #101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: development
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -928,6 +928,24 @@ if [ $targetSystem = raspi ] ; then
sudo bash $INSTALLERDIR/raspi/access_point/wap.sh
fi

read -p "Do you want to download languages for offline recognition?[y/n] " lang
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interaction is not possible, since we do build testing, as well as automated image creation. This needs to be a command line option or some combination.

echo
if [[ $lang = y ]] ; then
SR_LIB=$(python3 -c "import speech_recognition as sr, os.path as p; print(p.dirname(sr.__file__))")
sudo mkdir "$SR_LIB/it-IT"
sudo mkdir "$SR_LIB/temp"
echo "Downloading Italian Language"
sudo wget -O "$SR_LIB/temp/it-IT.tar.gz" 'https://sourceforge.net/projects/cmusphinx/files/Acoustic%20and%20Language%20Models/Italian/cmusphinx-it-5.2.tar.gz/download'
sudo tar -zxf "$SR_LIB/temp/it-IT.tar.gz" --directory "$SR_LIB/temp"
sudo mv "$SR_LIB/temp/cmusphinx-it-5.2/etc/voxforge_it_sphinx.lm" "$SR_LIB/temp/cmusphinx-it-5.2/etc/italian.lm"
sudo sphinx_lm_convert -i "$SR_LIB/temp/cmusphinx-it-5.2/etc/italian.lm" -o "$SR_LIB/temp/cmusphinx-it-5.2/etc/italian.lm.bin"
sudo mv "$SR_LIB/temp/cmusphinx-it-5.2/etc/italian.lm" "$SR_LIB/it-IT/italian.lm"
sudo mv "$SR_LIB/temp/cmusphinx-it-5.2/etc/italian.lm.bin" "$SR_LIB/it-IT/italian.lm.bin"
sudo mv "$SR_LIB/temp/cmusphinx-it-5.2/etc/voxforge_it_sphinx.dic" "$SR_LIB/it-IT/pronounciation-dictionary.dic"
sudo mv -v "$SR_LIB/temp/cmusphinx-it-5.2/model_parameters/voxforge_it_sphinx.cd_cont_2000/" "$SR_LIB/it-IT/acoustic-model/"
sudo rm -rf "$SR_LIB/temp"

fi

#
# Final output
Expand Down