简体   繁体   English

IBM Watson Discovery API查询

[英]IBM Watson Discovery API query

I am trying to use watson discovery api and makes request like this: 我正在尝试使用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=

First item in response has taxonomy like this: 响应中的第一项具有如下分类法:

"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"
    }
  ]`

Taxonomy's item labeled "technology" has score 0.499065 but I need items which has label with word "technology" AND score >0.8 (not OR). 分类标准中标有“技术”的项目得分为0.499065,但是我需要标有“技术”字且得分> 0.8(不是“或”)的项目。 How do I change my request to get what I want? 如何更改我的要求以获取所需的东西? Thanks. 谢谢。

Lets step back first. 让我们先退后一步。 The goal of this query is to find documets where the text references 'Ukraine' and then filter all results so that they taxonomy technology is there and has a score over 0.8 该查询的目标是找到文本参考为“ Ukraine”的文档,然后过滤所有结果,以便它们使用分类技术,并且得分超过0.8

I can't test this myself without access to your environment but it should be 我无法在无法访问您的环境的情况下自己对此进行测试,但应该

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=

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM