-
Notifications
You must be signed in to change notification settings - Fork 858
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove legacy code that uses prototypes
- Loading branch information
1 parent
4e33992
commit 6b69b9d
Showing
3 changed files
with
14 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
var natural = require('../../lib/natural'); | ||
const PorterStemmerEs = require('../../lib/natural/stemmers/porter_stemmer_es'); | ||
var classifier = new natural.LogisticRegressionClassifier(PorterStemmerEs); | ||
|
||
classifier.addDocument('ranchero golpe', 'Huevos'); | ||
classifier.addDocument('bbq', 'Huevos'); | ||
classifier.addDocument('salchichas ranchero', 'Tortas'); | ||
|
||
classifier.on('trainedWithDocument', (v) => console.log(v)) | ||
classifier.on('doneTraining', (v) => console.log(v)) | ||
classifier.train(); | ||
|
||
classifier.save('classifier.json', (err) => console.log(err)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters