- Based on Nodejs stable api.
- Promises.
- Full action params control.
- Catch more (e.g timeout..).
const BosonNLP = require('bostonnlp.js');
const bosonNLP = new BosonNLP({ apiToken : 'YOU_KEY', timeout: 1000 * 10 });
(async () => {
try {
const result = await bosonNLP.tag(['苟利国家生死已','南京市长江大桥'], { space_mode: 1 });
console.log(result);
} catch (error) {
throw error;
}
})()
Default timeout value is 10s. Need more method params detail please check http://bosonnlp.com/dev/center
- texts:
Required
- Type:
Array
orString
- params:
- Type:
Object
- Type:
- texts:
Required
- Type:
Array
orString
- params:
- Type:
Object
- Value: { auto: true } e.g..
- Type:
- texts:
Required
- Type:
Array
orString
- params:
- Type:
Object
- Type:
- texts:
Required
- Type:
Array
orString
- params:
- Type:
Object
- Type:
- texts:
Required
- Type:
Array
orString
- params:
- Type:
Object
- Type:
- texts:
Required
- Type:
Array
orString
- params:
- Type:
Object
- Type:
- texts:
Required
- Type:
String
- params:
- Type:
Object
- Type:
- texts:
Required
- Type:
Array
orString
- params:
- Type:
Object
- Type:
MIT license.