1.0.0 • Published 10 years ago

wit-node-2 v1.0.0

Weekly downloads
3
License
ISC
Repository
github
Last release
10 years ago

wit-node

Easy interface for interacting with the Wit.ai natural language parsing API.

This project will expand as the Wit.ai API expands, but as it stands there's a single endpoint. You can hit this endpoint easily with Wit.message([your message]), which uses Wit.ai to convert that phrase or sentence into an object with an intent and entities if any were specified.

You will need to create a Wit.ai account and begin training it.

Installation

npm install wit-node@">=0.0.2"

You'll need to set an environment variable named WIT_TOKEN or specify your token with Wit.token = [your token].

export WIT_TOKEN=[your token]

Alternatively, you can pass the token to Wit.message() as the second parameter.

Usage

Wit uses Q for promises, so the interface is nice and clean and reliable.

var promise = Wit.message('Hi')
promise.then(function(result) {
  result.intent // will be Hello with the default Wit instance.
  result.confidence // will be relatively low initially.
})

Result properties/methods

Entity properties/methods

License

Licensed under the MIT License

Copyright 2012 Mode Set

Make Code Not War

crest