Skip to content

Instantly share code, notes, and snippets.

@nhunzaker
Created February 4, 2012 21:41
Show Gist options
  • Save nhunzaker/1740327 to your computer and use it in GitHub Desktop.
Save nhunzaker/1740327 to your computer and use it in GitHub Desktop.
Using Speakeasy
// Using Speakeasy
//--------------------------------------------------//
// Sentiment analysis
var mood = require("speakeasy-nlp").sentiment;
mood.analyze("I hate you"); //=> { score: -1, ..... }
// Classifying statements
var meaning = require("speakeasy-nlp").classify;
meaning.classify("What is the meaning of life?") //==>
/*
{
action: 'what',
owner: 'life',
subject: 'meaning',
tokens: [ 'What','is', 'the', 'meaning', 'of', 'life','?' ]
}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment