task_categories:text2text-generation language:en size_categories:1K<n<10K format:csv modality:text library:datasets library:pandas library:mlcroissant library:polars region:us
---
task_categories:
- text2text-generation
language:
- en
size_categories:
- 1K<n<10K
---

# T2G

## Overview

T2G is a synthetic data consisting of text-graph pairs designed to finetune LLMs on information extraction tasks, specifically text-to-graph conversion. 

## Dataset Structure

The dataset is organized into the following main components:

Train Set: 800 instances for training models.

Validation Set: 100 for validating model performance.

Test Set: 100 instances for final evaluation.

## Data Fields

Each instance in the dataset contains the following fields:

- `TKG`: a temporal knowledge graph consisting of one or more entries, each composed of 4 components - head, relation, tail, time
- `sentence`/`text`: a piece of text generated from the given graph, utilizing large language models for text generation

## Example Instance

```json
{
  "TKG": (head: Wolfgang Grobe, relation: member of sports team, tail: Eintracht Braunschweig, time: from 1976-01-01 to 1982-01-01),
  "sentence": Wolfgang Grobe was a member of the sports team at Eintracht Braunschweig from January 1, 1976, to January 1, 1982.
}
```

## Usage

To use this dataset, you can load it using the Hugging Face datasets library:

```python
from datasets import load_dataset

dataset = load_dataset('ESITime/T2G-1k-Qwen2.5-3B', keep_default_na=False)
```

## License

This dataset is unlicensed. Feel free to use it as you want.

## Citation

If you use this dataset in your research, please cite it as follows:

```bib
@dataset{pnv2003_T2G_2024,
  author = {Phuong Ngo},
  title = {T2G: A synthetic data for text-to-graph conversion},
  year = {2024},
  publisher = {Hugging Face},
  url = {https://huggingface.co/datasets/ESITime/T2G-1k-Qwen2.5-3B}
}
```

## Acknowledgement

This dataset originated from the TempKB knowledge graph dataset, which can be accessed here: https://huggingface.co/datasets/ESITime/TempKB