nlp-node

1.0.4 • Public • Published

natural language processing by Node.js

description

the Natural Language Processing tools under the nodeJs running time, including Chinese word segmentation, sentiment analysis and so on.

simple to use

let nlp = require('nlp_node');
console.log(nlp.segment('这是待分词文本,调用接口直接分词并且统计词频。'));
console.log(nlp.sense('这是待情感分析文本,调用接口直接分析文章情感。'));

installation

npm install --save nlp_node

nlp

description

the interface of the Natural Language Processing.

loading
first you need to load nlp.

let nlp = require('nlp_node');

.segment(text, tags, options)
simply, method to segment a string and return object consist of words.

example

let nlp = require('nlp_node');
let content = '这是待分词文本,调用 nlp 接口直接分词并且统计词频。';
let object = nlp.segment(content);

custom segment params:
default

tags: ['n', 'v', 'a'],
options: {
  len: 2
}

计算所汉语词性标记集

tags = null 表示所有词性

.sense(text)
simply, method to sense a string or string array and return object consist of positive and negative.

example

let nlp = require('nlp_node');
let content = '这是待情感分析文本,调用 nlp 接口分析并且返回情感分析结果。';
let object = nlp.sense(content);

license

NLPIR
divide目录 - /lib/divide/
sentiment目录 - /lib/sentiment/

Dependents (0)

Package Sidebar

Install

npm i nlp-node

Weekly Downloads

0

Version

1.0.4

License

MIT

Last publish

Collaborators

  • soonfy