Finds named entities (currently proper names and common nouns) in the text along with entity types, salience, mentions for each entity, and other properties.
{Promise} - The promise which resolves to an array. The first element of the array is an object representing [AnalyzeEntitiesResponse]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.
Example
/** * TODO(developer): Uncomment these variables before running the sample. *//** * Input document. */// const document = {}/** * The encoding type used by the API to calculate offsets. */// const encodingType = {}// Imports the Language libraryconst{LanguageServiceClient}=require('@google-cloud/language').v1;// Instantiates a clientconstlanguageClient=newLanguageServiceClient();asyncfunctioncallAnalyzeEntities(){// Construct requestconstrequest={document,};// Run requestconstresponse=awaitlanguageClient.analyzeEntities(request);console.log(response);}callAnalyzeEntities();
{Promise} - The promise which resolves to an array. The first element of the array is an object representing [AnalyzeEntitySentimentResponse]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.
Example
/** * TODO(developer): Uncomment these variables before running the sample. *//** * Input document. */// const document = {}/** * The encoding type used by the API to calculate offsets. */// const encodingType = {}// Imports the Language libraryconst{LanguageServiceClient}=require('@google-cloud/language').v1;// Instantiates a clientconstlanguageClient=newLanguageServiceClient();asyncfunctioncallAnalyzeEntitySentiment(){// Construct requestconstrequest={document,};// Run requestconstresponse=awaitlanguageClient.analyzeEntitySentiment(request);console.log(response);}callAnalyzeEntitySentiment();
{Promise} - The promise which resolves to an array. The first element of the array is an object representing [AnalyzeSentimentResponse]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.
Example
/** * TODO(developer): Uncomment these variables before running the sample. *//** * Input document. */// const document = {}/** * The encoding type used by the API to calculate sentence offsets. */// const encodingType = {}// Imports the Language libraryconst{LanguageServiceClient}=require('@google-cloud/language').v1;// Instantiates a clientconstlanguageClient=newLanguageServiceClient();asyncfunctioncallAnalyzeSentiment(){// Construct requestconstrequest={document,};// Run requestconstresponse=awaitlanguageClient.analyzeSentiment(request);console.log(response);}callAnalyzeSentiment();
Analyzes the syntax of the text and provides sentence boundaries and tokenization along with part of speech tags, dependency trees, and other properties.
{Promise} - The promise which resolves to an array. The first element of the array is an object representing [AnalyzeSyntaxResponse]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.
Example
/** * TODO(developer): Uncomment these variables before running the sample. *//** * Input document. */// const document = {}/** * The encoding type used by the API to calculate offsets. */// const encodingType = {}// Imports the Language libraryconst{LanguageServiceClient}=require('@google-cloud/language').v1;// Instantiates a clientconstlanguageClient=newLanguageServiceClient();asyncfunctioncallAnalyzeSyntax(){// Construct requestconstrequest={document,};// Run requestconstresponse=awaitlanguageClient.analyzeSyntax(request);console.log(response);}callAnalyzeSyntax();
{Promise} - The promise which resolves to an array. The first element of the array is an object representing [AnnotateTextResponse]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.
Example
/** * TODO(developer): Uncomment these variables before running the sample. *//** * Input document. */// const document = {}/** * The enabled features. */// const features = {}/** * The encoding type used by the API to calculate offsets. */// const encodingType = {}// Imports the Language libraryconst{LanguageServiceClient}=require('@google-cloud/language').v1;// Instantiates a clientconstlanguageClient=newLanguageServiceClient();asyncfunctioncallAnnotateText(){// Construct requestconstrequest={document,features,};// Run requestconstresponse=awaitlanguageClient.annotateText(request);console.log(response);}callAnnotateText();
{Promise} - The promise which resolves to an array. The first element of the array is an object representing [ClassifyTextResponse]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.
Example
/** * TODO(developer): Uncomment these variables before running the sample. *//** * Input document. */// const document = {}// Imports the Language libraryconst{LanguageServiceClient}=require('@google-cloud/language').v1;// Instantiates a clientconstlanguageClient=newLanguageServiceClient();asyncfunctioncallClassifyText(){// Construct requestconstrequest={document,};// Run requestconstresponse=awaitlanguageClient.classifyText(request);console.log(response);}callClassifyText();
Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.
You can await on this method if you want to make sure the client is initialized.
Returns
Type
Description
Promise<{
[name: string]: Function;
}>
{Promise} A promise that resolves to an authenticated service stub.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-01-28 UTC."],[],[]]