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.60 to 0.0.61

5

lib/natural/classifiers/classifier.js

@@ -74,2 +74,6 @@ /*

function getClassifications(observation) {
return this.classifier.getClassifications(this.textToFeatures(observation));
}
function classify(observation) {

@@ -110,2 +114,3 @@ return this.classifier.classify(this.textToFeatures(observation));

Classifier.prototype.save = save;
Classifier.prototype.getClassifications = getClassifications;
Classifier.restore = restore;

@@ -112,0 +117,0 @@ Classifier.load = load;

14

package.json
{
"name": "natural",
"description": "General natural language (tokenizing, stemming, classification, inflection, phonetics, tfidf, WordNet) facilities for node.",
"version": "0.0.60",
"version": "0.0.61",
"engines": {

@@ -18,9 +18,13 @@ "node": ">=0.2.6"

"keywords": ["natural", "language", "porter", "lancaster", "stemmer", "bayes",
"classifier", "phonetic", "metaphone", "inflector", "wordnet", "tf-idf"],
"classifier", "phonetic", "metaphone", "inflector", "wordnet", "tf-idf",
"logistic", "regression"],
"main": "./lib/natural/index.js",
"maintainers": [{
"name": "Chris Umbel",
"email": "chris@chrisumbel.com",
"web": "http://www.chrisumbel.com"
"name": "Chris Umbel",
"email": "chris@chrisumbel.com",
"web": "http://www.chrisumbel.com"
}, {
"name": "Rob Ellis",
"email": "rob@silentrob.me"
}]
}

@@ -42,2 +42,17 @@ /*

it('should provide all classification scores', function() {
var classifier = new natural.BayesClassifier();
classifier.addDocument(['fix', 'box'], 'computing');
classifier.addDocument(['write', 'code'], 'computing');
classifier.addDocument(['script', 'code'], 'computing');
classifier.addDocument(['write', 'book'], 'literature');
classifier.addDocument(['read', 'book'], 'literature');
classifier.addDocument(['study', 'book'], 'literature');
classifier.train();
expect(classifier.getClassifications('i write code')[0].label).toBe('computing');
expect(classifier.getClassifications('i write code')[1].label).toBe('literature');
});
it('should classify with arrays', function() {

@@ -44,0 +59,0 @@ var classifier = new natural.BayesClassifier();

@@ -43,2 +43,17 @@ /*

it('should provide all classification scores', function() {
var classifier = new natural.LogisticRegressionClassifier();
classifier.addDocument(['fix', 'box'], 'computing');
classifier.addDocument(['write', 'code'], 'computing');
classifier.addDocument(['script', 'code'], 'computing');
classifier.addDocument(['write', 'book'], 'literature');
classifier.addDocument(['read', 'book'], 'literature');
classifier.addDocument(['study', 'book'], 'literature');
classifier.train();
expect(classifier.getClassifications('i write code')[0].label).toBe('computing');
expect(classifier.getClassifications('i write code')[1].label).toBe('literature');
});
it('should classify with arrays', function() {

@@ -45,0 +60,0 @@ var classifier = new natural.LogisticRegressionClassifier();

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