SpeakEasy
Simple Natural Language Processing
npm install speakeasy-nlp
Current commands:
*.classify
: Roughly determines the action, subject, and owner (posessive object) of a sentence. As of 0.2.2 it also includes verbs, nouns, and adjectives*.sentiment
: A collection of methods to approximate the positive/negative affect of a statement (relative to the whole statement)*.closest
: Uses levenshtein distance to find the best match for a word given an array
var speak = ;// Analyze sentences at a basic level// ------------------------------------- //speak //=> { action: "what", owner: "listener", subject: "name" }speak //=> { action: "what", owner: "it", subject: "time" }// Sentiment analysis// ------------------------------------- //speaksentiment //=> { score: 1, words: [hate] }speaksentiment //=> { score: 1, words: [love] }speaksentiment// (Negative scores dictate a stronger influence of negative words)//=> { score: -1, positive: { ... }, negative: { ... } }// Closest word// ------------------------------------- //speak //=> "nodejs"
Philosophy
The goal of this project is not to be the next final solution for natural language processing. There are plenty of other projects that do a significantly better job of this. SpeakEasy spawned out of another of my projects, Nodebot, as a method of processing user input to simulate the illusion of intelligence.
SpeakEasy's goal is to provide a library for NodeJS to perform simple language processing actions that perform well for 70%-80% of all cases.
License
speakeasy
is released under the MIT License.