New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

natural

Package Overview
Dependencies
Maintainers
1
Versions
144
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

natural - npm Package Compare versions

Comparing version 0.0.61 to 0.0.62

lib/natural/classifiers/logistic.js

13

examples/classification/basic.js

@@ -26,10 +26,11 @@ /*

classifier.train([
{classification: 'software', text: "my unit-tests failed."},
{classification: 'software', text: "tried the program, but it was buggy."},
{classification: 'hardware', text: "the drive has a 2TB capacity."},
{classification: 'hardware', text: "i need a new power supply."}
]);
classifier.addDocument('my unit-tests failed.', 'software');
classifier.addDocument('tried the program, but it was buggy.', 'software');
classifier.addDocument('the drive has a 2TB capacity.', 'hardware');
classifier.addDocument('i need a new power supply.', 'hardware');
classifier.train();
console.log(classifier.classify('did the tests pass?'));
console.log(classifier.classify('did you buy a new drive?'));

@@ -26,4 +26,4 @@ /*

natural.BayesClassifier.load('classifier.json', function(err, classifier) {
natural.BayesClassifier.load('classifier.json', null, function(err, classifier) {
console.log(classifier.classify('did the tests pass?'));
});

@@ -26,9 +26,10 @@ /*

classifier.train([
{classification: 'software', text: ['unit', 'test']},
{classification: 'software', text: ['bug', 'program']},
{classification: 'hardware', text: ['drive', 'capacity']},
{classification: 'hardware', text: ['power', 'supply']}
]);
classifier.addDocument('my unit-tests failed.', 'software');
classifier.addDocument('tried the program, but it was buggy.', 'software');
classifier.addDocument('the drive has a 2TB capacity.', 'hardware');
classifier.addDocument('i need a new power supply.', 'hardware');
classifier.train();
classifier.save('classifier.json', function(err, classifier) {

@@ -35,0 +36,0 @@ // the classifier is saved to the classifier.json file!

{
"name": "natural",
"description": "General natural language (tokenizing, stemming, classification, inflection, phonetics, tfidf, WordNet) facilities for node.",
"version": "0.0.61",
"version": "0.0.62",
"homepage": "https://github.com/NaturalNode/natural",
"engines": {

@@ -9,3 +10,3 @@ "node": ">=0.2.6"

"dependencies": {
"sylvester": ">= 0.0.8",
"sylvester": ">= 0.0.12",
"apparatus": ">= 0.0.4",

@@ -12,0 +13,0 @@ "underscore": "*"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc