bosonnlp.js

1.0.0 • Public • Published

bosonnlp.js

NPM

Features

  • Based on Nodejs stable api.
  • Promises.
  • Full action params control.
  • Catch more (e.g timeout..).

Usage

const BosonNLP = require('bostonnlp.js');
const bosonNLP = new BosonNLP({ apiToken : 'YOU_KEY', timeout: 1000 * 10 });

bosonNLP.tag(['今天天气不错','明天天气也不错'], {space_mode: 1})
        .then(console.log)
        .catch(console.error);

Default timeout value is 10s. Need more method params detail please check http://bosonnlp.com/dev/center

Methods

tag(texts, params)

  • texts:
    • Required
    • Type: Array or String
  • params:
    • Type: Object

sentiment(texts, params)

  • texts:
    • Required
    • Type: Array or String
  • params:
    • Type: Object
    • Value: { auto: true } e.g..

ner(texts, params)

  • texts:
    • Required
    • Type: Array or String
  • params:
    • Type: Object

depparser(texts, params)

  • texts:
    • Required
    • Type: Array or String
  • params:
    • Type: Object

keywords(texts, params)

  • texts:
    • Required
    • Type: Array or String
  • params:
    • Type: Object

classify(texts, params)

  • texts:
    • Required
    • Type: Array or String
  • params:
    • Type: Object

suggest(text, params)

  • texts:
    • Required
    • Type: String
  • params:
    • Type: Object

summary(texts, params)

  • texts:
    • Required
    • Type: Array or String
  • params:
    • Type: Object

License

MIT license.

Readme

Keywords

Package Sidebar

Install

npm i bosonnlp.js

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

16.2 kB

Total Files

11

Last publish

Collaborators

  • debiancc