0% found this document useful (0 votes)
53 views66 pages

Ch1. Knowledge Graph

Uploaded by

JinMan Kim
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views66 pages

Ch1. Knowledge Graph

Uploaded by

JinMan Kim
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 66

Ver.

2023/09/15

Introduction to Knowledge Graph

Jinyoung Yeo
Department of Artificial Intelligence
Yonsei University 1980

AAI2250: Introduction to Artificial Intelligence


Outline

1. What is Knowledge Graph?

2. Example of Knowledge Graph

3. Data Model in Knowledge Graph

4. Knowledge Graph Construction

5. Applications of Knowledge Graph

6. Wrap up!

2
What is Knowledge Graph?

3
What is Knowledge Graph?

• Term coined by Google


• Knowledge Graph (KG): KB of inter-
connected entities defined by a schema
• Three levels of knowledge
✓ Entity
✓ Triple (unit of a multi-relational graph)
✓ Schema (defining the vocabulary)

4
What is Knowledge Graph?

Relation
Subject, Object, Tail entity
Head entity

5
What is Knowledge Graph?

6
What is Knowledge Graph?
<<More technical>>

7
What is Knowledge Graph?

• Motivation
• Represents the world knowledge on the web

• Aims at converting the current web into a web of data


• Intended for realizing the machine-understandable web

• Allows combining data from several applications to arrive at new


information

Question: Is Knowledge Graph invented by Google?


Answer: No, There has been a long tradition on research graph form of
knowledge

8
What is Knowledge Graph?
Application of Knowledge Graph

https://www.youtube.com/watch?v=D9AdXzypM9w 9
What is Knowledge Graph?

• A set of standards

• Defines best practices for sharing data over the web for use by
applications

• Allows defining the semantics of data


• Example:
• Spouse is a symmetric relations (if A spouse of B then B spouse of A)
• zip codes are a subset of postal codes
• “sell” is the opposite of “buy”

10
What is Knowledge Graph?
• Semantic descriptions of entities and their relationships
✓ Uses a knowledge representation formalism
(RDF, RDF-Schema, OWL)

• Entities: real world objects (things, places, people) and abstract


concepts (genres, religions, professions)

• Relationships: graph-based data model where relationships are


first-class

• Semantic descriptions: types and properties with a well- defined


meaning (e.g. through an ontology)

• Possibly axiomatic knowledge (e.g. rules) to support automated


reasoning

11
Example of Knowledge Graph

12
Knowledge Graph @ Google

13
Knowledge Graph @ Google

14
Knowledge Graph @ Google

15
Knowledge Graph @ Google

16
Knowledge Graph @ Google

• Key benefits
✓ Find the right thing
✓ Get the best summary
✓ Go deeper and broader

17
Knowledge Graph @ Amazon

• Knowledge Graph for Alexa


✓ Billions of entities
✓ Combining heterogeneous knowledge sources
✓ Provide answers to customer queries

18
Knowledge Graph @ Amazon

• Product Graph http://conferences.cis.umac.mo/icde2019/wp-


content/uploads/2019/06/icde-2019-keynote-luna-dong.pdf

19
Knowledge Graph @ Microsoft

• Key benefits
✓ Enterprise KG provides connected data supporting
people at work
✓ Personalized search

20
The Rise of Knowledge Graphs

21
The Rise of Knowledge Graphs
• Many Semantic Web components (e.g. RDF and SPARQL) are used in various domains:

• Semantic Search (Google, Microsoft, Amazon)


• Smart Governments (data.gov.us, data.gov.uk)
• Pharmaceutical Companies (AstraZeneca)
• Automation (Siemens)
• Mass Media (Thomson Reuters)

22
Knowledge Graph API

Open-sourced KGs

or

Private KGs

https://developers.google.com/knowledge-graph/
23
Data Model in Knowledge Graph

24
Why Graphs?

• We need a structured and formal representation of knowledge


• We are surrounded by entities, which are connected by relations
• Graphs are a natural way to represent entities and their relationships
• Graphs can be managed efficiently

25
Semantic Networks

• Proposed in 1950s-60s to analysis the


meaning of words in sentences
✓ Memory like structure to store and
access knowledge by machines
• Basic notations:
✓ Nodes: to represent objects, concepts,
or situations
✓ Edges: to represent relationships

26
Pros/Cons of Semantic Networks

• Easy to follow hierarchy


• Easy to trace association
• Flexible

• No well defined syntax


• No formal semantics
• Not expressive enough to define meaning of labels
• Inefficient
• Many were later addressed by KL-ONE languages, later known
as Description Logics (underpinning of the W3C OWL standard)

27
Knowledge Graph: Going Beyond Semantic Network

• Key KG Standards:
✓ KG standard: RDF
✓ KG schema standard: OWL, based on Description Logics (DL)
✓ KG query language standard: SPARQL
• An Example knowledge graph in DL:
✓ Abox (data): tom:Koala, (tom,tim):friend, (tom,e1):eat
✓ Tbox (schema/ ontology): Koala ⊑ ∀eat.Plant
✓ This KB infers that e1:Plant
• Expressiveness: mainly based on TBox

28
Knowledge Graph: Going Beyond Semantic Network

• Resource Description Framework (RDF, W3C standard for


Knowledge Graph)
✓ With formal syntax, such as meta-properties like rdf:type and
rdfs:subClassOf
✓ With formal semantics
✓ NOT able to define classes though (that’s why OWL is needed)
• Large open KGs: Dbpedia, Yago, Freebase (2006)
• Data sub-graph
✓ [dbr:Barack_Obama rdf:type dbo:President .]
✓ [dbr:Barack_Obama dbo:birthplace dbr:Hawaii .]
✓ [dbr:Barack_Obama dbo:spouse dbr:Michelle_Obama .]
• Schema sub-graph
✓ dbo:President ⊑ dbo:Politician

29
Technology Stack

• Hypertext Web Technologies


• IRI: Generalization of URI
• Unicode: Language support
• XML: Create documents of structured data

• Standardized Semantic Web Technologies


• RDF: Creating statements (triples)
• RDFS: RDF Schema of classes and properties
• OWL: Extends RDFS by adding constructs
• SPARQL: Query RDF-based data
• RIF: Rule interchange format, goes beyond OWL

30
Resource Description Framework (RDF)

• Is the standard for representing knowledge

• RDF expresses information as a list of statements known


as triples

• A triple consists of:


• SUBJECT, PREDICATE, and an OBJECT
• Example: (“Muhammad Ali”, “isA”, “Boxer”)

31
RDF Model
[URI] [URI- Prefixed Form]

<http://dbpedia.org/resource/Muhammad_Ali> OR :Muhammad_Ali
Triple Structure [Resource]

• Subjects, predicates, and objects are


represented by resources or literals

• A resource is represented by a URI and

:name
denotes a named thing 1-17-1942^^xsd:date [Resource]
[Literal - Date]

• Literals represent a string or a number “Muhammad Ali”


[Literal - String]

• Literals representing values other than [Resource]

strings may have an attached datatype

32
Namespaces
• URI’s allow defining distinct identities to RDF
resources

• Each RDF dataset provider can define common


RDF resources using its own namespace
• Example:
• http://dbpedia.org/resource/Muhammad_Ali
• http://www.wikipedia.org/Muhammad_Ali

• URI’s representing the namespace can be replaced


with a prefix
• Example:
• dbp:Muhammad_Ali
• wiki:Muhammad_Ali

• The namespace can be defined in an RDF


document using @prefix
• Example:
• @prefix dbp: http://dbpedia.org/resource/
• @prefix wiki: http://www.wikipedia.org/
33
RDF Model

Vocabularies
• Vocabulary (i.e. new URI’s) can be created or resused

• Existing vocabularies (e.g. Friend of a Friend - FOAF) are stored


using, e.g., RDF schema (RDFS)

• The RDF Vocabulary Description Language (RDF Schema)


allows describing vocabularies

• RDF Schema allows defining properties or new classes of resources

34
RDF Model

• Mapping of Data to Ontologies

35
Web Ontology Language (OWL)

• A key technology for defining semantics for RDF data

• OWL extends RDFS to define ontologies

• An ontology is a formal definition of set of vocabulary that define relationships between vocabulary
terms and class members

• Ontologies are used to describe domain knowledge (e.g. biology) so that users are able to more
formally share and understand data

• An ontology defined with OWL is a collection of triples

36
Knowledge Graph Construction

37
Knowledge Graph Construction

• Text to Knowledge Pipeline System

Information
Extraction

https://www.youtube.com/watch?v=D9AdXzypM9w 38
Knowledge Graph Construction

• Information Extraction *
✓ Named Entity Recognition
✓ Relation Extraction

39
Knowledge Graph Construction

40
Knowledge Graph Construction

• Entity Linking Module

41
Knowledge Graph Construction

• Relation Extraction Module

42
Knowledge Graph Construction

Knowledge Graph: Going Beyond Semantic Network

43
Knowledge Graph Construction

44
Knowledge Graph Construction: Wikidata

• Collecting structured data. Unlike the


Wikipedias, which produce encyclopedic
articles, Wikidata collects data, in a
structured form.
• Collaborative. The data in Wikidata is
entered and maintained by Wikidata
editor, whoc decide on the rules of
content creation and management in
Wikidata supporting the notion of
verificability.
• Free. The data in Wikidata is published
under the Creative Commons
• Large.
✓ 25 million entities
✓ >1500 million triplets

45
Knowledge Graph Construction: DBpedia

• Example (continued)
✓ dbpedia:Vince_Vaughn rdf:type
dbpedia-owl:Actor .
✓ dbpedia:Vince_vaughn foaf:name “Vince
Vaughn” @en .
✓ dbpedia:Vince_Vaughn dbpedia-
owl:birthplace dbpedia:Minneapolis .

46
Knowledge Graph Construction from (Web) Tables

• (Web) Table understanding


✓ Extraction of Web tables: HTML tables, attribute-value
pairs (such as info box), entity lists
✓ Alignment with KG schema
✓ Column type prediction
✓ Table enhancement

47
NELL: Never Ending Language Learner

• Goals
✓ Extract information from Web texts to
construct KB
✓ Learn to read better than before
• Inputs
✓ Schema with 800 types and relations
✓ 10 – 20 seed examples for each
• Output: continuously growing KB
• Key methods
✓ Coupled Pattern Learner (CPL)
✓ Coupled SEAL (CSEAL)
✓ Coupled Morphological Classifier (CMC)
✓ Rule Learner (RL)

48
Applications of Knowledge Graph

49
Knowledge Graphs Enabling Intelligent Applications

50
Knowledge Graphs Enabling Intelligent Applications

51
Knowledge Graph Querying with SPARQL

• SPARQL is the standard query language of and standard protocol for querying KGs

52
Reasoning with Knowledge Graph

• Infer implicit knowledge from explicit knowledge

53
Reasoning with Knowledge Graph

• Infer implicit knowledge from explicit knowledge

54
Reasoning with Knowledge Graph

• Infer implicit knowledge from explicit knowledge

55
Question Answering over Knowledge Graphs

• Question: if we know Google bought YouTube, how could we make use of such
knowledge in NL form to answer questions like “Who owns YouTube?”
• Entailment graphs are needed for supporting the textual entailment
: company-1 buy company-2 |= company-1 own company-2
✓ There are meaning postulates, such as (buy sub-relation own)
✓ From Description Logic’s perspective, they are schema (rdfs:subPropertyOf) axioms
• Two major approaches
✓ Unsupervised methods: using machine reading (covering 100K relations)
✓ Supervised methods: using pre-trained language models (such as RoBERTa)

56
Question Answering over Knowledge Graphs

https://www.youtube.com/watch?v=D9AdXzypM9w 57
Question Answering over Knowledge Graphs

• Query Parsing

58
Knowledge Graph Embeddings

59
Knowledge Graph Embeddings

• Embedding entities and relationships of


multi-relational data in low-dimensional
vector spaces
• Use the embedding model for tasks like link
prediction, or rule extraction
• KGE model is fully expressive
✓ If given any ground truth,
✓ There exists an assignment of values to the
embeddings of the entities and relations
that
✓ Accurately separates the correct triplets
from incorrect ones

60
Evaluation of KG Embeddings

• Partial gold standard: some entities and relations are selected for manual annotation
✓ Pros: usually good quality
✓ Cons: Costly and only applicable to those with simple schema (if scheme is used)
• Silver standard: the KG is assumed to be perfect and used as a test dataset, widely
used for KG completion
✓ Pros: not expensive to get
✓ Cons: KGs are not perfect and thus quality is not as good as partial gold standard

61
Fake News Detection with Knowledge Graph

• Fake news detection based on KG: given a set of news triples g and a background
knowledge graph G
✓ True if g ∪ G is consistent
✓ Fake otherwise
• The embedding model M of entities and relations in G obtained by minimizing a
global loss function involving all entities and relations
• Model M can be used for reasoning

62
Wrap up!

63
Knowledge Graphs as Bridge Between Human and AI
Systems
• Human intelligence (e.g. to understand image)
✓ Perception: Dogs, happy, letters, numbers, red
✓ Knowledge: Dog year, Spring Festival, red for
celebration
✓ Reasoning: 2018 is a dog year, best wish for Spring
Festival
• How knowledge graphs help:
✓ Richer input for Machine Learning
✓ Explain Machine Learning
✓ Meta Learning: Guide learning with knowledge

64
KGs have become the epicentre of the AI hyperbole

• Knowledge Graph (or Big Knowledge), Big Data and Deep


Learning are key drivers of AI
✓ Unique technology for both reasoning and learning
✓ Reduce the need of large, labeled datasets, facilitate
transfer learning and explain-ability
✓ Encode domain, task and application knowledge that
would be costly to learning from data alone
✓ Facilitate the upgrade of AI from perceptual
intelligence to cognitive intelligence

65
Thank you!

66

You might also like