0% found this document useful (0 votes)
18 views

ITS662 Chapter 2 - Knowledge Engineering

Uploaded by

Nurul Syafiqah
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

ITS662 Chapter 2 - Knowledge Engineering

Uploaded by

Nurul Syafiqah
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 41

CHAPTER 2:

KNOWLEDGE ENGINEERING
OUTLINES:
❑Introduction, or what is knowledge engineering?

❑Will an expert system work for my problem?

❑Will a fuzzy expert system work for my problem?

❑Will neural network work for my problem?


WHAT IS KNOWLEDGE ENGINEERING
In which we discuss how to pick the right tool for the job, build an intelligent system
and turn data into knowledge.
Davis’ law: “For every tool there is a task perfectly suited to it”.
But…
It would be too optimistic to assume that for every task there is a tool perfectly suited
to it.
PROCESS OF KNOWLEDGE ENGINEERING
Phase 1: Problem assessment

Phase 2: Data and knowledge acquisition

Phase 3: Development of a prototype system

Phase 4: Development of a complete system

Phase 5: Evaluation and revision of the system

Phase 6: Integration and maintenance of the system


PHASE 1: PROBLEM ASSESSMENT

Determine the Identify the main Specify the Determine the


problem’s participants in the project’s resources needed
characteristics. project. objectives. for building the
system.
Problem type Description
Diagnosis Inferring malfunctions of an object from its behaviour and

TYPICAL Selection
recommending solutions.
Recommending the best option from a list of possible

PROBLEM
alternatives.
Prediction Predicting the future behaviour of an object from its

ADDRESS BY
behaviour in the past.
Classification Assigning an object to one of the defined classes.

INTELLIGENT
Clustering Dividing a heterogeneous group of objects into
homogeneous subgroups.

SYSTEM
Optimisation Improving the quality of solutions until an optimal one is
found.
Control Governing the behaviour of an object to meet specified
requirements in real-time.
PHASE 2: DATA AND KNOWLEDGE ACQUISITION

Collect and analyze Make key concepts


data and of the system design
knowledge. more explicit.
ISSUES WITH DATA
Incompatible data Inconsistent data Missing data

• Often the data we want to analyse • Often the same facts are represented • Actual data records often contain
store text in EBCDIC coding and differently in different databases. blank fields.
numbers in packed decimal format, • If these differences are not spotted • We normally we would attempt to
while the tools we want to use for and resolved in time, we might find infer some useful information from
building intelligent systems store text ourselves, for example, analysing them.
in the ASCII code and numbers as consumption patterns of carbonated
integers with a single- or double- drinks using data that does not • In many cases, we can simply fill the
precision floating point. include Coca-Cola just because it was blank fields in with the most common
• This issue is normally resolved with stored in a separate database. or average values.
data transport tools that • In other cases, the fact that a
automatically produce the code for particular field has not been filled in
the required data transformation. might itself provide us with very
useful information.
• For example, in a job application
form, a blank field for a business
phone number might suggest that an
applicant is currently unemployed.
HOW DO WE APPROACH KNOWLEDGE ACQUISITION?

Then we study and analyse


Usually we start with the acquired knowledge and
reviewing documents and repeat the entire process
reading books, papers and again. Knowledge
manuals related to the acquisition is an inherently
problem domain. iterative process.

Once we become familiar


with the problem, we can
collect further knowledge
through interviewing the
domain expert.
PHASE 3: DEVELOPMENT OF PROTOTYPE SYSTEM

Choose a tool Transform data Design and Test the


for building an and represent implement a prototype with
intelligent knowledge. prototype test cases.
system. system.
WHAT IS PROTOYPE
A prototype system is defined as a small version of the final system.
It is designed to test how well we understand the problem − to make sure that
the problem-solving strategy, the tool selected for building a system, and
techniques for representing acquired data and knowledge are adequate to
the task.
It also provides us with an opportunity to persuade the sceptics and, in many
cases, to actively engage the domain expert in the system’s development.
WHAT IS A TEST CASE?
A test case is a problem successfully solved in the past for which input data
and an output solution are known.
During testing, the system is presented with the same input data and its
solution is compared with the original solution.
PHASE 4: DEVELOPMENT OF COMPLETE SYSTEM

Prepare a Collect Implement the


detailed design additional Develop the complete
for a full-scale data and user interface. system.
system. knowledge.
DEVELOPING FULL SCALE SYSTEM
The main work at this phase is often associated with adding data and
knowledge to the system.
If, for example, we develop a diagnostic system, we might need to
provide it with more rules for handling specific cases.
If we develop a prediction system, we might need to collect
additional historical examples to make predictions more accurate.
The development of an intelligent system is, in fact, an evolutionary
process. As the project proceeds and new data and knowledge are
collected and added to the system, its capability improves, and the
prototype gradually evolves into a final system.
PHASE 5: EVALUATION AND REVISION OF THE
SYSTEM

Evaluate the system Revise the system as


against the necessary.
performance criteria.

Intelligent systems, unlike conventional computer programs, are designed to solve problems that quite
often do not have clearly defined “right” and “wrong” solutions.
To evaluate an intelligent system is , in
fact, to assure that the system performs
the intended task to the user’s satisfaction.

A formal evaluation of the system is EVALUATION OF


normally accomplished with the test cases.
THE SYSTEM
The system’s performance is compared
against the performance criteria that
were agreed upon at the end of the
prototyping phase.
PHASE 6: INTEGRATION AND MAINTENANCE OF
THE SYSTEM

Make arrangements for Establish an effective


technology transfer. maintenance program.
Once the system is integrated in the working
environment, the knowledge engineer withdraws
from the project.

This leaves the system in the hands of its users.


WHO MAINTAINS
Thus, the organisation that uses the system should
have in-house expertise to maintain and modify
THE SYSTEM?
the system.

Intelligent systems are knowledge-based


systems, and because knowledge evolves over
time, we need to be able to modify the system.
Diagnostic expert systems are relatively easy to develop:
Most diagnostic problems have a finite list of possible
solutions,
Involve a rather limited amount of well-formalised knowledge,
and
Often take a human expert a short time (say, an hour) to
DIAGNOSTICS solve.

EXPERT SYSTEM
CASE STUDY 1: DIAGNOSTICS EXPERT SYSTEM
Section 1: System Start-up
Problem Action
1.1. System does not start • Check power cords (both ends).
• Check the power strip.
• Check screen brightness.
“I want to develop an • Check phonet connectors.
intelligent system that can • Check keyboard connectors.
• Check pins connectors.
help me to fix malfunctions
of my Mac computer. Will 1.2. System starts and then freezes • Restart the Mac.
• Unhook all SCSI devices and restart the Mac.
an expert system work for • Restart with the shift key down (turns off
this problem?” extensions).
• Remove all extensions and add them back one at a
time. Restart the Mac after each addition. If using
System 7.5 or higher, use Extensions Manager.
1.3. System starts with a Sad Mac • Start with Disk Tools and do a clean reinstall of the
system.
• Run Disk First Aid, MacCheck, or Norton’s Disk
Doctor.
• Start with Disk Tools, and if the hard drive icon
does not show up, call AV Repair.
1.4. System starts with wrong “music” • Check cables.
GENERAL RULE STRUCTURE
In each rule, we include a clause that identifies the current task:
Rule: 1
if task is ‘system start-up’
then ask problem
Rule: 2
if task is ‘system start-up’
and problem is ‘system does not start’
then ask ‘test power cords’
Rule: 3
if task is ‘system start-up’
and problem is ‘system does not start’
and ‘test power cords’ is ok
then ask ‘test the power strip’
Tools range from high-level programming
languages such as LISP, PROLOG, OPS, C and
Java, to expert system shells.

High-level programming languages offer a


HOW DO WE
greater flexibility, but they require high-level
programming skills. CHOOSE AN
Shells provide us with the built-in inference
EXPERT SYSTEM
engine, explanation facilities and the user
interface.
DEVELOPMENT
TOOL?
We do not need any programming skills to use a
shell – we enter rules in English in the shell’s
knowledge base.
HOW DO WE CHOOSE AN EXPERT SYSTEM SHELL?
An expert system is shell is a piece of software that contains the user interface,
a format for declarative knowledge in the knowledge base, and an inference
engine.

When selecting an expert system shell, we consider

how the shell represents knowledge (rules or frames);

what inference mechanism it uses (forward or backward chaining);

whether the shell supports inexact reasoning and if so, what technique it uses
(Bayesian reasoning, certainty factors or fuzzy logic);

whether the shell has an “open” architecture allowing access to external data
files and programs;

how the user will interact with the expert system (graphical user interface,
hypertext).
KNOWLEDGE
REPRESENTATION
KNOWLEDGE

• A statement that relates a • A rule that describes a • Is a rule of thumb based on


certain element of truth sequence of relations years of experience.
about a subject matter or a relative to the domain • Example:
domain • Example: • If a person drives no more
• Example: • If the gas gauge shows • than 5 miles above the
• milk is white • quarter-full or less, • speed limit, then that
• the sun rises in the east • then look for a gasoline • person is not likely to be
• and sets in the west • station • stopped for speeding.

Facts Procedural Heuristic


rules
KNOWLEDGE
CATEGORIES
KNOWLEDGE CATEGORIES
CATEGORY TASK

Procedural Rules, Strategies, Agendas


Declarative Concepts, Objects, Facts
Knowledge about other types of
Meta-Knowledge
knowledge & how to use them.
“Compiled Knowledge” @ rules of
Heuristic
thumb
Structural Rules sets, Concept of relationships
KNOWLEDGE CATEGORIES: EXAMPLE
Procedural knowledge
• to boil an egg we must do… then…

Declarative knowledge
• my room no. is 2079

Meta-knowledge
• if you want to know about heart attack, please read this book

Heuristic knowledge
• the clouds looks dark and heavy, … heavy rain might fall…

Structural Knowledge
• a cat has four legs
KNOWLEDGE HIERARCHY
Noise: unwanted elements in communication that
can influence the judgment
Data: numeric/alphanumeric string that by
Meta-Knowledge themselves do not have any meaning
Information: data organized so that it is
Knowledge meaningful to the person receiving it
Information Knowledge:
 A collection of information that have been organized
and analyzed to make it understandable and
Data applicable to problem solving
 consists of symbols, relationship between them and
rules or procedures for manipulating them
Noise
Meta-knowledge: knowledge about other
knowledge
KNOWLEDGE HIERARCHY: EXAMPLES
What is Knowledge?
Consist of symbols, the relationships between them and rules or procedures for manipulating them.
It is a collection of information that have been organized and analyze to make it understandable and
applicable to problem solving.

Data Information Knowledge


30,000 RM30,000 The Mercedes car is
cheap
12 12 years old Too young to work
Green Green apple The apple is sour
SOURCE OF KNOWLEDGE
Documented
• Examples: printed &
electronic media

Not documented
• Example: experience,
observation
KNOWLEDGE
REPRESENTATION: DEFINITION
Knowledge representation is a science of translating
actual knowledge into a format that can be used by
the computer.
Knowledge Representation is the way that
knowledge is stored in a program
 This implies that there is a systematic way to store the
information
 It also implies that the knowledge is coded into the program
KNOWLEDGE REPRESENTATION: METHODS
 Capture the essential features of a problem domain and make that information
accessible to a problem-solving procedures.
 Provide a natural framework for expressing problem-solving knowledge where it
should make that knowledge available to the computer and assist the programmer
in its organization.
 3 categories:
 Object – Object-Attribute-Value (OAV)
 Rules
 Logic
OBJECT-ATTRIBUTE-VALUE
(OAV)
Refer to particular properties value of object
 Eg: The ball’s color is red (assign red to the ball’s color)
 The object can be physical (eg: car, books) or abstract (eg:
love, hobby).
 The value can be numerical, string or Boolean!.
 It could be either single or multi valued from different
attributes and objects.
OBJECT-ATTRIBUTE-VALUE (OAV)
Fact :=: “The chair’s color is red and priced at RM 35.00 ”
Fact :=: “I have a brother named Johnny. The 8 years-old brother likes to play
tennis and football.”
RULE
Rule is a knowledge structure that relates some known information to other
information and that can be concluded or inferred to be known.
Is a form of procedural knowledge → associates given information to some action.
Structure → connects antecedents (premises) and consequents (conclusions).
Statement “IF” → antecedent and “THEN” → consequent

IF <antecedent> THEN <consequent>

IF thirsty THEN drink_a_water


RULES: EXAMPLE
Example: Diagnosing strep throat (knowledge base)

Rule 1:
IF x has a sore throat
AND suspect bacterial infection
THEN patient has strep throat
Rule 2:
IF x temperature is > 37 c
THEN x has a fever
Rule 3:
IF x has been sick > a month
AND x has a fever
THEN suspect bacterial infection
LOGIC
❑The oldest representation existed.
❑Often referred to propositional logic and predicate calculus.
❑Formed well-founded approach to knowledge presentation and reasoning.
❑Implemented using PROLOG programming language.
❑Main structure → more than one atomic word (the smallest semantic meaning.
❑Eg: The ball color is blue => “ball_color_blue”
❑Manipulate basic Boolean logic operations (AND, OR, NOT, IMPLIES,
EQUIVALENCE.)
❑Example:
❑Normal :“Today is raining, therefore I will miss the class”
❑Logic : today_raining → i_will_miss_class
LOGIC: LOGICAL OPERATOR
GENERAL NAME FORMAL NAME SYMBOLS
Not Negation 
And Conjunction 
Or Disjunction 
If… Then/Implies Conditional →
If and only if Biconditional 
LOGIC: EXAMPLES
Propositional Logic – Example
 Example 1:
 Normal: The sky is blue and windy. It is really great for picnic
 Logic: sky_blue  windy → great_for_picnic
 Example 2:
 Normal: If the weather is cloudy, then it will be raining. If it is raining, people will stay at
home.
 Logic: (weather_cloudy → raining)  (raining → people_stay_home).
 Example 3:
 Normal: I will rather stay if and only if it is raining.
 Logic: i_will_stay  raining

You might also like