基本情况

针对各类场景下带有主观描述的中文文本,自动判断该文本的情感极性类别并给出相应的置信度,情感极性分为积极、消极、中性。为口碑分析、话题监控、舆情分析等应用提供基础技术支持。

应用场景

1.评论分析与决策:通过对产品多维度评论观点进行倾向性分析,给用户提供该产品全方位的评价,方便用户进行决策。
2.电商评论分类:通过对电商评论进行情感倾向性分析,将不同用户对同一商品的评论内容按情感极性予以分类展示。
3.舆情分析:通过对需要舆情监控的实时文字数据流进行情感倾向性分析,把握用户对热点信息的情感倾向性变化。

请求示例代码

var http = require('follow-redirects').http;
var fs = require('fs');

var options = {
   'method': 'GET',
   'hostname': '60.247.148.208',
   'port': 5001,
   'path': '/nlp/text_sentiment_classify?text=%E4%BA%94%E7%BE%8A%E6%9C%AC%E7%94%B0%E6%91%A9%E6%89%98%E8%BD%A6%E8%B6%8A%E5%87%BA%E8%B6%8A%E5%B7%AE%E4%BA%86&token=',
   'headers': {
   },
   'maxRedirects': 20
};

var req = http.request(options, function (res) {
   var chunks = [];

   res.on("data", function (chunk) {
      chunks.push(chunk);
   });

   res.on("end", function (chunk) {
      var body = Buffer.concat(chunks);
      console.log(body.toString());
   });

   res.on("error", function (error) {
      console.error(error);
   });
});

req.end();

响应示例

{
  "text": "五羊本田摩托车越出越差了",
  "items": [
    {
      "confidence": 0.981558,
      "negative_prob": 0.991701,
      "positive_prob": 0.00829906,
      "sentiment": "负向"
    }
  ],
  "log_id": 1853402360291175200,
  "left_nums": "999345.000"
}

请求参数

参数名 类型 是否必填 说明
token string 接口访问令牌,用于鉴权
text string 需要分析的文本内容对象,最大支持2000字节,即请求参数text值最大为1000个汉字和符号。

响应示例

{
  "text": "五羊本田摩托车越出越差了",
  "items": [
    {
      "confidence": 0.981558,
      "negative_prob": 0.991701,
      "positive_prob": 0.00829906,
      "sentiment": "负向"
    }
  ],
  "log_id": 1853402360291175200,
  "left_nums": "999345.000"
}
Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐