本页面介绍了 /api/docs/news_sentiment 路径的相关信息。

功能概述

该 API 用于分析新闻文本的情感倾向,返回情感分数和情感标签。

请求方法

  • GET /api/docs/news_sentiment

请求参数

  • text: 必选,新闻文本内容。

返回结果

  • score: 情感分数,范围 0-1,值越大表示情感越积极。
  • label: 情感标签,"positive" 表示积极,"negative" 表示消极。

示例

{
  "score": 0.8,
  "label": "positive"
}

使用方法

  1. 发送 GET 请求到 /api/docs/news_sentiment
  2. 在请求体中包含新闻文本内容。
  3. 解析返回结果。

扩展阅读

更多关于 API 的信息,请访问 API 文档

news_sentiment