-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rare case when entity has no relations but attribute triples #21
Comments
Hi Sven, This is because the code does not generate ids for the entities that only have attributes. Best regards, |
Hi, I have updated the code. Now the entity set contains the new entities from attribute triples. |
作者您好,如果只有属性三元组没有关系三元组可以吗。看了代码:triples_num = self.kgs.kg1.relation_triples_num + self.kgs.kg2.relation_triples_num,如果没有关系三元组的话triples_num为0,会导致后续计算loss时报错 |
同学你好,我后面开学了会仔细测试一下这个场景。不过目前的方法都是需要relation的,attribute只是辅助信息,所以可能很少存在relation为0的情况。如果你有需求,你可以先自己修改一下代码。我后面会修复一下来支持这个场景。 |
好的,我尝试修改下代码 |
Hi Zequn, sorry for the late answer.
I created a small example with all necessary files, so that you can also test it. Best regards |
Hi Zequn, did you already have some time to test the small example? Best regards |
Hi Sven, So sorry for my late reply. I've been very busy in the past few months (due to some personal reasons). I plan to test the proposed cases in the next few weeks. Sorry for the inconvenience. Best, Zequn |
Hi Zequn, thanks for your answer. Great, that you want to test the proposed cases ( I know that the data may be very noisy, but I think this makes the library stronger and more resilient to any input). Best regards |
Hi Sven, I have updated the code to support the proposed case where some entities have no relations. I tested the code with AlignE, not BootEA because the latter's current implementation cannot support entity alignment with dangling entities (i.e., those having no alignment as in your dataset). Please use the configuration (arguments.json) below, and you can further test the code on large training/test data. {
"loss_norm" : "L2",
"eval_metric" : "inner",
"eval_freq" : 10,
"neg_triple_num" : 10,
"pos_margin" : 0.01,
"dim" : 100,
"start_valid" : 10,
"rel_l2_norm" : true,
"output" : "output/",
"loss" : "limited",
"optimizer" : "Adagrad",
"truncated_freq" : 10,
"alignment_module" : "swapping",
"top_k" : [ 1, 5, 10, 50 ],
"search_module" : "greedy",
"csls" : 10,
"predict_top_k" : 1,
"neg_margin" : 2.0,
"likelihood_slice" : 10,
"sub_epoch" : 10,
"dataset_division" : "alignment/",
"init" : "normal",
"ordered" : true,
"batch_size" : 5000,
"stop_metric" : "hits1",
"batch_threads_num" : 4,
"sim_th" : 0.7,
"k" : 10,
"is_save" : true,
"max_epoch" : 2000,
"training_data" : "data/",
"embedding_module" : "AlignE",
"neg_sampling" : "truncated",
"truncated_epsilon" : 0.99,
"neg_margin_balance" : 0.2,
"test_threads_num" : 16,
"ent_l2_norm" : true,
"learning_rate" : 0.01,
"eval_norm" : false
}
As the test data is very small, the performance fluctuates a lot. I give the log of the first 40 epochs as follows:
Best, Zequn |
Hi Zequn, thank you so much for your quick answer and the code adaption. Can you provide some further information about the dangling entities? Am I right, that BootEA does not work, when some entities in the KG are not aligned? (How can the implementation depend on such a prerequisite? I thought that the algorithm just get a training alignment and tries to find other correspondences. Can the algorithm be adapted to work also in such cases or is it a strict requirement for the approach to work?) What other algorithms (implemented in this library) can be used in such situations, where not all entities are aligned (besides AlignE)? Best regards |
Hi Sven, You can refer to our recent paper for more details about entity alignment with dangling cases. This paper presents a primary attempt at this problem but this is still a long way to go. I will be still working on this problem and implement more algorithm variants (e.g., BootEA) that can be used in such situations. Best, |
Hi,
as you already pointed out in the pull request:
in the rare case that an entity has no relations but only attribute triples, the code fails also at this position when called by the init function of class KGs.
Best regards
Sven
The text was updated successfully, but these errors were encountered: