1

当我输入这个请求时:

{
  "text": "
Il sindaco pensa solo a far realizzare rotonde...non lo disturbate per le cavolate! ,Che schifo!
",
  "features": 
  {
  "sentiment": {
"targets": [
        "aggressione", "aggressioni", "agguati", "agguato", "furto", "furti", "lavoro nero", 
        "omicidi", "omicidio", "rapina", "rapine", "ricettazione", "ricettazioni", "rom", "zingari", "zingaro", 
        "scippo", "scippi", "spaccio", "scommesse"
      ]
    },
    "categories": {},
    "entities": {
      "emotion": true,
      "sentiment": true,
      "limit": 5
    },
    "keywords": {
      "emotion": true,
      "sentiment": true,
      "limit": 5
    }
  }
}

我得到这个回应:

{
  "language": "it",
  "keywords": [
    {
      "text": ",Che schifo",
      "relevance": 0.768142
    }
  ],
  "entities": [],
  "categories": [
    {
      "score": 0.190673,
      "label": "/law, govt and politics/law enforcement/police"
    },
    {
      "score": 0.180499,
      "label": "/style and fashion/clothing/pants"
    },
    {
      "score": 0.160763,
      "label": "/society/crime"
    }
  ],
  "warnings": [
    "sentiment: cannot locate keyphrase"
  ]
}

为什么我没有收到文档情绪的输出?如果 NLU 没有找到关键短语,它会在没有文本情绪的情况下返回此警告!这是要修复的 NLU 错误吗?

4

1 回答 1

0

如果 NLU 没有找到您传递的任何关键短语,那么它会抛出警告“无法找到关键短语”。即使文本中存在目标之一,它也会返回文档情绪。如果您不确定文本中是否存在目标短语,请仅针对情绪进行单独的 API 调用,而无需任何目标来检索文档情绪。我不会说它是 NLU 端的错误,但如果在给定文本中没有找到任何目标短语,服务可以是宽松的,而不是严格的。

于 2018-02-14T08:34:20.227 回答