Bài giảng Hệ chuyên gia - Phan Huy Khánh - Chương 2: Biểu diễn tri thức nhờ logic vị từ bậc một

Tri thức của một HCG có thể được biểu diễn theo nhiều

phương pháp khác nhau

aTuỳtheo từng HCG, người ta có thểsửdụng một hoặc

đồng thời cảnhiều phương pháp

aPhân chia theo ngôn ngữsửdụng, người ta có 3 cách :

VSửdụng ngôn ngữtựnhiên và ngôn ngữtoán học

VSửdụng ngôn ngữhình thức

VSửdụng ngôn ngữmáy tính

pdf45 trang | Chuyên mục: Trí Tuệ Nhân Tạo | Chia sẻ: dkS00TYs | Lượt xem: 1834 | Lượt tải: 5download
Tóm tắt nội dung Bài giảng Hệ chuyên gia - Phan Huy Khánh - Chương 2: Biểu diễn tri thức nhờ logic vị từ bậc một, để xem tài liệu hoàn chỉnh bạn click vào nút "TẢI VỀ" ở trên
một sự kiện (fact) hay một luật
V Luật là vị từ gồm hai vế trái và phải được nối nhau bởi một 
dấu mũi tên (→)
a Người ta sử dụng các ký hiệu và các phép toán lôgic
tác động lên các ký hiệu để thể hiện tri thức
và suy luận lôgic
15/45
Dùng lôgic mệnh đề
biểu diễn tri thức
a Ví dụ :
V MAN(X), FATHER(X, Y) là các sự kiện
V MAN(X) → MORTAL(X) là một luật 
a Giải thích :
V MAN(X) : «X là một người»
V MORTAL(X) : «X chết»
Phát biểu Vị
từ
Tom là
một người MAN(tom)
Tom là
cha của Mary FATHER(tom, mary)
Tất cả
mọi người đều chết MAN(X) →
MORTAL(X)
16/45
Ví
dụ
dùng lôgic vị
từ
a Từ các tri thức sau :
V Marc có tóc vàng hoe
V Jean có tóc màu nâu
V Pierre là cha của Jean
V Marc là cha của Pierre
V Jean là cha của René
V Marc là con của Georges.
V Giả sử X, Y và Z
là những người nào đó
V Nếu Y là con của X,
thì X là cha của Y
V Nếu X là cha của Z
và Z là cha của Y,
thì X là ông của Y
Ta có
thể
biểu diễn thành các sự
 kiện và
các luật như sau :
BLOND (marc)
BROWN (jean)
FATHER (pierre, jean)
FATHER (marc, pierre)
FATHER (jean, rené)
SON (marc, georges)
FATHER (X, Y) ←
 SON (Y, X)
GRANDFATHER (X, Y) ←
 FATHER (X, Z), FATHER (Z, Y) 
17/45
Biểu diễn tri thức nhờ
mạng ngữ
nghĩa
a Mạng ngữ nghĩa là một đồ thị :
V Các nút (node) dùng để thể hiện :
™ Các đối tượng
™ Thuộc tính của đối tượng
™ Giá trị của thuộc tính
V Các cung (arc) nối các nút để thể hiện mối quan hệ giữa các 
đối tượng
a Các nút và các cung đều được gắn nhãn
a Nghĩa sử dụng của một tri thức :
V Một đường đi trong đồ thị gồm các nút nối các cung
18/45
Semantic Nets
a Semantic net is a knowledge presentation method based 
on a network structure
a It consists of 
V points called nodes connected by
V links called arcs
a Nodes - object, concepts, events
a Arcs - relationships between nodes
a Common arcs used for representing hierarchies include
isa and has-part
a Knowledge represented as a network or graph
19/45
Example:
a The queen mary is an ocean liner
Every ocean liner is a ship
Ship
Ocean
 Liner
Queen
 Mary
isa
isa
có
biết
sẻ loài 
chim
cánh
bay
là
Sẻ
là
một loài chim có
cánh và
biết bay
20/45
Tính thừa kế
của mạng ngữ
nghĩa 
a Một trong những tính chất quan trọng của mạng ngữ nghĩa 
là tính thừa kế
a Bằng cách thêm vào đồ thị các nút mới và các cung mới, 
người ta có thể mở rộng một mạng ngữ nghĩa
a Các nút mới được thêm thể hiện các đối tượng tương tự
(với các nút đã có trong đồ thị), hoặc tổng quát hơn
a Khi sử dụng mạng ngữ nghĩa để biểu diễn tri thức,
người ta phải xây dựng các phép toán tương ứng 
21/45
Mở
rộng một mạng ngữ
nghĩa
cánh
 cụt
lặn
có
biết
sẻ loài chim
cánh
bay
là động 
vật trứng
đẻlà
biết
là
22/45
SHIP
isa has-part
isa
BoilerLiver PoolQueen MarySwimming Pool
HullEngineOil TankerOcean Liner
Mở
rộng một mạng ngữ
nghĩa
23/45
Mở
rộng một mạng ngữ
nghĩa
subclass subclass
haspart
subclass
instance
likes
sizelivesin
Animal
Reptile
Elephant
Nellie
Mammal
apples
large
head
Africa
24/45
Semantic Networks
a Arity of Relations
V Unary relations
Ex: Person(Jim): IS-A link
V Binary relations
Ex: Age(Jim, 27 years): Age link
V N-ary relations
Ex: Disease(Jim, Mumps, 5 days): By creating a reified
V disease-relation object with several cases :
(patient, diagnosis, duration)
25/45
Bài tập tại lớp
a Cho các từ dưới đây, vẽ mạng ngữ nghĩa tương ứng :
V Các đối tượng :
Animal, Bird, Breath, Skin, Move, Fish, Fly, Wings,
 Feathers, Ostrich, Tall, Yellow, Canary, Sing
V Các quan hệ :
Can, Cannot, Has, Is, Is-a
26/45
Semantic Network Representation
Animal
OstrichCanary
Fish
Bird
Breath
Skin
Move
Feathers
Wings
Fly
TallFlyYellowSing
can
can
has
has
can
Is a
Is a
has
is iscan cannot
Is a
Is a
27/45
Biểu diễn tri thức nhờ
bộ
ba O-A-V
a Bộ ba O-A-V (Object-Attribute-Value) :
đối tượng, thuộc tính và giá trị
cách mô tả các mạng ngữ nghĩa
V can be used to characterize the knowledge in a semantic net
V quickly leads to huge tables
ValueAttributeObject
Has-a Is-a
28/45
Ví
dụ
: OAV
Table
Object Attribute Value
Beluga 
Whale Dorsal Fin No
Beluga 
Whale Tail Fin No
Blue 
Whale Tail Fin Yes
Blue 
Whale Dorsal Fin Yes
Blue 
Whale Size
Very 
Large
Object Attribute Value
Astérix profession warrior
Obélix size extra large
Idéfix size petite
Panoramix wisdom infinite
29/45
Biểu diễn tri thức nhờ
khung
a Khi phạm vi bài toán được mở rộng ra :
V Số nút và số cung trong mạng tăng lên
V Mạng ngữ nghĩa trở nên phức tạp hơn
a Semantic nets → Frame :
V Trong trường phức tạp như vậy, nguời ta sử dụng khung frame
a Giới thiệu khung (frame) :
Nhóm các thuộc tính, giá trị của các đối tượng
a Hệ thống khung :
V Nhóm các khung có quan hệ với nhau.
V Quan hệ có thể là giá trị của một thuộc tính trong frame này là
giá trị của một frame khác
a Người ta xâ dựng các thủ tục suy diễn sử dụng khung
30/45
Biểu diễn tri thức nhờ
Frames
a Frames were the next development, allowing more convenient 
“packaging” of facts about an object
a Frames look much like modern classes, without the methods:
a We use the terms “slots” and “slot values” (filler)
mammal:
subclass: animal
elephant:
subclass: mammal
size: large
haspart: trunk
Nellie:
instance: elephant
likes: apples
31/45
Frames
a Frames often allowed you to say
which things were just typical of a class,
and which were definitional, so couldn’t be overridden
a Using an asterix to denote typical values:
a Frames also allowed multiple inheritance
(Nellie is an Elephant and is a circus animal)
a Introduces problems in inheritance
Elephant:
subclass: mammal
haspart: trunk
* colour: grey
* size: large
32/45
Simple Frame Example
Slot Name Filler
name Astérix
height small
weight low
profession warrior
armor helmet
intelligence very high
marital status presumed single
Thuộc tính Giá
trị
33/45
Representing Knowledge in Frames
a Frame Architecture
VA record-like data structure for representing stereotypical 
knowledge about some concept or object (or a class of 
objects)
VA frame name represents a stereotypical 
situation/object/process
VAttributes or properties of the object also called slot
VValues for attributes called fillers,
facets provide additional control over fillers
34/45
Frame Architecture
Frame Name:
Class:
Properties:
Object 1
Object 2
Property 1 Value 1
Property 2 Value 2
… …
… …
35/45
Types of Frames
a Class Frame
V Represents general characteristics of common objects
V Define properties that are common to all objects within class
V Static & dynamic property
a Static:
V Describes an object feature whose value does not change
a Dynamic:
V Feature whose value is likely to change during operation
36/45
Mô hình kiểu của khung
Frame Name:
Class:
Properties:
Bird
Animal
Color Unknown
Eats Worms
No._Wings 2
Flies True
Hungry Unknown
Activity Unknown
37/45
Subclass Frame
a Represents subsets of higher level classes or categories
a Creates complex frame structures
a Class relationships
Bird4
Bird
Robins Canaries Sparrows
Bird1 Bird2 Tweety Bird3
Class
Subclass
Instance
38/45
Instance Frame
a Represents specific instance of a class frame
a Inherits properties & values from the class
a Able to change values of properties & add new properties
Frame Name:
Class:
Properties:
Tweety
Bird
Color Yellow
Eats Worms
No._Wings 1
Flies False
Hungry Unknown
Activity Unknown
Lives Cage
39/45
Frame Inheritance
a Instance frame inherits information from its subclass frame and also its class
a Inheritance of behavior, facet
a Ease coding & modification of information
40/45
Frames and procedures
a Frames often allowed slots to contain procedures
a So.. Size slot could contain code to run to calculate the 
size of an animal from other data
a Sometimes divided into “if-needed” procedures, run when 
value needed, and “if-added” procedures, run when a 
value is added (to update rest of data, or inform user)
a So.. Similar, but not quite like modern object-oriented 
languages
41/45
Overview of Frame Structure
a Two basic elements: slots and facets (fillers, values, etc.); 
a Typically have parent and offspring slots
V Used to establish a property inheritance hierarchy 
(e.G., Specialization-of) 
a Descriptive slots
V Contain declarative information or data (static knowledge) 
a Procedural attachments
V Contain functions which can direct the reasoning process (dynamic 
knowledge) 
(e.G., "Activate a certain rule if a value exceeds a given level") 
a Data-driven, event-driven ( bottom-up reasoning) 
a Expectation-drive or top-down reasoning 
a Pointers to related frames/scripts - can be used to transfer control to a 
more appropriate frame 
[Rogers 1999]
42/45
Usage of Frames
a Filling slots in frames
V Can inherit the value directly 
V Can get a default value 
V These two are relatively inexpensive 
V Can derive information through the attached procedures (or 
methods) that also take advantage of current context (slot-
specific heuristics) 
V Filling in slots also confirms that frame or script is appropriate 
for this particular situation 
[Rogers 1999]
43/45
Problems with Frames
a Negation cannot be represented
V Jim does not have pneumonia
a Disjunction cannot be represented naturally
V Jim has Mumps or Rubella
a Qualification is not a part of the language
V All of Jim’s diseases are infectious
a => Thus, procedural attachments are often added
44/45
Biểu diễn tri thức nhờ
ngôn ngữ
nhân tạo
a Thực tế, ngôn ngữ tự nhiên :
V Là phương cách thuận tiện nhất để giao tiếp với một HCG
V Không những đối với người quản trị hệ thống
(tư cách chuyên gia)
V Mà còn đối với NSD cuối
a Hiện nay đã có những HCG có khả năng đối thoại trên 
ngôn ngữ tự nhiên (thông thường là tiếng Anh) nhưng chỉ
hạn chế trong một số lĩnh vực chuyên môn
45/45
A Quick Ontological View

File đính kèm:

  • pdfBài giảng Hệ chuyên gia - Phan Huy Khánh - Chương 2 Biểu diễn tri thức nhờ logic vị từ bậc một.pdf
Tài liệu liên quan