Chapter 6 - Expert Systems and Knowledge Acquisition
Chapter 6 - Expert Systems and Knowledge Acquisition
Chapter 6 - Expert Systems and Knowledge Acquisition
Goodall’s (1985) AI approach defines an expert system as a computer system that performs functions
similar to those normally performed by a human expert. He extends this definition to include the
nature of an expert system, in other words, he includes how ES behaves, in the technology approach:
“An expert system is a computer system that uses a representation of human
expertise in a specialist domain in order to perform functions similar to those
normally performed by a human expert in that domain”.
In formulating the above definition, Goodall (1985) focused on the implementation of two types of ES:
• ES performing at a suitable ‘high’ expert level, and
• ES that performs tasks which no human expert has, using perhaps a very complex set of rules
to control a chemical process at a speed and in circumstances (e.g. temperature, time, location)
which no human could possibly match. Such a system will most surely outperform the best
human expert.
107
University of Pretoria etd – De Kock, E (2003)
ES differs from conventional programs too. Raggad & Gargano (1999) and Turban et al (2001)
summarise the characteristics of conventional programs as follows:
• Conventional Computer Based Information Systems (CBIS) processes data and information
as a direct conceptual resource
• Conventional programs are based on algorithms or mathematical formulas and sequential
procedures that lead to a solution using data to solve problems
• The objective of CBIS is to create and efficient solution by designing an efficient algorithm
• CBIS are characterised by repetitive processing
• The processing system or control mechanism of the system and the knowledge of the subject
are intertwined as part of the sequence of instructions
• Knowledge of the subject is built into the processing mechanism or control of the system. The
subject knowledge or business rules form part of the sequence of instructions. All business
rules are part of the program code. The knowledge is stored as control embedded in the
program instructions. The control is the sequence in which the transactions are performed.
The programmer fixes these steps in advance. It is called the algorithm of the program.
• To change the business rules or domain knowledge a programmer needs to edit the program
and insert or change the statements that represent the information in the correct place
108
University of Pretoria etd – De Kock, E (2003)
• The program or system used does not explain which rules were used during processing of data
to produce the output
• The program is specialised to deal with specific information. A complete system of programs
and input are necessary to achieve something useful.
• One missing essential step causes the program(s) to malfunction. The data that are processed
should be complete and certain to achieve an appropriate result or valid output.
• Error detection of the domain knowledge is performed when executing the program and
noticing faulty output
• CBIS frequently uses algorithms in its search approach ,and
• CBIS has no reasoning capability except for a fixed process in the algorithm of the program,
and
• Updating and maintenance of data and information are usually difficult
109
University of Pretoria etd – De Kock, E (2003)
Goodall (1985) provides a comprehensive list of suitable types of tasks appropriate using ES in solving
problems that includes:
• Interpretation
• Prediction
• Diagnosis
• Debugging
• Design
• Planning
• Monitoring
• Instruction, and
• Control
110
University of Pretoria etd – De Kock, E (2003)
Turban et al (2001) calls the above-mentioned types the generic categories of Expert Systems. Most
ES systems will include one of the above problem areas as a dominant characteristic, but may include
some aspects of the others.
According to Goodall (1985), Mallach (1994), Turban (1995) and Turban et al (2001) the advantages
of using an expert system (a system with intelligent reasoning) above a conventional information
system (for example a system without intelligent reasoning) are:
• It improves the quality of the system. The program will function even with incomplete and
uncertain data from the very first time it executes previously non-programmable tasks. This is
an advantage in domains where knowledge changes frequently. It provides consistent advice
whilst reducing the error rate. More rules can be added to the existing knowledge as
knowledge about the domain increases.
• It can handle uncertainties expressed as probabilities. The way it is handled depends on the
inference engine of the particular ES.
• It explains the logic behind its recommendations, making the knowledge explicit
• It can be used as a training vehicle for users who lack the expertise
• It provides monetary savings once implemented. ES does not cost money when not being
used. Costs can be cut as the human expert’s availability is not needed all the time.
• Experts are freed enabling them to focus on tasks requiring their expertise
• It can codify and preserve knowledge of the specific problem domain. It offers a solution to
scarce expertise where few experts exist for a task or where the expert is about to retire or
leave the job.
• It increases programmer productivity. The author of the knowledge base will have access to
more advanced techniques and tools than the system’s eventual user. Separating the expert’s
knowledge into modular rules reduces the change of development errors and improves the
maintainability of the system.
• It can discover new knowledge
• It can provide increased output and productivity. ES works faster than humans do. Increased
outputs mean fewer workers and reduced costs. ES can be replicated as needed.
• It eliminates the need for expensive equipment used by human experts for monitoring and
control
• It makes knowledge and information accessible, and
111
University of Pretoria etd – De Kock, E (2003)
Mallach (1994), Turban (1995) and Turban et al (2001) give the drawbacks of ES as:
• The domain of expertise is usually narrow. An ES is designed for a specific purpose and is
not useful for another purpose.
• ES cannot apply common sense, only its rules
• Experts do not realise when they reach their limits. They may recommend inappropriate
actions. The experts’ performances “falls off a cliff” rather than degrade gradually.
• ES may be costly to develop because of the time of human experts and other people involved
in the process
• Knowledge is not always readily available
• Expertise is hard to extract from humans
• Lack of trust by end-users may be a barrier to ES use
• Knowledge transfer is subject to a host of perceptual and judgemental biases
• The work of rare and expensive knowledge engineers is required, and
• Most experts have independent means of checking whether their conclusions are reasonable
6.2 Architecture of ES
6.2.1 The process of ES
Transferring expertise from an expert to the computer and then to the user involves four activities:
knowledge acquisition, knowledge representation, knowledge inference and knowledge transfer
(Turban et al 2001). Knowledge is acquired from experts and other documented sources and then
represented or organised as rules or frames. These rules or frames are electronically stored as a body of
knowledge or a knowledge base. This knowledge base forms one of the distinct parts of an ES. The
112
University of Pretoria etd – De Kock, E (2003)
reasoning mechanism that draws conclusions from the knowledge attained in the knowledge base and
the knowledge obtained from the user forms the other distinct part of the ES. This reasoning
mechanism is known as the inference engine. The inference engine results in advice or
recommendations for novices. When understood by the novice, possibly by accessing the explanation
given by the ES, knowledge has been transferred to the user. Figure 2-6 (p21) shows the different
components of an ES and their interaction.
The user interface provides the conversation of the system with the user. It is responsible for posing
the questions to the user, reading the user’s reply and explaining the rules used to reach a conclusion.
A survey of typical ES suggested that on average (Goodall 1985):
• Eight percent of the code is used for the inference engine
• 22% of the code is used for setting the knowledge base, and
• 44% of the code is used conversing with the user
The explanation capability is one of the most important features of an ES and it realises in the user
interface. Turban et al (2001) views the explanation facility as a separate component of the ES that can
trace and explain the ES’ behaviour (See Figure 2-6: p21). The body of knowledge (also called the
knowledge base) and the inference engine, the reasoning mechanism of the ES, form the two
fundamental parts of the ES. These two subsystems provide the ES’ main functionality. The
knowledge base represents domain specific knowledge in a specific form. The inference engine
deduces facts or draws conclusions from the knowledge base based on the user input and the facts from
the knowledge base and/or other sources. The inference engine and the knowledge base exist as two
separate modules of the ES that work closely together.
113
University of Pretoria etd – De Kock, E (2003)
When allowing the user to use natural language in obtaining input, a misunderstanding could result
because of the ambiguous characteristic of natural language. The use of natural language in the
dialogue with the user relies on the meaning of the user’s utterances. The meaning of what exactly is
meant lies in examining the surrounding context and is prone to be misunderstood. The naïve user is
likely, by the system’s ability to read natural language, to be fooled into thinking that the ES absolutely
understands what he (the user) means. The best way to solve this problem is for the ES to generate all
possible interpretations of any sentence that could be ambiguous, feed it back to the user, and enquire
of the user which interpretation he (the user) really meant. The easiest way to understand the user is
not to allow conversation to be in any natural language, but rather via a predefined syntax, requesting
preformatted specific input. Questions posed to user and explanations of conclusions that are
reached can be given by taking the text provided by the author of the knowledge base and slotting it
into a few predefined sentence formats.
The methods of knowledge acquisition can be divided into manual, semi-automated and automated.
The primary manual approach is interviewing, ranging from completely unstructured to highly
structured interviews. Automated knowledge acquisition uses an induction system with case histories
and examples as input to derive the knowledge base. It eliminates the role of the knowledge engineer
and expert (Turban 1993). Automatic knowledge acquisition is also known as machine learning.
Knowledge collected must be analysed and coded prior to its representation in the computer.
Automated knowledge acquisition methods are easier to validate and verify. On average fewer
knowledge mistakes occur when acquiring knowledge from multiple experts because of the enhanced
114
University of Pretoria etd – De Kock, E (2003)
synergy among experts. Difficulties such as meeting time scheduling and resulting compromising
solutions in opinion conflicts may arise.
Knowledge representation is important and crucially affects the ease and speed with which the
inference engine can use it. Knowledge representation implies a systematic means of encoding what an
expert knows about a knowledge domain in an appropriate medium (Goodall 1985). A number of
knowledge acquisition techniques have been developed. Turban (1993) discussed a variety of
techniques. The selection of a technique depends on the types of knowledge that should be retained in
the knowledge base. Knowledge can be classified as surface knowledge, to put declarative and
procedural knowledge into heuristics to solve a problem quickly; or deep knowledge, which involves
fundamental knowledge of domain including the definition, axioms, general laws, principles and causal
relationships upheld by the knowledge. Surface knowledge is the basis for most common ES using
production rules. Production rules are widely used and quite efficient in diagnosis problems. They are
used to encode rules of thumb also called heuristics or knowledge used by humans (Turban 1995).
Knowledge can be formulated using formal theories or normative models.
Knowledge representation is the systematic means of encoding knowledge of the human expert in an
appropriate medium (Beynon-Davies 1991). Knowledge can be represented as:
• Predicate calculus or formal logic
• Business applications in the form of production rules
• Semantic networks, which organise knowledge through nodes in a graph rather than data
structure and represent relationships between the facts by links between the nodes, and
• Frames or structured objects that use data structures to store all structural knowledge of a
specific object in one place
Logic itself is not a way for computers to store knowledge, but proves to be a vital tool to think about
how computers store knowledge. Logic is part of mathematics and can be used in various forms to
reason about the correctness of computational representation and inference (Goodall 1985). The forms
of logic include:
• Programming languages such as PROLOG (programming in Logic)
• Pro-positional logic or calculus that consist of building blocks such as elementary sentences,
joined by ‘and’, ‘or’ and ‘not’. The internal structure of the elementary sentence is irrelevant.
, and
• Predicate logic with its basic building block objects and relations such as “is-a” and “has-a”
between them to build statements. The relations is called predicates and deals with the logical
operators “and”, “or” and “not”.
The above provide a theory to formalise the study of reasoning, determining valid knowledge
representations. It is used to prove the correctness or determine that certain types of inference are
correct or incorrect.
115
University of Pretoria etd – De Kock, E (2003)
Rules are often called production rules and the program that reasons with rules a production system,
especially when the inference is data-directed forward chaining. Most ES represent knowledge as rules
and therefore the knowledge base is often referred to as the rule base. The reason for its popularity is
that almost every piece of knowledge can be written as a rule. Many ES exist that requires rules as
input and tempts knowledge workers to express knowledge as such. Rules are natural and the only way
to codify some knowledge. Rules are a simulation of the cognitive behaviour of human experts. It
represents knowledge, but also represents a model of actual human behaviour. Rules are easy for a
human expert to read, understand and maintain. If the knowledge is expressed as data and not encoded
in the program’s control mechanism, it can be returned to the user in the form of explanations.
Production rules involve simple syntax that is flexible and easy to understand. They are quite efficient
in diagnosing problems of the form:
• if (condition)
• then (conclusion)
Each production rule in a knowledge base implements a chunk of expertise and when fed to the
inference engine, as part of a set, should synergistically yield a better result than any of the rules
individually. In reality, rules are highly independent and adding a new rule may contradict other rules
or cause other rules to be revised. Rule systems can broadly be classified into simple, all rules on the
same level and available to every search cycle, and structured rule-base systems where searches are
limited to segments of the rule base, thus improving the efficiency or the search. A rule set is a named
collection of individual rules pertaining to a distinct aspect of a problem and helps in comprehending
and maintaining the rule base. This structure is a kind of meta-knowledge that is imposed on the
knowledge base. Each sub problem could have its own rule set (Klein & Methlie 1995).
Semantic Nets is a popular and easy-to-understand way of representing non-rule knowledge. Semantic
networks organise knowledge through nodes in a graph rather than a data structure. Links or arcs
present relationships between the named nodes. The links or arcs represent relationships such as is-a,
has, is, own, needs and reflects the association between concepts. An ES that stores knowledge as a
semantic net incorporates an inference engine devoted to operations like inheritance. Such an inference
engine will consist of two parts. One part will deal with rules by forward chaining, backward chaining
or some other method. The other part will handle net operations matching relevant links in the net to
deduce facts.
116
University of Pretoria etd – De Kock, E (2003)
Objects can be described by a number of features or attributes, many of which stay constant from one
instance to the next. A frame is a piece of structured data about typical characteristics of an object, act
or event. The knowledge is more descriptive than procedural. Similar to rules, frames must be able to
deal with uncertainty and missing values. Frames may have default values and slot-filling procedures
associated with the slots, to cope with missing values. Frames enable reasoning about object features
such as inheritance and the occurrence of exceptions. The reasoning process starts by identifying a
frame as applicable to the current situation. Matching the set of frames against the facts available
selects an appropriate frame. The use of frames is relevant to non-monotonic logic. Non-monotonic
reasoning expresses reasoning with default attributes.
Case-based reasoning is a process that uses similar problems to solve the current problem. It consists
of two steps:
• Find those cases in memory that solved problems similar to the current problem, and
• Adapt previous solutions to fit the current problem
The case library forms an extra important component in case-based reasoning. The inference cycle
using CBR consists of:
• Retrieving solutions
• Adapting solutions, and
• Testing solutions
The critical step is to find and retrieve a relevant case from the case library. Cases are stored using
indexes. The stored case contains a solution, which is then adapted by modifying the parameters of the
old problem to suit the new situation resulting in a proposed solution. The solution is tested and if
found successful, added to the case library (Klein & Methlie 1995). Knowledge acquisition is easier in
case-based reasoning because of the granularity of the knowledge. Knowledge is presented in
precedent or resultant cases.
Beyond the knowledge representation language (rules, semantic nets, frames, cases), the knowledge
engineer needs further aids such as tools to edit the knowledge base; inference tracers to assist in error
detection; and analytical tools to find, update and consistently check the represented knowledge or
attributes (Klein & Methlie 1995).
117
University of Pretoria etd – De Kock, E (2003)
rule is executed (Klein & Methlie 1995) or fired by applying rule deduction or using formal logic. A
new fact is concluded and added to the working memory and new patterns found that match the new
fact. This sequence of steps and the linking of facts and patterns and rules are known as chaining
(Klein & Methlie 1995).
The inference engine deduces facts or draws conclusions from the knowledge base based on the user
input and the facts from the knowledge base and/or other sources. Three basic techniques are identified
when inferring facts or conclusions from the knowledge base:
• Forward chaining
• Backward chaining, and
• Hybrid chaining: using both forward and backward chaining
New knowledge can be inferred from the existing knowledge in the knowledge base. The specification
of how the reasoning is done is the core of the ES. This programming task is independent of the
subject knowledge in the knowledge base component. The reasoning method treats facts as arbitrary
symbols. The same inferencing method can be used by different kinds of knowledge (Goodall 1985).
Various algorithms can accomplish this task. One such algorithm used by ES, is the Rete Algorithm
(See Paragraph 4.2.9: p45)
Forward chaining match the current state with the rules’ antecedents or conditions in the knowledge
base. If the condition is true, the inference engine adds the conclusion to the list of known facts.
Known facts imply other facts. This technique is also known as data driven. It can be very inefficient,
especially if many rule conditions match the data provided by the user. The data provided by the user
is examined and new knowledge is concluded or asserted and responded to.
The second technique, backward chaining, also known as goal driven or directed, is more efficient if
the number of goals is limited and involves the acquiring of information from the user in the form of
questions to draw specific conclusions. This style is used to confirm diagnostic tasks and works
backwards from what needs to be proved to the facts that might affect it. It is a goal-directed backward
chaining of rules to try to prove a hypothesis made by the system. Sometimes stating the conclusions
and trying to prove them are unhelpful because none of the multiple goals exist. If this is the case,
forward chaining should rather be considered
When a large problem domain is involved, a more efficient program is yielded when the two
techniques are used in combination - hybrid chaining. To model the strategies used by a human
expert, an ES has to employ complex inference that almost always include both forward and backward
chaining with potentially many variations. One inference engine will not suit all possible tasks solved
by an ES. A typical rule-based system represents heuristic knowledge: that is short cuts in the
reasoning procedure. This process uses shallow knowledge.
118
University of Pretoria etd – De Kock, E (2003)
Model-based reasoning is based on fundamental or deep knowledge of the problem domain. The
relationships modelled could be either structural or behavioural. Structural relationship models are
used for advice systems and behavioural relationship models for Decision Support Systems that do
scenario analysis such as a “what-if” analysis. The behavioural model consists of causal relationships
that can be quantitative or qualitative (Klein & Methlie 1995). In model-based reasoning, the
reasoning follows the fundamental relationships, the cause-and-effect paths using a deeper knowledge.
The reasoning styles are directed by what need to be proved (goal directed) versus by what data are
available (data directed). When pursuing the goal directed style and several rules exist that prove some
conclusion the rule with the best change of proving it, is selected. This is done by conflict resolution,
for example a more specific rule is chosen above a less specific rule.
To simplify the process each rule can be assigned a number to reflect how useful it is. The number
could be a guide to select one rule from several that proves the same conclusion. Rules that deal with
uncertainty or imperfect data or are referred to as approximate rules, are called probabilistic
reasoning. An integral part of the working of the ES is how the inference engine determines when to
enquire the appropriate information from the user. Probabilistic reasoning is a method used by an ES
to draw inferences from the domain and problem knowledge where the knowledge or its
implementations or both are less than certain.
The knowledge base can include meta-rules. A meta-rule is a rule about the rules and potentially
affects the sequence of all other rules called. Meta-rules make the knowledge base more complex and
more difficult to understand e.g. the use of different rule sets. Two types of facts exist: those received
from the user in the form of input data (known facts) and those deduced from the input data (inferred
from primitive data). Knowledge can also be obtained from other sources such as databases (DB).
Much research is connected to Expert Systems and databases to refrain from transcribing some of the
information into rules.
119
University of Pretoria etd – De Kock, E (2003)
The rules connect items of knowledge about a problem. Some ES concentrate more on facts and less
on rules. Many pieces of information may have more than one attribute. Such knowledge is said to be
structured, compound or multi-attributed. All ES languages should provide for it in some way.
♦ Blackboard subsystem
Blackboards are not an alternative to frames and nets for storing knowledge. It is rather a complex
method used in complex systems to record choices, guesses and decisions about what to do next. It is
used in situations where more than one source of information is active. All knowledge sources have
access to a shared database. It involves an architecture that allows the independent knowledge sources
to communicate through the central device: the blackboard.
When a knowledge source is activated, it examines the current state of the blackboard and implies its
knowledge to either create a new hypothesis or change an existing one. The scheduler determines
which knowledge source can contribute to the solution in the blackboard next. Hearsay-III - a speech-
understanding project; ExperTax - a tax planning system, and FINSIM are examples of blackboard
systems (Klein & Methlie 1995). Turban et al (2001) describes the blackboard as a kind of database
that an area of working memory set aside for the description of the current problem, the input data and
the intermediate results.
120
University of Pretoria etd – De Kock, E (2003)
♦ An explanation sub-system
A by-product of the inference engine is that it is able to provide a trace of rules (subject knowledge)
used and thus provide an explanation of its conclusions. This explanation can be presented to the ES
user in the dialogue component. The explanation sub-system provides an area where the behaviour of
the ES can be accounted for (Turban et al 2001). It provides answers to questions such as:
• How was a certain conclusion reached?
• Why was a certain question asked?
• What is the plan to reach the solution? , and
• Why was a certain alternative rejected?
The consultation process involves the user who starts the process by requiring advice from the ES.
The ES provides a conclusion and explanation, using its inference engine. The engine searches the
knowledge base for an appropriate action by matching the input the user provides to the facts and rules
in the knowledge base. To execute this task the inference engine uses a work area or temporary
databases called the blackboard. All intermediate results are stored here. An explanation of actions
taken by the inference engine can be provided to the user. Finally, the knowledge in the knowledge
base may be refined by repetitive consultations. This knowledge refining system is not available in
many Expert Systems now, but is being developed as experimental ES.
121
University of Pretoria etd – De Kock, E (2003)
on the substantive content rather than the form of the ES. A shell helps to reduce the level of
skill required by the developers by effectively supplying some of the required expertise.
• A shell imposes prior structure, enabling developers to concentrate on substantive content
rather than form, and
• A shell reduces the required skill level of Expert Systems builders
Acquiring expert knowledge is a crucial component of knowledge engineering. This phase is difficult
and time consuming. It is the process of gathering the relevant information about a domain, usually
from an expert. Usually a computer program is compiled to incorporate all the knowledge of the
domain. A number of knowledge acquisition techniques have been developed. As mentioned before
knowledge can be classified as surface knowledge or deep knowledge. Surface knowledge involves the
presentation of declarative and procedural knowledge into heuristics to quickly solve the problem.
Surface knowledge is the basis for most ES and uses production rules. Deep knowledge involves
fundamental knowledge of the domain including definitions, axioms, general laws, principles and
causal relationships of the domain.
The human expert, from whom the knowledge is acquired, needs to be a person that can effectively
cope with the problem domain. Selection of the person is based on reputation. The expert should be
available and willing to co-operate in the process of developing the ES especially when acquiring the
knowledge and testing the system. The expert must be able to communicate his expertise.
Validity of knowledge in any system is crucial. If the knowledge inferred proves to be faulty or
erroneous in any way, the wrong decisions made by the experts will be made more speedily than when
the process was a manual one. The sources of errors could include:
• Not much is known about the problem domain; too little knowledge is available. To solve the
situation more domain expertise need to be obtained. , and/or
• The environment of the decision might be changing in which case the captured knowledge
needs to be maintained
Relational database systems manage knowledge in the form of facts but are quite different when
compared to knowledge bases. To understand ES and knowledge base construction, Beynon-Davies
(1991) compares the two technologies.
122
University of Pretoria etd – De Kock, E (2003)
123
University of Pretoria etd – De Kock, E (2003)
• A database uses a tool called the database management system (DMBS) to build database
systems
• The DBMS (Database Management System) is built upon a data model or architecture, and
• The database management system (DBMS) is an integral part of the database and handles
manipulation of large collections of facts
6.5 Summary
Expert Systems are based on two fundamental principles: the appropriate representation of domain
knowledge and the control of the domain knowledge. A standalone expert system stores a few facts
124
University of Pretoria etd – De Kock, E (2003)
and relies on the user to pass information to the system when needed to perform certain deductions.
The combination of Expert Systems and database technology could benefit both technologies. Models
have been developed for data base systems that would benefit the storage of knowledge in a knowledge
base. DBMS technology could contribute Expert Systems by giving them the ability to access large
collections of facts and also apply features such as concurrency control, data security and optimised
access to knowledge base items (Beynon-Davies 1991).
A deductive component could enhance database technology by providing the rules component of an ES
(Beynon-Davies 1991). A frame is roughly the equivalent to a row in a relational database. A slot is
roughly the notion of an attribute in a relation. Frames and slots are artefacts used in ES rules to
represent knowledge. A frame (See Paragraph 6.2.2: p113) use slots and is a knowledge presentation
used in Knowledge-based Systems.
The writer concludes in agreeing with Turban (1995) that an ES component is ideal to assist a decision-
maker in an area where expertise is required.
125