nbp-adapter-google-natural-language

0.0.4 • Public • Published

Google Natural Language adapter

This is a Google Natural Language adapter for Node.js Bot Platform. You need to provide:

  • projectId is a google project ID;
  • keyFilename is path to the json file with google keys;
  • logger is an instance of your logging tool.
import googleNaturalLanguageAdapterFactory from 'nbp-adapter-google-natural-language';
const googleNaturalLanguageAdapter = googleNaturalLanguageAdapterFactory({
    projectId: 'google-project-id',
    keyFilename: 'path-to-json-keys',
    logger
});

After you can create an instance of GNL and use it's methods:

const googleNaturalLanguage = googleNaturalLanguageAdapter();
 
googleNaturalLanguage.annotate('Here your sentence to annotate');
googleNaturalLanguage.detectEntities('Here your sentence where you can detect entities');
googleNaturalLanguage.detectSentiment('Here your sentence where you can detect sentiment');

Please, look at usage example.

Tunneling

Check tunneling.js. To bind context of all client's function we need to perform tunneling on each request, so inside skills you can do googleLanguage.annotate('Some text) without specifying application tokens.

Look at router-builder.js as an example.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.4
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.4
    0
  • 0.0.3
    0
  • 0.0.2
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i nbp-adapter-google-natural-language

Weekly Downloads

0

Version

0.0.4

License

ISC

Last publish

Collaborators

  • maxmert