查询 rank-profile 时召回 returns nothing

Recall returns nothing when querying rank-profile

我有一个示例 Vespa 实例,我想从 rank-profile 训练一个 lightgbm 模型。 https://docs.vespa.ai/documentation/learning-to-rank.html

但是,每当我使用 docID 指定召回时,我都会得到 0 个匹配。我正在使用此处的示例代码: https://github.com/vespa-engine/sample-apps/blob/master/text-search/src/python/collect_training_data.py

body = create_request_top_hits("test", "training", hits=2)
get_features(url, body)

这正确 returns:

[{'id': 'index:domains/0/944f3a850511f388fe97ac85',
  'relevance': 1.2427330381582673,
  'source': 'domains',
  'fields': {'uri': '6202597992',
   'rankfeatures': {'bm25(body)': 2.8145480372957787,
    'nativeFieldMatch(categories)': 0.0,
    'nativeFieldMatch(concepts)': 0.8591903630989031,
    'nativeFieldMatch(links)': 0.0,
    'nativeFieldMatch(title)': 0.0,
    'nativeProximity(categories)': 0.0,
    'nativeProximity(concepts)': 0.0,
    'nativeProximity(links)': 0.0,
    'nativeProximity(title)': 0.0,
    'rankingExpression(time_ranking)': 1.0}}},
 {'id': 'index:domains/0/93f92aae1d6a010c2111e9b7',
  'relevance': 1.2010786365413106,
  'source': 'domains',
  'fields': {'uri': '6206270866',
   'rankfeatures': {'bm25(body)': 2.0397289658724347,
    'nativeFieldMatch(categories)': 0.0,
    'nativeFieldMatch(concepts)': 0.8591903630989031,
    'nativeFieldMatch(links)': 0.0,
    'nativeFieldMatch(title)': 0.0,
    'nativeProximity(categories)': 0.0,
    'nativeProximity(concepts)': 0.0,
    'nativeProximity(links)': 0.0,
    'nativeProximity(title)': 0.0,
    'rankingExpression(time_ranking)': 1.0}}}]

要查看召回是否有效,我们将使用排名靠前的结果:

'id': 'index:domains/0/944f3a850511f388fe97ac85'
'uri': '6202597992'  # docIDs are derived from the uri field

并将召回设置为 docid:

doc_id = [6202597992, "6202597992", "944f3a850511f388fe97ac85"]  # multiple representations...
body = create_request_specific_ids("test", "training", doc_id)
get_features(url, body)

我希望这会 return 之前的排名特征,但我却获得了 0 次点击。这是完整的 return:

{'root': {'id': 'toplevel', 'relevance': 1.0, 'fields': {'totalCount': 0}, 'coverage': {'coverage': 100, 'documents': 798, 'full': True, 'nodes': 5, 'results': 5, 'resultsFull': 5}}}

我已经检查了文档和示例,但我无法在此处找到任何信息。任何见解将不胜感激。

collect script/function 期望在您的文档架构中有一个名为 id 的字段。如果您更改脚本以使用 uri 字段,您应该能够检索文档。