Datasets:

Modalities:
Text
Formats:
json
Languages:
English
ArXiv:
Libraries:
Datasets
pandas
License:
Re-DocRED-CF / README.md
amodaresi's picture
Update README.md
ea9437b verified
---
license: mit
language:
- en
configs:
- config_name: var-01
data_files:
- split: train
path: var-01/train.jsonl
- split: dev
path: var-01/dev.jsonl
- split: test
path: var-01/test.jsonl
- split: train_mix
path: var-01/train_mix.jsonl
- config_name: var-02
data_files:
- split: train
path: var-02/train.jsonl
- split: dev
path: var-02/dev.jsonl
- split: test
path: var-02/test.jsonl
- split: train_mix
path: var-02/train_mix.jsonl
- config_name: var-03
data_files:
- split: train
path: var-03/train.jsonl
- split: dev
path: var-03/dev.jsonl
- split: test
path: var-03/test.jsonl
- split: train_mix
path: var-03/train_mix.jsonl
- config_name: var-04
data_files:
- split: train
path: var-04/train.jsonl
- split: dev
path: var-04/dev.jsonl
- split: test
path: var-04/test.jsonl
- split: train_mix
path: var-04/train_mix.jsonl
- config_name: var-05
data_files:
- split: train
path: var-05/train.jsonl
- split: dev
path: var-05/dev.jsonl
- split: test
path: var-05/test.jsonl
- split: train_mix
path: var-05/train_mix.jsonl
- config_name: var-06
data_files:
- split: train
path: var-06/train.jsonl
- config_name: var-07
data_files:
- split: train
path: var-07/train.jsonl
- config_name: var-08
data_files:
- split: train
path: var-08/train.jsonl
- config_name: var-09
data_files:
- split: train
path: var-09/train.jsonl
---
# Re-DocRED-CF
Many datasets have been developed to train and evaluate document-level relation extraction (RE) models. Most of these are constructed using real-world data. However, it has been shown that RE models trained on real-world data suffer from factual biases. To evaluate and address this issue, we present [**CovEReD** (Paper)](https://www.arxiv.org/abs/2407.06699), a counterfactual data generation approach for document-level relation extraction datasets through entity replacement.
Using our pipeline, we have generated **Re-DocRED-CF**, a dataset of counterfactual RE documents, to help evaluate and address inconsistencies in document-level RE.
This repo contains five counterfactual variations of the seed dataset, i.e., Re-DocRED. All five sets of train/dev/test dataset files are available here through the HuggingFace Datasets API 🤗.
To select a specific variation (e.g. `var-01`):
```python
dataset = load_dataset("amodaresi/Re-DocRED-CF", "var-01")
```
#### Output:
```python
DatasetDict({
train: Dataset({
features: ['title', 'labels', 'original_doc_id', 'vertexSet', 'sents'],
num_rows: 2870
})
dev: Dataset({
features: ['title', 'labels', 'original_doc_id', 'vertexSet', 'sents'],
num_rows: 466
})
test: Dataset({
features: ['title', 'labels', 'original_doc_id', 'vertexSet', 'sents'],
num_rows: 453
})
train_mix: Dataset({
features: ['title', 'labels', 'original_doc_id', 'vertexSet', 'sents'],
num_rows: 5923
})
})
```
The `train_mix` is the original training set combined with its counterfactual variation counterpart.
We have also included four additional training set variations (var-[06, 07, 08, 09]), though they were not used in the evaluations presented in our paper.
The properties `title`, `labels`, `vertexSet`, and `sents` are structured similarly to those in the original DocRED & Re-DocRED datasets:
- `title`: Document title.
- `labels`: List of relations. Each entry indicates the relation between a head and a tail entity, with some entries also specifying evidence sentences.
- `vertexSet`: List of entity vertex sets. Each entry represents a vertex specifying all mentions of an entity by their position in the document, along with their type.
- `sents`: Tokenized sentences.
In examples that are counterfactually generated, the title includes a variation number. For example: `AirAsia Zest ### 1`.
The `original_doc_id` denotes the index of the example in the original seed dataset, i.e., Re-DocRED.
## GitHub Repo & Paper
For more information about the **CovEReD** pipeline, refer to:
- 📄 Paper: "[Consistent Document-Level Relation Extraction via Counterfactuals](https://www.arxiv.org/abs/2407.06699)"
- 🔗 GitHub Repo: [https://github.com/amodaresi/CovEReD](https://github.com/amodaresi/CovEReD)
## Cite
If you use the dataset, **CovEReD** pipeline, or code from this repository, please cite the paper:
```bibtex
@inproceedings{modarressi-covered-2024,
title="Consistent Document-Level Relation Extraction via Counterfactuals",
author="Ali Modarressi and Abdullatif Köksal and Hinrich Schütze",
year="2024",
booktitle = "Findings of the Association for Computational Linguistics: EMNLP 2024",
address = "Miami, United States",
publisher = "Association for Computational Linguistics",
}
```