1

我正在尝试使用 watson discovery api 并提出如下请求:

https://gateway.watsonplatform.net/discovery/api/v1
/environments/6da44f3d-678f-476a-ae8b-cf69327fcf93
/collections/f9c98c9e-be05-4a00-bc93-7159f5441251/query
?version=2016-11-07
&query=text:Ukraine,taxonomy:(label:technology,score>0.8)
&count=10
&offset=
&aggregation=
&filter=
&return=

响应的第一项具有如下分类:

"taxonomy": [
    {
      "score": "0.976715",
      "label": "/law, govt and politics/armed forces/army"
    },
    {
      "confident": "no",
      "score": "0.499065",
      "label": "/technology and computing/computer certification"
    },
    {
      "confident": "no",
      "score": "0.496026",
      "label": "/law, govt and politics/legal issues/human rights"
    }
  ]`

分类学的标签为“技术”的项目得分为 0.499065,但我需要标签为“技术”且得分 > 0.8(不是 OR)的项目。如何更改我的请求以获得我想要的?谢谢。

4

1 回答 1

1

让我们先退一步。此查询的目标是找到文本引用“乌克兰”的文档,然后过滤所有结果,以便它们存在分类技术并且得分超过 0.8

如果无法访问您的环境,我无法自己测试,但应该是

https://gateway.watsonplatform.net/discovery/api/v1
/environments/6da44f3d-678f-476a-ae8b-cf69327fcf93
/collections/f9c98c9e-be05-4a00-bc93-7159f5441251/query
?version=2016-11-07
&query=text:Ukraine
&count=10
&offset=
&aggregation=
&filter=taxonomy:(label:technology,score>0.8)
&return=
于 2017-04-19T00:27:39.557 回答