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

@nlpjs/ner

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nlpjs/ner - npm Package Compare versions

Comparing version 4.9.1 to 4.9.2

6

package.json
{
"name": "@nlpjs/ner",
"version": "4.9.1",
"version": "4.9.2",
"description": "Named Entity Recognition",

@@ -28,7 +28,7 @@ "author": {

"dependencies": {
"@nlpjs/core": "^4.6.0",
"@nlpjs/core": "^4.9.2",
"@nlpjs/language-min": "^4.6.0",
"@nlpjs/similarity": "^4.9.1"
},
"gitHead": "8133ce0c2da2d1c0c11ca787db27a4116215b875"
"gitHead": "956809b1d31b96962f588bff97aef9b73794af4d"
}

@@ -52,27 +52,3 @@ /*

registerDefault() {
this.container.registerPipeline(
'ner-process',
[
'.decideRules',
'extract-enum',
'extract-regex',
'extract-trim',
'extract-builtin',
],
false
);
this.container.registerPipeline(
'ner-??-process',
[
'.decideRules',
'extract-enum',
'extract-regex',
'extract-trim',
'extract-builtin',
'.reduceEdges',
],
false
);
}
registerDefault() {}

@@ -328,10 +304,36 @@ getRulesByName(locale = '*', name, force = false) {

async defaultPipelineProcess(input) {
if (!this.cache) {
this.cache = {
extractEnum: this.container.get('extract-enum'),
extractRegex: this.container.get('extract-regex'),
extractTrim: this.container.get('extract-trim'),
extractBuiltin: this.container.get('extract-builtin'),
};
}
let output = await this.decideRules(input);
output = await this.cache.extractEnum.run(output);
output = await this.cache.extractRegex.run(output);
output = await this.cache.extractTrim.run(output);
output = await this.cache.extractBuiltin.run(output);
output = await this.reduceEdges(output);
return output;
}
async process(srcInput) {
const input = { threshold: this.settings.threshold || 0.8, ...srcInput };
const result = await this.runPipeline(
input,
input.locale
? `${this.settings.tag}-${input.locale}-process`
: this.pipelineProcess
);
let result;
if (input.locale) {
const pipeline = this.container.getPipeline(
`${this.settings.tag}-${input.locale}-process`
);
if (pipeline) {
result = await this.runPipeline(input, pipeline);
}
} else if (this.pipelineProcess) {
result = await this.runPipeline(input, this.pipelineProcess);
}
if (!result) {
result = await this.defaultPipelineProcess(input);
}
delete result.threshold;

@@ -338,0 +340,0 @@ return result;

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