Socket
Socket
Sign inDemoInstall

speakeasy-nlp

Package Overview
Dependencies
1
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    speakeasy-nlp

A simple natural language processor for node javascript.


Version published
Weekly downloads
59
decreased by-3.28%
Maintainers
1
Install size
2.26 MB
Created
Weekly downloads
 

Changelog

Source

0.2.13

  • Fix bug in pos library related to for..in being used instead of forEach.

Readme

Source

SpeakEasy

Simple Natural Language Processing

Circle CI


npm install speakeasy-nlp


Current commands:

  1. *.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
  2. *.sentiment: A collection of methods to approximate the positive/negative affect of a statement (relative to the whole statement)
  3. *.closest : Uses levenshtein distance to find the best match for a word given an array


var speak = require("./speakeasy-nlp");

// Analyze sentences at a basic level
// ------------------------------------- //
speak.classify("What is your name?")             //=> { action: "what", owner: "listener", subject: "name" }
speak.classify("Do you know what time it is?")   //=> { action: "what", owner: "it", subject: "time" }

// Sentiment analysis
// ------------------------------------- //
speak.sentiment.negativity("I hate your guts")   //=> { score: 1, words: [hate] }
speak.sentiment.positivity("I love you")         //=> { score: 1, words: [love] }

speak.sentiment.analyze("I love you, but you smell something aweful")  
// (Negative scores dictate a stronger influence of negative words)
//=> { score: -1, positive: { ... }, negative: { ... } }

// Closest word
// ------------------------------------- //
speak.closest("node", ["foo", "nodejs", "baz"])     //=> "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.

Keywords

FAQs

Last updated on 12 Jun 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc