Скачать презентацию Chapter 5 Knowledge Representation Xiu-jun GONG Ph D Скачать презентацию Chapter 5 Knowledge Representation Xiu-jun GONG Ph D

1ef375dcbef24cf2b34848f4da7aef17.ppt

  • Количество слайдов: 38

Chapter 5 Knowledge Representation Xiu-jun GONG (Ph. D) School of Computer Science and Technology, Chapter 5 Knowledge Representation Xiu-jun GONG (Ph. D) School of Computer Science and Technology, Tianjin University gongxj@tju. edu. cn http: //cs. tju. edu. cn/faculties/gongxj/course/ai/

Outline Knowledge & Knowledge representation p Methodology for KR p n n n p Outline Knowledge & Knowledge representation p Methodology for KR p n n n p Logic Production System Semantic Net Frame Script Object-Oriented Summary

What is Knowledge ? Knowledge Information Knowledge Data Signal Knowledge = Facts+Rules+Control Strategy +(sometimes What is Knowledge ? Knowledge Information Knowledge Data Signal Knowledge = Facts+Rules+Control Strategy +(sometimes ) Faiths

Taxonomy of Knowledge p Facts: declarative knowledge n p likes(john, wine) Rules: procedural knowledge Taxonomy of Knowledge p Facts: declarative knowledge n p likes(john, wine) Rules: procedural knowledge n p thief(john), may_steal(X, Y) if thief(X) and likes(X, Y) Control Strategy: meta, super knowledge n n n reasoning strategy note form search strategy

Attributes of Knowledge p Range :Special ←→ General p Intend :Expository ←→ Instructional p Attributes of Knowledge p Range :Special ←→ General p Intend :Expository ←→ Instructional p Certainty :Certain ←→ Uncertain p Contain/Conflict :←→Contain Conflict(in faith)

Knowledge Representation p Knowledge representation is an issue that arises in both cognitive science Knowledge Representation p Knowledge representation is an issue that arises in both cognitive science and AI. n n n In cognitive science it is concerned with how people store and process information. In AI, the primary aim is to store knowledge so that programs can process it and achieve the verisimilitude of human intelligence. AI researchers have borrowed representation theories from cognitive science.

Some issues in KR How do people represent knowledge? p What is the nature Some issues in KR How do people represent knowledge? p What is the nature of knowledge and how do we represent it? p Should a representation scheme deal with a particular domain or should it be general purpose? p How expressive is a representation scheme? p Should the scheme be declarative or procedural? p

Methodology of KR Logic p Production System p Semantic Net p Frame p Script Methodology of KR Logic p Production System p Semantic Net p Frame p Script p

Propositional Logic p Propositional logic uses true statements to form or prove other true Propositional Logic p Propositional logic uses true statements to form or prove other true statements. n n p Representation (syntax): How to represent a proposition. Reasoning (algorithm): How to create or prove new propositions. Representation of propositional logic n n A propositional symbol and connectives (!, *, +, =>, <=> ) Example: p p p C = “It’s cold outside” ; C is a proposition O = “It’s October” ; O is a proposition If O then C ; if it’s October then it’s cold outside

Predicate Logic p p Same connectives as propositional logic Propositions have structure: Predicate/Function + Predicate Logic p p Same connectives as propositional logic Propositions have structure: Predicate/Function + arguments. n n p R, 2 ; Terms are not individuals, not propositions Red(R), (Red R) ; A proposition, written in two ways (south. Of Unicorn. Cafe Uni. Hall) ; a proposition (+ 2 2) ; Term, since the function + ranges over numbers Quantifiers enable general axioms to be written n (forall ? x (iff (Triangle ? x) (and (polygon ? x) (number. Of. Sides ? x 3))) Easy to inference

Logic as a KR language p advantages n n p With a semantics Expressiveness Logic as a KR language p advantages n n p With a semantics Expressiveness Disadvantages n n n Inefficient Undecidability Unable to express procedural knowledge Unable to do default reasoning No abduction

Production System (1) p p Production rules are one of the most popular and Production System (1) p p Production rules are one of the most popular and widely used knowledge representation languages Production rule system consists of three components n n n p working memory contains the information that the system has gained about the problem thus far. rule base contains information that applies to all the problems that the system may be asked to solve. interpreter solves the control problem, i. e. , decide which rule to execute on each selection-execute cycle. Used both for KR and Problem solving system

Production System (2) p Advantages: n n p Naturalness of expression Modularity Restricted syntax Production System (2) p Advantages: n n p Naturalness of expression Modularity Restricted syntax Ability to Represent Uncertain Knowledge Disadvantages n n Inefficient Less expressive

Semantic Nets p p Intuition base: n An important feature of human memory is Semantic Nets p p Intuition base: n An important feature of human memory is the high number of connections or associations between the different pieces of information contained in it. There are two types of primitive n Nodes correspond to objects, or classes of objects, in the world n Links are unidirectional connections between nodes and correspond to relationships between these objects

Semantic Nets p Major problem with semantic nets is that although the name of Semantic Nets p Major problem with semantic nets is that although the name of this knowledge representation language is semantic nets, there is not, ironically, clear semantics of the various network representations. For the above example, n n it can be interpreted as the representation of a specific bird named Tweety, or it can be interpreted as a representation of some relationship between Tweety, birds and animals.

Common used links p IS-A p PART-OF p MODIFILES: on, down, up, bottom, moveto, Common used links p IS-A p PART-OF p MODIFILES: on, down, up, bottom, moveto, … p Link types are set up for specific domain knowledge

Examples of Semantic Net (1) p Represent a table top Support leg 1 leg Examples of Semantic Net (1) p Represent a table top Support leg 1 leg 2 leg 3 leg 4 is-a table

Analysis of Semantic Net p For a particular Domain, you n n p make Analysis of Semantic Net p For a particular Domain, you n n p make up a set of link-types create a set of nodes connect them together ascribe meaning Write Programs to manipulate the knowledge n n Lisp CL

Examples of Semantic Net (2) p My car is tan and John’s car is Examples of Semantic Net (2) p My car is tan and John’s car is green I owner is-a car 1 color tan car is-a car 2 owner john color green

Inference in a Semantic Net (1) p Inheritance n n the is-a and instance-of Inference in a Semantic Net (1) p Inheritance n n the is-a and instance-of representation provide a mechanism to implement this. Inheritance also provides a means of dealing with default reasoning A clyde IS-A bird B IS-A C bird A can fly IS-A C clyde can fly

Inference in a Semantic Net (2) p Intersection search n n n The notion Inference in a Semantic Net (2) p Intersection search n n n The notion that spreading activation out of two nodes and finding their intersection finds relationships among objects. Many advantages including entity-based organization and fast parallel implementation. However very structured questions need highly structured networks

Inference in a Semantic Net (3) I I owner car 1 owner color car Inference in a Semantic Net (3) I I owner car 1 owner color car 1 tan is-a color what? is-a car tan is-a car 2 owner john color green What color is the car 1?

Frame representation p p Frame: a knowledge representation technique which attempts to organize concepts Frame representation p p Frame: a knowledge representation technique which attempts to organize concepts into a form which exploits interrelatioships and common beliefs frame-based KR is analogous to object-oriented programming; the difference is the entities encoded A frame is similar to a record data structure or database record: Frame has slot names and slot fillers, and usually arranged in a hierarchy

Structure of frame (1) Frame name slot: value , value, ……. . . slot: Structure of frame (1) Frame name slot: value , value, ……. . . slot: facet: value, …… Frame: printer superset: office-machine subset: {laser-printer, ink-jet-printer} energy-source: wall-outlet maker: Epson date: 1 -April-2003

Structure of frame (2) p Frames often allowed slots to contain procedures. n n Structure of frame (2) p Frames often allowed slots to contain procedures. n n “if-needed” procedures, run when value needed if-added” procedures, run when a value is added (to update rest of data, or inform user).

Class and instance frames p (frame) instance: representing” lowest-level” object; a single object or Class and instance frames p (frame) instance: representing” lowest-level” object; a single object or entity p (frame) class: describes different frames (either instances or classes) p every instance has an “is-a” link, pointing to its class n possibly more than one “is-a”

Example of frames (1) Bird Frame Name: Properties: Colour Wings Flies Class frame Unknown Example of frames (1) Bird Frame Name: Properties: Colour Wings Flies Class frame Unknown 2 True Frame Name: Tweety Bird Class: Instance frame Properties: Colour Wings Flies Yellow 1 False

Example of frames (2) Panda Bamboo Type: Plant Grow. Func: ……. . Location: Height: Example of frames (2) Panda Bamboo Type: Plant Grow. Func: ……. . Location: Height: 2 Type: Animal Colour: Black and white Food: Eat. Func: ……. . Name: Height: Age: 0 Sibling Jenny Name: Jenny Height: 1. 6 Age: 5 Sibling: Vicky Name: Vicky Height: 0. 7 Age: 1 Sibling:

Capability of frame representation p Advantages n n p Domain knowledge model reflected directly Capability of frame representation p Advantages n n p Domain knowledge model reflected directly Support default reasoning Efficient Support procedural knowledge Disadvantages n n Lack of semantics Expressive limitations

Scripts for KR Rather similar to frames: uses inheritance and slots; describes stereotypical knowledge, Scripts for KR Rather similar to frames: uses inheritance and slots; describes stereotypical knowledge, (i. e. if the system isn't told some detail of what's going on, it assumes the "default" information is true), but concerned with events. p Somewhat out of the mainstream of expert systems work. More a development of natural-language-processing research. p

Definition of scripts A script is a remembered precedent, consisting of tightly coupled, expectationsuggesting Definition of scripts A script is a remembered precedent, consisting of tightly coupled, expectationsuggesting primitive-action and statechange frames [Winston, 1992] p A script is a structured representation describing a stereotyped sequence of events in a particular context [Luger, Stubblefield, 1998] p

Why scripts? (1) p Because real-world events do follow stereotyped patterns. Human beings use Why scripts? (1) p Because real-world events do follow stereotyped patterns. Human beings use previous experiences to understand verbal accounts; computers can use scripts instead. p Because people, when relating events, do leave large amounts of assumed detail out of their accounts. People don't find it easy to converse with a system that can't fill in missing conversational detail

Why scripts? (2) Scripts predict unobserved events. p Scripts can build a coherent account Why scripts? (2) Scripts predict unobserved events. p Scripts can build a coherent account from disjointed observations. p Applications p n n This sort of knowledge representation has been used in intelligent front-ends, for systems whose users are not computer specialists. It has been employed in story-understanding and news-report-understanding systems.

Components of Scripts p Script name n n n n Entry conditions: Roles Props Components of Scripts p Script name n n n n Entry conditions: Roles Props Scene 1 Scene 2 … Results

Script: restaurant example (1) Script: RESTAURANT Track: Coffee Shop Props: Tables Menu Food Check Script: restaurant example (1) Script: RESTAURANT Track: Coffee Shop Props: Tables Menu Food Check Money Roles: Customer Waiter Cook Cashier Owner Scene 1: Entering 顾客进入餐厅 注意桌子 看往哪里坐 朝桌子走去 在座位坐下 Scene 2: Ordering (Menu on table) 顾客拿起菜单 顾客招呼服务员 服务员走向顾客 * (Customer ask for Menu) 顾客招呼服务员 服务员走向顾客 顾客向服务员要菜单 服务员去拿菜单 服务员走向桌子 服务员把菜单交给顾客 顾客从菜单中选择菜肴 服务员记下 服务员通知厨师 厨师制作菜肴 服务员说“没有” 进入Scene 4 进入Scene 3 不付款离开餐厅

Script: restaurant example (2) Entry conditions: Customer is hungry Customer has money Results: Customer Script: restaurant example (2) Entry conditions: Customer is hungry Customer has money Results: Customer has less money Owner has more money Customer is not hungry Customer is pleased(optional) Scene 3: Eating 厨师把菜肴交给服务员 服务员把菜肴交给 顾客吃下菜肴 返回Scene 2 * Scene 4: Leaving 服务员写帐单 顾客把钱交给服务员 顾客把小费交给服务员 服务员走向出纳员 服务员把钱交给出纳员 不付款离开餐厅 顾客离开餐厅

Summary: KR as p Logic (Declarative) n n p Procedural n n p Rules Summary: KR as p Logic (Declarative) n n p Procedural n n p Rules Productions systems Structure n n p Propositional Predicate Frames Scripts Associations n Semantic net

White and black Kind_of Animal With_Color Panda has_food Plant Kind_of Bamboo Height 2 m White and black Kind_of Animal With_Color Panda has_food Plant Kind_of Bamboo Height 2 m 1. 6 m Height IS_A Jenny IS_A AGE 5 yr Is_ sibling AGE Vicky Height 0. 7 m 1 yr