This repository contains the implementation code for Naive Rules, a method for analyzing data based on the modified ICEWS14 and ICEWS05-15 datasets that have been resegmented to eliminate leakage issues. The paper link is Do Temporal Knowledge Graph Embedding Models Learn or Memorize Shortcuts?
To use this code, please follow the steps below:
- Clone the repository to your local machine:
git clone https://github.com/NacyNiko/naive_rule.git
Follow the steps below to run the Naive Rules code:
- Run the
process_icews.pyscript to preprocess the dataset. This script will perform necessary data transformations.
python process_icews.py - Next, run the
model_rule_rhs.pyandmodel_rule_lhs.pyscripts separately. These scripts calculate the scores for rhs and lhs, respectively. Make sure to specify the dataset as eitherICEWS14RRorICEWS15RRusing the--datasetflag.
python model_rule_rhs.py --dataset ICEWS14RR
python model_rule_lhs.py --dataset ICEWS14RR - The averange of rhs score and lhs score was used as the final score.