You are on page 1of 53

KNOWLEDGE-BASED SYSTEM

DEVELOPMENT
Outline
 ES components
 Participants of ES development
 Tools and techniques
 Discussion on existing ES
 Knowledge engineering phases
ES Components
Interface
Expert System

Knowledge base
(Domain knowledge)

User
Inference engine
(Case Facts
Conclusions)

Working memory
(Case/Inferred facts
Conclusions)
ES Components
 Knowledge base
 Definition: Part of an ES that contains the domain
knowledge.
 The key bottleneck in developing ES.
 Contain everything necessary for understanding, formulating
and solving a problem.
 Contain facts and heuristics.
 The most popular approach to representing domain
knowledge is using production rules.
ES Components
 Knowledge base (example)

[rule1] ::
if physician_knows_patient_
has_meningitis
or suspect_meningitis
then infection_is_meningitis.

[rule2] ::
if suspect_meningitis_from_
test_results
or suspect_meningitis_from_
symptoms
then
suspect_meningitis.
ES Components
 Working memory
 Definition: Part of an ES that contains the problem facts that
are discovered during the session.
 The engine matches this info with the knowledge contained
in the system’s knowledge base to inference new facts or
conclusion.
 The info is either supplied by the user or by the system.
ES Components
 Working memory - example

PHYSICIAN_KNOWS_PATIENT
_HAS_MENINGITIS/NO

TESTS_WERE_RUN/YES
CULTURES_WERE_SEEN/YES

APPEARANCE_OF_THE_CULT
UER_IS_COCCUS/YES

STAIN_OF_THE_CULTUER_IS
_GRAMPOS/YES
ES Components
 Inference engine
 Definition: Processor in an ES that matches the facts
contained in the working memory with the domain
knowledge contained in the knowledge base, to draw
conclusions about the problem.
ES Components
 Inference engine
 Knowledge processor which is modeled after the expert
reasoning process.
 Work with facts contained in the working memory and
knowledge contained in the knowledge base - to draw
conclusion.
 When finds a match, it adds the rule’s conclusion to the
working memory and continues to scan the rules looking for
new matches.
ES Components
Final
 Inference engine Conclusion
[rule1] ::
if physician_knows_patient_
has_meningitis
or suspect_meningitis Matching
then
infection_is_meningitis. Firing
new fact or
[rule2] ::
if suspect_meningitis_from_
conclusion
test_results
or suspect_meningitis_from_
symptoms Acquiring
then Retrieving
suspect_meningitis. PHYSICIAN_KNOWS_PATIENT
_HAS_MENINGITIS/NO
Knowledge base TESTS_WERE_RUN/YES
CULTURES_WERE_SEEN/YES

APPEARANCE_OF_THE_CULT
UER_IS_COCCUS/YES

STAIN_OF_THE_CULTUER_IS_
GRAMPOS/YES

Working Memory
ES Components
 User interface

 A medium for a user to


communicate with the
system.
 Allow users to submit
queries, supply
information and receive
feedback.
ES Components
 User interface - Example
ES Components
 Explanation facility

 Is an integral part of an ES.


 A trademark of ES – ability to explain their reasoning.

Provide an explanation to the user about “WHY” it is
asking a question and “HOW” it reached some

??
conclusion.
ES Components
 Explanation facility - “WHY”

 Explain why ES ask a certain question to user.


 The explanation
 make user feel more comfortable
 provide insight into what issues the expert believes are important.
ES Components
 Explanation facility - “WHY”

 When “why” is asked – ES respond by describing what they


might conclude from the answer.
 Most ES respond by displaying the rule it is currently
pursuing.
ES Components
 Explanation facility - “WHY”
Rule1:
Rule 1:
 Example: IFThe
IF Thecar
carwill
willnot
notstart
start
THENThe
THEN Theproblem
problemmaymaybebein
inthe
theelectrical
electricalsystem
system

EXPERT: Will the car not start?


PERSON: WHY?
Expert: “If I know that the car won’t start, then I usually assume the
problem is in the electrical system.”
ES Components
 Explanation facility – “WHY”
ES Components
 Explanation facility - “HOW”

 Explain how does ES derive a certain conclusion.


 Very important in an ES – for the validity of ES results.
 User will be more confident – if the rationale behind the
recommendation is explained.
ES Components
 Explanation facility - “HOW”

 Follows the reasoning process used by the human expert.


 ES respond by tracking back through the rules that
established the conclusion – a map of the system’s line of
reasoning.
ES Components
 Explanation facility - “HOW”
Rule1:1:
Rule
IFIFThe
Thecar
carwill
willnot
notstart
start
 Example: THENThe
THEN Theproblem
problemmaymaybebeininthe
theelectrical
electricalsystem
system

Rule2:2:
Rule
IFIFThe
Theproblem
problemmaymaybe beininthe
theelectrical
electricalsystem
system
ANDThe
AND Thebattery
batteryvoltage
voltageisisbelow
below10
10volts
volts
THENThe
THEN Thefault
faultisisbad
badbattery
battery

EXPERT: The battery is bad.


PERSON: HOW?
Expert: “Since your car won’t start, I assumed there was a
problem with the electrical system. Once I found the battery
voltage was below 10 volts, I knew the batter was bad.”
ES Components
 Explanation facility – How?
Participants in the development team
Expert System
Development Team
Project Manager

Domain Expert Knowledge Engineer Programmer

Expert System

End-user

Negnevitsky, 2010
Development Team

 The main players are


 Domain expert
 Knowledge engineer
 End user
 Each plays a key role in
the ES development.
Development Team

 Domain Expert
 Definition: A person who posses the
skill and knowledge to solve a
specific problem in a manner
superior to others.
 Provides knowledge and problem-
solving strategies (expertise).
Development Team

• Domain Expert
▫ Has expertise in a certain area
▫ Has knowledge or special skills
that are not known or available
to most people.
▫ Can solve problems that most
people cannot solve or can
solve them much efficiently.
Development Team

 Domain Expert - Qualifications


 Has expert knowledge
 Has efficient problem-solving skills
 Can communicate the knowledge
 Can devote time
 Is not hostile
Human Expert Problem Solving

 Human Expert
 Expert stores domain knowledge in
his long-term memory (LTM).

 New facts stores in short-term


memory (STM).
Who is an Expert?  Human expert problem
solving

Making Long-term memory


Advice (knowledge)
conclusion

Reasoning combine

Patient
Short-term memory
Obtains (facts)
facts Expert

Stores
facts
Human Expert Problem Solving

Human Expert

Long-Term Memory
Domain Knowledge
Advisee
Reasoning Case Facts
Conclusions
Short-Term Memory
Case/Inferred Facts
Conclusion
Development Team

 Knowledge Engineer
 Definition: A person who designs,
builds, and tests an expert system.
 Primary responsibilities are to
acquire, process, and encode
knowledge.
Development Team

 Knowledge Engineer - major


responsibilities
 Problem assessment
 Interviewing the expert
 Concept identification
 Knowledge organization
 Problem-solving method identification
 Choosing the software
 Coding the system
 Testing the system
 Revising the system
 Integrating the system into workplace
 Maintaining the system
Development Team

 Knowledge Engineer -
Qualifications
 Has knowledge engineering skills
 Has good communication skills
 Can match problem to software
 Has expert system programming
skills
Development Team

 End-user
 The individual who will eventually
be working with the system.
 Can be a naïve user or an expert
himself.
 Final acceptance of the system –
depend to the degree on how well
the system meets the needs of the
end-user.
 History: ES technical success 
user’s need were not considered 
ES failure
Development Team

 End-user – qualifications
 Can help define interface
specifications
 Can aid in knowledge acquisition
 Can aid in system development
ES Tools
 Programming languages
 Development from scratch.
 LISP, PROLOG, Smalltalk, Java, Python.
 ES Shell
 CLIPs, Crystal, VP-Expert, Kappa-PC, EXSYS
Professional etc.
 AI environment toolkit
 LPA Flex
Well Known ES
 MYCIN
 Was developed at Stanford University to aid physicians in
diagnosing and treating patients with infectious blood diseases
caused by bacteremia (bacteria in the blood) and meningitis
(bacterial disease that causes inflammation of the membrane
surrounding the brain and spinal cord).
 Developed during the mid-1970s and took approximately 20
person-years to complete.
Well Known ES
 MYCIN
 A benchmark for today’s rule-based ES.
 Uses backward chaining.
 Incorporates approximately 500 rules.
 Written in INTERLISP (a dialect of the LISP).
Well Known ES
 MYCIN - Major features
 Utilizes a backward-chaining system
 Separates knowledge from control
 Incorporates meta-rules
 Employs inexact reasoning
 Remembers prior session
 Accommodates the user
 Natural language interaction
 Spelling checker
 Provides explanations
 Provides alternative recommendations
Knowledge Engineering

Main steps in ES development


(Padhy, 2006):
Statement of the problem to be
solved
Search for knowledge source.
Design of the ES
Selection of the degree of
participation of the user
Selection of the development
tool
Development of a prototype
Prototype checking
Refinement and generalization
Maintenance
S. van der Elst and M. van Tooren Updating
Knowledge Engineering

Problem Assessment

The acquisition of knowledge Knowledge Acquisition


from human expert or any & Analysis

exploration
reformulation
other sources.

modification
Design & Implementation
Definition: The process of
building an Expert System. Testing
Consists of 6 phases (Durkin,
1994). Documentation

Maintenance
Knowledge Engineering
 Phase 1 – Assessment
 To determine the feasibility and
justification of the problem.
 To define the overall goals of the
project, important features, and scope.
 Establishes the
 needed resources (including personnel),
 sources of needed knowledge –
experts, reports
 To define the principal project requirements.
Typical problems addressed by intelligent systems
(Assessment)
Problem type Description
Diagnosis Inferring malfunctions of an object from its behaviour and
recommending solutions.
Selection Recommending the best option from a list of possible
alternatives.
Prediction Predicting the future behaviour of an object from its
behaviour in the past.
Classification Assigning an object to one of the defined classes.
Clustering Dividing a heterogeneous group of objects into
homogeneous subgroups.
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.
Knowledge Engineering
 Phase 2 – Knowledge Acquisition
 Is a process of acquiring knowledge from expert – formally
known as knowledge acquisition.
 Definition: the process of acquiring, organizing, and studying
knowledge.
 Objective – to acquire the knowledge on the
problem.
Knowledge Engineering
 Phase 2 – Knowledge
Acquisition
 The knowledge provide
insight into the
 Problem
 Material for the design of the
expert system.
 Involves meetings with
expert.
Knowledge Engineering
 Phase 3 – Design
 Defined
 overall structure and organization of the system’s knowledge.
 method for processing the knowledge.
 Choose software tool – that can represent and reason with the
system’s knowledge.
 Build initial prototype
 to provide a vehicle for obtaining a better understanding of the
problem
 Serves as the focal point for further interviews/discussion with the
expert.
Knowledge Engineering
 Phase 4 – Testing
 A continual process throughout the project.
 Objective – to validate the overall structure of the system and
its knowledge.
 Study the users acceptability – both expert and end user.
Knowledge Engineering
 Phase 5 – Documentation
 The need to compile all of the project’s information into a
document - can meet the requirements of both the user and
developer of ES.
 Explains how to operate the system, tutorial on the major
operational features.
 Contain knowledge dictionary – provides well-organized
presentation of the system’s knowledge and problem-solving
procedures.
Knowledge Engineering
 Phase 6 – Maintenance
 Periodical maintenance
 to refine/update the ES knowledge
 reformulation of system specifications
Programming vs. ES Development

Major differences between conventional


programming and ES development.
Conventional Expert System
Programming Development
Development Focus on solution Focus on problem
Focus
Programming Programmer works Team effort
Effort alone
Program Sequential development Iterative development
Development
Errors in ES Development
 Major Errors
 Expert’s knowledge errors – supplied wrong knowledge
 Semantics errors – the meaning of the knowledge is not properly
communicated – human expert misinterprets engineer’s question, pr answer
inappropriately.
 Syntax errors – incorrect form of a rule or fact is entered.
 Inference engine errors – contains bugs.
 Inference chain errors – caused by erroneous knowledge, semantic errors,
inference engine bugs, incorrect specification of rule priorities, and unplanned
interactions between rules.
Conclusion..
 https://www.youtube.com/watch?v=Df6Z25a4OVo&list=
PLAamvX7fP-kIQ_j8wqo9dRMmEr9PciCNx&index=2
 https://www.youtube.com/watch?v=eni5JxRYtZM&index
=3&list=PLAamvX7fP-kIQ_j8wqo9dRMmEr9PciCNx
Preparing the proposal
 Proposal requirement/format:
 Introduction/project overview (domain)
 Problem statement
 Objective (at least one)
 Scope
 Literature review (min 10).
 Significant (in one paragraph)
 References

You might also like