Socket
Socket
Sign inDemoInstall

dropsuit-dersnt

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dropsuit-dersnt

DropSuit NLP - dersnt function: DropSuit NLP Method: dersnt - A JavaScript and Node.js function for locating sentences based on input nouns and uncovering derivative nouns.


Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

TAI Lab.

npm version npm License

Overview of DropSuit NLP and the dersnt Function

DropSuit NLP is an open-source JavaScript and Node.js library providing various tools for natural language processing and data manipulation. The dersnt function is one of its modules, used for processing default object instance json key value arrays (req_arr: requests), (res_arr: responses). It locates sentences based on input nouns and extracts derivative nouns, and offers three output options: dsnSn() for derivative sentences, dsnSt() for a concatenated string of derivative words, and dsnAr() for an array of derivative sentences' words. This library is licensed under the Apache License 2.0.

DropSuit NLP Method: dersnt - A JavaScript and Node.js function for finding sentences based on input nouns and uncovering derivative nouns

The dersnt function is a part of the DropSuit NLP library, and works in both JavaScript and Node.js. It processes default object instance json key value arrays (req_arr: requests), (res_arr: responses) to find sentences related to input nouns and extract derivative nouns. It provides three output options: dsnSn() for derivative sentences, dsnSt() for a concatenated string of derivative words, and dsnAr() for an array of derivative sentences' words. This function is open-source and available under the Apache License 2.0.

Installation

Add the library function by installing it via npm:

npm install dropsuit-dersnt

Usage

Import the library in your project:

const dropsuit_dersnt = require("dropsuit-dersnt");

Process intents.json using 'jsonIntStrct' function:

const json_data = require("dropsuit-dersnt/jsobj.js");
let intentData = json_data.jsonIntStrct("assets/json/intents.json");

Set boolean parameter (true/false) argument value to display console log processing results output information in terminal:

let dsdersnt = new dropsuit_dersnt(null, intentData.req_arr, intentData.res_arr, false);
dersnt(input: string|null, swa: number)
  • null/string: Input 'myInputString', or keep NULL to process constructor 'input'. Processes default object instance json key value (req_arr: requests), (res_arr: responses) array patterns.
  • swa: Stop word amount, a number 0-2, where 0 is minimum, 1 adds extra, and 2 is maximum from 3 lists.
Output return options:
  • dsnSn() Returns an array of derivative sentences.
  • dsnSt() Returns a concatenated string of derivative words.
  • dsnAr() Returns an array of derivative sentences, with each sentence broken down into an array of words.
Flowchart:
┌───────────────────────────┐
│      Input Sentence       │
└─────────────┬─────────────┘
┌─────────────┴─────────────┐       
│      Extract Nouns        │
└─────────────┬─────────────┘
┌─────────────┴─────────────┐
│   Derivative Sentences    │
└─────────────┬─────────────┘
┌─────────────┴─────────────┐
│ Derivative Sentence Nouns │
└───────────────────────────┘

Call function:

let out = dsdersnt.dersnt(myInputString);
console.log(out);

Return object instance:

Input:

 [ 'hello bot ok tell me please what kinds of items you sell please' ]

Nouns:

 [ 'bot', 'please', 'kinds', 'items', 'sell' ]

Output:

- Derivative sentences/nouns -

 {
  dsnSen: [
    'What kinds of items do you sell?',
    'What items do you have available?',
    'What are some of your best-selling items?'
  ],
  dsnStr: 'available best selling',
  dsnArr: [ 'available', 'best', 'selling' ],
  dsnSn: [Function: dsnSn],
  dsnSt: [Function: dsnSt],
  dsnAr: [Function: dsnAr]
}

Supporting DropSuit

DropSuit is an open-source library and I am dedicated to ensuring its continued development and improvement. If you have any questions, feedback, or encounter any issues, please reach out through the support via PayPal, and read more about support details.

Your support is crucial for the library's success. You can also contribute to the project by submitting bug reports, feature requests, or by providing feedback. Sharing the library with others who may find it useful and giving it a star on GitHub are also great ways to show your support. Thank you for using DropSuit!

License

Apache License 2.0

Keywords

FAQs

Package last updated on 09 Feb 2023

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