0.0.2 • Published 7 years ago

@botsfactory/botframework-watson-recognizer v0.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
7 years ago

@botsfactory/botframework-watson-recognizer

An Intent Recognizer to use IBM's Watson Conversation service with Microsoft's Bot Framework

NPM Version

Install

npm i -S @botsfactory/botframework-watson-recognizer

Usage

Usage is the same as with LuisRecognizer, only Watson's service credential and Workspace Id are needed.

Now Watson recognizer has multi language support.

import { WatsonRecognizer, IWatsonModelMap, IWatsonModel } from 'botframework-watson-recognizer';

//Map all your language models here, you can set only one, it's ok
let watsonModelMap: IWatsonModelMap = {
    en: { username: '<user_en>', password: '<password_en>', workspaceId: '<workspace-id_en>' },
    es: { username: '<user_es>', password: '<password_es>', workspaceId: '<workspace-id_es>' }
};

let recognizer = new WatsonRecognizer(watsonModelMap, process.env.INTENT_THRESHOLD);

let intents = new builder.IntentDialog({ recognizers: [recognizer] });

bot.dialog(`/`, intents)

intents.matches('greeting', '/greeting');
    
bot.dialog(`/greeting`,
    [
        (session: Session) => {
            session.send(`Hi!`)
            session.endDialog();
        }
    ]);

NOTE

This Recognizer only supports Intents and Entities extraction, Watson's Dialogs are not implemented yet.

Todo

  • Unit tests
  • MAYBE support Watson's Dialog

Check us out!

https://www.thebotmakers.com

License

MIT