Giter Site home page Giter Site logo

luis's Introduction

LUIS.ai for Golang

GitHub license GoDoc Build Status Go

Language Understanding Intelligent Service (LUIS)

LUIS lets your app understand language

  • LUIS is in beta and free to use
  • Supported browsers: Internet Explorer 10/11, Chrome

In LUIS you can:

  • Create language understanding models.
  • Use pre-built, world-class models from Bing and Cortana.
  • Deploy your models to an HTTP endpoint.
  • Activate models on any device.

Here is some suggestion and limitation you might want to check before add all you intent. Chinese

How to get APP_ID and APP_KEY

APP_KEY

Login and go to LUIS key page https://www.luis.ai/home/keys

You can see the API_KEY in "My Keys".

APP_ID

Create a new App (if you don't have one) and in the APP dashboard, you can get APP_ID from web URL. It might be 12341be8-8cfb-471c-b05a-636d58cd5678

Version ID (Important)

Before use this SDK, you must run follow step in luis.ai dashboard.

  • Create new app
  • Add few intent
  • Add Endpoint Key (You could use your API key)
  • Publish your model.

Installation

go get github.com/kkdai/luis

How to use it

var API_KEY string
var APPID string

func main() {
	var API_KEY string
	var APPID string

	APPID = os.Getenv("APP_ID")
	API_KEY = os.Getenv("SUB_KEY")

	if API_KEY == "" {
		fmt.Println("Please export your key to environment first, `export SUB_KEY=12234 && export APP_ID=5678`")
	}
	if API_KEY == "" {
		return
	}

	e := NewLuis(API_KEY, APPID)

	res, err := e.IntelList()

	if err != nil {
		log.Error("Error happen on :", err.Err)
	}
	fmt.Println("Got response:", string(res))
	result := NewIntentListResponse(res)
	fmt.Println("Luis Intent Ret", result)

	//Add utterances
	ex := ExampleJson{ExampleText: "test", SelectedIntentName: "test2"}
	res, err = e.AddLabel(ex)

	//Train it
	res, err = e.Train()
	if err != nil {
		log.Error("Error happen on :", err.Err)
	}

	//Predict it, once you have train your models.
	res, err = e.Predict("test string")

	if err != nil {
		log.Error("Error happen on :", err.Err)
	}
	fmt.Println("Got response:", string(res))
	fmt.Println("Get the best predict result:", GetBestScoreIntent(NewPredictResponse(res)))
}

Implemented APIs

  • actionChannels
  • intents
  • predict
  • train
  • example
  • Versions
  • Publish

Unimplement APIs (Yet)

Need your help to send your PR.

Contribute

Please open up an issue on GitHub before you put a lot efforts on pull request. The code submitting to PR must be filtered with gofmt

License

This package is licensed under MIT license. See LICENSE for details.

luis's People

Contributors

kkdai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

luis's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.