2.15 Knowledge Graphs#

In this lesson we talk more about Knowledge Graphs, an important topic already introduced in previous lessons but not yet explored.

Knowledge Bases and Knowledge Graphs#

A Knowledge Base (KB) is information stored as structured and unstructured data, ready to be used for analysis or inference. Usually, a KB is stored as a graph (i.e. a Knowledge Graph), where nodes are entities and edges are relations between entities. Entities can be real-world objects and abstract concepts.

For example, from the text “Fabio lives in Italy” we can extract the relation triplet <Fabio, lives in, Italy>, where “Fabio” and “Italy” are entities whereas “lives in” is the relation.


Fig. 6 On the left, factual triplets in a knowledge base. On the right, entities and relations in a knowledge graph. Image from A Survey on Knowledge Graphs: Representation, Acquisition and Applications#

Knowledge graphs are used in a variety of applications, including search engines, question-answering systems, recommender systems, and fact-checking.

While being less flexible and robust to noise compared to deep learning models, knowledge graphs are natively developed to be explainable and are a promising solution for the issue of understandability in machine learning.

The Google Knowledge Graph#

One of the most well-known knowledge graphs is the Google Knowledge Graph, which was launched in 2012. The Google Knowledge Graph contains billions of entities and trillions of edges, and is used to power features such as the “People also search for” and “Related searches” boxes that appear on the right-hand side of the search results page, like the following example.


Current Research in Knowledge Graphs#

Recent advances in knowledge-graph research mainly focus on knowledge representation learning, knowledge acquisition, and temporal knowledge graphs. Many recent advanced deep learning techniques are currently being integrated into knowledge graph technologies.


Fig. 7 Categorization of research on knowledge graphs. Image from A Survey on Knowledge Graphs: Representation, Acquisition and Applications#

Knowledge Representation Learning#

Knowledge Representation Learning consists of the mapping of entities and relations into low-dimensional vectors while capturing their semantic meanings.

Knowledge Representation Learning deals with:

  • Representation spaces in which the relations and entities are represented.

  • Scoring functions for measuring the plausibility of factual triples.

  • Encoding models (usually based on deep learning) for representing and learning relationships.

Knowledge Acquisition#

Knowledge Acquisition deals with the creation of new entities and relations in the knowledge graph. Knowledge Acquisition tasks include:

Temporal Knowledge Graphs#

Current knowledge graph research mostly focuses on static knowledge graphs where facts don’t change with time, while the temporal dynamics of a knowledge graph are less explored. However, temporal information is of great importance because the structured knowledge is true only within a specific period, and the evolution of facts follows a time sequence.

Recent research begins to take temporal information into knowledge representation learning and knowledge graph completion, which is termed as temporal knowledge graph in contrast to the previous static knowledge graph.

Applications of Knowledge Graphs#

Let’s see now some examples of applications of knowledge graphs. Have a look at the paper A Survey on Application of Knowledge Graph to read about more applications.


Fig. 8 Application fields of knowledge graphs. Image from A Survey on Application of Knowledge Graph#

Question Answering Systems#

Semantic information from KGs can be used to enhance search results in semantic-aware question answering services. Watson, a question answering system using several knowledge bases as its data source, has been developed by IBM to defeat human experts in a quiz television show. Structured knowledge is also an important component of chatbots and virtual assistants such as Cortana and Siri.

Recommender Systems#

Collaborative Filtering is a type of recommender system that performs recommendations based on users’ common preferences and historical interactions. This method usually suffers from the sparsity of users’ data (i.e. user-item interactions) and the cold start problem, but KGs can help solve such problems by using side information.

In general, using KGs in recommender systems helps to improve the accuracy and increase the diversity of recommended items, as well as brings interpretability to recommendations.

Information Retrieval#

More and more commercial web-based search engines today are incorporating entity data from KGs to improve their search results. For instance, Google incorporates data from the Google Knowledge Graph, while Facebook uses Graph Search.

Human knowledge about real-world entities in KGs assists search engines by improving their ability of understanding queries and documents. Such entity-oriented search improves with the development of large-scale KGs. KGs can be used in different components such as query representation, document representation, and ranking of a search system.

Domain-specific Applications#

Here’s a non-exhaustive list of domain-specific applications of knowledge graphs:

  • Medical: Textual medical knowledge is occupying a more and more important position in healthcare information systems. Therefore, there have been efforts in integrating textual medical knowledge into knowledge graphs, aiming at retrieving specific information using inference.

  • Cybersecurity: KGs can be combined with cybersecurity by providing context information useful to detect and predict dynamic attacks and safeguard people’s cyber assets.

  • Financial: It’s possible to build an enterprise KG by crawling the news of each company, identifying named entities, and extracting business relations between relevant stocks. This can then be combined with the news sentiment of correlated stocks in order to predict stocks’ price movements.

  • News: News language is highly condensed and full of knowledge entities and common sense, which are definitively areas where KGs can help. Moreover, fake news detection can be posed as a link-prediction task in KGs.

  • Education: Some studies have adopted KGs for learning resource recommendation and concept visualization. For example, KnowEDU is a system to construct KG for education automatically. Unlike general KGs in which nodes represent real-world entities, nodes in educational KGs represent instructional concepts that learners should master.

  • Social Network: KGs have been applied to social network de-anonymization, where they help to determine and measure privacy disclosure.

  • Classification: Considering image classification, for example, it’s possible to leverage knowledge graphs to study the relationship between categories in the image, and use the semantic information extracted from the graph to guide the image classification task.

  • Geoscience: While most geoscientific research work focuses on processing georeferenced quantitative data, some researchers are trying to extract information and do knowledge discovery from textual geoscience data. Such work consists of processing geological documents and extracting knowledge directly, building a KG.


What do nodes and edges typically represent in knowledge graphs?

  1. Numerical Values and Connectors.

  2. Objects and Connections.

  3. Entities and Relations.

  4. Concepts and Links.

  5. Terms and Associations.

True or False. Knowledge graphs unfortunately can’t help in the issue of understandability in machine learning.

True or False. The Google search engine currently leverages knowledge graphs.

What does research in knowledge graphs currently focus on?

  1. Knowledge representation learning, knowledge acquisition, and temporal knowledge graphs

  2. Developing algorithms to automatically create and populate a knowledge graph

  3. Improving the accuracy of knowledge graphs and temporal knowledge graphs

What is the scope of Knowledge Representation Learning?

  1. It encompasses symbolic and statistical methods for learning from large amounts of data

  2. It consists of the creation of new entities and relations in the knowledge graph

  3. It consists of mapping entities and relations into low-dimensional vectors while capturing their semantic meanings

Which of the following tasks is not about Knowledge Acquisition?

  1. Knowledge Graph Completion

  2. Entity Recognition

  3. Relation Extraction

  4. Temporal Knowledge Graphs

True or False. Knowledge graphs can be applied to question-answering systems, recommender systems and information retrieval.

Questions and Feedbacks#

Have questions about this lesson? Would you like to exchange ideas? Or would you like to point out something that needs to be corrected? Join the NLPlanet Discord server and interact with the community! There’s a specific channel for this course called practical-nlp-nlplanet.