Skip to main content

Project Alice CLI tool

Project description

nluTrainer

A decentralized NLU trainer

The idea behind this small tool is to provide a simple trainer on your Network for Alice to use. Training the NLU is a costly operation and your device running ProjectAlice might get slow at it the more skills you have. In order for Alice to use it, turn on the option delegateNluTraining

Users

To use this, create a Virtual Environment wherever you wish on your main computer, be it Windows, Linux or Mac, on a Synology station, whatever network device that can run python. Make sure this device runs Python 3.7!

python3.7 -m venv venv

Activate your virtual environment and install the nlu trainer with pip:

pip install projectalice-nlu-trainer

That's all you need to install!

Devs of this tool

  • Clone this repository
  • Open a terminal on whatever OS you are
  • CD to the path where you cloned this repository
  • Create a python 3.7 virtual environment: python -m venv
  • Activate your virtual environment
  • Install the package in dev mode: pip install --editable .

Usage

Run the trainer using this command, in your terminal, with admin rights as it needs to install the language packs:

alice-trainer --host ALICE_IP

You can also define some other options with arguments:

  • -h / --host: Define the Mqtt hostname, generally it's Alice's main unit IP address
  • -p / --port: Define the Mqtt port, by default 1883
  • -u / --user: Define a Mqtt username to connect with
  • -s / --password: Define a Mqtt password to connect with
  • -f / --tls_file: Define the path to your TLS certificate file to connect with, if you Mqtt server requires it

As you want it to be always running, you might want to automate it to run at computer boot.

Messages

  • projectalice/nlu/doTrain : Send this message to have the trainer train on the data in payload.

Payload structure:

{
    "language": "en",
    "data": "the data to train the NLU on, as a json string"
}
  • projectalice/nlu/trainerReady : Sent when the trainer has started and connected

  • projectalice/nlu/trainerStopped : Sent when the trainer is stopped

  • projectalice/nlu/trainingFailed : Sent if the training failed with the reason as payload

  • projectalice/nlu/trainingResult/# : Sent when the training is finished with the zipped result as a bytearray in payload. The mqtt topic last level is the file control hash (hashlib.blake2b(result.read_bytes()).hexdigest())

Nice to know

  • The trainer can only train if it's not already training.
  • The trainer will download the language pack each time a training is asked
  • You can only train Snips NLU on this for now
  • You are limited to Snips NLU supported languages

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

projectalice-nlu-trainer-1.0.0.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

projectalice_nlu_trainer-1.0.0-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file projectalice-nlu-trainer-1.0.0.tar.gz.

File metadata

  • Download URL: projectalice-nlu-trainer-1.0.0.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for projectalice-nlu-trainer-1.0.0.tar.gz
Algorithm Hash digest
SHA256 be6f6b50c7952917c7e443a387be81293f119f55b1d472dfa644bd013fd4ab03
MD5 b1464c31a99eb467dd9c2130a03a70fb
BLAKE2b-256 aa49c12479cdc8d68a2917cef888f1ed4e35057a8adb10eb0ba6607a1a3f9458

See more details on using hashes here.

File details

Details for the file projectalice_nlu_trainer-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: projectalice_nlu_trainer-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 18.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for projectalice_nlu_trainer-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8965f4654d6bc4687417a4bbcfeecbf9b1be069ee0617baeee1a88a166979b92
MD5 56d9a76b61d3512acbc46c34994168e6
BLAKE2b-256 2f2294c205a5604a6a77eb55cc75c710e6ccb5fac054d5214dacf4f22a0a2e19

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page