Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/davidgs/santasentiment

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/davidgs/santasentiment

  • v0.0.0-20201210205053-37b211ec0a62
  • Source
  • Go
  • Socket score

Version published
Created
Source

Google Cloud Natural Language API Go example

Authentication

  • Follow the instructions to set up your project and enable the Cloud Natural Language API.

  • From the Cloud Console, create a service account, download its json credentials file, then set the GOOGLE_APPLICATION_CREDENTIALS environment variable:

    export GOOGLE_APPLICATION_CREDENTIALS=/path/to/your-project-credentials.json
    

Run the sample

go build && ./analyze <command> <text>

Where command is entities, sentiment, or syntax.

For example:

go build && ./analyze entities "Renee French designed the Go gopher."

Prints something like this:

entities: <
  name: "Renee French"
  type: PERSON
  salience: 0.4693242
  mentions: <
    text: <
      content: "Renee French"
    >
  >
>
entities: <
  name: "Go"
  type: ORGANIZATION
  metadata: <
    key: "wikipedia_url"
    value: "http://en.wikipedia.org/wiki/Go_(programming_language)"
  >
  salience: 0.34126133
  mentions: <
    text: <
      content: "Go"
      begin_offset: 26
    >
  >
>
language: "en"

FAQs

Package last updated on 10 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc