Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

keyworder

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

keyworder

Intent recognition for prg-chatbot

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Keyworder - Intent prediction form PrgChatbot

Predict user intents with cool machine learning tool, Facebook FastText.

Preparing the model

  1. Install Facebook FastText
  2. Follow instructions

Using with Prg-Chatbot

Usage

const { Router } = require('prg-chatbot');
const keyworder = require('keyworder');
const path = require('path');

keyworder.setResolver({
    model: path.join(process.cwd(), 'models', 'model.bin')
});

const app = new Router();

app.use(keyworder('hello'), (req, res, postBack, next) => {
    res.text('Hello too!');
});


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

keyworder(tag, [threshold], [namespace]) ⇒ function

Create resolver middleware for PrgChatbot

Kind: global function

ParamTypeDescription
tagstringtag for matching
[threshold]numberoverride success threshold
[namespace]stringresolver namespace

Example

const keyworder = require('keyworder');

router.use(keyworder('hello-intent'), (req, res) => {
    res.text('Welcome too!');
});

setResolver(configuration, [namespace])

Kind: global function

ParamTypeDescription
configurationConfigurationthe resolver configuration
[namespace]stringset resolver for diferent namespace

Example

const keyworder = require('keyworder');
const path = require('path');

keyworder.setResolver({
    model: path.join(__dirname, 'model.bin')
});

resolve(text, [threshold], [namespace]) ⇒ Promise.<{tag:string, score:number}>

Resolve single text

Kind: global function

ParamTypeDescription
textstringquery text
[threshold]numberoverride the threshold
[namespace]stringuse other than default resolver

Configuration : Object

Kind: global typedef
Properties

NameTypeDescription
modelstringpath to trained fast text model
thresholdnumberprediction threshold (0.95 recommended)
cacheSizenumberkeep this amount of results cached
filterfunctiontext preprocessor
loggerfunctionresolver logger function

Keywords

FAQs

Package last updated on 08 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc