Relation extraction identifies semantic relationships between entities in text and turns them into relationship triples for a knowledge graph. It fits into a broader pipeline with named entity recognition and coreference resolution, helping systems gather facts from large text collections and check language-model outputs. section 11.3
Neural relation extraction comes in two main forms. Closed extraction selects relations from a predefined label set, improving control but requiring task-specific human annotation. Open extraction proposes probable relation labels itself, making it useful for broad, unfamiliar sources such as Wikipedia and news. section 11.7.2
A practical extraction workflow connects several signals:
- Recognize entities with named entity recognition, then use coreference resolution to connect mentions that refer to the same entity. section 11.3 section 11.4.2
- Inspect dependency parses to identify how verbs, subjects, objects, and prepositional phrases connect; these patterns can guide relation-extraction rules. section 11.6
- Target only relations relevant to the application, such as interactions between drugs, rather than attempting to extract every possible relationship. section 11.7.2
Reading a dependency tree
For “Gebru was unethically fired from her Ethical AI team,” spaCy identifies “fired” as the root and “Gebru” as its passive subject. The dependency tree exposes the sentence structure that a relation-extraction component can use, while also showing a limitation: the sentence does not identify who performed the firing. section 11.6
Figure 11.2 Four stages of knowledge extraction
Use the four-stage knowledge-extraction diagram to place relation extraction alongside entity recognition and coreference resolution. section 11.3


