diff --git a/README.md b/README.md index adac5fc3be34..812655d3b751 100644 --- a/README.md +++ b/README.md @@ -21,9 +21,9 @@ This client supports the following Google Cloud Platform services: * [Google Prediction API](#google-prediction-api) * [Google Translate API](#google-translate-api) * [Google Cloud Logging](#google-cloud-logging-beta) (Beta) +* [Google Cloud Natural Language](#google-cloud-natural-language-beta) (Beta) * [Google Cloud Resource Manager](#google-cloud-resource-manager-beta) (Beta) * [Google Cloud Vision](#google-cloud-vision-beta) (Beta) -* [Google Cloud Natural Language](#google-cloud-natural-language-alpha) (Alpha) If you need support for other Google APIs, check out the [Google Node.js API Client library][googleapis]. @@ -559,6 +559,71 @@ logging.getEntries(function(err, entries) { ``` +## Google Cloud Natural Language (Beta) + +> **This is a Beta release of Google Cloud Natural Language.** This feature is not covered by any SLA or deprecation policy and may be subject to backward-incompatible changes. + +- [API Documentation][gcloud-language-docs] +- [Official Documentation][cloud-language-docs] + +#### Preview + +```js +var gcloud = require('gcloud'); + +// Authorizing on a per-API-basis. You don't need to do this if you auth on a +// global basis (see Authorization section above). + +var language = gcloud.language({ + projectId: 'grape-spaceship-123', + keyFilename: '/path/to/keyfile.json' +}); + +// Get the entities from a sentence. +language.detectEntities('Stephen is in Michigan!', function(err, entities) { + // entities = { + // people: ['Stephen'], + // places: ['Michigan'] + // } +}); + +// Create a document if you plan to run multiple detections. +var document = language.document('Contributions welcome!'); + +// Analyze the sentiment of the document. +document.detectSentiment(function(err, positiveSentiment) { + // positiveSentiment = true +}); + +// Parse the syntax of the document. +document.annotate(function(err, annotations) { + // annotations = { + // language: 'en', + // sentiment: true, + // entities: {}, + // sentences: ['Contributions welcome!'], + // tokens: [ + // { + // text: 'Contributions', + // partOfSpeech: 'Noun (common and proper)', + // partOfSpeechTag: 'NOUN' + // }, + // { + // text: 'welcome', + // partOfSpeech: 'Verb (all tenses and modes)', + // partOfSpeechTag: 'VERB' + // }, + // { + // text: '!', + // partOfSpeech: 'Punctuation', + // partOfSpeechTag: 'PUNCT' + // } + // ] + // } +}); +``` + + ## Google Cloud Resource Manager (Beta) > **This is a Beta release of Google Cloud Resource Manager.** This feature is not covered by any SLA or deprecation policy and may be subject to backward-incompatible changes. @@ -707,71 +772,6 @@ vision.detectFaces('./image.jpg', function(err, faces) { ``` -## Google Cloud Natural Language (Alpha) - -> **This is an Alpha release of Google Cloud Resource Manager.** This feature is not covered by any SLA or deprecation policy and may be subject to backward-incompatible changes. - -- [API Documentation][gcloud-language-docs] -- [Official Documentation][cloud-language-docs] - -#### Preview - -```js -var gcloud = require('gcloud'); - -// Authorizing on a per-API-basis. You don't need to do this if you auth on a -// global basis (see Authorization section above). - -var language = gcloud.language({ - projectId: 'grape-spaceship-123', - keyFilename: '/path/to/keyfile.json' -}); - -// Get the entities from a sentence. -language.detectEntities('Stephen is in Michigan!', function(err, entities) { - // entities = { - // people: ['Stephen'], - // places: ['Michigan'] - // } -}); - -// Create a document if you plan to run multiple detections. -var document = language.document('Contributions welcome!'); - -// Analyze the sentiment of the document. -document.detectSentiment(function(err, positiveSentiment) { - // positiveSentiment = true -}); - -// Parse the syntax of the document. -document.annotate(function(err, annotations) { - // annotations = { - // language: 'en', - // sentiment: true, - // entities: {}, - // sentences: ['Contributions welcome!'], - // tokens: [ - // { - // text: 'Contributions', - // partOfSpeech: 'Noun (common and proper)', - // partOfSpeechTag: 'NOUN' - // }, - // { - // text: 'welcome', - // partOfSpeech: 'Verb (all tenses and modes)', - // partOfSpeechTag: 'VERB' - // }, - // { - // text: '!', - // partOfSpeech: 'Punctuation', - // partOfSpeechTag: 'PUNCT' - // } - // ] - // } -}); -``` - - ## Contributing Contributions to this library are always welcome and highly encouraged. diff --git a/lib/language/index.js b/lib/language/index.js index 6a6517140250..fc40e57e637e 100644 --- a/lib/language/index.js +++ b/lib/language/index.js @@ -59,10 +59,11 @@ var util = require('../common/util.js'); * @alias module:language * * @classdesc - * The object returned from `gcloud.language` gives you complete control. + * The object returned from `gcloud.language` gives you access to the methods + * that will run detections and annotations from your text. * - * To learn more about Google Cloud Natural Language, see - * [What is Google Cloud DNS?](https://cloud.google.com/natural-language) + * To learn more about Google Cloud Natural Language, see the official + * [Google Cloud Natural Language API Documentation](https://cloud.google.com/natural-language/docs). * * @param {object} options - [Configuration object](#/docs). *