s_intentions

1.1.1 • Public • Published

s_intentions

It's a free dependencies Node.js package that provides a module for detecting user intentions while typing a string, comparing it against a list of possible intentions built by Sìntropia.

Key Features:

  • Intent Detection: Determines the likelihood that an input string matches each of the provided possible intentions.
  • String Permutations: Utilizes permutation algorithms to explore possible variants of strings, enhancing the robustness of intent detection.
  • Edit Distance: Calculates the edit distance between permutations of the input string and permutations of possible intentions.

Installation

npm install s_intentions

Usage

import { detect, getMostLikely } from 's_intentions';

-------- USING THE DETECT METHOD --------
const stringToDetect = 'Elon Mudk';
const possibleIntentions = ['Elon Musk', 'Tony Stark', 'Peter Parker'];

const results = detect(stringToDetect, possibleIntentions);
console.log(results);

/* 
RETURNS:
[
  { intenction: 'Elon Musk', probability: 0.8888888888888888 },
  { intenction: 'Tony Stark', probability: 0.30000000000000004 },
  { intenction: 'Peter Parker', probability: 0.25 }
] */

-------- USING THE GETMOSTLIKELY METHOD --------
const stringToDetect = 'Elon Mudk';
const possibleIntentions = ['Elon Musk', 'Tony Stark', 'Peter Parker'];
const minimumThresholdNeeded = 0.8;
const results = getMostLikely(stringToDetect, possibleIntentions, minimumThresholdNeeded);
console.log(results);

/* 
RETURNS:
"Elon Musk"
*/


s_intentions simplifies the process of intent detection, making it easier to understand and respond to user needs during interaction with an input string.

License

This project is licensed under the MIT License.

Package Sidebar

Install

npm i s_intentions

Weekly Downloads

1

Version

1.1.1

License

ISC

Unpacked Size

6.52 kB

Total Files

6

Last publish

Collaborators

  • yodo