jasperproject / jasper-client

Client code for Jasper voice computing platform
MIT License
4.53k stars 1.01k forks source link

PocketSphinx STT binary (.deb) packages for Debian #436

Open ialex87 opened 8 years ago

ialex87 commented 8 years ago

Actually I just wanted to share with you deb binary packages for PocketSphinx STT. It's a pain in the ass to compile them, and it's not "right way" to install them by "make install". Use the right way, and track you packages.

So please welcome binary files compiled on rPi2.

cmuclmtk_0.8-1_armhf.deb - https://drive.google.com/open?id=0ByR-0pXyV40paVR4R3Ryd09XWUU openfst_1.3.4-1_armhf.deb - https://drive.google.com/open?id=0ByR-0pXyV40pNlZZY0p6MUVpWW8 pocketsphinx_0.8-1_armhf.deb - https://drive.google.com/open?id=0ByR-0pXyV40pLTR1T3ZnM0xNdFE sphinxbase_0.8-1_armhf.deb - https://drive.google.com/open?id=0ByR-0pXyV40pdlpqMmhQQk9odDg

Phonetisaurus - https://drive.google.com/open?id=0ByR-0pXyV40pX3dybHphaFVZZ1U

ghost commented 8 years ago

If you would like to send me a message, I am happy to host these for the forum. I think it would be a big help.

ghost commented 8 years ago

I have requested access to the files, please let me know if you give access

ialex87 commented 8 years ago

I thought it was opened. Now access is open for sure ;)

rbravenboer commented 8 years ago

Hi MrDeath, The link to sphinxbase is the same as from pocketsphinx. Can you post the correct link to sphinxbase? Thanks, Robin

ialex87 commented 8 years ago

Hey, thanks for correction. I have updated it.

PatrickSteiner commented 8 years ago

This is great help, so thanks a lot!

Will your packages work with Phonetisaurus from the experimental debian repo?

What steps are still required to be made? So far I found

Did I miss something ( as it's not working properly at the moment )

ialex87 commented 8 years ago

As I remember Phonetisaurus it's already build, and it's in official documentation. and Yes, should work. :)

On Thu, Jan 21, 2016 at 9:45 AM, Patrick Steiner notifications@github.com wrote:

This is great help, so thanks a lot!

Will your packages work with Phonetisaurus from the experimental debian repo?

What steps are still required to be made? So far I found

  • cloneing and building Jasper itself
  • building Phonetisaurus model

Did I miss something ( as it's not working properly at the moment )

— Reply to this email directly or view it on GitHub https://github.com/jasperproject/jasper-client/issues/436#issuecomment-173517813 .

Kind regards,

Iepuras Alex IT system engineer Mob : +373 68105008 Skype : alex_iepuras e-mail : iepurasalex@gmail.com Web : www.ialex.info http://ialex.info

PatrickSteiner commented 8 years ago

Sorry to ask again, but already did spend more time then with any other tech on this ..

Is my assumption correct, that after installing your packages the only thing left to do is

Thanks again, Patrick

ialex87 commented 8 years ago

I would suggest you to go through install documentation, but instead of compiling from sources sphinx and other, just install them from deb packages.

On Thu, Jan 21, 2016 at 9:58 AM, Patrick Steiner notifications@github.com wrote:

Sorry to ask again, but already did spend more time then with any other tech on this ..

Is my assumption correct, that after installing your packages the only thing left to do is

  • cloneing and building Jasper itself
  • building Phonetisaurus model

Thanks again, Patrick

— Reply to this email directly or view it on GitHub https://github.com/jasperproject/jasper-client/issues/436#issuecomment-173521604 .

Kind regards,

Iepuras Alex IT system engineer Mob : +373 68105008 Skype : alex_iepuras e-mail : iepurasalex@gmail.com Web : www.ialex.info http://ialex.info

rbravenboer commented 8 years ago

Hi, just wondering if you are going to create a Phonetisaurus package. The one from the experimental repository gives the following error:


The following packages have unmet dependencies:

phonetisaurus : Depends: python:any but it is not installable

So it would be great to get a package for phonetisaurus as well.

Thanks in advance. Robin

ialex87 commented 8 years ago

Updated phonetisaurus https://drive.google.com/open?id=0ByR-0pXyV40pX3dybHphaFVZZ1U As I remember, you should add it last. Just run .sh script to install it.

thomastoye commented 8 years ago

Is Phonetisaurus still supposed to be downloaded via the extra repository (as described under Installing Phonetisaurus, m2m-aligner and MITLM in http://jasperproject.github.io/documentation/installation/#installing-sphinx)? I get the following error if I install just your packages:

ERROR:client.vocabcompiler:Fatal compilation Error occured, cleaning up...
Traceback (most recent call last):
  File "/home/pi/jasper/client/vocabcompiler.py", line 163, in compile
    self._compile_vocabulary(phrases)
  File "/home/pi/jasper/client/vocabcompiler.py", line 271, in _compile_vocabulary
    self._compile_dictionary(vocabulary, self.dictionary_file)
  File "/home/pi/jasper/client/vocabcompiler.py", line 320, in _compile_dictionary
    g2pconverter = PhonetisaurusG2P(**PhonetisaurusG2P.get_config())
  File "/home/pi/jasper/client/g2p.py", line 90, in __new__
    "$PATH.")
OSError: Can't find command 'phonetisaurus-g2p'! Please check if Phonetisaurus is installed and i
n your $PATH.
thomastoye commented 8 years ago

So I got it to work, finally! Here are my notes to install Jasper on the latest Raspbian:

/etc/network/interfaces:

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

allow-hotplug eth0
iface eth0 inet static
  address 192.168.1.51
  netmask 255.255.255.0
  gateway 192.168.1.1

allow-hotplug wlan0
iface wlan0 inet static
    address 192.168.1.52
    netmask 255.255.255.0
    #gateway 192.168.1.1 # can only have 1 gateway directive in this file
      # see http://raspberrypi.stackexchange.com/questions/13895/solving-rtnetlink-answers-file-exists-when-running-ifup
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

allow-hotplug wlan1
iface wlan1 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

/etc/wpa_supplicant/wpa_supplicant.conf:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
  ssid="your SSID here"
  psk="your PSK here"
}
sudo apt-get update
sudo apt-get upgrade --yes
sudo apt-get install vim git-core python-dev python-pip bison libasound2-dev libportaudio-dev python-pyaudio --yes
export LD_LIBRARY_PATH="/usr/local/lib"
source .bashrc
LD_LIBRARY_PATH="/usr/local/lib"
export LD_LIBRARY_PATH
PATH=$PATH:/usr/local/lib/
export PATH
carrier: ''
first_name: Thomas
gmail_password: ''
last_name: Toye
phone_number: ''
prefers_email: true
stt_engine: sphinx
timezone: Europe/Brussels

Phonetisaurus 0.7.8 is no longer available since Google Code is dead, so we grab an archive that contains it and use that. Phonetisaurus 0.8.0x did not compile for me.

sudo apt-get install subversion autoconf libtool automake gfortran g++ --yes

wget https://mitlm.googlecode.com/files/mitlm-0.4.1.tar.gz
wget https://m2m-aligner.googlecode.com/files/m2m-aligner-1.2.tar.gz

cd m2m-aligner-1.2/
sudo make

cd mitlm-0.4.1/
sudo ./configure
sudo make install

wget https://www.dropbox.com/s/1bgavg07qx8fe5w/phonetisaurus-googlecode-archive.tgz?dl=0
tar xzf phonetisaurus-googlecode-archive.tgz?dl=0
cd phonetisaurus-googlecode-archive/downloads
tar xzf phonetisaurus-0.7.8.tgz
cd phonetisaurus-0.7.8/src
sudo make
sudo cp ~/builds/phonetisaurus-googlecode-archive/downloads/phonetisaurus-0.7.8/phonetisaurus-g2p /usr/local/bin/phonetisaurus-g2p
sudo cp ~/builds/m2m-aligner-1.2/m2m-aligner /usr/local/bin/m2m-aligner

Change this line

        cmd = ['aplay', '-D', 'plughw:1,0', str(filename)]

To this

        cmd = ['aplay', '-D', 'plughw:0,0', str(filename)]
edouardpoitras commented 8 years ago

Thanks for these detailed steps @thomastoye!

ghost commented 8 years ago

Please whoever is keeping the latest version please contact me, as I am working on a place to store these for the community, and if we worked together it would be 1000x easier.

PatrickSteiner commented 8 years ago

@thomastoye, thanks for writing this down. This saves lots of people time!

How is your experience on a RPi2? The level of recognised words is very poor on my setup and was wondering how others are experiencing Jasper.

Did you use any overclocking?

thomastoye commented 8 years ago

@PatrickSteiner

I'm on a Raspberry Pi B+, no RPI 2 yet. I, too, found the level of recognized words very low. I tested Google's STT, and found it to be much better than PocketSphinx but I quickly hit the API limit (and I don't want everything I say flowing to Google). I've found it to be workable though, since it just listens for keywords. I see things like "INFO:client.stt:Transcribed: ['GARBLE GARBLE TIME WARBLE GARBLE']" in the console, but it still works fine.

ialex87 commented 8 years ago

try wit.ai it's better :)

digiltd commented 8 years ago

@thomastoye

Thanks for the guide. My input would be that I wouldn't edit the /usr/share/alsa/alsa.conf file.

Just create a new conf file like so sudo nano /etc/asound.conf and add your config there.

So for example, in your instructions where you change the system alsa.conf file:

defaults.pcm.card 0 => defaults.pcm.card 1

Instead you would create the new asound.conf file

sudo nano /etc/asound.conf

and add

pcm.!default {
  type hw
  card 1
}
ctl.!default {
  type hw
  card 1
}
crespum commented 8 years ago

I'm using Raspbian Jessie and I've been able to install from the repositories. However, in my profile.yml I had to replace this line: hmm_dir: '/usr/local/share/pocketsphinx/model/hmm/en_US/hub4wsj_sc_8k' by this other line: hmm_dir: '/usr/share/pocketsphinx/model/hmm/en_US/hub4wsj_sc_8k'

dmbuchta commented 8 years ago

I know this has been said already but is it possible to get these steps updated on the docs? If I saw this three days ago it would have saved me a whole lot of head banging, keyboard smashing debugging. @MrDeath, @thomastoye, @crespum, your comments saved me.

wreeecks commented 7 years ago

@thomastoye thanks for sharing your notes. Just want to add new links where to download mitlm and m2m.

mitlm 0.4.1 https://github.com/mitlm/mitlm/releases/download/v0.4.1/mitlm_0.4.1.tar.gz

m2m-aligner https://m2m-aligner.googlecode.com/files/m2m-aligner-1.2.tar.gz

Another thing is the last instruction. The code below can be found in ~/jasper/clients/tts.py

cmd = ['aplay', '-D', 'plughw:0,0', str(filename)]

bruxi commented 7 years ago

When I try to compile phonetisaurus with the version downloaded with the dropbox link above I get the following compile errors:

mkdir -p ../bin ../lib ../phonetisaurus ../rnnlm g++ -std=c++0x -fPIC -Wall -Wno-sign-compare -O2 -I3rdparty/sparsehash -I3rdparty/utfcpp -I3rdparty/rnnlm -std=c++11 -c util.cc -o util.o In file included from /usr/local/include/fst/label-reachable.h:34:0, from /usr/local/include/fst/lookahead-matcher.h:28, from /usr/local/include/fst/lookahead-filter.h:29, from /usr/local/include/fst/compose.h:31, from /usr/local/include/fst/fstlib.h:63, from util.h:32, from util.cc:30: /usr/local/include/fst/interval-set.h: In member function ‘void fst::IntervalSet::Intersect(const fst::IntervalSet&, fst::IntervalSet) const’: /usr/local/include/fst/interval-set.h:221:16: error: parse error in template argument list if (it1->end < it2->end) ^ /usr/local/include/fst/interval-set.h: In member function ‘void fst::IntervalSet::Complement(T, fst::IntervalSet) const’: /usr/local/include/fst/interval-set.h:243:18: error: parse error in template argument list if (interval.begin < interval.end) { ^ /usr/local/include/fst/interval-set.h:250:16: error: parse error in template argument list if (interval.begin < interval.end) { ^ /usr/local/include/fst/interval-set.h: In member function ‘bool fst::IntervalSet::Contains(const fst::IntervalSet&) const’: /usr/local/include/fst/interval-set.h:351:54: error: expected ‘)’ before ‘it1’ } else if (it2->begin < it1->begin || it2->end > it1->end) { // no C ^ Makefile:56: recipe for target 'util.o' failed make: *** [util.o] Error 1

Any idea why that is? Installed openfst from the deb-package from the first post in this thread.

G10DRAS commented 7 years ago

Lets try below pkg: https://github.com/G10DRAS/Raspbian-Pkgs/blob/master/phonetisaurus-_0.8-1_armhf.deb

bruxi commented 7 years ago

Thank you, that worked for me. But I suggest to update the documentation of the install process. It seems to be slightly outdated.