New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

molir

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

molir

A Most Likely Intent Recogniser (MoLIR)

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

MoLIR

MoLIR (A.k.a Most Likely Intent Recogniser) is a simple, non machine learning, text intent classifier.

Usage

1 - Install dependency

npm install molir --save

2 - Require the module

const IntentClassifier = require('molir');

3 - Declare your intents

let intents = [
    {
      "intentName":"WEATHER",
      "utterences":[
        "Weather",
        "Whats the weather like?",
        "Hows the weather looking?",
        "Whats the weather forecast"
      ],
      "keywords": [
        "Weather",
        "Forecast"
      ]
    },
    {
      "intentName":"NEWS",
      "utterences":[
        "News",
        "Todays news",
        "Whats the top story?",
        "Whats the top news",
        "Whats going on today",
        "Whats going on"
      ],
      "keywords": [
        "News",
        "Story"
      ]
    },
    {
      "intentName":"GREETING",
      "utterences":[
        "Hello",
        "Hey",
        "Howdy",
        "Hello how are you?"
      ],
      "keywords": [
        "Hello",
        "Hey",
        "Howdy"
      ]
    }
  ];

4 - Create classifier passing in the intents and a minimum matching confidence score

let classifier = new IntentClassifier(intents, 0.75);

5 - Classify your input

classifier.classify("Whats todays news?")
.then((result)=>{
    console.log(result);
    /*
    { 
        classified: true,
        intentName: 'NEWS',
        confidence: 0.8888888888888888 
    }
    */
})

Keywords

molir

FAQs

Package last updated on 02 Aug 2018

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