Quick and dirty NodeJS bindings for snips-nlu-rs.
- Library needs to be made async, loading and parsing block, will have to work out how to do it in Neon.
- Implement filter_intents parameter
- Unit tests
- Zip/Dir loading
- Feature parity with other FFI's
curl https://sh.rustup.rs -sSf | sh
npm install
Set dockers max container memory to 4gb. snips-nlu-rs uses a lot when compiling. See the issue here
docker build -t snips-nlu-js .
docker run -t -i snips-nlu-js
You may also want to mount a local filesystem to the directory /work so you can extract the files from the container with the -v /host/directory:/work
command
npm install
Currently only local usage only, binaries will be published on release
cd path/to/snips-nlu-js
npm link
cd path/to/your/project
npm link snips-nlu-js
In your code:
const createNluEngine = require('snips-nlu-js');
try {
const nluEngine = createNluEngine('./path/to/assistant.json');
const result = nluEngine.parse('your string');
console.log(result);
} catch (e) {
console.error(e.message);
}
./cli.js trained_assistant.json weather
The package has been developed on Node 8 and it worked on Node 6. Enough for AWS Lambda.
Thanks to the Neon project for their rust bindings and Snips for their super fast rust implementation of their nlu engine
Licensed under the Apache License, Version 2.0.