Google Cloud Natural Language API provides natural language understanding technologies to developers, including sentiment analysis, entity recognition, and syntax analysis. This API is part of the larger collection of Cloud Machine Learning APIs.
These sample Java applications demonstrate how to access the Cloud Natural Language API.
- Install Maven.
- Clone this project.
- Get the key json from Google.
- Save it in a json file ( ex: NLPFirstProject.json).
- Get the absolute path of the
NLPFirstProject.json
file, which is available in the project root folder. - Set the environment variable as follows
export GOOGLE_APPLICATION_CREDENTIALS=/pathTo/NLPFirstProject.json
- Run the main method in the
Sample.java
file.