Lecture 2 Knowledgebased systems Sanaullah Manzoor CSIT Lahore
Lecture 2 Knowledge-based systems Sanaullah Manzoor CS&IT, Lahore Leads University sanaullahmanzoor 1988@gmail. com https: //sites. google. com/site/engrsanaullahmanzoor/home
Knowledge Representation
Overview Knowledge Processing § Motivation § Objectives § Knowledge Types § Knowledge Representation Method • • • Semantic Networks Frames Production Rules 33
Catching My Plane o Scenario for an examination of knowledge representation and reasoning: o A traveller wants to know when he/she needs to leave his/her hotel in order to catch a plane o background knowledge situation knowledge acquisition of additional knowledge for decision making reasoning methods verification and validation o o
Computer Scenario l Traveler posts a query to a computer
Google:
Bing:
Ask. com:
Human Scenario l Traveler asks a human n e. g. hotel receptionist
Motivation § § Representation and manipulation of knowledge has been essential for the development of humanity as we know it Use of formal methods and support from machines can improve our knowledge representation and reasoning abilities Intelligent reasoning is a very complex phenomenon, and may have to be described in a variety of ways Basic understanding of knowledge representation and reasoning is important for the organization and management of knowledge
Objectives l l l be familiar with the commonly used knowledge representation and reasoning methods examine the suitability of knowledge representations for specific tasks evaluate the representation methods and reasoning mechanisms employed in computer -based systems
Knowledge Representation Ø • • • Types of Knowledge Factual Subjective Heuristic Deep or Shallow Other Types Knowledge Representation Methods Semantic Networks Frames Production Rules
Factual Knowledge l Verifiable n through experiments, formal methods, sometimes commonsense reasoning often created by authoritative sources n l l typically not under dispute in the domain community often incorporated into reference works, textbooks, domain standards
Subjective Knowledge l Relies on individuals n insight, experience l possibly subject to interpretation more difficult to verify l n especially if the individuals possessing the knowledge are not cooperative l different from belief n both are subjective, but beliefs are not verifiable
Heuristic Knowledge l l Based on rules or guidelines that frequently help solving problems often derived from practical experience working in a domain n as opposed to theoretical insights gained from deep thoughts about a topic l verifiable through experiments
Deep and Shallow Knowledge l deep knowledge enables explanations and credibility considerations n possibly including formal proofs l shallow knowledge may be sufficient to answer immediate questions, but not for explanations n heuristics are often an example of shallow knowledge Shallow is for time-being consideration while deep is long-term
Other Types of Knowledge l Procedural knowledge n knowing how to do something l Declarative knowledge n n expressed through statements that can be shown to be true or false prototypical example is mathematical logic l Tacit knowledge n implicit, unconscious knowledge that can be difficult to express in words or other representations
Other Types of Knowledge l Priori knowledge n n independent on experience or empirical evidence e. g. “everybody born before 1983 is older than 20 years” l Posteriori knowledge n dependent of experience or empirical evidence e. g. “X was born in 1983” n
Knowledge Representation Methodologies
Before we begin the methods. . Let’s see this l There is a common method used for many non-AI (databases) representation, namely n Object-Attribute-Value (O-A-V) Triplets u u An O-A-V is a more complex type of proposition (fact). It divides statement into three (3) parts as shown: shirt object price attribute RM 39 value
There can be single or multiple attribute facts color shirt size blue XL cost rm 39 There can also be single or multiple value facts.
Semantic Networks § § A semantic net has a binary relation Concepts are represented by nodes Links between nodes represent the relationships Drawbacks: § § § Disjunctive and conjunctive information cannot be included into semantic nets E. g. apple can be either green or red E. g. panda has color black and white 22
Semantic Networks (II) l Examples of relationship labeled on arcs (notice that there is an underscore) n n n l is_a has_part Examples of concepts (nodes) n n n bird person book famous intelligent 23
A semantic net that represents a bird’s property feathers has_covering bird has_property flies is_a small size bluebird has_color blue 24
Exercise: Draw a semantic network for the following description: Lab is a room. Lab has a door. Lab has computers. Printer is in lab. Laser printer is a Printer. 25
Inheritance in Semantics Nets Animal can Breathe can Move can has Bird has Penguin Fly Wings Feathers We shall see this later Canary can Sing is Yellow Animal’s properties are inherited to Bird and Bird’s properties are inherited to a bird species called canary 26
Frames l l The idea behind frames is to store information in meaningful chunks. This frame has 4 slots: BOOK Title Author Publisher Year : Qualitative Reasoning : Ken D. Forbus : Prentice-Hall : 2000 27
Frame Description Hotel Room specialisation of: room location: the hotel contains: bed, chair & phone Hotel Phone specialisation of: phone use: calling room service billing: through room Hotel Bed superclass: bed size: king : : contains: mattress, pillow, etc. 28
Frames l You should be able to see now : n n that a frame describes an object by embedding all the information about that object in “slots” that slots are commonly known in programming terms as fields or attributes with associated value u n n this is an advantage (discuss in later part) that a frame is similar to a database record that a frame describes typical instances of the concepts they represent 29
Converting from Frames to Semantics Nets date has_a book has_a publisher is_a author has_a novel is_a encyclopedia is_a Forbus editor has_a 30
Production Rules l Most Expert Systems are rule-based n l l (I) i. e. the knowledge-base of the ES consists of a huge set of production rules (or just “rules”) Facts, rules and inference engines are required to execute a rule-based expert system Production-rules system captures knowledge in simple “if-then” format. 31
Production Rules (II) l l l The human mental process is too complex to be represented as an algorithm However, most experts are capable of expressing their knowledge in the form of rules for their problem solving e. g. u u IF the traffic-light is green THEN the action is go IF the traffic-light is red THEN the action is stop 32
Production Rules (III) l A production rule model consists of two parts: the IF part, called antecedent or premise or condition, and n the THEN part, called consequent or conclusion or action condition In our earlier example: n l l l IF <the traffic-light is green> THEN <go> IF <the traffic-light is red> THEN <stop> action 33
Production Rules l l (IV) Multiple conditions are joined by the keywords AND (conjunction), OR (disjunction) or a combination of both. Example: IF OR <condition-1> <condition-2> : OR <condition-n> THEN <action> IF <condition-1> AND <condition-2> : AND <condition-n> THEN <action> 34
Example 1 Production Rules l for a subset of the English language <sentence> -> <subject> <verb> <object> <modifier> <subject> -> <noun> <object> -> <noun> -> kid| man | woman <verb> -> loves | hates <modifier> -> a little | a lot | forever | sometimes
Example 1 Parse Tree l Example sentence: kid loves mother forever <sentence> <subject> <verb> <noun> kid <object> <modifier> <noun> loves mother forever
Production Rules Heuristics: IF AND THEN the spill is liquid the spill p. H is < 6 the smell is vinegar the spill material is acetic acid Directive: IF the fuel tank is empty THEN refuel the car (VII) Strategy: IF THEN the car is dead check fuel tank step 1 is complete IF step 1 is complete AND the fuel tank is full THEN check battery step 2 is complete IF step 2 is complete AND the battery is replaced THEN check electrical fuel lines : : 37
Production System Model Long term memory Short term memory Production Rules Facts Reasoning Conclusion 38
- Slides: 38