File size: 3,108 Bytes
009c53a
 
 
 
fc8e2fc
009c53a
 
8bb7b16
fc8e2fc
 
8bb7b16
 
 
 
 
6246de1
 
8bb7b16
3dae347
b2a9950
3dae347
8bb7b16
3dae347
b2a9950
8bb7b16
 
4fb7cff
8bb7b16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b2a9950
 
 
8bb7b16
 
 
 
 
 
 
 
 
 
 
 
b2a9950
8bb7b16
 
 
 
b2a9950
8bb7b16
 
 
b2a9950
 
8bb7b16
 
b2a9950
8bb7b16
 
b2a9950
8bb7b16
b2a9950
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
---
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:
1.  **Inverse Mapping**: Every sample includes both the forward relation (e.g., *Mother*) and its logical inverse (e.g., *Child*).
2.  **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 Tekgen
* `head` / `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 which `Original` entities were changed to which `Artifical` placeholders.

## 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](https://github.com/sefeoglu/inverserelations)

## Citation

If you use this dataset in your research, please cite the original FewRel/TekGen papers and this repository.

```bibtex

@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)}}
}