satori-flow
v0.1.1
Published
[![Build Status](https://travis-ci.org/voice-assistant/satori-flow.svg?branch=master)](https://travis-ci.org/voice-assistant/satori-flow)
Downloads
2
Readme
Satori
An intent detector.
Overview
Satori is a tiny library to detect intent of input sentence. Specifically Ssatori gets the input JSON (containing sentence, device type and user id) and then returns the intention and the arguments, which are needed to process the selected tasks.
Install
Run the following command in your repository.
npm install git+ssh://[email protected]/voice-assistant/satori-flow --save
Sample
The following is a sample code to detect intent from user by Satori.
import { ConfigurationBuilder } from 'satori-flow'
import { IntentDetector } from 'satori-flow'
const config = new ConfigurationBuilder()
.addIntent("repeat", { "type" : "verbatim", "patterns" : [ "repeat", "please repeat" ]})
.addRunner("repeat", {"type" : "random", "list" : ["sure"]} )
.build();
const detector = new IntentDetector(config);
const result = detector.match({"text" : "I would like to repeat again.", "userId" : 985499 });
console.log(result)
For detailed usage. Please read doc/main.adoc.
License
Apache 2.0
Contribution
See CONTRIBUTING.md.