duterscmy / ccks2019-ckbqa-4th-codes

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

entity_extractor.py #12

Closed miaozjs closed 4 years ago

miaozjs commented 4 years ago

提示缺少entity_extractor_ans.txt文件,想请问entity_extractor_ans.txt来自哪里

miaozjs commented 4 years ago

已解决,这个文件新建一下就好 另一个问题:entity_extractor.py 文件这个速度是正常的吗?

4 商朝在哪场战役中走向覆灭? ====当前实体mention为:商朝==== ====当前实体mention为:在哪==== ====当前实体mention为:场==== ====当前实体mention为:战役==== ====当前实体mention为:走向==== ====当前实体mention为:覆灭==== ====当前属性mention为:战役中==== ====当前属性mention为:商朝==== ====当前属性mention为:在哪==== ====当前属性mention为:走向==== ====当前属性mention为:覆灭==== 候选实体为: <商朝> ['商朝', 2.0, 26.0, 0.0, 2, 7] <在哪> ['在哪', 2.0, 1.0, 2.0, 2, 3] <场(词语释义)> ['场', 1.0, 1.0, 4.0, 1, 2] <场(物理学定义)> ['场', 1.0, 1.0, 4.0, 1, 2] <场(戏剧术语)> ['场', 1.0, 1.0, 4.0, 1, 1] <场(视频技术术语)> ['场', 1.0, 1.0, 4.0, 1, 1] <场(茶家术语)> ['场', 1.0, 1.0, 4.0, 1, 1] <场(谭剑飞创作的诗歌)> ['场', 1.0, 1.0, 4.0, 1, 2] <战役> ['战役', 2.0, 713.0, 5.0, 1, 5] <巴布亚半岛战役> ['战役', 2.0, 713.0, 5.0, 1, 3] <公元246年> ['战役', 2.0, 713.0, 5.0, 0, 2] <走向> ['走向', 2.0, 2254.0, 8.0, 1, 3] <覆灭> ['覆灭', 2.0, 70.0, 10.0, 1, 3] <颠危> ['覆灭', 2.0, 70.0, 10.0, 0, 0] "战役中" ['战役中', 3.0, 1.0, 5.0, 2, 3] 15 耗费时间236.69秒

duterscmy commented 4 years ago

正常应该没有这么慢吧,这一步计算特征需要先得到两跳子图内关系,会用到知识库,如果知识库没有建索引的话会比较慢,最好在实体名这个属性上建个索引。

---Original--- From: "miaozjs"<notifications@github.com> Date: Mon, Dec 2, 2019 22:03 PM To: "duterscmy/ccks2019-ckbqa-4th-codes"<ccks2019-ckbqa-4th-codes@noreply.github.com>; Cc: "Subscribed"<subscribed@noreply.github.com>; Subject: Re: [duterscmy/ccks2019-ckbqa-4th-codes] entity_extractor.py (#12)

已解决,这个文件新建一下就好 另一个问题:entity_extractor.py 文件这个速度是正常的吗?

4 商朝在哪场战役中走向覆灭? ====当前实体mention为:商朝==== ====当前实体mention为:在哪==== ====当前实体mention为:场==== ====当前实体mention为:战役==== ====当前实体mention为:走向==== ====当前实体mention为:覆灭==== ====当前属性mention为:战役中==== ====当前属性mention为:商朝==== ====当前属性mention为:在哪==== ====当前属性mention为:走向==== ====当前属性mention为:覆灭==== 候选实体为: <商朝> ['商朝', 2.0, 26.0, 0.0, 2, 7] <在哪> ['在哪', 2.0, 1.0, 2.0, 2, 3] <场(词语释义)> ['场', 1.0, 1.0, 4.0, 1, 2] <场(物理学定义)> ['场', 1.0, 1.0, 4.0, 1, 2] <场(戏剧术语)> ['场', 1.0, 1.0, 4.0, 1, 1] <场(视频技术术语)> ['场', 1.0, 1.0, 4.0, 1, 1] <场(茶家术语)> ['场', 1.0, 1.0, 4.0, 1, 1] <场(谭剑飞创作的诗歌)> ['场', 1.0, 1.0, 4.0, 1, 2] <战役> ['战役', 2.0, 713.0, 5.0, 1, 5] <巴布亚半岛战役> ['战役', 2.0, 713.0, 5.0, 1, 3] <公元246年> ['战役', 2.0, 713.0, 5.0, 0, 2] <走向> ['走向', 2.0, 2254.0, 8.0, 1, 3] <覆灭> ['覆灭', 2.0, 70.0, 10.0, 1, 3] <颠危> ['覆灭', 2.0, 70.0, 10.0, 0, 0] "战役中" ['战役中', 3.0, 1.0, 5.0, 2, 3] 15 耗费时间236.69秒

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

miaozjs commented 4 years ago

增加索引,速度问题已改善,碰见另一个问题在运行tuple_extractor.py文件时进行similarity操作的时候 similarity.py文件中 class SimProcessor 调用了 train.csv ,这个文件数据格式是什么呢

image

MrRace commented 4 years ago

@duterscmy 同求similarity.py 中 生成train.csv的处理脚本~

miaozjs commented 4 years ago

@duterscmy 同求similarity.py 中 生成train.csv的处理脚本~ 我按照question \t relation \t 正例还是负例(0 or 1)格式处理原问答数据,代码可以正常运行下去

miaozjs commented 4 years ago

0

georgewangchn commented 3 years ago

docker运行 bin/neo4j-admin import --database=xxx.db --nodes=import/node.csv --relationships=import/relation.csv

yoyotv commented 3 years ago

增加索引,速度问题已改善

@miaozjs 你好,想请问一下这边的增加索引以提升速度,具体该怎么做呢? 我在这个问题"商朝在哪场战役中走向覆灭?",花费的时间比您的236.69还多2倍 謝謝您

yoyotv commented 3 years ago

已解決,參照 https://neo4j.com/docs/operations-manual/4.2/performance/index-configuration/