Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
whichx
Advanced tools
Readme
WhichX is a Naive Bayes' Classifier written in Javascript for classifying short text descriptions into categories. It is a very small library with a very simple API and no dependencies. To see a working demo you can also go to http://www.rudikershaw.com/articles/whichpet.
$ npm install whichx
If you are using Node start by requiring whichx.
var WhichX = require("whichx");
Simply define a new WhichX object. This object represents your dataset, the labels that you want your data classified into, as well as the means to add and classify descriptions.
// Define your whichx object.
var whichpet = new WhichX();
After this you will want to add the labels you wish to give to the types of descriptions you wish to classify.
// Define an array of labels for description types.
var labels = ["cat","dog","fish","horse","bird","reptile"];
// Add your labels to the whichx object.
whichpet.addLabels(labels);
// Add an extra single label to the whichx object.
whichpet.addLabels("pokemon");
Now you can add descriptions to each label. These descriptions, with their labels, act as your training set data.
// Add a description and its label to the data set.
whichpet.addData("pokemon", "loyal and bright yellow with a lightning shaped tail");
// ... Add more here.
With enough data (the more the better), you can provide a description on it's own and ask the classifier which label it thinks it belongs to.
// Which pet am I talking about?
var pet = whichpet.classify("Its yellow and shoots lightning");
console.log("It's a " + pet + "!");
That's it. Enjoy.
For questions about the API or additional functionality, please see the FAQs.
FAQs
A text description classifier for classifying arbitrary strings into provided labels
The npm package whichx receives a total of 15 weekly downloads. As such, whichx popularity was classified as not popular.
We found that whichx 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.