【发布时间】:2017-01-05 07:26:00
【问题描述】:
我正在使用NodeJs 在sentiment lib 的帮助下创建我的应用程序
问题是当否定词以肯定的方式使用时会给出错误的结果。
var sentiment = require('sentiment');
var result = sentiment('I am dying to eat a kitkat!');
console.dir(result);
{ 得分:-3,比较:-0.42857142857142855,标记:['i', 'am', 'dying', 'to', 'eat', 'a', 'kitkat' ], 单词:[ 'dying' ],
正面:[],负面:['垂死']}
///or
result = sentiment('your internet is not bad', knowladgeBase);
console.dir(result);
{ 得分:-3,比较:-0.6,标记:['你的','互联网', 'is', 'not', 'bad' ],单词:['bad'],正面:[],负面: ['坏'] }
【问题讨论】:
标签: node.js nlp sentiment-analysis