Last active
February 5, 2021 19:33
-
-
Save ismaelc/e63c9ed36e57e76fa07265a1889d41a6 to your computer and use it in GitHub Desktop.
ml-classify-text-js-sample
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
let positive = [ | |
'This is great, so cool!', | |
'Wow, I love it!', | |
'It really is amazing', | |
] | |
let negative = [ | |
'This is really bad', | |
'I hate it with a passion', | |
'Just terrible!', | |
] | |
classifier.train(positive, 'positive') | |
classifier.train(negative, 'negative') | |
predictions = classifier.predict('It sure is pretty great!') | |
//positive (0.5423261445466404) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment