390 likes | 425 Views
Lecture 2. Knowledge-based systems. Sanaullah Manzoor CS&IT, Lahore Leads University sanaullahmanzoor1988@gmail.com https://sites.google.com/site/engrsanaullahmanzoor/home. Knowledge Representation. Overview Knowledge Processing. Motivation Objectives Knowledge Types
E N D
Lecture 2 Knowledge-based systems SanaullahManzoor CS&IT, Lahore Leads University sanaullahmanzoor1988@gmail.com https://sites.google.com/site/engrsanaullahmanzoor/home
Overview Knowledge Processing • Motivation • Objectives • Knowledge Types • Knowledge Representation Method • Semantic Networks • Frames • Production Rules 3
Catching My Plane • Scenario for an examination of knowledge representation and reasoning: • A traveller wants to know when he/she needs to leave his/her hotel in order to catch a plane • background knowledge • situation knowledge • acquisition of additional knowledge for decision making • reasoning methods • verification and validation
Computer Scenario • Traveler posts a query to a computer
Human Scenario • Traveler asks a human • 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 • be familiar with the commonly used knowledge representation and reasoning methods • examine the suitability of knowledge representationsfor 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 • Verifiable • through experiments, formal methods, sometimes commonsense reasoning • often created by authoritative sources • typically not under dispute in the domain community • often incorporated into reference works, textbooks, domain standards
Subjective Knowledge • Relies on individuals • insight, experience • possibly subject to interpretation • more difficult to verify • especially if the individuals possessing the knowledge are not cooperative • different from belief • both are subjective, but beliefs are not verifiable
Heuristic Knowledge • Based on rules or guidelines that frequently help solving problems • often derived from practical experience working in a domain • as opposed to theoretical insights gained from deep thoughts about a topic • verifiable through experiments
Deep and Shallow Knowledge • deep knowledge enables explanations and credibility considerations • possibly including formal proofs • shallow knowledge may be sufficient to answer immediate questions, but not for explanations • heuristics are often an example of shallow knowledge Shallow is for time-being consideration while deep is long-term
Other Types of Knowledge • Procedural knowledge • knowing how to do something • Declarative knowledge • expressed through statements that can be shown to be true or false • prototypical example is mathematical logic • Tacit knowledge • implicit, unconscious knowledge that can be difficult to express in words or other representations
Other Types of Knowledge • Priori knowledge • independent on experience or empirical evidence • e.g. “everybody born before 1983 is older than 20 years” • Posteriori knowledge • dependent of experience or empirical evidence • e.g. “X was born in 1983”
Before we begin the methods.. Let’s see this • There is a common method used for many non-AI (databases) representation, namely • Object-Attribute-Value (O-A-V) Triplets • An O-A-V is a more complex type of proposition (fact). • It divides statement into three (3) parts as shown: price shirt RM39 attribute value object
There can be single or multiple attribute facts blue color shirt size XL cost rm39 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
Semantic Networks (II) • Examples of relationship labeled on arcs (notice that there is an underscore) • is_a • has_a • has_part • Examples of concepts (nodes) • bird • person • book • famous • intelligent
A semantic net that represents a bird’s property has_covering has_property bird feathers flies is_a size has_color small blue bluebird
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.
Inheritance in Semantics Nets Breathe Animal Move can can Fly Bird Wings Feathers can has has Penguin We shall see this later can Canary Sing Yellow Animal’s properties are inherited to Bird and Bird’s properties are inherited to a bird species called canary is
Frames • The idea behind frames is to store information in meaningful chunks. • This frame has 4 slots: BOOK Title : Qualitative Reasoning Author : Ken D. Forbus Publisher : Prentice-Hall Year : 2000
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. ::
Frames • You should be able to see now : • 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 • 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
Converting from Frames to Semantics Nets has_a has_a book date publisher is_a is_a has_a author novel encyclopedia is_a Forbus has_a editor
Production Rules (I) • Most Expert Systems are rule-based • 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.
Production Rules (II) • 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. • IF the traffic-light is green THEN the action is go • IF the traffic-light is red THEN the action is stop
Production Rules (III) • A production rule model consists of two parts: • the IF part, called antecedent or premise or condition, and • the THEN part, called consequent or conclusion or action • In our earlier example: • IF <the traffic-light is green> THEN <go> • IF <the traffic-light is red> THEN <stop> condition action
Production Rules (IV) • Multiple conditions are joined by the keywords AND (conjunction), OR (disjunction) or a combination of both. • Example: IF <condition-1> OR <condition-2> : OR <condition-n> THEN <action> IF <condition-1> AND <condition-2> : AND <condition-n> THEN <action>
Example 1 Production Rules • for a subset of the English language <sentence> -> <subject> <verb> <object> <modifier> <subject> -> <noun> <object> -> <noun> <noun> -> kid| man | woman <verb> -> loves | hates <modifier> -> a little | a lot | forever | sometimes
Example 1 Parse Tree • Example sentence:kid loves mother forever <sentence> <subject> <verb> <object> <modifier> <noun> <noun> kid loves mother forever
Production Rules (VII) Strategy: IF the car is dead THEN 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 : : Heuristics: IF the spill is liquid AND the spill pH is < 6 AND the smell is vinegar THEN the spill material is acetic acid Directive: IF the fuel tank is empty THEN refuel the car
Production System Model Short term memory Long term memory Facts Production Rules Reasoning Conclusion