Hemera:QuickStart

From HemeraBook
Revision as of 22:11, 14 December 2011 by Projettwk (Talk | contribs)

Jump to: navigation, search

Introduction

System administrator must have installed Hemera, and third-party tools.
Trick: if it is not the case, Standard user can perform a local installation (usually in ~/hemera).

All command lines are given assuming Hemera scripts are available in PATH.

Quick help

To have quick help, you can use the help.sh script.
Output sample:

$ help.sh
Hemera - Intelligent System - Help
Online documentation: https://sourceforge.net/apps/mediawiki/hemerais/index.php?title=Main_Page
Configuration file: config/hemera.conf
Check your configuration: scripts/checkConfig.sh
See README and INSTALL files.

Available tools
 in scripts
   checkConfig.sh               checks Hemera tools configuration.
   help.sh                      gives some helps and tools description.
   hemera.sh                    starts/status/stops Hemera components according to configuration.
   makeHemera.sh                makes Hemera (documentation, source code management ...).
   manageSound.sh               manages sound play/pause/continue/stop action.
   processInput.sh              processes the specified input and moves it to err/done according to result.
   setupHemera.sh               setups Hemera.
 in scripts/core/speech
   speech.sh                    manages command line and uses configured tool to perform text to speech.
 in scripts/core/speechRecognition
   computeFeatureFile.sh        computes sound feature file, needed by sphinx3.
   speechRecognition.sh         manages command line and uses configured tool to perform speech recognition.
 in scripts/daemon
   inputMonitor.sh              input monitor daemon (checks for input and updates a event list which will be process by ioprocessor).
   ioprocessor.sh               input/output processor daemon (controls various Hemera [core] modules according to input).
   soundRecorder.sh             sound recorder daemon.
 in misc
   speech2Recognition.sh        uses speech core module to generate speech file from specified text, and speechRecognition core module to decode it.


Quick config check

To quickly check your configuration, you can use the checkConfig.sh script.
Output sample:

$ checkConfig.sh
17/05/11 18:33.49  [check]  Checking 'hemera.path.bin' ... OK
17/05/11 18:33.49  [check]  Checking 'hemera.path.lib' ... OK
17/05/11 18:33.49  [check]  Checking 'hemera.locale' ... OK
17/05/11 18:33.49  [check]  Checking locale files (BEGIN)
17/05/11 18:33.49  [check]  Checking locale files (END)
17/05/11 18:33.49  [check]  Found: java version "1.6.0_20" [OpenJDK Runtime Environment (IcedTea6 1.9.7) (fedora-52.1.9.7.fc14-x86_64)]
17/05/11 18:33.49  [check]  Checking 'environment.ant.home' ... OK
17/05/11 18:33.50  [check]  Found: Apache Ant version 1.7.1 compiled on April 16 2010
17/05/11 18:33.50  [check]  Checking 'hemera.run.activation.tomcat' ... OK
17/05/11 18:33.50  [check]  Found: Apache Tomcat Version 7.0.12
17/05/11 18:33.50  [hemera]  Checking 'hemera.run.mode' ... OK
17/05/11 18:33.50  [hemera]  Checking 'hemera.run.activation.inputMonitor' ... OK
17/05/11 18:33.50  [hemera]  Checking 'hemera.run.activation.ioProcessor' ... OK
17/05/11 18:33.50  [hemera]  Checking 'hemera.run.activation.soundRecorder' ... OK
17/05/11 18:33.50  [hemera]  Checking 'hemera.run.activation.tomcat' ... OK
17/05/11 18:33.50  [inputMonitor]  Checking 'hemera.core.iomanager.inputMonitor.path' ... OK
17/05/11 18:33.50  [inputMonitor]  Checking 'hemera.core.iomanager.inputMonitor.options' ... OK
17/05/11 18:33.50  [IOProcessor]  Checking 'hemera.core.iomanager.ioProcessorMonitor.path' ... OK
17/05/11 18:33.50  [IOProcessor]  Checking 'hemera.core.iomanager.ioProcessorMonitor.options' ... OK
17/05/11 18:33.50  [soundRecorder]  Checking 'hemera.core.speechRecognition.soundRecorder.path' ... OK
17/05/11 18:33.50  [soundRecorder]  Checking 'hemera.core.speechRecognition.soundRecorder.options' ... OK
17/05/11 18:33.50  [featureFileManagement]  Checking 'hemera.core.speechRecognition.soundFeatureCreator.path' ... OK
17/05/11 18:33.50  [featureFileManagement]  Checking 'hemera.core.speechRecognition.soundFeatureCreator.options' ... OK
17/05/11 18:33.50  [speechRecognition]  Checking 'hemera.core.speechRecognition.mode' ... OK
17/05/11 18:33.50  [speechRecognition]  Checking 'hemera.core.speechRecognition.soundConverter.path' ... OK
17/05/11 18:33.50  [speechRecognition]  Checking 'hemera.core.speechRecognition.soundConverter.options' ... OK
17/05/11 18:33.50  [speechRecognition]  Checking configuration specific to mode 'sphinx3' ...
17/05/11 18:33.50  [speechRecognition]  Checking 'hemera.core.speechRecognition.tool.path' ... OK
17/05/11 18:33.50  [speechRecognition]  Checking 'hemera.core.speechRecognition.tool.options' ... OK
17/05/11 18:33.50  [speechRecognition]  Checking 'hemera.core.speechRecognition.sphinx3.lexicalModel.words' ... OK
17/05/11 18:33.50  [speechRecognition]  Checking 'hemera.core.speechRecognition.sphinx3.lexicalModel.fillers' ... OK
17/05/11 18:33.50  [speechRecognition]  Checking 'hemera.core.speechRecognition.sphinx3.languageModel' ... OK
17/05/11 18:33.50  [speechRecognition]  Checking 'hemera.core.speechRecognition.sphinx3.acousticModel.definition' ... OK
17/05/11 18:33.50  [speechRecognition]  Checking 'hemera.core.speechRecognition.sphinx3.acousticModel.means' ... OK
17/05/11 18:33.50  [speechRecognition]  Checking 'hemera.core.speechRecognition.sphinx3.acousticModel.variances' ... OK
17/05/11 18:33.50  [speechRecognition]  Checking 'hemera.core.speechRecognition.sphinx3.acousticModel.mixtureWeights' ... OK
17/05/11 18:33.50  [speechRecognition]  Checking 'hemera.core.speechRecognition.sphinx3.acousticModel.transitionMatrices' ... OK
17/05/11 18:33.50  [speech]  Checking 'hemera.core.speech.mode' ... OK
17/05/11 18:33.50  [speech]  Checking 'hemera.core.speech.espeak.language' ... OK
17/05/11 18:33.50  [speech]  Checking 'hemera.core.speech.soundPlayer.path' ... OK
17/05/11 18:33.50  [speech]  Checking 'hemera.core.speech.soundPlayer.options' ... OK
17/05/11 18:33.50  [speech]  Checking configuration specific to mode 'espeak+mbrola' ...
17/05/11 18:33.50  [speech]  Checking 'hemera.core.speech.tool.path' ... OK
17/05/11 18:33.50  [speech]  Checking 'hemera.core.speech.tool.options' ... OK
17/05/11 18:33.50  [speech]  Checking 'hemera.core.speech.mbrola.path' ... OK
17/05/11 18:33.50  [speech]  Checking 'hemera.core.speech.mbrola.language' ... OK
17/05/11 18:33.50  [manageSound]  Checking 'hemera.core.speech.soundPlayer.path' ... OK
17/05/11 18:33.50  [manageSound]  Checking 'hemera.core.speech.soundPlayer.options' ... OK


Quick sound check

After you have configured your microphone, you can check sound recording and playing according to your configuration with the provided checker.
It uses exactly your configuration the same way than speech and speech recognition core modules; so this check must be successful.
When you launch it:

  • it starts sound recording and wait for you to speak in your microphone
  • speak in your microphone and then be silent (be sure there is no more sound captured by your microphone)
  • it indicates that sound has been successfully recorder, and then it plays it, and then starts a new recording

At any time, you can interrupt the test with CTRL+C.

It is recommended to use this tool and to record/play 2 sound files (without interrupting the checker) to ensure newfile SoX miscellaneous effect is working.
If it is not the case, ensure to have SoX v14.2 or later.

Output sample:

$ soundChecker.sh 
29/05/11 11:19.46  [soundChecker]  LogFile: /home/projettwk/programmation/projects/hemera/Hemera/run/log/2011-05-29-11-19-46-soundChecker.log
29/05/11 11:19.46  [soundChecker]  Starting sound recorder daemon ... 
29/05/11 11:19.46  [soundChecker]  At any time you can stop the test with CTRL+C
29/05/11 11:19.46  [soundChecker]  Speak in your microphone (then ensure there is silence when you have finished)
29/05/11 11:19.59  [soundChecker]  Successfully recorded 'recordedSound001.wav', system will play it
29/05/11 11:20.03  [soundChecker]  Speak in your microphone (then ensure there is silence when you have finished)
^C29/05/11 11:20.06  [soundChecker]  soundChecker is NOT running.


Speech core module check

For these tests, it can be interesting to use the verbose option (-v).
If your system is well configured, you should hear Hemera speak.

Single sentence

$ speech.sh -t "Test"  -v                                                                                                           
20/04/11 21:42.50  [speech]  LogFile: /home/projettwk/programmation/projects/hemera/Hemera/run/log/2011-04-20-21-42-50-speech.log                                                         
20/04/11 21:42.50  [speech]  INFO: Checking binary: aplay                                                                                                                               
20/04/11 21:42.50  [speech]  INFO: Checking binary: espeak
20/04/11 21:42.50  [speech]  INFO: Checking binary: /home/projettwk/programmation/projects/hemera/Hemera/thirdParty/speech/bin/mbrola
20/04/11 21:42.50  [speech]  INFO: Checking data file: /home/projettwk/programmation/projects/hemera/Hemera/thirdParty/speech/scripts/../data/language/fr4
20/04/11 21:42.50  [speech]  INFO: System will play speech 'Test', using espeak, and mbrola speechOutput=-
20/04/11 21:42.50  [speech]  INFO: Generated temporary speech file: /home/projettwk/programmation/projects/hemera/Hemera/run/tmp/work/1303328570-speechFile.wav

Wikipedia definition search

$ speech.sh -d "Intelligence" -v
20/04/11 21:46.07  [speech]  LogFile: /home/projettwk/programmation/projects/hemera/Hemera/run/log/2011-04-20-21-46-07-speech.log
20/04/11 21:46.07  [speech]  INFO: Checking binary: aplay
20/04/11 21:46.07  [speech]  INFO: Checking binary: espeak
20/04/11 21:46.07  [speech]  INFO: Checking binary: /home/projettwk/programmation/projects/hemera/Hemera/thirdParty/speech/bin/mbrola
20/04/11 21:46.07  [speech]  INFO: Checking data file: /home/projettwk/programmation/projects/hemera/Hemera/thirdParty/speech/scripts/../data/language/fr4
20/04/11 21:46.07  [speech]  INFO: Getting contents of URL 'http://en.mobile.wikipedia.org/transcode.php?go=Intelligence'
20/04/11 21:46.08  [speech]  INFO: Got contents of URL 'http://en.mobile.wikipedia.org/transcode.php?go=Intelligence' with success
20/04/11 21:46.08  [speech]  INFO: System will play speech '/home/projettwk/programmation/projects/hemera/Hemera/run/tmp/work/1303328767-DefinitionContents.tmp', using espeak, and mbrola speechOutput=-
20/04/11 21:46.09  [speech]  INFO: Generated temporary speech file: /home/projettwk/programmation/projects/hemera/Hemera/run/tmp/work/1303328768-speechFile.wav



Speech recognition core module check

You can use the miscellaneous script speech2Recognition.sh to check your configuration a funny way.
It uses the Speech core module to generate speech sound file which are then injected in the Speech Recognition core module.
Finally, script gives summary about given sentence, and final sentence (it can be interesting to check your models).

Single test

$ speech2Recognition.sh -t "Test"
20/04/11 21:55.14  [speech2Recognition]  LogFile: /home/projettwk/programmation/projects/hemera/Hemera/run/log/2011-04-20-21-55-14-speech2Recognition.log
20/04/11 21:55.14  [speech2Recognition]  Iteration 1/1, text to speech then recognize is 'Test'
20/04/11 21:55.14  [speech]  Generated speech file: /home/projettwk/programmation/projects/hemera/Hemera/run/tmp/work/1303329314-speech2Recognition-1.wav
20/04/11 21:55.14  [speechRecognition]  Converting sound file /home/projettwk/programmation/projects/hemera/Hemera/run/tmp/work/1303329314-speech2Recognition-1.wav ... done
20/04/11 21:55.14  [speechRecognition]  Creating feature sound file for /home/projettwk/programmation/projects/hemera/Hemera/run/tmp/work/1303329314-speech2Recognition-1.wav.raw ... done
20/04/11 21:55.14  [speechRecognition]  Launching result log analyzer ...
20/04/11 21:55.14  [speechRecognition]  Launching speech recognition on prepared sound list file /home/projettwk/programmation/projects/hemera/Hemera/run/tmp/work/1303329314-preparedSoundFileList.txt ...
20/04/11 21:55.16  [speechRecognition]  Managed sound file '1303329314-speech2Recognition-1.wav.raw':
  Result: terrestre 
  Stats:   42 frm;  3796 cdsen/fr,  225 cisen/fr, 83504 cdgau/fr,  4887 cigau/fr, Sen 0.69, CPU 0.69 Clk [Ovrhd 0.04 CPU 0.04 Clk]
          7979 hmm/fr,  51 wd/fr, Search: 0.19 CPU 0.20 Clk   
20/04/11 21:55.16  [speechRecognition]  Stopped result log analyzer.
20/04/11 21:55.18  [speech2Recognition]  After 1 iterations, text to speech 'Test' -> 'terrestre'

We can see that "Test" word alone is recognized as "terrestre" (in French); which means you should Create your own Speech Recognition Models.

Thorough test

The script allows specifying iteration count, allowing to see after how many iteration the Speech Recognition core module recognizes the same thing.

Test 1

With the same sentence than previous test.

$ speech2Recognition.sh -t "Test" -I 2
20/04/11 22:04.34  [speech2Recognition]  LogFile: /home/projettwk/programmation/projects/hemera/Hemera/run/log/2011-04-20-22-04-34-speech2Recognition.log
20/04/11 22:04.34  [speech2Recognition]  Iteration 1/2, text to speech then recognize is 'Test'
20/04/11 22:04.34  [speech]  Generated speech file: /home/projettwk/programmation/projects/hemera/Hemera/run/tmp/work/1303329874-speech2Recognition-1.wav
20/04/11 22:04.34  [speechRecognition]  Converting sound file /home/projettwk/programmation/projects/hemera/Hemera/run/tmp/work/1303329874-speech2Recognition-1.wav ... done
20/04/11 22:04.34  [speechRecognition]  Creating feature sound file for /home/projettwk/programmation/projects/hemera/Hemera/run/tmp/work/1303329874-speech2Recognition-1.wav.raw ... done
20/04/11 22:04.34  [speechRecognition]  Launching result log analyzer ...
20/04/11 22:04.34  [speechRecognition]  Launching speech recognition on prepared sound list file /home/projettwk/programmation/projects/hemera/Hemera/run/tmp/work/1303329874-preparedSoundFileList.txt ...
20/04/11 22:04.36  [speechRecognition]  Managed sound file '1303329874-speech2Recognition-1.wav.raw':
  Result: terrestre 
  Stats:   42 frm;  3795 cdsen/fr,  225 cisen/fr, 83491 cdgau/fr,  4887 cigau/fr, Sen 0.67, CPU 0.69 Clk [Ovrhd 0.02 CPU 0.04 Clk]
          8000 hmm/fr,  51 wd/fr, Search: 0.22 CPU 0.20 Clk   
20/04/11 22:04.36  [speechRecognition]  Stopped result log analyzer.
20/04/11 22:04.37  [speech2Recognition]  Iteration 2/2, text to speech then recognize is 'terrestre'
20/04/11 22:04.38  [speech]  Generated speech file: /home/projettwk/programmation/projects/hemera/Hemera/run/tmp/work/1303329874-speech2Recognition-2.wav
20/04/11 22:04.38  [speechRecognition]  Converting sound file /home/projettwk/programmation/projects/hemera/Hemera/run/tmp/work/1303329874-speech2Recognition-2.wav ... done
20/04/11 22:04.38  [speechRecognition]  Creating feature sound file for /home/projettwk/programmation/projects/hemera/Hemera/run/tmp/work/1303329874-speech2Recognition-2.wav.raw ... done
20/04/11 22:04.38  [speechRecognition]  Launching result log analyzer ...
20/04/11 22:04.38  [speechRecognition]  Launching speech recognition on prepared sound list file /home/projettwk/programmation/projects/hemera/Hemera/run/tmp/work/1303329878-preparedSoundFileList.txt ...
20/04/11 22:04.40  [speechRecognition]  Managed sound file '1303329874-speech2Recognition-2.wav.raw':
  Result: terrestre 
  Stats:   42 frm;  3789 cdsen/fr,  225 cisen/fr, 83347 cdgau/fr,  4887 cigau/fr, Sen 0.69, CPU 0.69 Clk [Ovrhd 0.04 CPU 0.04 Clk]
          7939 hmm/fr,  51 wd/fr, Search: 0.20 CPU 0.20 Clk   
20/04/11 22:04.40  [speechRecognition]  Stopped result log analyzer.
20/04/11 22:04.41  [speech2Recognition]  After 2 iterations, text to speech 'Test' -> 'terrestre'

We can see, it stable after 1 iteration.

Test 2

Checking with a French sentence.

$ speech2Recognition.sh -t "Bonjour à tous" -I 2
20/04/11 22:05.52  [speech2Recognition]  LogFile: /home/projettwk/programmation/projects/hemera/Hemera/run/log/2011-04-20-22-05-52-speech2Recognition.log
20/04/11 22:05.52  [speech2Recognition]  Iteration 1/2, text to speech then recognize is 'Bonjour à tous'
20/04/11 22:05.52  [speech]  Generated speech file: /home/projettwk/programmation/projects/hemera/Hemera/run/tmp/work/1303329952-speech2Recognition-1.wav
20/04/11 22:05.52  [speechRecognition]  Converting sound file /home/projettwk/programmation/projects/hemera/Hemera/run/tmp/work/1303329952-speech2Recognition-1.wav ... done
20/04/11 22:05.52  [speechRecognition]  Creating feature sound file for /home/projettwk/programmation/projects/hemera/Hemera/run/tmp/work/1303329952-speech2Recognition-1.wav.raw ... done
20/04/11 22:05.52  [speechRecognition]  Launching result log analyzer ...
20/04/11 22:05.52  [speechRecognition]  Launching speech recognition on prepared sound list file /home/projettwk/programmation/projects/hemera/Hemera/run/tmp/work/1303329952-preparedSoundFileList.txt ...
20/04/11 22:05.55  [speechRecognition]  Managed sound file '1303329952-speech2Recognition-1.wav.raw':
  Result: bonjour à tous 
  Stats:   89 frm;  3873 cdsen/fr,  225 cisen/fr, 85197 cdgau/fr,  4887 cigau/fr, Sen 0.69, CPU 0.70 Clk [Ovrhd 0.03 CPU 0.04 Clk]
          8580 hmm/fr,  22 wd/fr, Search: 0.22 CPU 0.22 Clk   
20/04/11 22:05.55  [speechRecognition]  Stopped result log analyzer.
20/04/11 22:05.56  [speech2Recognition]  Iteration 2/2, text to speech then recognize is 'bonjour à tous'
20/04/11 22:05.56  [speech]  Generated speech file: /home/projettwk/programmation/projects/hemera/Hemera/run/tmp/work/1303329952-speech2Recognition-2.wav
20/04/11 22:05.56  [speechRecognition]  Converting sound file /home/projettwk/programmation/projects/hemera/Hemera/run/tmp/work/1303329952-speech2Recognition-2.wav ... done
20/04/11 22:05.56  [speechRecognition]  Creating feature sound file for /home/projettwk/programmation/projects/hemera/Hemera/run/tmp/work/1303329952-speech2Recognition-2.wav.raw ... done
20/04/11 22:05.56  [speechRecognition]  Launching result log analyzer ...
20/04/11 22:05.56  [speechRecognition]  Launching speech recognition on prepared sound list file /home/projettwk/programmation/projects/hemera/Hemera/run/tmp/work/1303329956-preparedSoundFileList.txt ...
20/04/11 22:05.59  [speechRecognition]  Managed sound file '1303329952-speech2Recognition-2.wav.raw':
  Result: bonjour à tous 
  Stats:   89 frm;  3873 cdsen/fr,  225 cisen/fr, 85204 cdgau/fr,  4887 cigau/fr, Sen 0.70, CPU 0.70 Clk [Ovrhd 0.03 CPU 0.04 Clk]
          8587 hmm/fr,  22 wd/fr, Search: 0.22 CPU 0.22 Clk   
20/04/11 22:05.59  [speechRecognition]  Stopped result log analyzer.
20/04/11 22:06.00  [speech2Recognition]  After 2 iterations, text to speech 'Bonjour à tous' -> 'bonjour à tous'

We can see that it is well recognized from the first iteration.



Go to User Guide