Datasets:

Modalities:
Text
Formats:
json
Languages:
English
ArXiv:
Libraries:
Datasets
pandas
License:
File size: 4,862 Bytes
c097d73
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ea9437b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
---
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",
}
```