/microsoft-cognitive-services

Full library for Microsoft cognitive services API written in Golang

Primary LanguageGoMIT LicenseMIT

microsoft-cognitive-services

Put intelligence APIs to work, Full library for microsoft cognitive services

Build Status Progress


I will improve this library just for improve my dominance on Golang.

Tap into the power of machine learning with easy-to-use REST APIs. Get started

Subscription key : Subscription key which provides access to this API. Found in your subscriptions.

List of APIs :

Name Link Library info Reference Coverage percent
Computer vision link see GoDoc Progress
Emotion link see GoDoc Progress
Face link see GoDoc Progress
Spell check link see GoDoc Progress
Academic link see GoDoc Progress

Computer Vision

  go get github.com/ahmdrz/microsoft-cognitive-services/computer-vision

Sample

// test project main.go
package main

import (
    "fmt"

    "github.com/ahmdrz/microsoft-cognitive-services/computer-vision"
)

func main() {
    fmt.Println("Hello World!")
    vis, err := vision.New("<KEY>")
    if err != nil {
        panic(err)
    }

    result, err := vis.Analyze("https://portalstoragewuprod2.azureedge.net/vision/Analysis/1.jpg",
        vision.VisualFeatures{
            Adult: true,
            Tags:  true,
        })
    if err != nil {
        panic(err)
    }

    fmt.Println(result)
}

Also you can upload your images , Here is a sample code :

// test project main.go
package main

import (
    "fmt"

    "github.com/ahmdrz/microsoft-cognitive-services/computer-vision"
)

func main() {
    fmt.Println("Hello World!")
    vis, err := vision.New("<KEY>")
    if err != nil {
        panic(err)
    }

    result, err := vis.AnalyzeFile("test.jpg",
        vision.VisualFeatures{
            Adult: true,
            Tags:  true,
        })
    if err != nil {
        panic(err)
    }

    fmt.Println(result)
}

Emotion

  go get github.com/ahmdrz/microsoft-cognitive-services/emotion

Sample

// test project main.go
package main

import (
    "fmt"

    "github.com/ahmdrz/microsoft-cognitive-services/emotion"
)

func main() {
    fmt.Println("Hello World!")
    emo, err := emotion.New("<KEY>")
    if err != nil {
        panic(err)
    }

    result, err := emo.Recognize("https://portalstoragewuprod.azureedge.net/emotion/recognition1.jpg")
    if err != nil {
        panic(err)
    }

    fmt.Println(result)
}

Face

  go get github.com/ahmdrz/microsoft-cognitive-services/face

Sample

// test project main.go
package main

import (
    "fmt"

    "github.com/ahmdrz/microsoft-cognitive-services/face"
)

func main() {
  	fmt.Println("Hello World!")
  	facevar, err := face.New("<KEY>")
	if err != nil {
		panic(err)
	}

	results, err := facevar.Detect("https://portalstoragewuprod.azureedge.net/media/Default/Documentation/Face/Images/FaceFindSimilar.QueryFace.jpg",
		face.DetectOrder{
			FaceLandmarks: true,
			FaceAttributes: face.FaceAttributesOrder{
				Age: true,
			},
		},
	)
	if err != nil {
		panic(err)
	}

	for _, result := range results {
		fmt.Println(result.FaceAttributes.Age)
	}
}

Academic

  go get github.com/ahmdrz/microsoft-cognitive-services/academic

Sample

Under Construction 😄

License

Visit license file

Contrib

Help me to improve it by pull requests.