duterscmy / ccks2019-ckbqa-4th-codes

中文知识库问答代码,CCKS2019 CKBQA评测第四名解决方案
477 stars 91 forks source link

搜索关系时当实体是object怎么搜索出来? #15

Closed 1234560o closed 4 years ago

1234560o commented 4 years ago

作者,您好,在kb.py代码中GetRelations_2hop函数在搜索2跳内的所有关系的时候,也包括其它都是把实体当作subject来进行搜索("match (a:Entity)-[r1:Relation]-()-[r2:Relation]->() where a.name=$name return DISTINCT r1.name,r2.name"),如果question中的goldentity是object,这样不是就不能搜索出来呢?比如下面这个例子: q43:谁废除了分封制? select ?x where { ?x <主要成就> "废除 分封制". } <秦始皇(中国首位皇帝)>

duterscmy commented 4 years ago
font{
    line-height: 1.6;
}
ul,ol{
    padding-left: 20px;
    list-style-position: inside;
}

    这个例子是可以的。因为统计过这个语料,一跳问题的话实体作为主语和宾语的情况都有,两跳问题的话两个关系都是反方向的特别少。这个sql语句实际是第一跳考虑了两个方向,第二跳只考虑了单向,所以对于这个例子是可以搜索到关系的

在2019年12月6日 16:14,zwj<notifications@github.com> 写道: 

作者,您好,在kb.py代码中GetRelations_2hop函数在搜索2跳内的所有关系的时候,也包括其它都是把实体当作subject来进行搜索("match (a:Entity)-[r1:Relation]-()-[r2:Relation]->() where a.name=$name return DISTINCT r1.name,r2.name"),如果question中的gold_entity是object,这样不是就不能搜索出来呢?比如下面这个例子:

q43:谁废除了分封制?

select ?x where { ?x <主要成就> "废除 分封制". }

<秦始皇_(中国首位皇帝)>

—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or unsubscribe.

1234560o commented 4 years ago

哦,谢谢。我猜测,这类sql语句->表示单向,-是双向吧?

duterscmy commented 4 years ago
font{
    line-height: 1.6;
}
ul,ol{
    padding-left: 20px;
    list-style-position: inside;
}

    嗯是的

在2019年12月6日 16:30,zwj<notifications@github.com> 写道: 

哦,谢谢。我猜测,这类sql语句->表示单向,-是双向吧?

—You are receiving this because you commented.Reply to this email directly, view it on GitHub, or unsubscribe.

1234560o commented 4 years ago

我看到这个例子: q2265:"双城论"的提出者的作品有哪些? SELECT ?x WHERE { <双城论> <提出者> ?y . ?x <作者> ?y . } 如果二跳只考虑单向,像这种是不是就搜索不到呢?

duterscmy commented 4 years ago

是的,统计数据是有这种情况,但是如果考虑到这个情况,那每个问题平均候选答案规模会翻倍到3000左右,时间上和后续结果都有影响,所以就做了个剪枝。

---原始邮件--- 发件人: "zwj"<notifications@github.com> 发送时间: 2019年12月9日(周一) 下午3:35 收件人: "duterscmy/ccks2019-ckbqa-4th-codes"<ccks2019-ckbqa-4th-codes@noreply.github.com>; 抄送: "Comment"<comment@noreply.github.com>;"Caomingyu"<1054527636@qq.com>; 主题: Re: [duterscmy/ccks2019-ckbqa-4th-codes] 搜索关系时当实体是object怎么搜索出来? (#15)

我看到这个例子: q2265:"双城论"的提出者的作品有哪些? SELECT ?x WHERE { <双城论> <提出者> ?y . ?x <作者> ?y . } 如果二跳只考虑单向,像这种是不是就搜索不到呢?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.