
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
@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.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.