Watson NLU 情绪不一致

发布于 2025-01-19 12:41:46 字数 1347 浏览 5 评论 0原文

我有 2 个非常简单的句子,它们从 IBM Watson NLU 引擎产生非常不同的情感值。所以我不知道如何配置 API 来一致地处理每个句子。

  "text": "WidgetX has been recently created. It is terrible.",
  "features": {
    "sentiment": {},
    "entities": {
      "sentiment": true
    },
    "keywords": {
      "sentiment": true
    }
  }

产生中立的情绪:

  "keywords": [
    {
      "text": "WidgetX",
      "sentiment": {
        "score": 0,
        "label": "neutral"
      },
      "relevance": 0.5,
      "count": 1
    }
  ],
  "entities": [
    {
      "type": "Organization",
      "text": "WidgetX",
      "sentiment": {
        "score": 0,
        "label": "neutral"
      },
      "relevance": 0.978348,
      "count": 1,
      "confidence": 0.562355
    }
  ]

而将文本更改为以下会产生正确的非常负面的情绪:

  "text": "WidgetX has been recently created, and it is terrible.",

  "keywords": [
    {
      "text": "WidgetX",
      "sentiment": {
        "score": -0.964476,
        "label": "negative"
      },
      "relevance": 0.5,
      "count": 1
    }
  ],
  "entities": [
    {
      "type": "Organization",
      "text": "WidgetX",
      "sentiment": {
        "score": -0.964476,
        "label": "negative"
      },
      "relevance": 0.978348,
      "count": 1,
      "confidence": 0.319847
    }
  ]

I have 2 very simple sentences which produce very different sentiment values from the IBM Watson NLU engine. So I am at a loss how to configure the APIs to handle each sentence consistently.

  "text": "WidgetX has been recently created. It is terrible.",
  "features": {
    "sentiment": {},
    "entities": {
      "sentiment": true
    },
    "keywords": {
      "sentiment": true
    }
  }

Produces a neutral sentiment:

  "keywords": [
    {
      "text": "WidgetX",
      "sentiment": {
        "score": 0,
        "label": "neutral"
      },
      "relevance": 0.5,
      "count": 1
    }
  ],
  "entities": [
    {
      "type": "Organization",
      "text": "WidgetX",
      "sentiment": {
        "score": 0,
        "label": "neutral"
      },
      "relevance": 0.978348,
      "count": 1,
      "confidence": 0.562355
    }
  ]

Whereas changing the text to below produces the correct very negative sentiment:

  "text": "WidgetX has been recently created, and it is terrible.",

  "keywords": [
    {
      "text": "WidgetX",
      "sentiment": {
        "score": -0.964476,
        "label": "negative"
      },
      "relevance": 0.5,
      "count": 1
    }
  ],
  "entities": [
    {
      "type": "Organization",
      "text": "WidgetX",
      "sentiment": {
        "score": -0.964476,
        "label": "negative"
      },
      "relevance": 0.978348,
      "count": 1,
      "confidence": 0.319847
    }
  ]

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

待"谢繁草 2025-01-26 12:41:46

这很有趣。这句话

WidgetX是最近创建的,而且很糟糕。

是一个句子。根据上下文,it 可以指代许多事物,例如主格名词 WidgetX 或副词 recently 或动词 created 。因此,陈述了以下一项或多项。

  • WidgetX 很糟糕
  • 它的创建是最近的 很糟糕
  • 它已经被创建了 很糟糕

在所有情况下,它都是一个否定的陈述。

这句话

WidgetX 最近已创建。太可怕了。

由两个句子组成。第一句只是说明 WidgetX 已被创建,没有任何情感。第二个语句中没有上下文,只有代词 it,其中 It 可能与第一个句子相关,也可能没有。

This is interesting. The phrase

WidgetX has been recently created, and it is terrible.

is a single sentence. By context it can refer to a number of things the nominative noun WidgetX or the adverb recently or the verb created. So that one or more of the following is being stated.

  • WidgetX is terrible
  • That its creation was recent is terrible
  • That it has been created is terrible

In all cases its a negative statement.

The phrase

WidgetX has been recently created. It is terrible.

comprises of two sentences. The first sentence just states that WidgetX has been created, there is no emotion. There is no context in the second statement, just the pronoun it, where It might be related to the first sentence or it might not.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文