license: mit
task_categories:
- text-classification
- text-generation
language:
- en
pretty_name: Relation Extraction for Inverse Relations (FewRel & TekGen)
size_categories:
- 1K<n<10K
tags:
- relation-extraction
- nlp
- dataset-robustness
- inverse-relations
Relation Extraction for Inverse Relations
This dataset is designed to evaluate the robustness of Relation Extraction (RE) models, with a specific focus on Inverse Relations and entity substitution. It is derived from the FewRel and TekGen benchmarks (from Text2Bench).
Dataset Summary
The primary goal of this dataset is to test whether models can recognize a relationship regardless of the direction or the surface form of the entities. It includes:
- Inverse Mapping: Every sample includes both the forward relation (e.g., Mother) and its logical inverse (e.g., Child).
- Artificial Substitutions: A version of the dataset where real-world entities are replaced with synthetic names (e.g., replacing "Denmark" with "Emilyfort") to test if models rely on memorized entity knowledge rather than linguistic context.
Relation Examples
| Forward Relation | Inverse Relation |
|---|---|
| Child (P40) | Mother (P25) |
| Child (P40) | Father (P22) |
| Follows (P155) | Followed by (P156) |
| Has Part (P527) | Part of (P361) |
Dataset Structure
The dataset is provided in JSON format and split into four main distributions:
- Original FewRel/TekGen: The ground-truth sentences and relations.
- Artificial FewRel/TekGen: Sentences where entities have been substituted with synthetic placeholders.
- Relation Metadata: Supplemental files providing human-readable definitions for Wikidata P-IDs and TekGen relation strings.
Key Fields
tokens: The input text (tokenized or raw string) in FewRel.sent: The input sentence (raw string) in Tekgenhead/tail: The subject and object entities.head_to_tail: The ID/Name of the forward relation.tail_to_head: The ID/Name of the inverse relation.artificial_data: A mapping showing whichOriginalentities were changed to whichArtificalplaceholders.
Usage
You can load this dataset for tasks such as:
- Text Classification: Predicting the relation ID between two entities.
- Text Generation: Generating a sentence that expresses a specific inverse relation.
Repository
For scripts and more technical details on how the artificial data was generated, visit the official repository: 👉 sefeoglu/inverserelations
Citation
If you use this dataset in your research, please cite the original FewRel/TekGen papers and this repository.
@misc{fewrel_inverse_2025,
author = {Sefeoglu},
title = {Relation Extraction for Inverse Relations from FewRel},
year = {2025},
publisher = {GitHub/HuggingFace},
journal = {GitHub repository},
doi = { 10.57967/hf/8462 },
howpublished = {\url{[https://github.com/sefeoglu/inverserelations](https://github.com/sefeoglu/inverserelations)}}
}