Indri 建立索引及检索

Indri 搜索引擎,为文本集合提供最先进文本搜索和丰富的结构化查询语言。

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 methodthe name of failed tests
accessed classesthe source code of failed tests
method invocationsthe complete failure message
used variables
comments

下面是 Defects4J 中 Lang-3 示例:
在这里插入图片描述

思考:

  1. Buggy Method 的可能会有多个
  2. 上述只考虑理论,实际错误定位中,如何确定 Buggy Method ?将所有文件都整理出来建立索引 ?

这里不使用 DeepFL 中的文档字段,但仍收集查询字段的信息。

  • Failure Message 可以在 Defects4J 的 framework/projects/<pid>/trigger_tests 文件中得到
  • Failed Test 可以根据路径找到,但是否有快速获得方法代码片段的方法?
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值