๐งช Relation Extraction Sandbox
Try Open IE-style extraction. Paste a sentence with two entities marked using [E1]โฆ[/E1] and [E2]โฆ[/E2] tags. The parser detects entity types, candidate verbs between them, and proposes a triple.
Lecture 11 Interactive Learning Companion ยท RE ยท Distant Supervision ยท Open IE ยท KG-aware Extraction
Explore each core topic from Lecture 11. Select a category to see definitions, methods, and annotated examples.
Try Open IE-style extraction. Paste a sentence with two entities marked using [E1]โฆ[/E1] and [E2]โฆ[/E2] tags. The parser detects entity types, candidate verbs between them, and proposes a triple.
Step through how different RE methods process the same sentence. Compare how supervised, distantly supervised, Open IE, and KG-aware approaches arrive at a triple.
Select a method above to begin the walkthrough
Explore the major RE methods and their trade-offs. Click a tip to expand it.
| Method | Supervision | What it does | Typical use |
|---|---|---|---|
| Feature-based | Supervised | Hand-crafted features โ SVM / MaxEnt classifier | Small, well-annotated corpora |
| Tree kernels | Supervised | Similarity over parse-tree fragments | Pre-deep-learning era benchmarks |
| CNN / PCNN | Sup. / Distant | Convolutional encoder over word + position embeddings | Distantly-supervised corpora (NYT) |
| BiLSTM + attention | Supervised | Sequence model with selective attention over mentions | Long-range context, document-level RE |
| BERT / transformers | Supervised | Entity-marker tokens + [CLS] classification | Modern strong baseline (TACRED, DocRED) |
| Open IE | Unsupervised | Surface-form (subj; verb; obj) tuples, no fixed schema | Broad-coverage extraction over web text |
| Distant supervision | Weak | Use KB triples as automatic labels (Mintz 2009) | Scaling to large unlabeled corpora |
| Multi-instance | Weak | Bag-level labels with sentence-level attention | Reducing distant-supervision noise |
| KG-aware RE | Hybrid | Text encoder + KG embedding (Mรถller & Usbeck 2025) | Imbalanced / zero-shot RE over Wikidata |
| Few-shot LLM | Prompted | In-context examples; LLM generates triples | New domains with little labelled data |
| Generative RE | Seq2Seq | REBEL / GenIE / KnowGL โ text โ triples directly | End-to-end KG construction |
Surface patterns that signal a relation between two entities โ what an RE model has to learn:
"[Marie Curie] was born in [Warsaw]" โ easiest case; the verb phrase is the relation cue.
"[Apple] (founded by [Steve Jobs])โฆ" โ relation in a side clause, no main verb.
"[Curie] won two Nobel prizes. She studied in [Paris]." โ needs coreference + multi-hop.
"[Obama] left the [White House] in 2017" โ implies "was president of"; surface text alone is ambiguous.
Test your knowledge of RE, distant supervision, Open IE, and KG-aware extraction. 10 points per correct answer!
Press "Start" to begin the RE Challenge!
12 questions covering RE foundations, supervised methods, distant supervision, Open IE, and KG construction. You can review answers before finishing.
Key concepts, formulas, and patterns for relation extraction and KG construction. Keep this open during revision.
Input: sentence s, entities (e1, e2)
Output: relation r in R โช {NONE}
# R = predefined relation schema
# (s, r, o) triples are the same shape
# as RDF โ that's why RE feeds KGsNER โ Entity Linking โ RE โ Events
10.1 โ 10.2 โ 10.3 โ 10.4
# Modern joint models collapse stagesLexical: bag-of-words between e1,e2
head words of each entity
Syntactic: POS tags, dependency path
parse-tree fragments
Semantic: entity types, WordNet hyper.
SRL roles, gazetteer hits
KB: prior triples, type info"[E1] Steve Jobs [/E1] founded
[E2] Apple [/E2] in 1976."
# Encode โ pool [E1],[E2] โ MLP โ relationIf (e1, r, e2) โ KB,
then EVERY sentence mentioning
both e1 and e2 expresses r.
# Strong โ free labels
# Wrong โ produces noisy dataFor a bag of sentences {s1..sk}
mentioning (e1,e2):
AT LEAST ONE expresses r.
# PCNN + selective attention (Lin 2016)
# RL/GAN denoising (Narasimhan, Wu 2017)"Steve Jobs co-founded Apple in 1976."
โ (Steve Jobs; co-founded; Apple)
โ (Steve Jobs; co-founded Apple in;
1976)
# No fixed relation set
# Surface verb IS the relationTextRunner, ReVerb, OLLIE,
Stanford OpenIE, MinIE
โ Domain-independent, scalable
โ Same relation surfaces many ways
โ Needs canonicalisation for a KGP = TP / (TP + FP) # precision
R = TP / (TP + FN) # recall
F1 = 2ยทPยทR / (P + R)
# Often ignore the NO_RELATION class
# in macro-averagingHeld-out KG facts: split KB triples
into train / test, evaluate
predictions vs held-out test set.
Manual P@N: rank predictions, hand-
check top N โ most honest for
facts NEW to the KG.h_text = BERT(sentence)
h_kg = NeuralBellmanFord(KG, e1, e2)
logits = MLP([h_text ; h_kg])
# concatenate or attend over bothโ Imbalanced labels (long-tail rels)
โ Zero-shot relations via topology
โ Disambiguating ambiguous text cues
โ Helps less when entities are
not yet in the KG (cold start)1. NER โ find entity mentions
2. EL โ link to KG IDs (Q-IDs)
3. RE โ predict relations
4. Canonicalise โ map verbs โ props
5. Fuse โ reconcile across sources
6. Validate โ SHACL / ShEx checks
7. Commit โ write to live graphCompletion: predict missing edges
among entities ALREADY in the KG
(link prediction; pure graph task)
Extension: add NEW facts (and maybe
new entities) by extracting from
external text โ needs REโ Always include a NO_RELATION class
โ Use entity markers for transformer RE
โ Stratify splits โ beware entity leakage
โ Validate triples with SHACL before
committing to the KG
โ Track provenance (sentence + model
+ confidence) for every triple
โ Don't trust held-out KG metrics โ
the KG itself is incomplete
โ Don't ignore the long tail โ
most relations have few examples