nju-websoft / bootea Goto Github PK
View Code? Open in Web Editor NEWBootstrapping Entity Alignment with Knowledge Graph Embedding, IJCAI 2018
License: MIT License
Bootstrapping Entity Alignment with Knowledge Graph Embedding, IJCAI 2018
License: MIT License
numpy.core._exceptions._ArrayMemoryError: Unable to allocate 3.73 GiB for an array with shape (10000, 100000) and data type float32
运行过程中出现此问题 请问如何解决?
hello,你好,最近在膜拜你写的BootEA代码,不过对于其中使用到的数据有个小问题,请教下哈:ref_ent_ids和sup_ent_ids之间的区别是什么呢,感觉好像都是对齐种子?
老师您好,我正在DBP15k上复现MultiKE。
然而MultiKE在论文中使用的数据集是DBP-WD和DBP-YG,所以我决定先在这两个数据集上复现,再在DBP15k上复现。
(这两个数据集来自这个仓库,所以本issue发在这里。)
我复现的过程中发现,代码里缺少基于实体名获取嵌入的部分。于是我用了bert。结果,在不训练网络的情况下,仅仅使用 bert 给出的嵌入,其对齐效果就有99%。
一开始我以为是bert太强大。但是,很快我发现,我错了。
我做了实验:只基于实体名,当两个实体名相等时,则认为两实体对齐了。其中没有用到任何模型。这仅仅是一些 if-else 而已。其结果令人惊讶,100%。
代码如下
# 1. build map
kg1_id2name = {}
kg2_id2name = {}
kg2_name2id = {}
with open("./dataset/DWY100K/dbp_yg/mapping/0_3/ent_ids_1") as f:
lines = f.readlines()
for i in lines:
id, name = i.strip().split("\t")
kg1_id2name[int(id)] = name
with open("./dataset/DWY100K/dbp_yg/mapping/0_3/ent_ids_2") as f:
lines = f.readlines()
for i in lines:
id, name = i.strip().split("\t")
kg2_id2name[int(id)] = name
kg2_name2id[name] = int(id)
# 2. load test data
left_entities = []
right_entities = []
with open("./dataset/DWY100K/dbp_yg/mapping/0_3/ref_ent_ids") as f:
lines = f.readlines()
all = len(lines)
for i in lines:
a, b = i.split("\t")
aId = int(a)
bId = int(b)
left_entities.append(aId)
right_entities.append(bId)
# 3. predict
my_right_entities = []
for left_entity in left_entities:
left_entity_name = kg1_id2name[left_entity]
idx = left_entity_name.rindex("resource/")
short_name = left_entity_name[idx+len("resource/"):]
try:
kg2_entity_id = kg2_name2id[short_name]
my_right_entities.append(kg2_entity_id)
except Exception:
my_right_entities.append(-1)
# 4. result
true_count = 0
for i in range(len(right_entities)):
right_entity = right_entities[i]
my_right_entity = my_right_entities[i]
if right_entity == my_right_entity:
true_count += 1
print("true/all = %.2f%%" % (true_count/all*100))
结果截图
也就是说,对齐种子如果只通过实体名这一方面的信息做对齐,效果必须有100%。
这太奇怪了。
我使用该数据集的方法是否正确?对齐种子的实体名是否发生了泄漏?我应该如何正确地使用这两个数据集?
期待您的解惑。
Hi, Zequn.
I try to use https://github.com/thunlp/IEAJKE(IPTransE) to reproduce the results of IPTransE on DBP15Kzh-en. But the results are so much bad than what reported in your paper BootEA(My results are Hit@1: 0.1941, Hit@10: 0.4685, MRR: 0.2833). I just changed the data format of the DBP15Kzh-en to what IPTransE needs. No parameters modified.
Would you like to share some advice on it? (Or kindly would you like to share the code/input_dataset that you use?)
Thanks!
Hi, could you please share the results of AlignE under different proportion of seeds? There are only the results of BootEA in paper charts.
您好,我对您提出的方法很感兴趣,我们复现了实验,发现自举过程是从ref_pairs中筛选新的对齐实体对,请问是否应该是从未对齐的实体中选择呢?
Can you tell me about the description of DWY100k?
想请问一下result文件里面的结果,为什么只对齐了ref-pairs中的实体。还想问一下为什么那个输出的准确率和召回率会随着迭代次数减少。
好像是内存满了,打开任务管理器GPU好像没跑起来,这是什么问题,其他的代码都可以用GPU跑,该怎么解决
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.