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

@nlpjs/nlu

Package Overview
Dependencies
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nlpjs/nlu - npm Package Compare versions

Comparing version 4.8.1 to 4.9.0

6

package.json
{
"name": "@nlpjs/nlu",
"version": "4.8.1",
"version": "4.9.0",
"description": "Natural Language Understanding",

@@ -30,6 +30,6 @@ "author": {

"@nlpjs/language-min": "^4.6.0",
"@nlpjs/neural": "^4.8.1",
"@nlpjs/neural": "^4.9.0",
"@nlpjs/similarity": "^4.0.0-rc.4"
},
"gitHead": "290e87216eabbd99569a17c1f5a890ade09c1e44"
"gitHead": "4d1bbc367e7488a4bf34973f2b4444978857493e"
}

@@ -24,10 +24,3 @@ /*

let NeuralNetwork;
try {
// eslint-disable-next-line
NeuralNetwork = require('@nlpjs/neural-worker').NeuralNetwork;
} catch (err) {
// eslint-disable-next-line
NeuralNetwork = require('@nlpjs/neural').NeuralNetwork;
}
const { NeuralNetwork } = require('@nlpjs/neural');
const Nlu = require('./nlu');

@@ -43,23 +36,9 @@

getBestIntent(classifications) {
let best;
let bestClassification = 0;
const keys = Object.keys(classifications);
for (let i = 0; i < keys.length; i += 1) {
if (classifications[keys[i]] > bestClassification) {
best = keys[i];
bestClassification = classifications[keys[i]];
}
}
return best;
}
innerProcess(srcInput) {
const input = srcInput;
if (!this.neuralNetwork) {
input.classifications = { None: 1 };
} else {
input.classifications = this.neuralNetwork.run(input.tokens);
}
const intent = this.getBestIntent(input.classifications);
input.classifications = this.neuralNetwork
? this.neuralNetwork.run(input.tokens)
: { None: 1 };
this.convertToArray(input);
const { intent } = input.classifications[0];
if (

@@ -66,0 +45,0 @@ input.settings &&

@@ -93,3 +93,2 @@ /*

'.innerProcess',
'.convertToArray',
'.filterNonActivated',

@@ -96,0 +95,0 @@ '.normalizeClassifications',

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