Dataset Viewer
Auto-converted to Parquet Duplicate
messages
listlengths
2
2
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nSeptember (Sep.) is the ninth month o...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nIn unified field theory the cosmologi...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nAmbroise, sometimes Ambroise of Norma...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nOrigin People have been making cheese...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nIn mathematics, particularly abstract...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nAlessandro Algardi (July 31, 1598 – J...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nAnubis (; ), also known as Inpu, Inpw...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nAbae (, ) was an ancient town in the ...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nGreen is a color between the yellow a...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nThe Atari 5200 SuperSystem or simply ...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nDemographics of American Samoa includ...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nIn physics, angular momentum (sometim...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nEinstein on the Beach is an opera wri...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nAn antacid is a substance which neutr...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nThe Apache HTTP Server ( ) is a free ...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nEvents Pre-1600 1111 – Henry V is cro...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nAlaska ( ) is a non-contiguous U.S. s...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nApplied ethics is the practical aspec...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nAlexios III Angelos (Greek: Άλέξιος Ά...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nThe economy of Botswana is currently ...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nASP may refer to: Combat ASP pistol A...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nSummers are all about trendy and colo...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nThe Atari Lynx is a hybrid 8/16-bit f...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nA want is a wish or a desire for some...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nAmerican folklore encompasses the fol...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nAmok syndrome is an aggressive dissoc...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nIn this article the concept of mass i...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nAn afterglow in meteorology consists ...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nAntonio Agliardi (4 September 1832 – ...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nThe paper discusses the impact of adj...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nAleksandr Isayevich Solzhenitsyn (11 ...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nPTC Therapeutics, Inc. and CV Therape...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nAberdare ( ; ) is a town in the Cynon...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nAedesius (, died 355 AD) was a Neopla...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nThe Universe, far to be homogenous, e...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nPTC Therapeutics, Inc. and CV Therape...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nA sign error in an angle while drawin...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nNeurons in the central nervous system...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nThe Abencerrages or Abencerrajes (fro...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\n(, IAST: , ) is the ancient Indian pr...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nChoi, D. H., Jang, G. I., Lapidus, A....
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nThis paper defines an equation for ca...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nAlfred Bernhard Nobel ( , ; 21 Octobe...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nBefore now, all that was known about ...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nThe Book of Amos is the third of the ...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nAntisemitism (also spelled anti-semit...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nThe following is a list of current an...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nIn computer architecture, Amdahl's la...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nEvents Pre-1600 636 – Arab–Byzantine ...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nAristotle (; Aristotélēs, ; 384–322 B...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nWeb semantic access in specific domai...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nThe accusative case (abbreviated ) of...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nAquarius is an equatorial constellati...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nDimensions are the way we see, measur...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nAn assault is the illegal act of caus...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nIn geometry, a convex uniform honeyco...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nThe aurochs (Bos primigenius) ( or ) ...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nWe present an analysis of planetary m...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nInterest in development of brain pros...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nAdenosine triphosphate (ATP) is an or...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nAbercarn is a town and community in C...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nAmethyst is a violet variety of quart...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nCurrency is the unit of money used by...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nAries is one of the constellations of...
[ { "role": "user", "content": "Extract knowledge graph triplets from the following text. Return a JSON array of objects with keys: source (title, type), relation (type, weight), target (title, type). If no valid triplets can be extracted, return an empty array.\n\nText:\nBulgaria (; ), officially the Republi...
End of preview. Expand in Data Studio

YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

license: mit

task_categories:

  • text-generation
  • token-classification
  • question-answering language:
  • en tags:
  • knowledge-graph
  • relation-extraction
  • triplet-extraction
  • graph-rag
  • information-extraction
  • instruction-tuning
  • ontology size_categories:
  • 1K<n<10K pretty_name: HGR Knowledge Graph Triplet Dataset

HGR Knowledge Graph Triplet Dataset

Dataset Summary

The HGR Knowledge Graph Triplet Dataset is an instruction-tuning dataset for training language models to perform ontology-constrained knowledge graph extraction.

Given a passage of text, the task is to generate a structured set of triplets in the form:

source -> relation -> target

where:

  • source contains an entity title and type
  • relation contains a relation type and confidence weight
  • target contains an entity title and type

The dataset is designed for:

  • Knowledge Graph Construction
  • GraphRAG pipelines
  • Relation Extraction
  • Structured Information Extraction
  • Entity Linking pipelines
  • Document-to-Graph conversion

Dataset Characteristics

Property Value
Total Samples 3,350
Training Samples 2,575
Validation Samples 75
Test Samples 700
Relation Types 20
Hard Negatives 392
Schema Errors 0
Language English
Domain Wikipedia + arXiv

Motivation

Traditional instruction datasets for relation extraction often suffer from:

  • inconsistent entity names
  • unconstrained relation types
  • missing confidence scores
  • hallucinated relations
  • outputs unsuitable for graph databases

This dataset was created specifically to train models that produce:

  • ontology-constrained outputs
  • normalized entity titles
  • grounded triplets
  • confidence calibrated relations
  • graph-ingestable JSON

Corpus Sources

The corpus is collected from:

Wikipedia

General world knowledge including:

  • People
  • Concepts
  • Organizations
  • Scientific topics
  • Historical events

arXiv

Scientific and technical literature including:

  • Machine Learning
  • Artificial Intelligence
  • Computer Science
  • Algorithms
  • Research methods

Dataset Construction Pipeline

The dataset was built using a multi-stage pipeline.

1. Corpus Collection

Raw passages are collected from:

  • Wikipedia
  • arXiv

2. Quality Filtering

Passages undergo:

  • Language filtering
  • Length filtering
  • Quality heuristics

Low-quality passages are discarded.


3. Deduplication

MinHash deduplication removes:

  • Near duplicates
  • Copy-pasted content
  • Repeated paragraphs

4. Triplet Generation

Triplets are generated using:

DeepSeek V4-Flash

Each passage is converted into:

source -> relation -> target

triplets with:

  • entity title
  • entity type
  • relation type
  • confidence weight

5. Schema Validation

Generated outputs are validated against a fixed ontology.

Invalid:

{
 "relation":"released"
}

Valid:

{
 "relation":"used_for"
}

Only ontology-compliant triplets are retained.


6. Semantic Validation

Triplets are checked for:

  • entity grounding
  • relation consistency
  • structural correctness
  • semantic plausibility

7. Hard Negative Generation

The training split includes intentionally difficult negatives.

Examples:

  • invalid entity pairs
  • incorrect relations
  • misleading but plausible connections

Hard negatives comprise:

392 examples (~15%)

and improve robustness against hallucination.


8. Curriculum Ordering

Training examples are ordered:

Easy → Medium → Hard

based on:

  • triplet count
  • entity complexity
  • relation ambiguity
  • semantic density

9. Train/Test Decontamination

Entity-level decontamination is performed before splitting.

This reduces:

  • entity leakage
  • memorization bias
  • train-test contamination

Relation Ontology

The dataset contains exactly 20 relation types:

implements
trained_on
evaluates
part_of
introduces
extends
depends_on
contrasts_with
applied_to
measured_by
founded_by
developed_by
defined_as
consists_of
is_type_of
based_on
used_for
created_by
located_in
predecessor_of

Models trained on this dataset are expected to generate only these relations.


Data Format

The dataset follows a chat-style instruction tuning format.

Example:

Input

{
  "messages":[
    {
      "role":"user",
      "content":"Extract knowledge graph triplets from the following text..."
    }
  ]
}

Output

[
  {
    "source":{
      "title":"September",
      "type":"entity"
    },
    "relation":{
      "type":"part_of",
      "weight":0.92
    },
    "target":{
      "title":"Gregorian calendar",
      "type":"entity"
    }
  },

  {
    "source":{
      "title":"September",
      "type":"defined_as",
      "weight":0.92
    },
    "target":{
      "title":"ninth month",
      "type":"concept"
    }
  }
]

Dataset Statistics

Training

Metric Value
Samples 2575
Hard Negatives 392
Relations Seen 20
Schema Errors 0
Mean Weight 0.540
Weight Std 0.247

Validation

Metric Value
Samples 75
Relations Seen 19
Schema Errors 0
Mean Weight 0.512
Weight Std 0.240

Test

Metric Value
Samples 700
Relations Seen 20
Schema Errors 0
Mean Weight 0.477
Weight Std 0.233

Intended Use

This dataset is intended for training models for:

  • Knowledge Graph Extraction
  • GraphRAG
  • Relation Extraction
  • Entity Linking
  • Structured Information Extraction
  • Ontology-Constrained Generation

Limitations

  • English-only corpus.
  • Fixed ontology of 20 relation types.
  • Scientific and encyclopedic domains are overrepresented.
  • Confidence scores are model-generated rather than human annotated.
  • The dataset prioritizes schema correctness over exhaustive relation coverage.

Citation

@dataset{das2026hgrdataset,
  title={HGR Knowledge Graph Triplet Dataset},
  author={Mohar Das},
  year={2026},
  publisher={Hugging Face}
}
Downloads last month
26