These steps assume Python 3.4+
, PortAudio
and Speex
are already installed. See the Mix.nlu Python sample app's README for more information.
You should also have a Twilio developer account, with a valid number that can send SMS.
Once you have all that, you can install your Python environment:
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
-
Copy the credentials file and contact list templates:
cp contacts.sample.json contacts.json cp creds.sample.json creds.json
-
Create an empty Mix.nlu model, then upload
sms-model.trsx
; -
Publish a version of the model, and create an app config (context tag of your choice) pointing to it;
-
Copy the Mix.nlu credentials for the app config, and update
creds.json
; -
Get your Twilio developer credentials, and update
creds.json
; -
Edit
contacts.json
with the contacts you wish to use.
The LOG
variable in nlu.py
can optionally be set to False
,
in order to disable printing all WebSocket messages to the screen.
Note: user_id
should be set accordingly for each command
This command should be run first, with the actual list of contacts to be recognized.
python nlu.py --user_id=samueldg data_upload CONTACT contacts.json
Note: There is a short delay before the data upload actually kicks in for the recognition. Doing a couple of NLU requests usually does the trick.
python nlu.py --user_id=samueldg audio
python nlu.py --user_id=samueldg text 'Say hi to myself'
python nlu.py --user_id=samueldg data_wipe