Keyworder - Intent prediction form PrgChatbot
Predict user intents with cool machine learning tool, Facebook FastText.
Preparing the model
- Install Facebook FastText
- Follow instructions
Using with Prg-Chatbot
Usage
const Router = ;const keyworder = ;const path = ; keyworder; const app = ; app;
API
Functions
- keyworder(tag, [threshold], [namespace]) ⇒
function
Create resolver middleware for PrgChatbot
- setResolver(configuration, [namespace])
- resolve(text, [threshold], [namespace]) ⇒
Promise.<{tag:string, score:number}>
Resolve single text
Typedefs
- Configuration :
Object
function
keyworder(tag, [threshold], [namespace]) ⇒ Create resolver middleware for PrgChatbot
Kind: global function
Param | Type | Description |
---|---|---|
tag | string |
tag for matching |
[threshold] | number |
override success threshold |
[namespace] | string |
resolver namespace |
Example
const keyworder = ; router;
setResolver(configuration, [namespace])
Kind: global function
Param | Type | Description |
---|---|---|
configuration | Configuration |
the resolver configuration |
[namespace] | string |
set resolver for diferent namespace |
Example
const keyworder = ;const path = ; keyworder;
Promise.<{tag:string, score:number}>
resolve(text, [threshold], [namespace]) ⇒ Resolve single text
Kind: global function
Param | Type | Description |
---|---|---|
text | string |
query text |
[threshold] | number |
override the threshold |
[namespace] | string |
use other than default resolver |
Object
Configuration : Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
model | string |
path to trained fast text model |
threshold | number |
prediction threshold (0.95 recommended) |
cacheSize | number |
keep this amount of results cached |
filter | function |
text preprocessor |
logger | function |
resolver logger function |