【问题标题】:How do I filter the results of an aggregation in IBM Watson discovery service如何过滤 IBM Watson 发现服务中的聚合结果
【发布时间】:2018-06-12 04:02:29
【问题描述】:

在 Watson 发现服务中,我已经在汇总我的文档以获取最重要的概念。使用以下查询:

term(enriched_metadata_text.concepts.text,count:10)

但是,我的源材料已经集中在几个核心概念上。在这种情况下冰球,所以我想做的是能够过滤掉那些概念。查询如下所示:

term(enriched_metadata_text.concepts.text,count:10).filter(enriched_metadata_text.concepts.text:!("National Hockey League"|"Ice hockey"))

但这不起作用。如果我先过滤,我可以让它工作:

filter(enriched_metadata_text.concepts.text:!("National Hockey League"|"Ice hockey")).term(enriched_metadata_text.concepts.text,count:10)

然而,这个问题是它过滤带有“冰球”概念的文档,然后汇总结果。我想获取概念列表,然后将其过滤掉,而不会丢失任何文档。

提前感谢您的帮助。

【问题讨论】:

    标签: watson watson-discovery


    【解决方案1】:

    我相信您应该能够使用 nested 聚合来完成您的任务以实现您的目标。

    nested 将聚合范围限定为子文档(这就是概念)

    所以我的建议是运行以下查询:

    nested(enriched_metadata_text.concepts).filter(enriched_metadata_text.concepts.text:!("National Hockey League"|"Ice hockey")).term(enriched_metadata_text.concepts.text,count:10)
    

    如果可行,请告诉我!

    【讨论】:

    • 你好安德鲁。那个确切的查询不起作用,它使用发现工具只会让微调器转来转去。我现在将阅读发现文档以了解更多“嵌套”的作用。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-02-24
    • 1970-01-01
    • 1970-01-01
    • 2011-08-19
    • 2015-10-06
    • 1970-01-01
    • 2016-10-02
    相关资源
    最近更新 更多