zoukankan      html  css  js  c++  java
  • 倒排索引(Inverted Index)

    倒排索引(Inverted Index)
     
    倒排索引是一种索引结构,它存储了单词与单词自身在一个或多个文档中所在位置之间的映射。
    倒排索引通常利用关联数组实现。它拥有两种表现形式:

    inverted file index,其表现形式为 {词项,词项所在文档的ID}
    full inverted index,其表现形式为 {词项,(词项所在文档的ID,在具体文档中的位置)}

    具体实例,假设有三个文档:

        D0 = "it is what it is"
        D1 = "what is it"
        D2 = "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)}

  • 相关阅读:
    Windows网络编程经验小结
    异步Socket服务器与客户端
    用C#实现C/S模式下软件自动在线升级
    Linux 安装字体
    word 生成目录
    Linux sar使用
    yum 使用说明
    HASH JOIN算法
    row cache lock
    cursor: pin S
  • 原文地址:https://www.cnblogs.com/GrantYu/p/3669062.html
Copyright © 2011-2022 走看看