Project: Use Haskell to perform actions generated by a voice recognition API

From this list

Tags

Intermediate, API, FFI

What

Google Chrome has had native voice recognition support for some time now. But there are several services that go a step further and use natural language processing to turn a voice command into an action.

api.ai gives a nice example:

Request:

Hey Calendar, schedule lunch with Mary Johnson at 12 pm tomorrow.

Result:

{
  "action":"meeting.create",
  "name":"Lunch with Mary Johnson",
  "invitees":["Mary Johnson"],
  "time":"2014-08-06T12:00:00-07:00"
}

Other services include wit.ai and Soundcloud’s Houndify. Houndify actually already does the step we’re interested in: taking the action and actually performing it.

So, the hard part, natural language processing, has already been done. Great! What can we do with the actions? Lots of stuff:

What you will learn / Rough plan

You’ll first have to be able to talk with one of the APIs. Getting back some JSON, you’ll want to cast that to a concrete data type.

Think about how you will structure actions in your code. Perhaps use typeclasses to indicate the type of an action? What about unrecognized actions?

Then, you will have to actually do something:

Depending on what the action is, you will learn about the FFI, running shell commands (perhaps use Turtle?) and other things.