【发布时间】:2018-08-08 11:29:31
【问题描述】:
def query_RR(postings, qtext):
words = tokenize(qtext)
allpostings = [postings[w] for w in words]
for a in allpostings:
print a.keys()
这是查询 [0, 2, 3, 4, 6] [1, 4, 5] [0, 2, 4] [4, 5] 的结果
查询采用用户输入的术语('qtext'),标记并为每个标记生成一个发布列表。
发布列表是嵌套字典的列表(例如 [{0 : 0.68426, 1: 0.26423}, {2: 0.6842332, 0: 0.9823}]。我正在尝试使用键找到这些嵌套字典的交集
【问题讨论】:
标签: python list intersection