Download as pdf or txt
Download as pdf or txt
You are on page 1of 25

Artificial Intelligence

Knowledge
Representation

Gloria Virginia & Matahari Bhakti Nendya

DWCU, Genap 2019/2020

Applying AI Concepts

Computer

Knowledge Inference
Inputs base mechanism Outputs

2
Knowledge Base
• The first step in constructing an AI program is to build a
knowledge base
• Forming the system’s source of intelligence
• Will be used by the inference mechanism to reason and draw
conclusions

• Contains:
Ø concepts, theories, practical procedures, and their associations
Ø facts about objects (in the chosen domain) and their relationship

• Should be collected, codified, and organized in systematic order

Knowledge Engineering

• Process of collecting and organizing the knowledge

• Steps:

1. Identify the task

2. Collecting and assemble the relevant knowledge


Ø Knowledge acquisition

3. Represent the knowledge to form a knowledge base


Ø Knowledge representation

4
Knowledge Representation

• Process of how knowledge is represented to form a


knowledge base

• Explicating knowledge residing in the human brain in a formal


form

• Knowledge and information will be mathematical objects!

• Includes two component: formal and psychological part

Knowledge Representation (2)


• A variety of schemes have been devised to put almost any kind of
knowledge into symbolic form suitable for storage in and
manipulation by computer

• Characteristic of the schemes:


– Can be programmed with existing computer language and stored in
computer memory
– Designed so that the facts and other knowledge contained within
them can be used in reasoning

• Hence, knowledge base contains a data structure that can be


manipulated by an inference system

6
Knowledge Representation (3)
• Some knowledge representation schemes:
1. Logic
2. List
3. Tree
4. Semantic Network
5. Production System
6. Frame

Logic

• Study of reasoning process and system of rules and


procedures that aid in the reasoning process

• General form of any logical process:

Input: Output:
premises inferences
Logical
or or
process
facts conclusions

8
Logic (2)
• Basic type of reasoning :
– Deductive
Ø general premises are used to reach specific inferences
Ø from general to particular
Ø Using rules and preconditions to make a conclusion
Ø It’s a method of verification

– Inductive
Ø specific premises are used to infer general inferences
Ø from particular to general
Ø The premises of an argument are believed to support the conclusion
Ø It’s a method of discovery

Logic (3)
• Computational Logic:
Ø Symbolic logic or mathematical logic
Ø A system of rules and procedures that permit the drawing of inferences
from various premises using a variety of logical techniques

Type of logic In real world Fact believed by the agent


Propositional logic Fact True/False
Predicate logic Fact, object, relation True/False
Temporal logic Fact, object, relation, time True/False
Probability theory Fact Degree of belief [0, 1]
Fuzzy logic Degree of truth Degree of belief [0, 1]

10
Propositional Logic

• Proposition = a true or false statement/fact

• Example:
– All human are mortal.
– 5+3=8
– Call me now!
– Is it cold?

11

Propositional Logic (2)

• Connectives:
– Combining two or more propositions
– Basic connectives: AND, OR, NOT, IMPLIES, EQUIVALENT

Connectives Symbol

AND ∧, ∩, &
OR ∨,∪, +
NOT ¬, ∼, !
IMPLIES ⇒, ➔, ⊃
EQUIVALENT ⇔, ≡, ↔

12
Propositional Logic (3)
• Variables
Ø Representing a proposition and relations

• Truth Table
Ø Tabulate the value of a proposition for all possible values of its variables

P Q P AND Q P Q P OR Q
T T T T T T
T F F T F T
F T F F T T
F F F F F F

P Q P Q P Q P Q
T T T T T T
T F F T F F
F T T F T F
F F T F F T

13

Propositional Logic (4)

•Ex. reasoning:
p : I am in a good health
q : we have a class
Modus Ponens

If I am in a good health, then we have a class p q (T)


I am in a good health p (T)
we have a class q (T)

(( p q)∧p) q

14
Propositional Logic (5)
• Inference Rule:
1. Modus Ponens (Implication-Elimination): (( p1 p2 ) ∧ p1 ) p2

2. And-Elimination: p1 ∧ p2 ∧ ... ∧ pn pi

3. And-Introduction: p1, p2, ... , pn p1 ∧ p2 ∧ ... ∧ pn

4. Or-Introduction: pi p1 ∨ p2 ∨ ... ∨ pn

5. Double-Negation-Elimination: ¬ ¬ p p

6. Unit Resolution: ( p1 ∨ p2 , ¬p2 ) p1

7. Resolution: (¬p1 p2 , p2 p3 ) ¬p1 ∨ p3

15

Predicate Logic

• Represent knowledge in finer detail

• Breaking a statement (or proposition) down into two


component parts:
1. Arguments/Constants
Ø the objects an assertion is made about
2. Predicate
Ø describe a property of objects, or relationship among
objects
Ø allow us to talk about the objects

16
Predicate Logic (2)
Proposition: THE CAR IS IN GARAGE

Argument Argument
(object) Predicate (object)
(assertion)

PREDICATE (object1/atom1, object2/atom1 [, object3/atom1])

in (car, garage)

Predicate Argument
(assertion) (object)

17

Predicate Logic (3)

in (car, garage) Example:


• The car is in garage
Predicate Argument • Berto gives Orel an apple
(assertion) (object)

give (Berto, Orel, apple) give (boy(Berto), girl(Orel), fruit(apple))

Predicate Argument
(assertion) (object)

18
Predicate Logic (3)
Example: Variables
• John likes Mary John likes Mary
like(x,y)
x=John, y=Mary

• Quantifiers
∀ : for all, for any, for each à universal quantifier
∃ : there exists, some à existential quantifier

19

List and Tree


• Representing hierarchical knowledge

• List:
– A written series of related items
– Objects are grouped according to rank or relationship

• Tree:
– A graphical structure of a hierarchy
– Nodes : show the object/event
– Arc : show the relationship

20
List
List A
Element A.1
Element A.2
Element A.3
Element A.2
Element A.4
Subelement A.2.a
Subelement A.2.b
Element A.4
Subelement A.2.c
Subelement A.4.a
Subelement A.2.d
Subelement A.4.b
Subelement A.4.c Subelement A.2.c
Subelement A.4.d Sub-subelement A.2.c.1
Sub-subelement A.2.c.2
Sub-subelement A.2.c.3

21

Tree
Node
A

1 2 3 4 5 6

a b c d e f g

Arc
(1) (2)

22
Semantic Network
• Semantic network reflect the complex manner in which human
knowledge is structured

23

Semantic Network (2)


• Graphical depictions of knowledge that show relationship
between objects
Ø The nodes representing concept
Ø The arcs representing relationships

• Basic assumption:
Ø The meaning of word can be represented by the set of its
verbal associations

24
Semantic Network (3)

25

Semantic Network (4)


• To seek answer
Ø the computer simply searches forward or backward through the
arcs from a starting node
Ø Ex.: human_being(Kay)?

• Important:
– Graphic in nature, but in a computer it is stated in verbal terms
– There’s no standard set of relations

26
Semantic Network: Car Navigation System

27

Semantic Network: Car Navigation System (2)

Example of map:

28
Semantic Network: Car Navigation System (3)

Representation of the map:

29

Semantic Network: Car Navigation System (4)

• Titik: (36.59, 48.23)

Point(point_id, X, Y) titik1
Point(titik1, 36.59, 48.23) titik7

titik6
jalur6

• Path:
Path(path_id, [point_id1, point_id2], length)

Path(jalur6, [titik6, titik7], 596.25)

Path(path_id, [point_id1, point_id2], length, speed1, speed2)

Path(jalur6, [titik6, titik7], 596.25, 30, 50)

30
Conceptual Graph

Concept Relationship Type: Referent

31

Conceptual Graph (2)

32
Production System

• Production system:
Øentire set of rules for executing a task

IF [condition] THEN [action]

• Elements:
– Condition : state of affairs that must exist for the rule to be
applicable
– Action : thing to be done if rule is applied

33

Production System (2)


• Example:
1. If job < 15 times in a year, then performance is poor
2. If job >= 15 times in a year, then performance is good
3. If age < 2 years, then rating is beginner
4. If age >= 2 years and performance is poor, then rating is beginner
5. If age >= 2 years and performance is good, then rating is advance
6. If rating is beginner and purpose is having fun, then competition is
local festival
7. If rating is beginner and purpose is serious, then competition is
national festival
8. If rating is advance and purpose is having fun, then competition is
national annual festival
9. If rating is advance and purpose is serious, then competition is
international festival

34
Frame
• Suitable for the representation of more complex (or “deeper”)
knowledge => Nodes can have an internal structure

• For humans often tacit knowledge

• Abstraction that captures general/typical properties of objects

• Describes particular object, event, location, situation, etc. in great


detail

• When hierarchies of frames are used, then one frame may also inherit
the properties of another frame

35

Frame (2)

Name: Name-1

Attribute-1: Value-1

Attribute-2: Procedure-1
Slots
Attribute-3: Procedure-2 Fillers

......

Attribute-n: Value-m

36
Frame (3)
CLASS: Name-1 Inherit
values from
Inheritance
Property-1: Value-1
Property-2: Procedure-1

CLASS: Name-2
Superclass: Name-1 Inherit values
from
Property-1: Value-1
Property-2: Procedure-1
Property-3: Procedure-2

INSTANCE: Name-3
CLASS: Name-2
Property-1: Value-1
Property-2: Procedure-1
Property-3: Procedure-2

37

CLASS: ZE vehicle
[N] Weight, kg:
[N] Top speed, km/h:

CLASS: Electric vehicle CLASS: Solar vehicle CLASS: Muscle vehicle


Superclass: ZE vehicle Superclass: ZE vehicle Superclass: ZE vehicle
[N] Weight, kg:
[N] Top speed, km/h:
[Str] Motor:
[Str] Battery type:

CLASS: Car CLASS: Motorcycle CLASS: Scooter


Superclass: Electric vehicle Superclass: Electric vehicle Superclass: Electric vehicle

[N] Weight, kg:


[N] Top speed, km/h:
[Str] Motor:
[Str] Battery type:
[N] Range, km:

38
CLASS: Sedan CLASS: Van CLASS: Truck
Superclass: Car Superclass: Car Superclass: Car
[N] Weight, kg:
[N] Top speed, km/h:
[Str] Motor:
[Str] Battery type:
[N] Range, km:
[N] Payload, kg:

INSTANCE: Ford Ecostar


CLASS: Van
[N] Weight, kg: 1851
[N] Top speed, km/h: 113
[Str] Motor: 3-phase, AC induction
[Str] Battery type: Sodium sulfur
[N] Range, km: 161
[N] Payload, kg: 463

39

Summary
• Knowledge base

• Knowledge representation: Computer

1. Logic
2. List Inputs Knowledge Inference Outputs
base mechanism
3. Tree
4. Semantic network
5. Production system
6. Frame

40
Ontology: Philosophical Foundation

• Philosophy of being:
- Try to answer questions such as:
‣ What are things?
‣ What is the essence that remains inside things even
when they change (in color, size, etc.)?
‣ Do concepts (book, tree, table, etc.) exist outside our
mind?
‣ How can the entities of the world be classified?

41

Ontology: Philosophical Foundation (2)

• Essence:
‣ what this something is (Gambra, 1999)

• Existence:
‣ to be present among things in the real world (Gómez-Pérez,
2004)

• Ex.: a centaur is half a man and half


a horse
‣ it has essence though it does not
exist!

42
Ontology: Definition in CS

An ontology is a formal, explicit specification


of a shared conceptualization
(Gruber and Borst, 1998)

‣ conceptualization: a model of the real world

‣ explicit: can be represented and processed algorithmically

‣ formal: has well-defined syntax and semantics

‣ shared: is agreed upon in a community and facilitates


communication between its member agents

43

Categorization of Ontologies (2)

• Lassila and McGuinness (2001)


‣ According to the information the ontology needs to
express and the richness of its internal structure

Thesauri General
Catalog “narrower Formal Frames logical
/ID term” relation is-a (properties) constraints

Terms/ Informal Formal Value Disjointness,


glossary is-a instance restriction inverse,
part-of...

44
Ontology Standards

Knowledge management standards for an Ontology:


• Resource Description Framework (RDF)
• Web Ontology Language (OWL)
• Simple Knowledge Organization System (SKOS)

45

Resource Description Framework (RDF)

Sikos, L. F. (2015). Mastering Structured Data on the Semantic Web: From HTML5
Mircodata to Linked Open Data. New York: Apress

46
Resource Description Framework (RDF) (2)

Sikos, L. F. (2015). Mastering Structured Data on the Semantic Web: From HTML5
Mircodata to Linked Open Data. New York: Apress

47

Resource Description Framework (RDF) (3)

Sikos, L. F. (2015). Mastering Structured Data on the Semantic Web: From HTML5
Mircodata to Linked Open Data. New York: Apress

48
Sikos, L. F. (2015). Mastering Structured Data on the Semantic Web: From HTML5
Mircodata to Linked Open Data. New York: Apress

49

Summary
• Knowledge base

• Knowledge representation
scheme: Computer

1. Logic
Knowledge Inference
2. List Inputs
base mechanism
Outputs

3. Tree
4. Semantic network
5. Conceptual Graph
6. Production system
7. Frame

• Ontology

50

You might also like