New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

classy-classifier

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

classy-classifier

Bayes classifier

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

Classy

This is a text classifier redesigned to be more modern and hopefully, in the future, faster than it's original version made by miguelmota.

Example Usage

var BayesClassifier = require('bayes-classifier')
var classifier = new BayesClassifier()

var positiveDocuments = [
  `I love tacos.`,
  `Dude, that burrito was epic!`,
  `Holy cow, these nachos are so good and tasty.`,
  `I am drooling over the awesome bean and cheese quesadillas.`
]

var negativeDocuments = [
  `Gross, worst taco ever.`,
  `The buritos gave me horrible diarrhea.`,
  `I'm going to puke if I eat another bad nacho.`,
  `I'd rather die than eat those nasty enchiladas.`
]

classifier.addDocuments(positiveDocuments, `positive`)
classifier.addDocuments(negativeDocuments, `negative`)

classifier.train()

API

classifier.addDocument(doc, class)

classifier.addDocuments([docs], class)

classifier.train()

classifier.classify(doc)

classifier.getClassifications(doc)

classifier.restore(classifier)

It is licensed with the MIT license

Keywords

native

FAQs

Package last updated on 28 Mar 2022

Did you know?

Socket

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.

Install

Related posts