re-docred / README.md
Despina's picture
Update README.md
850be61 verified
|
Raw
History Blame Contribute Delete
8.47 kB
---
tags:
- relation-extraction
- information-extraction
language:
- en
pretty_name: Sentence-Level Re-DocRED with Full Relation Names
dataset_info:
features:
- name: title
dtype: string
- name: text
dtype: string
- name: entity1
dtype: string
- name: entity2
dtype: string
- name: entity1Type
dtype: string
- name: entity2Type
dtype: string
- name: relation
dtype: string
- name: prompt_0_shot
dtype: string
- name: prompt_2_shot
dtype: string
- name: prompt_5_shot
dtype: string
splits:
- name: train
num_bytes: 283334093
num_examples: 80450
- name: validation
num_bytes: 44741739
num_examples: 12524
- name: test
num_bytes: 45266093
num_examples: 12693
download_size: 134475255
dataset_size: 373341925
configs:
- config_name: default
data_files:
- split: train
path: data/train-*
- split: validation
path: data/validation-*
- split: test
path: data/test-*
task_categories:
- text-classification
- text-generation
size_categories:
- 10K<n<100K
---
# Dataset Card for Sentence-Level Re-DocRED with Full Relation Names
## Dataset Description
This dataset is a transformed version of the `tonytan48/Re-DocRED` dataset, which itself is based on the original DocRED (Document-Level Relation Extraction) dataset.
The key transformations applied are:
1. **Sentence-Level Conversion:** The original dataset is document-level, meaning each sample contains multiple sentences, entities, and relations within a document. This version **unravels** the data so that **each row corresponds to a single relation instance within one specific evidence sentence**. If a relation has multiple evidence sentences listed in the original data, it will appear as multiple rows in this dataset, one for each evidence sentence.
2. **Text Cleaning:** The `text` field (containing the sentence) has been processed to normalize spacing around punctuation and specific quote patterns (e.g., ` Zest Air' ' )` becomes `Zest Air'')`, `Airport ' s` becomes `Airport's`).
3. **Full Relation Names:** The `relation` feature contains the full textual name of the relation (e.g., "country", "place of birth", "head of government") mapped from the original Wikidata Property IDs (e.g., "P17", "P19", "P6") using a predefined mapping. If a relation ID from the source data was not found in the mapping, the original ID is retained as the value.
4. **Instruction Prompts:** Each row additionally carries ready-to-use instruction prompts (`prompt_0_shot`, `prompt_2_shot`, `prompt_5_shot`) so the dataset can be used directly for prompt-conditioned fine-tuning and evaluation of (small) language models.
This format is often more suitable for sentence-based relation extraction models.
This copy is packaged for the paper **"Sub-Billion, Super-Frontier: Fine-Tuned Small Language
Models Rival Zero-Shot Frontier LLMs on General and Literary Relation Extraction"**
(Christou & Tsoumakas, 2026) [arXiv:2606.22606](https://arxiv.org/abs/2606.22606).
**Source Data:**
* Based on: `tonytan48/Re-DocRED` on Hugging Face Hub.
* Original DocRED: [https://github.com/thunlp/DocRED](https://github.com/thunlp/DocRED)
## Dataset Structure
### Data Instances
Each instance represents a potential relation between two entities within a specific sentence.
**Example Record:** (Example data; actual values may vary)
```python
{
'text': "Zest Airways, Inc. operated as AirAsia Zest (formerly ''Asian Spirit and Zest Air''), was a low-cost airline based at the Ninoy Aquino International Airport's in Pasay City, Metro Manila in the Philippines.",
'title': "Zest Airways",
'entity1': "Zest Airways",
'entity2': "Philippines",
'entity1Type': "ORG",
'entity2Type': "LOC",
'relation': "country" # Mapped from original P17
}
```
### Data Fields
* **`text`** (`string`): The cleaned text of a single sentence potentially containing evidence for the relation.
* **`title`** (`string`): The title of the original Wikipedia document from which the sentence originates.
* **`entity1`** (`string`): The text/name of the head entity involved in the relation. *Note: This is typically derived from the first mention listed in the `vertexSet` of the source data for the corresponding entity index.*
* **`entity2`** (`string`): The text/name of the tail entity involved in the relation. *Note: Derived similarly to `entity1`.*
* **`entity1Type`** (`string`): The semantic type of the head entity (e.g., PERSON, ORG, LOC). *Note: Derived similarly to `entity1`.*
* **`entity2Type`** (`string`): The semantic type of the tail entity (e.g., PERSON, ORG, LOC). *Note: Derived similarly to `entity1`.*
* **`relation`** (`string`): The full name of the relation between `entity1` (head) and `entity2` (tail) (e.g., 'country', 'place of birth'). *If the original relation ID (like 'PXXX') was not found in the predefined mapping used during creation, the original ID string is used here as a fallback.*
* **`prompt_0_shot`** (`string`): Zero-shot instruction prompt (task instructions + the input sentence).
* **`prompt_2_shot`** (`string`): The same prompt with 2 in-context demonstrations prepended.
* **`prompt_5_shot`** (`string`): The same prompt with 5 in-context demonstrations prepended.
The three `prompt_*` columns are alternative renderings of the **same** example at different shot
counts, so pick one shot setting per experiment rather than concatenating them.
### Data Splits
The dataset is divided into the same splits as the original Re-DocRED dataset:
* `train`: Training data.
* `validation`: Validation data.
* `test`: Test data.
*(Note: Relation labels in the original DocRED test set are typically held out. This dataset includes relations from the test split if they were present in the source `tonytan48/Re-DocRED` test split; otherwise, the test split might be empty or lack meaningful relation labels depending on the source version).*
### Dataset Creation
This dataset was generated by processing the `tonytan48/Re-DocRED` dataset using a Python script with the Hugging Face `datasets` library. The script iterates through each document, identifies relation labels (`labels`), and for each relation, iterates through its specified evidence sentences (`evidence`). For each evidence sentence associated with a relation, a new record is created containing the sentence text, document title, head/tail entity details (name and type, derived from the first mention in the original `vertexSet`), and the mapped relation name. Text cleaning regex was applied to the sentence text.
### Usage
You can load the dataset using the Hugging Face `datasets` library:
```python
from datasets import load_dataset
repo_name = "Despina/re-docred"
dataset = load_dataset(repo_name)
# Access splits
train_data = dataset['train']
validation_data = dataset['validation']
test_data = dataset['test']
# Example access
print(f"First training example:\n{train_data[0]}")
```
## Licensing Information
This dataset is distributed under the Creative Commons Attribution-ShareAlike 4.0 International License (CC BY-SA 4.0), consistent with the licensing of the original DocRED dataset.
## Citation Information
**If you use this dataset, please cite our paper along with the original DocRED and Re-DocRED papers:**
``` markdown
@article{christou2026subbillion,
title={Sub-Billion, Super-Frontier: Small Language Models Rival Zero-Shot Frontier LLMs on General and Literary Relation Extraction},
author={Christou, Despina and Tsoumakas, Grigorios},
journal={arXiv preprint arXiv:2606.22606},
year={2026},
url={https://arxiv.org/abs/2606.22606}
}
@inproceedings{yao2019docred,
title={DocRED: A Large-Scale Document-Level Relation Extraction Dataset},
author={Yao, Yuan and Ye, Deming and Li, Peng and Han, Xu and Lin, Yankai and Liu, Zhenghao and Liu, Zhiyuan and Huang, Lixin and Zhou, Jie and Sun, Maosong},
booktitle={Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics},
pages={764--777},
year={2019},
publisher={Association for Computational Linguistics}
}
@inproceedings{tan2022revisiting,
title={Revisiting DocRED-Addressing the False Negative Problem in Relation Extraction},
author={Tan, Qingyu and Xu, Lu and Bing, Lidong and Ng, Hwee Tou and Aljunied, Sharifah Mahani},
booktitle={Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing},
pages={8472--8487},
year={2022}
}
```