
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
@chatopera/node-ner
Advanced tools
Sequence Labeler to train NER model with CRF++.
npm install @chatopera/node-ner
var intent = require("@chatopera/node-ner")
Part of Speech
let tags = intent.pos(["i", "want", "a", "cab", "from", "kak", "to", "idap"]);
console.log("tokens ", tags);
tags = intent.pos("I want a cab from beijing to shanghai");
console.log("tokens ", tags);
Tokenizer
let tokens = intent.tokenzie("I want a cab from beijing to shanghai");
console.log("tokens ", tokens);
Extract features for sentence that can be used as input to train CRF model.
let input_xseq1 = intent.sen2features("I want a cab from beijing to shanghai");
console.log(input_xseq1)
Train models.
let curdir = __dirname;
let modelSavedPath = path.join(curdir, "tmp", "test.crf.book_cab.model");
let input_yseq1 = ["O", "O", "O", "O", "O", "B-from", "O", "B-destination"];
let samples = [
[input_xseq1, input_yseq1],
... // add many as possible
];
let train = intent.train(samples, modelSavedPath);
Predict entities in sentence with model.
let curdir = __dirname;
let modelSavedPath = path.join(curdir, "tmp", "test.crf.book_cab.model");
let sentence = "book a cab from York to DC."
let tags = intent.predict(featureExtractor.sen2features(sentence), modelSavedPath);
let tokens = intent.tokenzie(sentence);
let result = intent.extractEntities(tokens, tags);
console.log("extractEntities", result)
// extractEntities { from: 'york', destination: 'dc.' }
More examples: check out test/index.js.
cd app/
npm install
DEBUG=intent* ava test/index.js
MIT
FAQs
NER with CRFSuite package.
We found that @chatopera/node-ner demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.