Relation extraction
Relation extraction is a natural-language-processing technique that identifies semantic relationships between entities expressed in text.
Graph Algorithms for Data Science
Relation extraction identifies semantic relationships expressed between entities in text.
- How it is used
- Converts unstructured text into graph-ready relationships for an information-extraction pipeline.
- How deep it goes
- Defines triples, compares rule-based and deep-learning approaches, and implements end-to-end extraction without training a custom model.
- Examples
- Uses Google acquiring YouTube and Apple Inc. founding, employment, acquisition, and product text to inspect extracted triples.
- What you can do after
- Apply it via SpaCy and REBEL to extract relation records from text, inspect results, and construct graph relationships.
Read how Graph Algorithms for Data Science explains relation extraction →
Natural Language Processing in Action, Second Edition
Neural relation extraction is the use of neural models to identify semantic relations between entities in text.
- How it is used
- Builds knowledge graphs and validates generated text by extracting task-relevant relationships from documents.
- How deep it goes
- Explains closed and open neural extraction, pipeline dependencies, and dependency-based patterns, but defers detailed model construction.
- Examples
- Uses Wikipedia text, pharmaceutical documents, and a spaCy dependency parse of a sentence about Gebru’s firing.
- What you can do after
- Evaluate relation-extraction designs by choosing closed or open labels, inspecting dependency structures, and targeting useful relations.
Read how Natural Language Processing in Action, Second Edition explains relation extraction →
Essential GraphRAG
Relationship extraction is the process of identifying and describing semantic connections between entities found in source text.
- How it is used
- Builds structured graph data from text for GraphRAG workflows.
- How deep it goes
- Specifies entity and relationship fields, formatting delimiters, model invocation, and parsing, without detailing extraction evaluation.
- Examples
- Uses PERSON, ORGANIZATION, LOCATION, EVENT, CREATURE, and WEAPON_OR_TOOL entity types.
- What you can do after
- Operate a Python extraction function that produces parsed entities and relationships for database import.
Related concepts
- transformersused by · Hugging Face Transformers is an open-source library providing pretrained transformer models, tokenizers, and tools for using and training models across machine-learning tasks.
- tupleproduces · A tuple is a finite, ordered collection of elements treated as a single composite value or record.
- information extractionpart of · Information extraction is the computational process of identifying specified facts, entities, fields, or relationships in input data and producing structured information.
- structured extractionpart of · Structured extraction is the process of identifying specified information in source content and representing it as organized data in a defined structure.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


