Linguistic Structure/Information Extraction

Lesson 6.153,291 words

Information Extraction

Information extraction turns free text into a database, and the first step is relation extraction: pulling entity-relation-entity triples out of sentences. We cover all five families — hand-built patterns, supervised classifiers, semi-supervised bootstrapping, distant supervision, and unsupervised Open IE — with worked bootstrapping and distant-supervision traces, then the neural and LLM systems that extended them.

╌╌╌╌

A sequence labeler reads the sentence _Citing high fuel prices, United Airlines said Friday it has increased fares by 6` is money. That is where named-entity recognition stops. It never says that United raised the fare, that the raise took effect Friday, or that the amount was six dollars. The facts are in the sentence; they are just not in a form a database can store or a query can reach.

Information extraction (IE) closes that gap. It reads unstructured text and emits structured records — relations, events, times — that a downstream system can put in a table and look up. Those records already have the shape a knowledge base stores, which is why IE is the standard way to populate one: running it over a corpus yields rows to insert.1

The information-extraction pipeline. Raw text is tagged for entities, then relations, events, and times are extracted and normalized into structured database records.

The full pipeline runs end to end: extracting relations among entities, extracting and normalizing times, detecting events and ordering them, and filling templates for recurring situations. This lesson takes the first and largest stage — relation extraction — and its five algorithmic families; the temporal and template stages continue in the companion lesson, extracting times, events, and templates. Throughout, the goal is the same: free text in, a queryable database out.

Relation extraction

Assume the named entities are already tagged. Relation extraction discerns the relationships that hold among them. In the airline text above, the tagged sentence continues: American Airlines, a unit of AMR Corp., immediately matched the move, spokesman Tim Wagner said. United, a unit of UAL Corp., said the increase took effect Thursday. From this a relation extractor should learn that Tim Wagner is a spokesman for American Airlines, that United is a unit of UAL Corp., and that American is a unit of AMR — binary relations that are instances of generic relations like part-of or employs.2

A sentence maps to a set of relation triples, each a subject, a relation, and an object over the tagged entities.

These triples correspond exactly to the model-theoretic notion of a relation: a set of ordered tuples over a domain. The domain elements are the tagged entities (after coreference resolution links it, United, and the airline to one underlying entity). A relation like is just the set of pairs for which it holds. This view even subsumes NER: recognizing a class of entities is identifying a unary relation.

Relation types and ontologies

Which relations? The choice is a design decision, standardized by the datasets that annotate them. The ACE (Automatic Content Extraction) evaluations define 17 relations grouped into a handful of families — Person-Social, Physical, General-Affiliation, Org-Affiliation, Part-Whole, and Artifact — each typed by the entities it connects.

A sampler of ACE-style relations, each with the entity types it links and an example. PER, ORG, GPE, LOC are named-entity types.

Other domains define their own inventories. UMLS, the Unified Medical Language System, has 54 relations over 134 entity types, so that a sentence like Doppler echocardiography can be used to diagnose left anterior descending artery stenosis yields . Wikipedia infoboxes supply another huge store, readily turned into relations or into a metalanguage called RDF (Resource Description Framework). An RDF triple is a subject-predicate-object expression, exactly the shape of a relation triple:

Crowdsourced DBpedia holds over 2 billion such triples; Freebase (now part of Wikidata) holds relations between people, nationalities, and locations. A distinct and important family is ontological relations — the hierarchical is-a (hypernym) and part-of relations that organize concepts rather than facts about individuals. WordNet encodes chains like Giraffe is-a ruminant is-a ungulate is-a mammal is-a vertebrate, plus an Instance-of relation tying an individual (San Francisco) to its class (city). Extracting these relations is how ontologies get built and extended.

Finally, hand-labeled datasets exist for training and testing. TACRED contains 106,264 examples over 41 relation types (like per:city_of_birth, org:subsidiaries, org:member_of), drawn from news and web text.

TACRED example sentences, each with a subject and object span, their entity types, and the gold relation label. About 80 percent of examples carry the no-relation label.

The heavy no-relation share matters: sufficient negative data is what lets a supervised classifier learn when not to fire.

Relation extraction algorithms

There are five main families: handwritten patterns, supervised machine learning, semi-supervised (via bootstrapping or distant supervision), and unsupervised (Open IE). Each trades recall against the cost of annotation.

Hand-built patterns

The earliest and still common approach is lexico-syntactic patterns, first developed by Hearst and therefore called Hearst patterns. Consider the sentence Agar is a substance prepared from a mixture of red algae, such as Gelidium. A reader who has never heard of Gelidium still infers that it is a kind of red algae — a hyponym of red algae. Hearst captures the inference with a pattern over noun phrases:3

Matching it against the sentence yields . Hearst suggested five such patterns for the hypernym relation; modern versions add named-entity constraints so they can target specific relations.

Hand-built lexico-syntactic patterns for hypernyms, where NP-H is the parent (hypernym); braces mark optional material. NER-constrained patterns target specific relations like PER holding a POSITION at an ORG.

Hand-built patterns are high-precision and can be tailored to a domain. Their weakness is low recall — an enormous set would be needed to catch every phrasing — and the labor of writing them all.

Supervised relation extraction

If a fixed set of relations and entities is chosen and a corpus is hand-annotated, the task becomes ordinary supervised classification. The scheme is: find pairs of named entities (usually in the same sentence) and apply a relation classifier to each pair. An optional intermediate filter first makes a binary decision — are these two entities related at all? — to skip the expensive full classification on the many unrelated pairs.

Algorithm:Find-Relations(words)\textsc{Find-Relations}(words) — classify relations among tagged entities
  1. 1
    relationsrelations \gets nil
  2. 2
    entitiesFind-Entities(words)entities \gets \textsc{Find-Entities}(words)
  3. 3
    for each entity pair e1,e2\langle e_1, e_2 \rangle in entitiesentities do
  4. 4
    if Related?(e1,e2)\textsc{Related?}(e_1, e_2) then
  5. 5
    relationsrelationsClassify-Relation(e1,e2)relations \gets relations \cup \textsc{Classify-Relation}(e_1, e_2)
  6. 6
    return relationsrelations

A feature-based classifier (logistic regression, random forest) describes each pair with hand-designed features. For American Airlines (mention M1) and Tim Wagner (mention M2) in American Airlines, a unit of AMR, immediately matched the move, spokesman Tim Wagner said, useful features include:

  • Word features: the headwords of M1 and M2 and their concatenation (Airlines, Wagner, Airlines-Wagner); bag-of-words in each mention; words in particular positions (M2 = spokesman, M2 = said); the bag of words between the mentions (a, AMR, of, immediately, matched, ...).
  • Named-entity features: the entity types and their concatenation (M1: ORG, M2: PER, M1M2: ORG-PER); the entity level (NAME, NOMINAL, PRONOUN); the number of entities between the arguments.
  • Syntactic structure: the constituency or dependency syntactic path between M1 and M2, e.g. the dependency path Airlines <-subj matched <-comp said ->subj Wagner.

A neural classifier treats the task the same way but learns the representation. A typical Transformer system feeds the sentence to a pretrained encoder (BERT, RoBERTa, SpanBERT), takes the sentence representation (the [CLS] token), and adds a linear layer that assigns one of the relation labels. A key detail is that the input is partially de-lexified: the subject and object spans are replaced by their NER tags, which keeps the model from overfitting to the individual lexical items.

Neural relation extraction. A pretrained encoder reads the sentence with the subject and object entities replaced by their NER tags; a linear classifier on the CLS representation predicts the relation.

When the test set resembles the training set and enough labeled data exists, supervised systems reach high accuracy. What they cost is that labeled data: annotation is expensive, and the models are brittle — they do not transfer to a new text genre. That fragility motivates the semi-supervised and unsupervised methods.

Semi-supervised bootstrapping

Suppose there is no labeled corpus, only a few high-precision seed tuples or seed patterns. Bootstrapping grows a classifier from them: take the entities in a seed pair, find sentences that contain both, generalize the context between and around them into new patterns, use those patterns to find new tuples, and repeat.

Algorithm:Bootstrap(R)\textsc{Bootstrap}(R) — grow relation tuples from seed pairs
  1. 1
    tuplestuples \gets a set of seed tuples having relation RR
  2. 2
    repeat
  3. 3
    sentencessentences \gets sentences containing both entities of some tuple in tuplestuples
  4. 4
    patternspatterns \gets generalize the context around the entities in sentencessentences
  5. 5
    newpairsnewpairs \gets tuples matched by patternspatterns
  6. 6
    newpairsnewpairs \gets pairs in newpairsnewpairs with high confidence
  7. 7
    tuplestuplesnewpairstuples \gets tuples \cup newpairs
  8. 8
    until enough tuples
  9. 9
    return tuplestuples

Say we want airline-hub pairs and know only that Ryanair has a hub at Charleroi. Searching for Ryanair, Charleroi, and hub in proximity turns up Budget airline Ryanair, which uses Charleroi as a hub, Ryanair's hub at Charleroi, Charleroi, a main hub for Ryanair. Generalizing the context between the mentions yields patterns that find more hub pairs:

text
/ [ORG], which uses [LOC] as a hub // [ORG]'s hub at [LOC] // [LOC], a main hub for [ORG] /
The bootstrapping loop. Seed tuples find sentences; sentences generalize to patterns; patterns extract new tuples, which feed back as seeds. Confidence filtering guards against semantic drift.

The danger is semantic drift: one erroneous pattern introduces a wrong tuple, which spawns bad patterns, and the meaning of the extracted relation drifts. Given the seed hub relation, a sentence like Sydney has a ferry hub at Circular Quay might inject , propagating error. Bootstrapping systems therefore attach confidence values to new tuples and accept only high-confidence ones. Confidence for a pattern balances two factors — how well matches the current tuple set, and how productive it is — through the Riloff-Jones metric over a document collection :

where is the set of current tuples matches and is everything finds in . To score a new tuple supported by a set of patterns , the noisy-or combination treats each as a probability and gives the chance that not all supporting patterns are wrong:

Conservative acceptance thresholds keep the process from drifting away from the target relation.

A worked bootstrapping trace

Run one round with numbers. Seed the hub relation with the single tuple and search a collection . Three patterns emerge from the sentences found:

  • [ORG], which uses [LOC] as a hub
  • [ORG]'s hub at [LOC]
  • [LOC], a main hub for [ORG]

Suppose the current tuple set has grown to accepted hub pairs, and across the patterns behave as follows. Pattern matches tuples of which are in — it is precise but also finds tuples total, so , . Pattern has , . Pattern is looser: , . The Riloff-Jones confidence scores each:

Normalizing to probabilities (divide by the max, ) gives , , . Now a candidate tuple turns up, matched by and but not . The noisy-or combination gives the probability that not both supporting patterns erred:

That clears any reasonable threshold, so joins . Contrast a shaky tuple matched only by the loose : its confidence is just , below a threshold of, say, , so it is rejected, avoiding the semantic drift illustrated above. The two guards work together: the Riloff-Jones metric distrusts unproductive-yet-imprecise patterns like , and noisy-or rewards a tuple only when a high-confidence pattern backs it.

Distant supervision

Distant supervision keeps the classifier of the supervised method but replaces hand annotation with a large database. Instead of a handful of seeds, it aligns a knowledge base to text to manufacture a huge, noisy training set.4 To learn place-of-birth, note that Freebase already lists over 100,000 examples, including <Edwin Hubble, Marshfield> and <Albert Einstein, Ulm>. Run an NER tagger over 800,000 Wikipedia articles and extract every sentence containing both entities of some known tuple:

  • ...Hubble was born in Marshfield...
  • ...Einstein, born (1879), Ulm...
  • ...Hubble's birthplace in Marshfield...

Each known tuple <relation, e1, e2> becomes one training instance whose features are pooled from all the sentences mentioning that pair.

Distant supervision. For every tuple of a relation in the database, gather all sentences mentioning both entities, pool their features, and emit one labeled training instance; then train a supervised classifier.
Algorithm:Distant-Supervision(D,T)\textsc{Distant-Supervision}(D, T) — train a relation classifier from a KB and text
  1. 1
    for each relation RR do
  2. 2
    for each tuple (e1,e2)(e_1, e_2) of entities with relation RR in DD do
  3. 3
    sentencessentences \gets sentences in TT that contain e1e_1 and e2e_2
  4. 4
    ff \gets frequent features in sentencessentences
  5. 5
    observationsobservations{(e1,e2,f,R)}observations \gets observations \cup \{(e_1, e_2, f, R)\}
  6. 6
    CC \gets train supervised classifier on observationsobservations
  7. 7
    return CC

Because the training set is enormous, distant supervision can afford very rich features — conjunctions of entity types with intervening words or dependency paths, like . It combines the strengths of the earlier methods: a rich feature-based classifier (like supervised), high-precision KB evidence (like patterns), no iterated pattern expansion and so no semantic drift (unlike bootstrapping), no labeled training corpus (like unsupervised), and it produces training tuples that feed a neural classifier where features are not even needed. The no-relation label is trained by sampling entity pairs absent from any KB relation. Its main weakness is low precision, and it only works for relations a large database already covers.

A worked distant-supervision trace

Follow one tuple through the pipeline. The KB fact is born-in, Albert Einstein, Ulm . Align it to a Wikipedia dump and NER-tag the result, keeping every sentence that mentions both Einstein and Ulm:

  • Einstein was born in Ulm in 1879.
  • Einstein, born (1879), Ulm.
  • Ulm, Einstein's birthplace, sits on the Danube.

Each sentence contributes a feature to the one training instance for this tuple. From the first: entity types PER/LOC, intervening string was born in, dependency path PER <-nsubj born ->obl LOC. From the second: the pattern PER, born (YEAR), LOC. From the third: PER's birthplace to the left of the LOC. The instance for born-in(Einstein, Ulm) therefore carries a union of features pooled across all three sentences, and the identical tuple born-in, Edwin Hubble, Marshfield contributes its own sentences' features to a second instance of the same relation. The classifier learns that the relation born-in is signaled by the conjunction

which no single sentence would have taught reliably. This is what separates distant supervision from bootstrapping: bootstrapping expands patterns one at a time and can drift; distant supervision pools thousands of noisy features per relation into one classifier, so a single wrong sentence is outvoted rather than propagated. The cost is that a tuple like born-in, Einstein, 1879 — where the KB actually meant born-year — injects a mislabeled instance, the low-precision noise the method is known for.

Unsupervised relation extraction (Open IE)

To extract relations from the web with no labeled data and no fixed relation list, use open information extraction (Open IE), where relations are simply strings of words, usually verb-centered. The ReVerb system extracts a relation from a sentence in four steps:5

  1. Run a POS tagger and entity chunker over .
  2. For each verb, find the longest sequence of words starting with the verb that satisfies syntactic and lexical constraints, merging adjacent matches.
  3. For each such relation phrase , find the nearest noun phrase to the left (not a relative pronoun, wh-word, or existential there) and the nearest noun phrase to the right.
  4. Assign a confidence to the relation with a classifier.
Open IE with ReVerb. The relation phrase is a verb-anchored word string; the arguments are the nearest noun phrases on each side, producing untyped triples.

The syntactic constraint requires a verb-initial phrase (which may include nouns, since light verbs like make, have, do carry the relation in a noun, as in have a hub in); the lexical constraint prunes rare, over-specific phrases by keeping only relations that occur with at least 20 distinct argument pairs across a huge corpus. Fader et al. built a dictionary of 1.7 million normalized relations this way. The great advantage is coverage — a vast number of relations without specifying them in advance. The disadvantage is that these string relations must be mapped to a canonical form before they can join a database, and the verb focus misses relations expressed nominally.

Evaluating relation extraction

Supervised systems are scored against a human-annotated gold set with precision, recall, and F-measure. Semi-supervised and unsupervised methods are much harder to evaluate, because they mine new relations from huge text and there is no way to pre-annotate a gold set. The workaround is to draw a random sample of the output and have a human check it, giving an estimated precision on the extracted tuples (not the mentions):

Ranking output by confidence and sampling the top 1000, top 10,000, and so on lets one plot how precision behaves as more tuples are extracted. Recall cannot be measured directly — there is no denominator of all true relations in the web.

Neural and LLM relation extraction

The five families above are the classical picture. Two lines of work extended relation extraction past it, and both are grounded in specific public systems.

Distant supervision was made precise (Mintz 2009; Riedel 2010; Zeng 2015). Distant supervision as the lesson presents it is due to Mintz, Bills, Snow, and Jurafsky, Distant Supervision for Relation Extraction without Labeled Data (ACL 2009), who aligned Freebase to Wikipedia and trained a logistic-regression classifier on the pooled features — the exact recipe traced above. Its known low-precision fault was attacked directly. Riedel, Yao, and McCallum (Modeling Relations and Their Mentions without Labeled Text, ECML 2010) relaxed the naive assumption that every sentence mentioning a KB pair expresses the relation, to the at-least-one assumption: at least one of the pooled sentences does. Multi-instance multi-label learning (Surdeanu et al., EMNLP 2012) generalized this, and PCNN (Zeng et al., Distant Supervision for Relation Extraction via Piecewise Convolutional Neural Networks, EMNLP 2015) added selective attention over the sentence bag so the classifier could down-weight the noisy mentions. Each step attacks the precision problem noted above.67

Neural and LLM relation extraction (SpanBERT; PURE; matching-the-blanks). The Transformer classifier the lesson sketches — a pretrained encoder with the subject and object de-lexified to their NER tags — was refined in several public systems. SpanBERT (Joshi et al., SpanBERT: Improving Pre-training by Representing and Predicting Spans, TACL 2020) pretrains by masking and predicting contiguous spans rather than single tokens, which improved TACRED relation accuracy because relations hinge on spans. Matching-the-blanks (Baldini Soares et al., ACL 2019) pretrains a relation representation directly, by teaching the model that two sentences sharing an entity pair encode a similar relation. PURE (Zhong and Chen, A Frustratingly Easy Approach for Entity and Relation Extraction, NAACL 2021) showed a simple pipeline — recognize entities, then classify each pair with entity-type markers inserted around the spans — beats many joint models, reinforcing the lesson's de-lexification trick. Most recently, large language models do relation extraction and Open IE zero- or few-shot: prompt the model with the sentence and the relation inventory (or none, for open extraction) and read off the triples, no relation-specific training. This trades the fixed-schema precision of a trained classifier for coverage and flexibility, the same coverage-versus-precision tension the Open IE section drew, now without hand-built ReVerb constraints.89

The relation-extraction lineage past the five classical families. Distant supervision (Mintz 2009) was made precise by the at-least-one and multi-instance relaxations and PCNN attention; the neural encoder-classifier was refined by SpanBERT and PURE; and LLMs now extract relations zero- or few-shot.

Where this continues

Relation extraction is the first and largest stage of the pipeline, and it spans five families that trade recall against annotation cost: high-precision hand-built patterns, supervised classifiers where labels exist, semi-supervised bootstrapping and distant supervision where they are scarce, and unsupervised Open IE where the relations themselves are unknown. The neural encoder-classifiers and, lately, the zero-shot LLMs push the same task further without new hand-built machinery.

With entities linked into typed triples, the pipeline still has to place those facts in time and assemble them into records. Detecting and normalizing temporal expressions, ordering events on a timeline, and filling slot-and-filler templates continue in extracting times, events, and templates.

Footnotes

  1. Jurafsky & Martin, Speech and Language Processing (3rd ed.), Ch. 17 — Information Extraction: turning unstructured text into structured data, exemplified by the airline fare-raise story that runs through the chapter.
  2. Jurafsky & Martin, Ch. 17, §17.1 — Relation Extraction: relations as ordered tuples over a domain; the ACE and TACRED relation inventories, RDF triples, Freebase, and WordNet's ontological is-a and part-of relations.
  3. Jurafsky & Martin, Ch. 17, §17.2.1 — Using Patterns to Extract Relations: Hearst's lexico-syntactic patterns for the hyponym relation, extended with named-entity constraints for high-precision, low-recall extraction.
  4. Jurafsky & Martin, Ch. 17, §17.2.4 — Distant Supervision for Relation Extraction: aligning a large database (Freebase) to text to manufacture noisy training data, combining the strengths of pattern-based, supervised, and unsupervised methods.
  5. Jurafsky & Martin, Ch. 17, §17.2.5 — Unsupervised Relation Extraction: Open IE and the ReVerb system, extracting verb-centered relation strings under syntactic and lexical constraints with no fixed relation set.
  6. Mintz, Bills, Snow & Jurafsky (2009), Distant Supervision for Relation Extraction without Labeled Data, ACL 2009 — aligning Freebase to Wikipedia and training a feature-based classifier on pooled per-tuple features; and Riedel, Yao & McCallum (2010), Modeling Relations and Their Mentions without Labeled Text, ECML 2010, relaxing the assumption to at-least-one; multi-instance multi-label learning in Surdeanu et al. (2012), EMNLP.
  7. Zeng et al. (2015), Distant Supervision for Relation Extraction via Piecewise Convolutional Neural Networks (PCNN), EMNLP 2015 — piecewise CNN sentence encoding with selective attention over the mention bag to suppress noisy distant-supervision instances.
  8. Joshi et al. (2020), SpanBERT: Improving Pre-training by Representing and Predicting Spans, TACL — span-masking pretraining improving TACRED relation accuracy; and Baldini Soares et al. (2019), Matching the Blanks: Distributional Similarity for Relation Learning, ACL, pretraining a relation representation from entity-pair-sharing sentences.
  9. Zhong & Chen (2021), A Frustratingly Easy Approach for Entity and Relation Extraction (PURE), NAACL — a simple pipeline inserting entity-type markers around subject and object spans, outperforming many joint models and reinforcing the de-lexification approach; recent LLMs extract relations and Open IE triples zero- or few-shot from a prompt.

╌╌ END ╌╌