Chapter 3: Representing Knowledge in Computer Introduction (Representing knowledge, Metrics for assessing knowledge representation schemes), Logic representation, Inference rules, Semantics networks, Frames and Scripts, Decision trees.
Chapter Representing Knowledge in Computer K216 C: Studies on Intelligence School of Knowledge Science JAIST TuBao Ho Outline of chapter Introduction Representing knowledge Metrics for assessing knowledge representation schemes Logic representation Inference rules Semantics networks Frames and Scripts Decision trees Introduction declarative knowledge is knowledge about things location of JAIST, its transport links “JAIST is in Tatsunokuchi”, “Hokuriku Railroad Ishikawa line goes from Nomachi to Tsurugi” procedural knowledge is knowledge about how to things how to get to JAIST “Take the Hokuriku Railroad, Ishikawa line to go to Tsurugi”, “Get on the JAIST shuttle” Introduction domain-specific knowledge: specific knowledge on a particular subject Example: “JAIST shuttle goes from Tsurugi to JAIST” domain-independent knowledge: general knowledge that applies throughout our experience Example: “shuttle bus is a means of transport” Common sense: common knowledge about the world that is possessed by every schoolchild It is evident for human but not for machine Example: “Bird can fly” Introduction In order to make use of knowledge in AI and intelligent systems we need to get it from the source (knowledge acquisition) and represent it in a form usable by the machine Human knowledge is usually expressed through language, which cannot be accurately understood by machine The representation of knowledge in computer must therefore be both appropriate for the computer to use and allow easy and accurate encoding from the source Example of representing knowledge The “15 game”: two people A and B take turns selecting numbers from to without replacement The person who first has exactly three numbers in his collection that add up to 15 wins the game A 5; B A 5, 9; B 3, A 5, 9, 4; B 3, 1, A win!! (A selects 5; B selects 3) (A selects 9: B chooses to prevent A from achieving 15) (A selects 4; B chooses to block A) (A selects and wins with 4+5+6 = 15) Example of representing knowledge A choosing is equivalent to putting A’s marker in the ticktack-toe board Use tick-tack-toe representation for the “15 game” A 5; B A 5, 9; B 3, A 5, 9, 4; B 3, 1, A win!! A B A A B B B A A B A B B A A A B A B Aspects of representation languages The syntax describes the possible configurations that can constitute sentences External representation: how sentences are represented on the printed page Internal representation: the real representation inside the computer The semantics determines the fact in the world to which the sentences refer Without semantics, a sentence is just an arrangement of electrons or a collection of marks on a page Metrics for assessing knowledge representation schemes Expressiveness Handle different types and levels of knowledge Effectiveness (効果) Effectiveness is doing the right thing Efficiency (能率) Efficiency is doing the thing right Explicitness Be able to provide an explanation of its inferences Outline of chapter Introduction Logic representation 2.1 2.2 Propositional logic Predicate logic Inference rules Semantics networks Frames and Scripts Decision trees 10 Case frames A semantic network using a token expression: “Taro studied English in his room on April 1st” study agent taro time EVEN T object English April 1st location his room 36 Semantics networks expressiveness: The levels of the hierarchy provide a mechanism for representing general and specific knowledge The representation is a model of human memory, and it is therefore relatively understandable effectiveness: they support inference through property inheritance efficiency: they reduce the size of the knowledge base and help maintain consistency in the knowledge base explicitness: reasoning equates to following paths through the network, so the relationships and inference are explicit in the network links 37 Outline of chapter Introduction Logic representation Inference rules Semantics networks Frames and Scripts Frames Scripts Decision trees 38 Frames Proposed by M Minsky: when we look at, listen to, or think about something, we so within a certain general framework When we focus on one particular idea or object, there is often a frame (its internal structure) corresponding to the idea, which is a structure made up of slots that contain each constituent element of the idea 39 Frames name: instructor specialization of: teacher name: unit(last name, first name) age: unit(year) address: ADDRESS department: range (engineering, science, literature, law) subject: range (information science, computer, …) salary: SALARY date started: unit(year, month) Slots name: student specialization of: young person name: unit(last name, first name) age: unit(year) address: ADDRESS home address: ADDRESS department: range(engineering, science, literature, law) subject: range(information science, computer, …) date entered: unit(year, month) Slot content 40 Connection between frames teach frame young people frame instructure frame name: SALARY monthly salary: unit(dollars) annual salary: unit(dollars) average monthly salary: unit(dollars), compute(AVE-M) tax amount: unit(dollars), compute(TAX) student frame ADDRESS SALARY the system will the calculation at the frames called AVE-M and TAX and return the results 41 Frames expressiveness: they allow representation of structured knowledge and procedural knowledge effectiveness: actions or operations can be associated with a slot and performed efficiency: they allow more complex knowledge to be captured efficiently explicitness: the additional structure makes the relative importance of particular objects and concepts explicit 42 get out of the bed Scripts location: bed room action: make bed open the window go to the door open the door and get out go to the Bathroom France wash one’s face Scripts describe knowledge about chronological flow location: bath room action: enter the bath room use the tooth brush wash one’s face comb one’s hair get out of the bath room eat breakfast This script for getting up in the morning and eating breakfast location: kitchen action: folk blankets unlock the window key hold the window handle pull the handle walk hold the door knob turn the knob push the door open the door, turn on the tap, wipe your face by hand shave dry your face bath room washstand mirror light tap sink tooth cleaning set shaving water comes out when you turn on the water water stops when you turn off the water water stays in when you close the drain water goes away when you open the drain tooth brush tooth paste 43 Overview Introduction Logic representation Inference rules Semantics networks Frames and Scripts Decision trees 44 Decision Trees Decision Tree is a classifier in the form of a tree structure that is either: a leaf, indicating a class of instances, or a decision node that specifies some test to be carried out on a single attribute value, with one branch and subtree for each possible outcome of the test A decision tree can be used to classify an instance by starting at the root of the tree and moving through it until a leaf is met 45 Data of London Stock Market Major factors affecting the stock market: - What it did yesterday - Bank interest rate - What the New York market is doing today - Unemployment rate - England is losing Decision to make: The London market will rise today? Instance No (previous days) It rises today It rose yesterday NY rises today Bank rate high Unemployment high England is losing Y Y N Y Y Y Y N N N Y Y N Y N Y N Y N N N N N Y N N N Y N Y ? Y Y Y N N Y Y Y Y N N 46 Decision Trees Is unemployment high? YES The London market will rise today {2, 3} decision node NO Is the New York market rising today ? YES The London market will rise today {1} NO The London market will not rise today {4, 5, 6} leaf node 47 Semantic Network Is a Boy Is a School Joe Is a Woman Has a child Goes to Is a Owns a Sam Silver Mercedes Benz Food Is a Is a Work for MF Verdy Plays Is a Color Is a Man Married to Car Needs Kay Has a child Human Being Is member of Made in Germany Soccer Is a League Sport 48 Example of Frames Automobile Frame Class of: Transportation Name of manufacturer: Audi Origin of manufacturer: Germany Model: 5000 Turbo Type of car: Sedan Weight (kg): 1500 Wheelbase (inches): 105.8 Number of door: (default) Transmission: 3-speed automatic Number of wheels: (default) Engine: (Reference Engine Frame) - Type: In-line, overhead cam - Number of cylinders: Acceleration: (procedural attachment) - 0-60: 10.4 seconds - Quarter mile: 17.1 seconds, 85 mph Gas mileage: 22 mpg average (procedural attachment) Engine Frame Cylinder bore: 3.19 inches Cylinder stroke: 3.4 inches Compression ratio: 7.8 to Fuel system: Injection with turbo Horsepower: 140 hp Torque: 160 ft/LB 49 Hierarchy of Frames Frame A Attribute Is-a If needed In relationship In equation Name Unit cap Measured … Is-a Total capacity … Is-a hierarchy (frames are linked in a certain way) Machine N Capacity X Name Frame B Resource Name Product Frame C Mach Prod Cap Mach-Prod-Cap Demon: Active rule # 36 If added Frame D Name Capacity usage equation Form c P c ij i j i Rule #36 IF capacity required > 25 THEN a second machine is needed In relationships Name Product Capacity required for a unit product Danish Mixer cookie … … 10 Frame E 50 ...Outline of chapter Introduction Representing knowledge Metrics for assessing knowledge representation schemes Logic representation Inference rules Semantics networks... machine The representation of knowledge in computer must therefore be both appropriate for the computer to use and allow easy and accurate encoding from the source Example of representing knowledge. .. which thing has that property (x)[P(x) Q(x)] expresses the fact that everything in a certain class has a certain property without saying what everything in that class is 18 Semantics in logic