This repository contains the code for the paper "Towards Better Graph-based Cross-document Relation Extraction via Non-bridge Entity Enhancement and Prediction Debiasing" (Findings of ACL 2024, 📃arXiv Paper).
Follow the guideliens from : https://github.com/thunlp/CodRED
data
: Directory for data
ours
: Directory for code
ours/main.py
: File for training/validate
All of the dataset files are in ./dataset/
please add dsre_train_example.json to ./dataset/
Note that we also provide the dataset for open setting in ./dataset/open_setting_data/
, following https://github.com/luka-group/MrCoD
For data preparation and processing steps, please refer to https://github.com/thunlp/CodRED
dataset | Link |
---|---|
dsre_train_example.json | Download |
We also provide checkpoints for convenient.
Model | Link |
---|---|
Ours w/o y_bias,y_rela | Download |
y_rela Classifer | Download |
Here are examples for model inference (you can modify the ours/train.sh for inference):
- Ours full model:
CUDA_VISIBLE_DEVICES=0 python main.py --dev --test --load_checkpoint "checkpoint path for w/o y_bias,y_rela*checkpoint for y_rela classifer" --per_gpu_train_batch_size 1 --per_gpu_eval_batch_size 1 --learning_rate 3e-5 --epochs 1
- Ours w/o y_bias,y_rela:
CUDA_VISIBLE_DEVICES=0 python main.py --dev --test --load_checkpoint "checkpoint path for w/o y_bias,y_rela" --per_gpu_train_batch_size 1 --per_gpu_eval_batch_size 1 --learning_rate 3e-5 --epochs 1