Skip to content
This repository has been archived by the owner on Apr 12, 2023. It is now read-only.
/ go-gcnl Public archive

Golang library for accessing the Google Cloud Natural Language API

License

Notifications You must be signed in to change notification settings

jlubawy/go-gcnl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-gcnl

This package can be used to easily access the Google Cloud Natural Language API.

Update: Found out about Google's official libraries after I created this library. I'd recommend using them instead as I'm not planning on maintaining this library (assuming the official one works too).

Quick-Start

Analyze Entities Method

package main

import (
    "fmt"
    "log"

    "github.com/jlubawy/go-gcnl/entities"
)

var apiKey = "<your API key goes here>"
var content = "Plain text content to analyze"

func main() {
    req := entities.NewRequest(apiKey)
    entityMap, err := req.FromPlainText(content)
    if err != nil {
        log.Fatalln(err)
    }

    for _, es := range entityMap {
        for _, e := range es {
            fmt.Println(e)
        }
    }
}

For a more in-depth example see https://github.com/jlubawy/go-gcnl/tree/master/cmd/gcnl-entities.

To analyze an HTML document given a URL see entities.FromURL.

TODO

  • analyzeEntities
  • analyzeSentiment
  • annotateText

About

Golang library for accessing the Google Cloud Natural Language API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published