Presentation is loading. Please wait.

Presentation is loading. Please wait.

Expert Systems, Paula Matuszek

Similar presentations


Presentation on theme: "Expert Systems, Paula Matuszek"— Presentation transcript:

1 Expert Systems, Paula Matuszek
Knowledge Representation for Expert Systems Paula Matuszek CSC 8750, Fall, 2004 Slides taken in part from: 9/22/2018 Expert Systems, Paula Matuszek

2 Expert Systems, Paula Matuszek
Motivation KBS are useless without the ability to represent knowledge different knowledge representation schemes may be appropriate depending on tasks and circumstances knowledge representation schemes and reasoning methods must be coordinated 9/22/2018 Expert Systems, Paula Matuszek

3 Knowledge and its Meaning
Epistemology Types of Knowledge Knowledge Pyramid 9/22/2018 Expert Systems, Paula Matuszek

4 Expert Systems, Paula Matuszek
Epistemology the science of knowledge EPISTEMOLOGY ( Gr. episteme, "knowledge"; logos, "theory"), branch of philosophy concerned with the theory of knowledge. The main problems with which epistemology is concerned are the definition of knowledge and related concepts, the sources and criteria of knowledge, the kinds of knowledge possible and the degree to which each is certain, and the exact relation between the one who knows and the object known. [Infopedia 1996] 9/22/2018 Expert Systems, Paula Matuszek

5 Expert Systems, Paula Matuszek
Types of Knowledge a priori knowledge comes before knowledge perceived through senses considered to be universally true a posteriori knowledge knowledge verifiable through the senses may not always be reliable procedural knowledge knowing how to do something declarative knowledge knowing that something is true or false tacit knowledge knowledge not easily expressed by language 9/22/2018 Expert Systems, Paula Matuszek

6 Knowledge in Expert Systems
Conventional Programming Knowledge-Based Systems Algorithms + Data Structures = Programs Knowledge + Inference = Expert System N. Wirth 9/22/2018 Expert Systems, Paula Matuszek

7 Expert Systems, Paula Matuszek
Knowledge Pyramid Meta- Knowledge Information Data Noise 9/22/2018 Expert Systems, Paula Matuszek

8 Characteristics of a good KR for ES:
It should Be able to represent the knowledge important to the domain Reflect the structure of knowledge in the domain Otherwise knowledge engineering is a constant process of distorting things to make them fit. Capture knowledge at the appropriate level of granularity Support incremental, iterative development It should not Be too difficult to reason about Require that more knowledge be represented than is needed to solve the problem 9/22/2018 Expert Systems, Paula Matuszek

9 Knowledge Representation Methods
Decision Trees Rules Forward chaining rules Backward chaining rules Semantic Nets Schemata and Frames Logic 9/22/2018 Expert Systems, Paula Matuszek

10 Expert Systems, Paula Matuszek
Decision Trees Knowledge is structured as a tree Internal nodes are questions or tests Links or arcs are possible outcomes of tests Leaves are decisions Common way of representing decision making: Troubleshooting guide Taxonomy key 9/22/2018 Expert Systems, Paula Matuszek

11 Decision Trees: Example
Is your animal a mammal? Yes: Is your animal a pet Yes: Your animal is a cat No: Your animal is a lion. No: Is your animal bigger than a breadbox? Yes: Your animal is a bear No: Your animal is a mouse. 9/22/2018 Expert Systems, Paula Matuszek

12 Decision Trees: Advantages
Easy to implement. We know a lot about trees in computer science. Explanations and the inference process are very clearcut and easy to explain Easy to get started. Don’t require excessive knowledge For simple problems, may reflect well the problem domain. Fast to do inference: it’s just a tree walker Obvious way to do automated extension 9/22/2018 Expert Systems, Paula Matuszek

13 Decision Trees: Disadvantages
Decision trees reflect a semi-procedural view of expertise which is often not a good match to a domain Difficult to modify Difficult to maintain “tree” shape, even if you allow multiple inheritance Intermediate state of a problem is only captured implicitly. Often very difficult to elicit from expert Don’t scale well. Large decision trees are very hard to maintain and debug. Gives an illusion of structure which doesn’t actually reflect the domain 9/22/2018 Expert Systems, Paula Matuszek

14 Expert Systems, Paula Matuszek
Production Rules frequently used to formulate the knowledge in expert systems a formal variation is Backus-Naur form (BNF) metalanguage for the definition of language syntax a grammar is a complete, unambiguous set of production rules for a specific language a parse tree is a graphic representation of a sentence in that language provides only a syntactic description of the language not all sentences make sense 9/22/2018 Expert Systems, Paula Matuszek

15 Example 1 Production Rules
for a subset of the English language <sentence> -> <subject> <verb> <object> <modifier> >subject> -> <noun> <object> -> <noun> <noun> -> man | woman <verb> -> loves | hates | marries | divorces <modifier> -> a little | a lot | forever | sometimes 9/22/2018 Expert Systems, Paula Matuszek

16 Expert Systems, Paula Matuszek
Example 1 Parse Tree Example sentence: man loves woman forever <sentence> <subject> <verb> <object> <modifier> <noun> <noun> man loves woman forever 9/22/2018 Expert Systems, Paula Matuszek

17 Expert Systems, Paula Matuszek
Chaining Rules Specialization of production rules Typical pattern is LHS: Left Hand Side: Some kind of condition RHS: Right Hand Side: Some kind of action The left hand side might test the existence of some fact, the result of some test, the relationship of two values The right hand side might assert a fact, elicit additional data, quit, reach a decision. 9/22/2018 Expert Systems, Paula Matuszek

18 Forward Chaining Rules
Like CLIPS: Typically used in domains which are data-driven. Left hand side generally tests the existence or value of specific data, or identifies situation which requires new data. Right hand side typically asserts some additional condition or state to be true, or acquires new data. Appropriate when there are many possible conclusions, data is readily available Example: automotive diagnostic systems 9/22/2018 Expert Systems, Paula Matuszek

19 Backward Chaining Rules
Like Prolog Typically used in domains which are goal-driven Left hand side is typically a condition which we would like to reach, or suspect we are in Right hand side is typically the facts or conditions which will be true if the left hand side is true. More appropriate when you have relatively few goals or data is relatively expensive to acquire Example: system for diagnosing cancer 9/22/2018 Expert Systems, Paula Matuszek

20 Advantages of Production Rules
Simple and easy to understand Basic inference is straightforward Formal foundations for some variants Get started quickly The pattern-matching view of knowledge which they reflect is often a close match to the expert’s thought processes. 9/22/2018 Expert Systems, Paula Matuszek

21 Disadvantages of Production Rules
Simple implementations are very inefficient if there is a large branching factor. Some types of knowledge are not easily expressed in such rules Large sets of rules become difficult to understand and maintain Good at capturing existing knowledge, but no capability for reasoning about new problems 9/22/2018 Expert Systems, Paula Matuszek

22 An Aside: Shallow vs Deep Reasoning
Shallow Reasoning heuristic pattern-recognition-based fast can’t solve new problems typically associated with rules Deep Reasoning algorithmic causal-based slow can solve previously unseen problems typically associated with more structured representations 9/22/2018 Expert Systems, Paula Matuszek

23 Structured Knowledge Representations
Decision trees and rules are very ad-hoc. Don’t really capture the structure of a domain Modeling-based representations reflect the structure of the domain, and then reason based on the model. Semantic Nets Frames Scripts Sometimes called associative networks 9/22/2018 Expert Systems, Paula Matuszek

24 Basics of Associative Networks
All include Concepts Various kinds of links between concepts “has-part” or aggregation “is-a” or specialization More specialized depending on domain Typically also include Inheritance Some kind of procedural attachment 9/22/2018 Expert Systems, Paula Matuszek

25 Expert Systems, Paula Matuszek
Semantic Nets graphical representation for propositional information originally developed by M. R. Quillian as a model for human memory labeled, directed graph nodes represent objects, concepts, or situations labels indicate the name nodes can be instances (individual objects) or classes (generic nodes) links represent relationships the relationships contain the structural information of the knowledge to be represented the label indicates the type of the relationship 9/22/2018 Expert Systems, Paula Matuszek

26 Semantic Nets Components
Nodes or Concepts Arcs or Links Inheritance Generic (class) and Individual (object) Constraints, procedural attachments Nodes “things” or “objects” or “concepts”. Typically a demonstrative entity, a noun. E.g., ship, computer, day, dream Arcs relationships. Typically a few types expressing important relationships among nodes. The type carries semantic information. E.g., is_a, has_part, provides_power_to, agent 9/22/2018 Expert Systems, Paula Matuszek

27 Expert Systems, Paula Matuszek
Semantic Net Examples Ship HasA HasA Hull Propulsion Person InstanceOf Instance Instance Steamboat Bob give Mary agent recipient object Candy 9/22/2018 Expert Systems, Paula Matuszek

28 Expert Systems, Paula Matuszek
Generic/Individual Generic describes the idea--the “notion” static Individual or instance describes a real entity must conform to notion of generic dynamic “individuate” or “instantiate” Some representations distinguish two kinds of links: Instance Of: instance level relationship A Kind Of: class level relationship ISA can mean either, depending on whose terminology you are following . 9/22/2018 Expert Systems, Paula Matuszek

29 Individuation example
Generic Representation Person give Person agent recipient object Thing Process the sentence “Bob gave Mary some candy”. Instantiation Bob give Mary agent recipient object Candy 9/22/2018 Expert Systems, Paula Matuszek

30 Procedural Attachments, Constraints
Add heuristics Associated with either nodes or links Constraints maintain “definitional” flavor or nets associated with links typically constrain a concept in some way compared to its parents: size, type, number May invoke a procedural attachment 9/22/2018 Expert Systems, Paula Matuszek

31 Expert Systems, Paula Matuszek
Semantic Net Example Abraracourcix Astérix is-boss-of is-boss-of Cétautomatix is-a is-a is-friend-of buys-from is-a Gaul Obélix is-a fights-with is-a AKO Dog Panoramix takes-care-of is-a Human lives-with is-a sells-to barks-at Idéfix Ordralfabetix 9/22/2018 Expert Systems, Paula Matuszek

32 Other Typical Examples
Configuration systems Diagnosis for large systems Identification systems 9/22/2018 Expert Systems, Paula Matuszek

33 Expert Systems, Paula Matuszek
Relationships without relationships, knowledge is an unrelated collection of facts reasoning about these facts is not very interesting relationships express structure in the collection of facts this allows the generation of meaningful new knowledge generation of new facts generation of new relationships 9/22/2018 Expert Systems, Paula Matuszek

34 Types of Relationships
relationships can be arbitrarily defined by the knowledge engineer allows great flexibility for reasoning, the inference mechanism must know how relationships can be used to generate new knowledge inference methods may have to be specified for every relationship frequently used relationships IS-A relates an instance (individual node) to a class (generic node) AKO (a-kind-of) relates one class (subclass) to another class (superclass) 9/22/2018 Expert Systems, Paula Matuszek

35 Expert Systems, Paula Matuszek
Inheritance Inheritance is the duplication of a concept’s relationships by its descendents. Typically follows specialization hierarchy. Not all relationships are inherited In semantic nets, inherited relationships may be further constrained but are not typically overridden. Mammals have hair. A whale is a mammal. We can’t say whales don’t have hair, but we can further constrain it to say that they have very sparse hair. Efficient for creation, maintenance and storage Inefficient for reasoning 9/22/2018 Expert Systems, Paula Matuszek

36 Deep Reasoning, Semantic Net
System power power 110v Sorter 2 power Sorter 1 power 12v Voltmeter Gives power to Gate 1 Gate 5 Gate 2 Gate 6 ISA Measures Measures is inherited along the ISA hierarchy Measures is not inherited along the “Gives power to” hierarchy. We can conclude that we can use the voltmeter to measure the power at Sorter 2 power. 9/22/2018 Expert Systems, Paula Matuszek

37 Semantic Nets for Expert Systems
Advantages Represent static structures well Efficient for structures with duplication Represent domains with extensive relationships well Reason about requirements and definitions easily Capture semantics Support inferring new knowledge 9/22/2018 Expert Systems, Paula Matuszek

38 Semantic Nets: Disadvantages
Hard to represent a variable world or domain Hard to represent default information Need detailed, complete model for effective reasoning: slow to get started Link (arc) types need careful definition; standard terminology is confusing Slow for negative reasoning 9/22/2018 Expert Systems, Paula Matuszek

39 Expert Systems, Paula Matuszek
Schemata suitable for the representation of complex knowledge causal relationships between a percept or action and its outcome nodes can have an internal structure for humans often tacit knowledge related to the notion of records in computer science 9/22/2018 Expert Systems, Paula Matuszek

40 Expert Systems, Paula Matuszek
Concept Schema abstraction that captures general/typical properties of objects has the most important properties that one usually associates with an object of that type may be dependent on task, context, background and capabilities of the user, … similar to stereotypes makes reasoning simpler by concentrating on the essential aspects may still require relationship-specific inference methods 9/22/2018 Expert Systems, Paula Matuszek

41 Expert Systems, Paula Matuszek
Schema Examples the most frequently used instances of schemata are frames [Minsky 1975] scripts [Schank 1977] frames consist of a group of slots and fillers to define a stereotypical objects scripts are time-ordered sequences of frames 9/22/2018 Expert Systems, Paula Matuszek

42 Expert Systems, Paula Matuszek
Frame represents related knowledge about a subject provides default values for most slots frames are organized hierarchically allows the use of inheritance knowledge is usually organized according to cause and effect relationships slots can contain all kinds of items rules, facts, images, video, comments, debugging info, questions, hypotheses, other frames slots can also have procedural attachments procedures that are invoked in specific situations involving a particular slot on creation, modification, removal of the slot value 9/22/2018 Expert Systems, Paula Matuszek

43 Expert Systems, Paula Matuszek
Simple Frame Example Slot Name Filler name Astérix height small weight low profession warrior armor helmet intelligence very high marital status presumed single 9/22/2018 Expert Systems, Paula Matuszek

44 Overview of Frame Structure
two basic elements: slots and facets (fillers, values, etc.); typically have parent and offspring slots used to establish a property inheritance hierarchy (e.g., specialization-of) descriptive slots contain declarative information or data (static knowledge) procedural attachments contain functions which can direct the reasoning process (dynamic knowledge) (e.g., "activate a certain rule if a value exceeds a given level") data-driven, event-driven ( bottom-up reasoning) expectation-drive or top-down reasoning pointers to related frames/scripts - can be used to transfer control to a more appropriate frame 9/22/2018 Expert Systems, Paula Matuszek [Rogers 1999]

45 Expert Systems, Paula Matuszek
Slots each slot contains one or more facets facets may take the following forms: values default used if there is not other value present range what kind of information can appear in the slot if-added procedural attachment which specifies an action to be taken when a value in the slot is added or modified (data-driven, event-driven or bottom-up reasoning) if-needed procedural attachment which triggers a procedure which goes out to get information which the slot doesn't have (expectation-driven; top-down reasoning) other may contain frames, rules, semantic networks, or other types of knowledge 9/22/2018 Expert Systems, Paula Matuszek [Rogers 1999]

46 Expert Systems, Paula Matuszek
Usage of Frames filling slots in frames can inherit the value directly can get a default value these two are relatively inexpensive can derive information through the attached procedures (or methods) that also take advantage of current context (slot-specific heuristics) filling in slots also confirms that frame or script is appropriate for this particular situation 9/22/2018 Expert Systems, Paula Matuszek [Rogers 1999]

47 Example Frame: Low-level frame
Object This Expert Systems class ISA Expert Systems class Date Fall, 2004 Time 6:15-9PM Thursdays Instructor Matuszek Enrollment 4 Has_A ROSTER 9/22/2018 Expert Systems, Paula Matuszek

48 Frame Example: default frame
Object Expert Systems Class ISA Class Date Time 6:15-9PM Instructor IF-NEEDED: Ask department IF-ADDED: Update payroll Enrollment Count ROSTER: Student-IDs Has_A ROSTER 9/22/2018 Expert Systems, Paula Matuszek

49 Another Example: high-level frame
Object ROSTER ISA Class Record Enrollment Limit 25 Enrollment Status Open Student-IDs IF-ADDED Increment Filler(Enrollment) If Filler(Enrollment) = Filler(Enrollment Limit) Then Filler(Status) = Closed IF-DROPPED 9/22/2018 Expert Systems, Paula Matuszek

50 Expert Systems, Paula Matuszek
Frame Advantages Fairly intuitive for many applications similar to human knowledge organization suitable for causal knowledge easier to understand for a complex domain than logic or rules Good at representing structured knowledge Handles defaults and exceptions gracefully Captures some of the underlying structure and semantics Efficient for structures with a lot of duplication 9/22/2018 Expert Systems, Paula Matuszek

51 Expert Systems, Paula Matuszek
Frame Disadvantages Easy to think of as definitions of concepts valid instances of a concept may not fit definition If you need definitional approach, use semantic nets inheritance not all properties of a class stereotype should be propagated to subclasses alteration of slots can have unintended consequences in subclasses Requires substantial structure there to do anything 9/22/2018 Expert Systems, Paula Matuszek

52 Frames vs Semantic Nets
Frames and nets capture comparable knowledge You can automatically transform a frame into a net and vice versa Differences are more in typical usage: Semantic nets are normally considered as specifications, and do not allow exceptions or defaults Frames are normally considered as typical descriptions; defaults and overrides are expected Nets typically distinguish strongly between classes and instances; frames typically do instantiation at the slot level and don’t have a clearcut distinction at the frame level Which is preferable depends on your domain! 9/22/2018 Expert Systems, Paula Matuszek

53 Expert Systems, Paula Matuszek
Scripts Describe typical events or sequences Components are script variables (players, props) entry conditions transactions exit conditions Create instance by filling in variables 9/22/2018 Expert Systems, Paula Matuszek

54 Restaurant Script Example
generic template for restaurants different types default values script for a typical sequence of activities at a restaurant Often has a frame behind it; script is essentially instantiating the frame 9/22/2018 Expert Systems, Paula Matuszek [Rogers 1999]

55 Expert Systems, Paula Matuszek
Restaurant Script EAT-AT-RESTAURANT Script Props: (Restaurant, Money, Food, Menu, Tables, Chairs) Roles: (Hungry-Persons, Wait-Persons, Chef-Persons) Point-of-View: Hungry-Persons Time-of-Occurrence: (Times-of-Operation of Restaurant) Place-of-Occurrence: (Location of Restaurant) Event-Sequence: first: Enter-Restaurant Script then: if (Wait-To-Be-Seated-Sign or Reservations) then Get-Maitre-d's-Attention Script then: Please-Be-Seated Script then: Order-Food-Script then: Eat-Food-Script unless (Long-Wait) when Exit-Restaurant-Angry Script then: if (Food-Quality was better than Palatable) then Compliments-To-The-Chef Script then: Pay-For-It-Script finally: Leave-Restaurant Script 9/22/2018 Expert Systems, Paula Matuszek [Rogers 1999]

56 Expert Systems, Paula Matuszek
Logic Discussed in depth in AI Advantages: Good formal characteristics: complete, sound Can get started easily Very flexible Disadvantages: Does not reflect human thinking very well Acquisition is slow Monotonic Reasoning inefficient for large systems 9/22/2018 Expert Systems, Paula Matuszek

57 KR Languages and Programming Languages
how is a knowledge representation language different from a programming language (e.g. Java, C++)? programming languages can be used to express facts and states what about "there is a pit in [2,2] or [3,1] (but we don't know for sure)" or "there is a wumpus in some square" programming languages are not expressive enough for situations with incomplete information we only know some possibilities which exist 9/22/2018 Expert Systems, Paula Matuszek [Rogers 1999]

58 KR Languages and Natural Language
how is a knowledge representation language different from natural language e.g. English, Spanish, German, … natural languages are expressive, but have evolved to meet the needs of communication, rather than representation the meaning of a sentence depends on the sentence itself and on the context in which the sentence was spoken e.g. “Look!” sharing of knowledge is done without explicit representation of the knowledge itself ambiguous (e.g. small dogs and cats) 9/22/2018 Expert Systems, Paula Matuszek [Rogers 1999]

59 Good Knowledge Representation Languages
combine the best of natural and formal languages: expressive concise unambiguous independent of context what you say today will still be interpretable tomorrow efficient the knowledge can be represented in a format that is suitable for computers practical inference procedures exist for the chosen format effective there is an inference procedure which can act on it to make new sentences 9/22/2018 Expert Systems, Paula Matuszek [Rogers 1999]

60 Summary: Knowledge Representation
knowledge representation is very important for knowledge-based system popular knowledge representation schemes are rules, semantic nets, schemata (frames, scripts), logic the selected knowledge representation scheme should have appropriate inference methods to allow reasoning a balance must be found between effective representation, efficiency, understandability 9/22/2018 Expert Systems, Paula Matuszek


Download ppt "Expert Systems, Paula Matuszek"

Similar presentations


Ads by Google