【问题标题】:Watson discovery highlightWatson 发现亮点
【发布时间】:2018-03-05 09:38:58
【问题描述】:

我是塔卡。

我试图在 Node.red 中的 Watson Discovery 上获得突出显示的结果。
它不起作用。
你能告诉我我们是否可以在 Node.red 中获得突出显示的结果
如果可以的话怎么做?

这是我试过的。 我在 Node.red 中创建了一个函数节点来传递查询
从 Discovery 查询生成器到 Discovery 节点,如下所示。

msg.discoveryparams = {};  
msg.discoveryparams.environment_id = 'xxxxxxxxxxxxx';  
msg.discoveryparams.collection_id = 'xxxxxxxxxxxxxxxx';  
msg.discoveryparams.nlp_query = true;  
msg.discoveryparams.query = msg.payload;<--query from query builder  
msg.discoveryparams.query_options = {highlight:true};  <-- add to get highlighted
return msg;  

谢谢。

【问题讨论】:

    标签: ibm-cloud watson discovery watson-discovery


    【解决方案1】:

    query_options 尚未在 Node-RED 节点中实现发现。如果您希望它被实施,请针对 github 存储库提出问题 - https://github.com/watson-developer-cloud/node-red-node-watson

    【讨论】:

      【解决方案2】:

      这是一段代码

      var discovery = new watson.DiscoveryV1(params.discovery);
      
      discovery.query(
              {environment_id: params.discovery.environment_id,
                  collection_id: params.discovery.collection_id,
                  natural_language_query: req.body.input.text,
                  passages: true,
                  highlight: true  // this will enable highlight
              }
      

      【讨论】:

        猜你喜欢
        • 2019-01-31
        • 2020-10-24
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-03-23
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多