0.0.1 • Published 2 years ago

classy-classifier v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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