0

在 Watson API 文档中,给出了使用 CURL 向训练数据添加查询的以下内容:

curl -X POST -u "{username}":"{password}" -H "Content-Type: application/json" -d
'{
  "natural_language_query": "who is keyser soze",
  "filter": "text:criminology",
  "examples": [
    {
      "document_id": "adaf50f1-2526-4fad-b670-7d6e8a42e6e6",
      "relevance": 2
    },
    {
      "document_id": "63919442-7d5b-4cae-ab7e-56f58b1390fe",
      "cross_reference": "my_id_field:14",
      "relevance": 4
    }
  ]
}' "https://gateway.watsonplatform.net/discovery/api/v1/environments/{environment_id}/collections/{collection_id}/training_data?version=2018-03-05"

无论我如何尝试或使用多个库,它似乎都没有正确的 JSON 格式(即使 JSON 验证器已确认)。

有没有人尝试使用这种方法来添加查询?

4

0 回答 0