`
zhangyu8374
  • 浏览: 93376 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

反向索引(Inverted Index)

阅读更多
反向索引是一种索引结构,它存储了单词与单词自身在一个或多个文档中所在位置之间的映射。反向索引通常利用关联数组实现。它拥有两种表现形式:
  1. inverted file index其表现形式为 {单词,单词所在文档的ID}
  2. full inverted index,其表现形式为{单词,(单词所在文档的ID,在具体文档中的位置)}
具体实例,假设有三个文档:
  • T0 = "it is what it is"
  • T1 = "what is it"
  • T2 = "it is a banana"
那么,采用inverted file index方式,结果是:
"a": {2}
"banana": {2}
"is": {0, 1, 2}
"it": {0, 1, 2}
"what": {0, 1}
采用full inverted index方式,结果是:
"a":      {(2, 2)}
"banana": {(2, 3)}
"is": {(0, 1), (0, 4), (1, 1), (2, 1)}
"it": {(0, 0), (0, 3), (1, 2), (2, 0)}
"what": {(0, 2), (1, 0)}
分享到:
评论
2 楼 ethan_shan 2015-11-27  
 
1 楼 337240552 2013-03-19  

相关推荐

Global site tag (gtag.js) - Google Analytics