1

我正在尝试使用 Microsoft azure 认知服务在 powerapps 上运行应用程序。这是一个情感分析应用程序,其中根据我们输入的句子给出 0 到 1 之间的情感分析分数,其中 1 表示正面,0 表示负面。但是我尝试和执行多少我无法处理这个错误:

TextAnalytics.DetectLanguage 失败:

{
  "code": "BadRequest",
  "message": "Invalid request",
  "innerError": {
    "code": "InvalidRequestQueryString",
    "message": "Request contains a query string. Request content should be placed in the request body, not in the url as a query string."
  }
}

如果有人对此错误有任何想法并知道如何处理它。请帮我执行此代码。

4

1 回答 1

0

从错误中,听起来您的请求格式不正确。该服务正在寻找以下格式的 POST 请求,听起来您正在发送参数化 URL。

根据这些文档,请求应采用以下形式:

{
  "documents": [
    {
      "language": "en",
      "id": "1",
      "text": "Hello world. This is some input text that I love."
    },
    {
      "language": "fr",
      "id": "2",
      "text": "Bonjour tout le monde"
    },
    {
      "language": "es",
      "id": "3",
      "text": "La carretera estaba atascada. Había mucho tráfico el día de ayer."
    }
  ]
}

您的要求如何比较?

于 2019-04-17T06:04:46.800 回答