Node.js Client for Google Cloud Natural Language API (Beta)
Google Cloud Natural Language API: Google Cloud Natural Language API provides natural language understanding technologies to developers. Examples include sentiment analysis, entity recognition, and text annotations.
Quick Start
In order to use this library, you first need to go through the following steps:
- Select or create a Cloud Platform project.
- Enable the Google Cloud Natural Language API.
- Setup Authentication.
Installation
$ npm install --save @google-cloud/language
Preview
LanguageServiceClient
var language = require('@google-cloud/language');
var client = language({
});
var content = 'Hello, world!';
var type = language.v1.types.Document.Type.PLAIN_TEXT;
var document = {
content : content,
type : type
};
client.analyzeSentiment({document: document}).then(function(responses) {
var response = responses[0];
})
.catch(function(err) {
console.error(err);
});
Next Steps