liveBook · Manning

Knowledge base

As explained in Natural Language Processing in Action, Second Edition

A knowledge base is an organized collection of facts, entities, and relationships representing information about a domain or the world.

A knowledge base is an organized store of facts about a domain or the world. NLP systems can populate one from text and use it to interpret statements, retrieve information, and support decisions. section 1.12 section 1.8

A graph representation connects entities through relationships. Queries can follow several relations and derive facts that are not explicitly stored; this process is knowledge graph inference. section 11.8

A knowledge base supports several practical operations:

  • Store entities, relationships, conversation history, user information, and general world knowledge. section 1.8
  • Answer questions that require multiple hops across relations, such as deriving a person’s military rank from connected facts. section 11.8
  • Retrieve graph facts with languages such as SPARQL, Cypher, or AQL. section 11.9

Querying Wikidata

Wikidata supplies entities with Q-identifiers and relationships with P-identifiers. A Python client can resolve Timnit Gebru’s Q-id, use SPARQL to find a notable scholarly article, and retrieve its authors: Timnit Gebru, Margaret Mitchell, and Emily M. Bender. section 11.9

Figure 11.4 Stanislav’s knowledge graph
figure

Inspect the connected entities and relationships used to infer Stanislav’s military rank. section 11.8

Knowledge bases improve interpretation but are not always required: chatbots can still produce useful behavior with upper-layer NLP algorithms, search, or string matching alone. section 1.9

How Natural Language Processing in Action, Second Edition covers it

How deep it goes
Descends from organizational purpose to graph inference and executable SPARQL queries, while deferring broader commonsense compilation challenges.
Examples
Uses Wikidata identifiers, SPARQL queries, scholarly authorship, and a military-rank inference graph.
What it assumes
Assumes familiarity with NLP pipelines and databases while explaining entities, properties, identifiers, and inference through examples.
What you can do after
Apply it via SPARQL to retrieve linked entities and answer questions requiring multiple relational hops.
How it connects
Connects natural language processing, information extraction, knowledge graphs, databases, inference, chatbots, and question answering.

Also explained in

Compare how 10 books explain knowledge base →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Natural Language Processing in Action, Second Edition. The section links point to the parts of the book it draws on.