How to use the @google-cloud/language.v1beta2 function in @google-cloud/language

To help you get started, we’ve selected a few @google-cloud/language examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github googleapis / nodejs-language / samples / analyze.v1beta2.js View on Github external
async function analyzeEntitiesInFile(bucketName, fileName) {
  // [START language_entities_file]
  // Imports the Google Cloud client library
  const language = require('@google-cloud/language').v1beta2;

  // Creates a v1beta2 client
  const client = new language.LanguageServiceClient();

  /**
   * TODO(developer): Uncomment the following lines to run this code
   */
  // const bucketName = 'Your bucket name, e.g. my-bucket';
  // const fileName = 'Your file name, e.g. my-file.txt';

  // Prepares a document, representing a text file in Cloud Storage
  const document = {
    gcsContentUri: `gs://${bucketName}/${fileName}`,
    type: 'PLAIN_TEXT',
  };

@google-cloud/language

Google Cloud Natural Language API client for Node.js

Apache-2.0
Latest version published 2 months ago

Package Health Score

92 / 100
Full package analysis