Skip to content

Go library for the Wit.ai API for Natural Language Processing

License

Notifications You must be signed in to change notification settings

christianrondeau/go-wit

 
 

Repository files navigation

go-wit

Build Status GoDoc

A Go library for the Wit.ai API for Natural Language Processing.

Version

0.4

Installation

go get -u github.com/christianrondeau/go-wit

Reference

Usage

package main

import (
	"github.com/christianrondeau/go-wit"
	"encoding/json"
	"log"
	"os"
)

func main() {
  // Initialize the client
	client := wit.NewClient(os.Getenv("WIT_ACCESS_TOKEN"))

  // Text processing
	result, _ := client.Message("Hello World")
	log.Println(result.Entities["intent"].value)

	// Speech processing
	request = &wit.MessageRequest{}
	request.File = "../_audio_sample/helloWorld.wav"
	request.ContentType = "audio/wav;rate=8000"
	result, _ = client.AudioMessage(request)
	log.Println(result.Entities["intent"].value)
}

## Testing

Set the `WIT_ACCESS_TOKEN` environment variable to your [Wit](https://wit.ai) Server API token

    cd go-wit
    go test

## License

[MIT](LICENSE.txt)

## Author

Original Author: Jason Goecke [@jsgoecke](https://twitter.com/jsgoecke)
Maintainer: Christian Rondeau [@christianrondeau](https://github.com/christianrondeau)

About

Go library for the Wit.ai API for Natural Language Processing

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%