Presentation is loading. Please wait.

Presentation is loading. Please wait.

Assignments An Exercise in Building a KBS. Assignments  Goals: Exercise in the building of a simple KBS  Implementation of a simple knowledge base 

Similar presentations


Presentation on theme: "Assignments An Exercise in Building a KBS. Assignments  Goals: Exercise in the building of a simple KBS  Implementation of a simple knowledge base "— Presentation transcript:

1 Assignments An Exercise in Building a KBS

2 Assignments  Goals: Exercise in the building of a simple KBS  Implementation of a simple knowledge base  Implementation of a simple inference mechanism  Implementation of a simple user interface  Focus: initial steps to build a KBS  choosing a KR methodology defining & creating a knowledge base (KB)  facts and rules, semantic network, frames define tasks in the domain implement inference (search,backward/forward chaining, inheritance)

3 List of Assignments  Diagnosis Diagnose faults in a PC based on observed malfunctions Diagnose faults in a car/bike based on observed malfunctions  Prognosis Predict weather conditions based on observations and recorded patterns Predict stock market prices based on observations and recorded patters  Configuration Construct PC/car/bike configuration for clients based on preferences/constraints

4 List of Assignments  Recommendation Systems Recommend an MSc course to graduate students based on their preferences and capabilities Recommend job opportunities to graduate students based on their preferences and capabilities Recommend investments to clients based on their status (financial etc.) and needs, and on the market trends Recommend package holidays to clients based on their status and preferences

5 List of Assignments  Classification & Taxonomic Organization Build and reason with a taxonomy (classification) of vehicles  Recommendation to users based on needs (optionally) Build and reason with a taxonomy (classification) of art items Build and reason with a taxonomy (classification) of pieces of music Etc.

6 List of Assignments  You can also propose any assignment you can think of After a discussion with me  E.g. Earthquake forecasting (prognosis)

7 Diagnosis  Implementation of simple system that can diagnose faults in a PC based on observed malfunctions  The system could take as input facts describing malfunctions and return a description of the possible fault(s) Forward chaining  Or it could take as input a possible fault and decide if the system suffers from it or not Backward chaining

8 Diagnosis  Build a rule base using either: A pseudo formal language (simple syntax must be defined) Prolog  Implement a simple inference engine for your domain Forward chaining Backward chaining General search algorithms/heuristics  Some pattern matching code will be necessary

9 Diagnosis  Examples of rules If antivirus program does not start and it is installed then computer is infected with virus or license has expired If computer cannot boot then there is a disk error If cannot connect to internet then modem is faulty or phone line is down  Rules can stored in a text file in some convenient syntax and structure

10 Diagnosis  The working memory will contain the facts entered by the user Computer does not boot MS Word does not start Disk boot error message appears Antivirus is installed Phone line is OK Etc.  Or the query about a possible fault Is the CD-writer problematic?

11 Diagnosis  These facts/queries must be given in a convenient syntax as well  The working memory can be implemented as a (simple) data structure a list, a queue, a stack, etc.  You can read all rules in memory and also store them in a (simple) data structure But they must exist in a file (not hardwired in the program code!)

12 Diagnosis  If you use backward/forward chaining, at least two cycles must be executed for some task (not all of them necessarily)! It is not OK if no facts are added or removed from working memory ever It is not OK if all queries are answered by doing a match with a single rule and firing a single rule  This is a requirement in all assignments! Assuming a rule-based KBS is implemented

13 Diagnosis - Deliverables  A text file containing the KB with the rules (and possibly some facts)  A text file containing the task/query definitions that you tried  A report explaining how your inference engine works, what have you done, why, and how queries are answered by your program  And of course… The source code and executable files

14 Diagnosis - Deliverables  This assignment is for 1 student Prolog (SWI or WIN-PROLOG/FLEX) or CLIPS or JAVA can be used  Any other assignment from the diagnosis domain has similar requirements

15 Prognosis  Implementation of simple system that can predict weather conditions or earthquake event or volcano eruption based on observations and recorded patterns  The system could take as input facts describing e.g. the weather and return a prediction of the weather for the next days Forward chaining  Or it could take as input a possible weather condition and decide if it will occur (e.g. will it rain?) Backward chaining

16 Prognosis  Build a rule base using either: A pseudo formal language (simple syntax must be defined) Prolog  Implement a simple inference engine for your domain Forward chaining Backward chaining General search algorithms/heuristics  Some pattern matching code will be necessary

17 Prognosis  Examples of rules If it is hot and humid then it will rain If sunny and summer then temperature>30 If rain for past 5 days then will stop raining or rain for next 5 days  Rules can be stored in a text file in some convenient syntax and structure

18 Prognosis  The working memory will contain the facts entered by the user Rain for past 5 days Winter Cloudy Clouds from Southeast approaching Yesterday’s temperature=21 Etc.  Or the query about a possible fault Will it rain tomorrow?

19 Prognosis  These facts/queries must be given in a convenient syntax as well  The working memory can be implemented as a (simple) data structure a list, a queue, a stack, etc.  You can read all rules in memory and also store them in a (simple) data structure But they must exist in a file (not hardwired in the program code!)

20 Prognosis  If you use backward/forward chaining, at least two cycles must be executed for some task (not all of them necessarily)! It is not OK if no facts are added or removed from working memory ever It is not OK if all queries are answered by doing a match with a single rule and firing a single rule  This is requirement in all assignments! Assuming a rule-based KBS is implemented

21 Prognosis - Deliverables  A text file containing the KB with the rules (and possibly some facts)  A text file containing the task/query definitions that you tried  A report explaining how your inference engine works, what have you done, why, and how queries are answered by your program  And of course… The source code and executable files

22 Prognosis - Deliverables  This assignment is for 1 student Prolog (SWI or WIN-PROLOG/FLEX) or CLIPS or JAVA can be used  Any other assignment from the prognosis domain has similar requirements

23 Classification & Taxonomic Organization  Implementation of a simple system in the domain of vehicle classification and (optionally) recommendation  The system should be able to conduct a simple dialogue with clients i.e. answer simple queries and perform simple tasks posted by a client

24 Classification & Taxonomic Organization  draw a semantic network or frame network (or ontology) for your domain use inheritance - 'subtype' object hierarchy (taxonomy) use frames or entities/relations to describe concepts and their attributes  Nodes or Frames Vehicles and vehicle parts (cars, bikes, trucks, engines, etc.)  Features (links & attributes or slots) size, width, max speed, acceleration, max number of passengers, max capacity, etc.

25 Classification & Taxonomic Organization  Transform the semantic (or frames) network diagram into a knowledge base (KB) using either: facts & rules a direct approach (hierarchies) Prolog  If you don’t use Prolog you have to use a pseudo formal language define the syntax of frames (nodes/links) or rules/facts

26 Classification & Taxonomic Organization  Define list of basic tasks/queries  Use pseudo formal language (define syntax) or Prolog operations on vehicle items in the KB  Insert a new category or specific vehicle client queries  Does a BMW 320i have a sunroof Recommendation tasks (optional)  User enters a set of requirements and the system proposes a vehicle

27 Classification & Taxonomic Organization  Examples: add new vehicle item in the KB specify basic properties answer queries about a vehicle item Depending on the KR method you choose you can also define more complex tasks, such as:  'explain' procedure that describes to a user certain vehicles  'profile' procedure that defines what the user looks for  'recognize' / match user's wishes with the vehicle types, etc.

28 Classification & Taxonomic Organization – If not Prolog then  Implement a simple inference engine for your domain  Depending on the KR framework you choose it may be based on Inheritance/graph navigation Forward chaining Backward chaining  Some pattern matching code will be necessary

29 Classification & Taxonomic Organization  You inference engine should be able to handle some (not necessarily all) of the tasks/queries you have defined You choose which ones If you use Prolog all tasks/queries must be implemented

30 Classification & Taxonomic Organization  Prepare a report containing explanations for: Semantic (frames) network KB pseudo (or Prolog) description in rules & facts language if used Tasks/queries you have defined The way your inference engine works Reflection on problems & interesting issues in this assignment

31 Classification & Taxonomic Organization - Deliverables  A semantic (frames) network diagram of the vehicle domain  A text file containing the vehicle KB with facts & rules or semantic (frames) network  A text file containing the task/query definitions  A report explaining how your inference engine works, what have you done, why, and how queries are answered by your program

32 Classification & Taxonomic Organization - Deliverables  And of course… The source code and executable files  This assignment is for 1 student using WIN-Prolog/FLEX or a Frames (or ontology) language/tool

33 Classification  Implementation of a simple KBS that will be able to classify pieces of music into genres Use frames  This assignment is for 1 student

34 Classification  draw a frame network for your domain use inheritance - 'subtype' object hierarchy (taxonomy) use frames to describe concepts and their attributes  Frames Pieces of music and genres (songs, pop, classical, dance, etc.)  Features (slots) artist, duration, date, producer, etc.

35 Classification  Features (slots) Write a daemon that will try to play the piece of music  Implement the KB directly as a network of frames  Implement an inference mechanism based on inheritance / graph navigation  Define a set of tasks/queries

36 Classification - Deliverables  A frames network diagram of the vehicle domain  A text file containing the vehicle KB with the frames network  A text file containing the task/query definitions  A report explaining how your inference engine works, what have you done, why, and how queries are answered by your program  Code/exe…

37 Recommendation Systems  Implementation of a simple system that will propose to a final year student potential MSc courses  The system should hold knowledge about various MSc courses Their prerequisites Their level of difficulty Tuition fees Other requirements Etc.

38 Recommendation Systems  A student should be able to enter his/hers profile Grades Courses takes Topic of final year project Languages spoken Etc. And the system should be able to propose MSc courses that fit the student’s profile

39 Recommendation Systems  Design and implement an MSc advisor rule-based system  Create a rule base using either A pseudo formal language (define syntax) Prolog  Knowledge about specific MSc courses can either be entered by the user each time the system is used or can be stored in the KB

40 Recommendation Systems  Examples of rules If student only speaks English then MSc course must be in English If topic of final year project is AI then student likes AI If student likes AI and has grade > 7 in AI course and has passed Algorithms & Data Structures then MSc course title should contain word AI If MSc course title should contain word AI and MSc course must be in English then MSc course in Edinburgh or MSc course in Imperial

41 Recommendation Systems  Implement a simple inference mechanism (or use any Prolog)  Deliverables are same as previous assignments Except the parts about semantic (frames networks)  This assignment is for 1 student

42 Recommendation Systems  Implementation of a simple system that will propose to a final year student potential job opportunities Similar as Assignment 5 Instead of MSc courses we have jobs All else similar

43 Configuration  Implementation of a simple system that will construct PC configurations for clients  A client should be able to enter his/hers preferences Cpu, RAM, HD, etc. Assume that clients are not knowledgeable And the system should be able to construct a PC configuration that fits the client’s needs and satisfies any relevant constraints

44 Configuration  Design and implement a PC configuration rule-based system  Create a rule base using either A pseudo formal language (define syntax) Prolog  Implement a simple inference mechanism (or use Prolog’s)

45 Configuration Systems  Examples of rules related to preferences If wants fast PC and low cost then 2MHz <Cpu<3MHz and 2Gb<RAM<1Gb If wants to play games then graphics controller is X or Y or Z If wants fast internet then provide ADSL  Examples of rules related to constraints If graphics controller is Y then sound controller is W If wants HP PC then cost>1500

46 Configuration  Deliverables are same as previous assignments  Instead of rules you can use constraint satisfaction if you want  This assignment is for 1 student


Download ppt "Assignments An Exercise in Building a KBS. Assignments  Goals: Exercise in the building of a simple KBS  Implementation of a simple knowledge base "

Similar presentations


Ads by Google