diff --git a/-keyphrase b/-keyphrase new file mode 100644 index 0000000..e69de29 diff --git a/-time b/-time new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md new file mode 100644 index 0000000..fecb6fd --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +# requirements +/!\ You need to have the [Kalliope Core](https://github.com/kalliope-project/kalliope) installed before cloning this starter kit. + +# kalliope starter config fr + +This is an out of the box working configuration for french kalliope user + +How to use + ```bash +git clone https://github.com/kalliope-project/kalliope_starter_fr.git +cd kalliope_starter_fr +kalliope start +``` diff --git a/brain.yml b/brain.yml new file mode 100755 index 0000000..6371842 --- /dev/null +++ b/brain.yml @@ -0,0 +1,22 @@ +--- + + - includes: + - brains/say.yml + - brains/systemdate.yml + - brains/neurotransmitter.yml + - brains/recherche.yml + - brains/kill.yml + + - name: "default-synapse" + signals: + - order: "default-synapse" + neurons: + - say: + message: + - "Je n'ai pas compris vôtre ordre" + - "Je ne connais pas cet ordre" + - "Veuillez renouveller votre ordre" + - "Veuillez reformuller s'il vous plait" + - "Je n'ai pas saisi cet ordre" + + diff --git a/brains/kill.yml b/brains/kill.yml new file mode 100644 index 0000000..2a668e2 --- /dev/null +++ b/brains/kill.yml @@ -0,0 +1,9 @@ +--- + + - name: "stop-kalliope" + signals: + - order: "stop" + neurons: + - say: + message: "Au revoir" + - kill_switch diff --git a/brains/neurotransmitter.yml b/brains/neurotransmitter.yml new file mode 100644 index 0000000..65d0fdf --- /dev/null +++ b/brains/neurotransmitter.yml @@ -0,0 +1,40 @@ +--- + - name: "synapse1" + signals: + - order: "pose moi une question" + - order: "pose-moi une question" + neurons: + - say: + message: "aimez vous les frites?" + - neurotransmitter: + from_answer_link: + - synapse: "synapse2" + answers: + - "absolument" + - "peut-être" + - synapse: "synapse3" + answers: + - "pas du tout" + default: "synapse4" + + - name: "synapse2" + signals: + - order: "synapse2" + neurons: + - say: + message: "Vous aimez les frites! Moi aussi!" + + + - name: "synapse3" + signals: + - order: "synapse3" + neurons: + - say: + message: "vous n'aimez pas les frites. c'est pas grave." + + - name: "synapse4" + signals: + - order: "synapse4" + neurons: + - say: + message: "Je n'ai pas compris votre réponse" \ No newline at end of file diff --git a/brains/recherche.yml b/brains/recherche.yml new file mode 100644 index 0000000..1e646b9 --- /dev/null +++ b/brains/recherche.yml @@ -0,0 +1,11 @@ + - name: "search-fr" + signals: + - order: "recherche {{ search }}" + neurons: + - say: + message: + - "Recherche effectuee" + - search: + args: + - search + async: False diff --git a/brains/say.yml b/brains/say.yml new file mode 100644 index 0000000..a9c2703 --- /dev/null +++ b/brains/say.yml @@ -0,0 +1,46 @@ +--- + - name: "say-hello-fr" + signals: + - order: "Bonjour" + neurons: + - say: + message: + - "Bonjour monsieur" + + - name: "open-software-fr" + signals: + - order: "ouvre moi {{ application }}" + - order: "ouvre-moi {{ application }}" + - order: "ouvrir {{ application }}" + - order: "ouvre {{ application }}" + - order: "ouvres {{ application }}" + neurons: + - say: + message: + - "Le logiciel est ouvert" + - run: + args: + - application + async: True + + - name: "open-google-fr" + signals: + - order: "google" + neurons: + - say: + message: + - "Google est ouvert" + - shell: + cmd: "firefox http://www.google.fr/&" + async: True + + - name: "open-facebook-fr" + signals: + - order: "facebook" + neurons: + - say: + message: + - "Facebook est ouvert" + - shell: + cmd: "firefox http://fr-fr.facebook.com/&" + async: True diff --git a/brains/systemdate.yml b/brains/systemdate.yml new file mode 100644 index 0000000..137f6bb --- /dev/null +++ b/brains/systemdate.yml @@ -0,0 +1,23 @@ +--- + + - name: "say-local-date" + signals: + - order: "quelle heure est-il" + neurons: + - systemdate: + say_template: + - "il est {{ hours }} heure et {{ minutes }} minute" + + - name: "say-local-date-from-template" + signals: + - order: "quelle date sommes-nous" + neurons: + - systemdate: + file_template: "templates/systemdate_template.j2" + + - name: "gouter-time" + signals: + - order: "est-ce qu'il est l'heure du goûter" + neurons: + - systemdate: + file_template: "templates/systemdate_template_gouter.j2" \ No newline at end of file diff --git a/file b/file new file mode 100644 index 0000000..1ee55d4 --- /dev/null +++ b/file @@ -0,0 +1,5 @@ +sudo apt-get install swig libpulse-dev +sudo apt install libttspico-utils +sudo apt install libatlas3-base +sudo apt install libopenblas-base +sudo apt install libblas3 diff --git a/res b/res new file mode 100644 index 0000000..e69de29 diff --git a/resources/neurons/.gitignore b/resources/neurons/.gitignore new file mode 100644 index 0000000..86d0cb2 --- /dev/null +++ b/resources/neurons/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore \ No newline at end of file diff --git a/resources/stt/.gitignore b/resources/stt/.gitignore new file mode 100644 index 0000000..86d0cb2 --- /dev/null +++ b/resources/stt/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore \ No newline at end of file diff --git a/resources/tts/.gitignore b/resources/tts/.gitignore new file mode 100644 index 0000000..86d0cb2 --- /dev/null +++ b/resources/tts/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore \ No newline at end of file diff --git a/settings.yml b/settings.yml new file mode 100644 index 0000000..0b80509 --- /dev/null +++ b/settings.yml @@ -0,0 +1,150 @@ +--- +# --------------------------- +# Kalliope default settings +# Use YAML syntax +# --------------------------- + +# --------------------------- +# Trigger +# --------------------------- +# This is the trigger that will catch your magic work to wake up Kalliope +default_trigger: "snowboy" + +# Trigger engine configuration +# Available engine are: +# - snowboy +triggers: + - snowboy: + pmdl_file: "trigger/kalliope-FR-20samples.pmdl" + + +# --------------------------- +# Speech to text +# --------------------------- + +# This is the STT that will be used by default +default_speech_to_text: "google" + +# Spreech to Text engines configuration +# Available engine are: +# - google (via SpeechRecognition) +# - +speech_to_text: + - cmusphinx: + -hmm: "/usr/local/lib/python2.7/dist-packages/pocketsphinx/model/fr" + -lm: "/usr/local/lib/python2.7/dist-packages/pocketsphinx/model/fr.lm.bin" + -dict: "/usr/local/lib/python2.7/dist-packages/pocketsphinx/model/fr.dict" + - google: + language: "fr-FR" + - wit: + key: "B5JI3YUSLYOYWNIDBINBVM34XUODME2K" + - bing: # API not working : credential fails .. + key: "9e48ddaf75904838bedc11aea6b36fb0" + - apiai: # Fail retriving the text from the audio file .. + key: "e0cbff154af44944a6b9f82c0668b527" + language: "fr" + - houndify: # In the online documentation but Not implemented yet in the speech recognition lib ..? + key: "7zj90T7qAV74OYXk4X4vI2Xhk7wPsJu4aEZ0G5Ll-BMmV1JGtFpCxtSH9SmTY4G3bpEJ7a5y_GTQid-CAKI6vw==" + client_id: "lN4JXeaSticbSo9-llczbA==" + + +# --------------------------- +# Text to speech +# --------------------------- +# This is the default TTS that will be used by Kalliope to talk. +default_text_to_speech: "pico2wave" +# where we store generated audio files from TTS engine to reuse them +cache_path: "/tmp/kalliope_tts_cache" + +# Text to Spreech engines configuration +# Available engine are: +# - pico2wave +# - voxygen +text_to_speech: + - espeak: + voice: "fr" + variant: "f1" + cache: True + - pico2wave: + language: "fr-FR" + cache: True + - voxygen: + voice: "Agnes" + cache: True + - acapela: + language: "sonid15" + voice: "Manon" + cache: True + - googletts: + language: "fr" + cache: True + - voicerss: + language: "fr-fr" + cache: True + + +# --------------------------- +# Wake up answers +# --------------------------- +# When Kalliope detect the hotword/trigger, he will select randomly a phrase in the following list +# to notify the user that he's listening for orders +random_wake_up_answers: + - "Oui monsieur?" + - "Je vous écoute" + - "Monsieur?" + - "Que puis-je faire pour vous?" + - "J'écoute" + - "Oui?" + +# You can play a sound when Kalliope detect the hotword/trigger instead of saying something from +# the `random_wake_up_answers`. To active the 'random_wake_up_sounds' you must comment out the 'random_wake_up_answers' +# The file must be .wav or .mp3 format. +random_wake_up_sounds: + - "trigger/dong.wav" + # - "/my/personal/full/path/my_file.mp3" + +# --------------------------- +# On ready notification +# --------------------------- +# This section is used to notify the user when Kalliope is waiting for a trigger detection by playing a sound or speak a sentence out loud + +# This parameter define if you play the on ready answer: +# - always: every time Kalliope is ready to be awaken +# - never: never play a sound or sentences when kalliope is ready +# - once: at the first start of Kalliope +play_on_ready_notification: "never" + +# The on ready notification can be a sentence. Place here a sentence or a list of sentence. If you set a list, one sentence will be picked up randomly +on_ready_answers: + - "en attente" + +# You can play a sound instead of a sentence. +# Remove the `on_ready_answers` parameters by commenting it out and use this one instead. +# Place here the path of the sound file. Files must be .wav or .mp3 format. +on_ready_sounds: +# - "sounds/ding.wav" + - "sounds/dong.wav" + +# --------------------------- +# Rest API +# --------------------------- +rest_api: + active: True + port: 5000 + password_protected: True + login: admin + password: secret + +# --------------------------- +# Default Synapse +# --------------------------- +# Specify an optional default synapse response in case your order is not found. +default_synapse: "default-synapse" + +# --------------------------- +# resource directory path +# --------------------------- +resource_directory: + neuron: "resources/neurons" + stt: "resources/stt" + tts: "resources/tts" diff --git a/templates/rss_new_lemonde.j2 b/templates/rss_new_lemonde.j2 new file mode 100644 index 0000000..7c1c9c5 --- /dev/null +++ b/templates/rss_new_lemonde.j2 @@ -0,0 +1,7 @@ +Voici les info de {{ feed }} + +{% set count = 1 %} +{% for item in items %} +Info {{ count }}. {{ item.title }} +{% set count = count + 1 %} +{% endfor %} \ No newline at end of file diff --git a/templates/systemdate_template.j2 b/templates/systemdate_template.j2 new file mode 100644 index 0000000..64f73b1 --- /dev/null +++ b/templates/systemdate_template.j2 @@ -0,0 +1,4 @@ +{% set day_of_week = {"0": "dimanche", "1": "lundi", "2": "mardi", "3": "mercredi", "4": "jeudi", "5": "vendredi", "6": "samedi"}[weekday] | default("") -%} +{% set month_word = {"1": "janvier", "2": "février", "3": "mars", "4": "avril", "5": "mai", "6": "juin", "7": "juillet", "8": "août", "9": "septembre", "10": "octobre", "11": "novembre", "12": "décembre"}[month] | default("") -%} + +Nous sommes le {{ day_of_week }} {{ day_month }} {{ month_word }} {{ year }} \ No newline at end of file diff --git a/templates/systemdate_template_gouter.j2 b/templates/systemdate_template_gouter.j2 new file mode 100644 index 0000000..211ffa7 --- /dev/null +++ b/templates/systemdate_template_gouter.j2 @@ -0,0 +1,5 @@ +{% if hours|int() in range(16,17) %} +oui il est l'heure +{% else %} +non pas encore +{% endif %} \ No newline at end of file diff --git a/templates/wikipedia_search.j2 b/templates/wikipedia_search.j2 new file mode 100644 index 0000000..9cac816 --- /dev/null +++ b/templates/wikipedia_search.j2 @@ -0,0 +1,12 @@ +{% if returncode == "DisambiguationError" %} + La recherche retourne les pages suivantes: + {% if may_refer is not none %} + {% for page in may_refer %} + {{ page }} + {% endfor %} + {% endif %} +{% elif returncode == "PageError" %} + La recherche n'a rien donnée +{% else %} + {{ summary }} +{% endif %} \ No newline at end of file diff --git a/test b/test new file mode 100644 index 0000000..0b2ce88 --- /dev/null +++ b/test @@ -0,0 +1 @@ +pocketsphinx_continuous -hmm /usr/local/lib/python2.7/dist-packages/pocketsphinx/model/fr -lm /usr/local/lib/python2.7/dist-packages/pocketsphinx/model/fr.lm.bin -dict /usr/local/lib/python2.7/dist-packages/pocketsphinx/model/fr.dict -infile test.wav -samprate 48000 -nfft 2048 diff --git a/test.wav b/test.wav new file mode 100644 index 0000000..be7b0c9 Binary files /dev/null and b/test.wav differ diff --git a/trigger/dong.wav b/trigger/dong.wav new file mode 100644 index 0000000..426596b Binary files /dev/null and b/trigger/dong.wav differ diff --git a/trigger/kalliope-FR-20samples.pmdl b/trigger/kalliope-FR-20samples.pmdl new file mode 100644 index 0000000..6aac0ee Binary files /dev/null and b/trigger/kalliope-FR-20samples.pmdl differ