Indri 搜索引擎,为文本集合提供最先进文本搜索和丰富的结构化查询语言。
-
蒙特利尔大学 Jing He 的 PDF
1-Windows 版
安装完成后,启动根目录 lib 中的 IndexUI.jar 和 RetUI.jar,Help 中有相关说明。可参考 Youtube 的指南(西班牙语)。
2-Lunix 版
需要 Build-Essential 、g++(5.4 或更早版本)、make、zlib1g-dev,安装过程参考 文章
执行 bin 内的 IndriBuildIndex <parameter_files>
建立索引,IndriRunQuery <parameter_files>
进行查询,parameter_files 的格式:
<parameters>
<option> </option>
<option> </option>
...
<option> </option>
</parameters>
索引参数文件中 option 示例:
# 数据及其格式
<corpus>
<path>/path/to/source/files</path>
<class>trectext</class>
</corpus>
# 建立索引位置
<index>/path/to/the/index</index>
# 使用内存
<memory>256M</memory>
# 停用词
<stopper>
<word>a</word>
<word>the</word>
...
<word>is</word>
</stopper>
# 词干提取器
<stemmer>
<name>krovetz</name>
</stemmer>
# 字段
<field><name>title</name></field>
<field><name>description</name></field>
查询参数文件中 option 示例:
# 索引位置
<index>/path/to/the/index</index>
# 查询
<query>
<number>1</number>
<text>text1</text>
</query>
<query>
<number>2</number>
<text>text2</text>
</query>
...
# 返回列表长度
<count>10</count>
# 输出格式
<runID>runName</runID>
<trecFormat>true</trecFormat>
<text>
标签内查询语言内容较复杂,可参考 Wiki,例:
text1 text2 等价于 #combine(text1 text2)
#combine[title](text1) 则只对 title 字段检索
输出结果格式:
<queryNumber> Q0 <DocID> <rank> <score> <runID>
3-DeepFL 中的 Indir
2019 - DeepFL: Integrating Multiple Fault Diagnosis Dimensions for Deep Fault Localization 这篇文章中研究了 source code methods 和 failed test information 之间的文本相似性。a × b 构成 15 种组合。
文档字段 | 查询字段 |
---|---|
the full qualified name of the method | the name of failed tests |
accessed classes | the source code of failed tests |
method invocations | the complete failure message |
used variables | |
comments |
下面是 Defects4J 中 Lang-3 示例:
思考:
- Buggy Method 的可能会有多个
- 上述只考虑理论,实际错误定位中,如何确定 Buggy Method ?将所有文件都整理出来建立索引 ?
这里不使用 DeepFL 中的文档字段,但仍收集查询字段的信息。
- Failure Message 可以在 Defects4J 的
framework/projects/<pid>/trigger_tests
文件中得到 - Failed Test 可以根据路径找到,但是否有快速获得方法代码片段的方法?