Project

wit-ruby2

0.0
No commit activity in last 3 years
No release in over 3 years
A simple library for interacting with wit.ai -- will expand as the api does
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.6
>= 0
>= 0
>= 0

Runtime

>= 0.8.8
 Project Readme

wit-ruby2

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

Initially a fork of: wit-ruby

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 are available.

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

Installation

gem 'wit-ruby2', '>= 0.0.3'

Usage

require 'wit-ruby2'

client = Wit::Client.new("WIT_TOKEN")

result = client.classify_message('Hi')

result.intent # will be Hello with the default Wit instance.
result.confidence # the confidence score of the classification
result.entities # A hash of entity types
result.entities["location"].first.value # the value of the first location extracted

Result properties/methods

  • id The unique message id provided back from Wit.
  • text The original message sent.
  • intent The intent, as determined by Wit.
  • confidence The confidence level that Wit determined.
  • entities Hash of entities, which contains an array of n extracted entities

Entity properties/methods

  • value: the value extracted by wit

License

Licensed under the MIT License