SimKGC icon indicating copy to clipboard operation
SimKGC copied to clipboard

Questions about the inverse relations

Open ShaoZhangHao opened this issue 1 year ago • 1 comments

Could you please explain how you handle relations in the code for the Bert.Tokenizer? Is it simply by adding "inverse" in front of each relation? It seems like you don't have a dataset called 'relations2description,' which means that relations are just the strings in the middle column of 'train.txt/valid.txt/test.txt' and haven't undergone any processing. They haven't been converted into descriptions like entities and are used directly, is that correct? Will the Bert model be able to correctly process and output embeddings with rich semantic information, similar to when they are converted into descriptions?

Additionally, how do you handle inverse relations? Is it as simple as adding 'inverse' in front of all relations? Will this approach provide the correct inverse relations? I couldn't find a file like 'inverse_relation2description,' so I need your assistance. Thank you for taking the time to help me with this.

ShaoZhangHao avatar Sep 21 '23 08:09 ShaoZhangHao

  1. We map each relation id to its string format, please check out preprocess.py for details.
  2. Yes, the inverse relations are simply handled by adding "inverse" prefix, BERT will learn this pattern.

intfloat avatar Sep 21 '23 11:09 intfloat