GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — java-docs-samples/language/analysis at master · haritnin/java-docs-samples

Expand file tree

/

analysis

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

analysis

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
src
src
 
 
README.md
README.md
 
 
demo.cmd
demo.cmd
 
 
demo.sh
demo.sh
 
 
pom.xml
pom.xml
 
 

README.md

Outline

Google Cloud Natural Language API Entity Recognition Sample

This sample demonstrates the use of the Google Cloud Natural Language API for entity recognition.

Java Version

This sample requires you to have Java8.

Download Maven

This sample uses the Apache Maven build system. Before getting started, be sure to download and install it. When you use Maven as described here, it will automatically download the needed client libraries.

Run the sample

To build the sample, we use Maven.

mvn clean compile assembly:single

We can then run the assembled JAR file with the java command. The variable $COMMAND takes three values entities, sentiment, or syntax.

Basic usage:

java -cp target/language-entities-1.0-jar-with-dependencies.jar \
    com.google.cloud.language.samples.Analyze \
    <entities | sentiment | syntax> \
    <text | GCS path>

Usage Examples

Analyze entities

java -cp target/language-entities-1.0-jar-with-dependencies.jar \
    com.google.cloud.language.samples.Analyze \
    entities \
    "The quick brown fox jumped over the lazy dog."

Analyze sentiment

java -cp target/language-entities-1.0-jar-with-dependencies.jar \
    com.google.cloud.language.samples.Analyze \
    sentiment \
    "The quick brown fox jumped over the lazy dog."

Analyze syntax

java -cp target/language-entities-1.0-jar-with-dependencies.jar \
    com.google.cloud.language.samples.Analyze \
    syntax \
    "The quick brown fox jumped over the lazy dog."

Included with the sample are demo.sh and demo.bat which show additional examples of usage.

Run demo from *nix or OSX

demo.sh

Run demo from Windows

demo
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.