Skip to content

Charyf/witai-charyf

Repository files navigation

Wit.AI NLP for Charyf

This gem provides an adapter to Wit.AI service. Wit.AI is an free natural language processing which can be used to determine user intents in natural language.

Getting Started

Installing to existing charyf applicaiton

Add this line to your charyf application's Gemfile:

gem 'witai-charyf'

And then execute:

$ bundle

Then add the wit.ai to the applocation loads by adding line to config/load.rb

require 'witai/charyf'

To generate the intializer run

charyf generate witai:install

You should be welcomed by the message

      create  config/initializers/wit.rb
      notice  Wit installed
		      Do not forget to set wit intent processor in application configuration
			       config.enabled_intent_processors = [.., :wit, ..]

You can configure the processor inside config/initializers/wit.rb which was generated by the installer

Now enable wit.ai processor inside your application config (config/application.rb) or specific environment config (e.g.: config/environments/development.rb)

config.enabled_intent_processors = [.., :wit, ..]

Install with new charyf application

You can add wit as intent processor during generation of new application. Just use --intent-processors=wit as argument with your charyf new ... command.

When installing wit along charyf new application, config/loads.rb and configuration inside config/application.rb will be populated automatically.

You can configure the processor inside config/initializers/wit.rb which was generated by the installer

Usage

Configure

WitAI::Charyf::Extension.configure do
  # Set to you Wit.AI App API Key
  # As charyf uses wit only to determine intent you can use
  # either server or client key
  #
  # config.api_key = 'PUMSOASDDB43HCJ3OMBOXKEENOOS92WDI6' <- your API key
end

Defining intents

See https://wit.ai/docs/quickstart gudie to learn how to define intents using wit.

Don't forget to wait for training to finish.

Intent names are then routed inside charyf. If you define intent value some_intent then you can route this intent name inside charyf's router.

Define routing as usually using config/routes.rb

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the Wit::Nlp::Charyf project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

About

WitAI intent processor (NLP) for Charyf

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published