0% found this document useful (0 votes)
34 views55 pages

Lecture Note 2 New

The document outlines the course CSC 520 on Expert Systems, focusing on the integration of Natural Language Interfaces (NLI) in expert systems to enhance user interaction and decision-making. It discusses the benefits of NLI, such as accessibility, personalization, and improved user experience, while also addressing challenges like ambiguity, accuracy, and ethical considerations. Various implementation approaches and programming languages for developing expert systems are also detailed, emphasizing the importance of rules in knowledge representation.

Uploaded by

bamiwuye tobby
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views55 pages

Lecture Note 2 New

The document outlines the course CSC 520 on Expert Systems, focusing on the integration of Natural Language Interfaces (NLI) in expert systems to enhance user interaction and decision-making. It discusses the benefits of NLI, such as accessibility, personalization, and improved user experience, while also addressing challenges like ambiguity, accuracy, and ethical considerations. Various implementation approaches and programming languages for developing expert systems are also detailed, emphasizing the importance of rules in knowledge representation.

Uploaded by

bamiwuye tobby
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

CSC 520 (Expert Systems)

Dr. A.R. Iyanda


@OAU.edu.ng

Class: Wednesday (10 - 12noon)


Outlines
• Natural Language interface for Expert Systems
• Programming Language for Developing Expert System
· A rule-based expert system
• Non-monotonic reasoning
• Knowledge representation for diagnosis, qualitative representation.
Natural Language interface for Expert Systems
• A Natural Language Interface (NLI) for Expert Systems bridges the gap
between human users and complex knowledge-based systems by
enabling users to interact with the system using natural language.
• Expert Systems are AI systems designed to mimic the decision-making
capabilities of human experts in specific domains, while Natural
Language Processing (NLP) facilitates the understanding and
generation of human language.
Natural Language interface for Expert Systems
• Natural Language Interface for Expert Systems represents a significant
advancement in AI-driven decision support and knowledge
management.
• By enabling users to interact with expert systems using natural
language, NLI enhances accessibility, usability, and effectiveness,
leading to improved decision-making and user satisfaction across
various domains and applications.
Why Natural Language Interface for Expert
Systems?
• Accessibility and Ease of Use: NLI makes expert systems more
accessible to users who may not have expertise in the system's
domain. Users can interact with the system using familiar language,
eliminating the need to learn complex query languages or interfaces.
• Improved User Experience: NLI enhances the user experience by
providing a more intuitive and conversational interaction model.
Users can ask questions, request explanations, or provide input in
natural language, leading to more efficient and engaging interactions
Why Natural Language Interface for Expert
Systems?
• Personalization: NLI enables expert systems to provide personalized
responses tailored to the user's specific needs, preferences, and
context. Users can receive customized advice, recommendations, and
solutions based on their individual circumstances and requirements.
• Adaptability and Flexibility: NLI allows for dynamic and adaptive
interaction with expert systems, enabling users to refine their queries,
explore different options, and iterate on their decisions. Expert
systems with NLI capabilities are scalable and adaptable to changing
user needs, preferences, and requirements.
Why Natural Language Interface for Expert
Systems?
• Facilitating Knowledge Acquisition: NLI simplifies the process of
acquiring knowledge from expert systems by allowing users to ask
questions and receive explanations in plain language. Users can gain
understanding of complex concepts and decision-making processes
without prior expertise in the domain.
• Enhanced Decision Support: NLI enables users to seek advice,
recommendations, and solutions from expert systems using natural
language queries. Users can receive personalized responses tailored
to their specific needs and preferences, leading to more informed
decision-making.
Challenges and Considerations
• Ambiguity and Interpretation: NLP systems must deal with the
inherent ambiguity and nuances of natural language, leading to
challenges in interpretation and understanding.
• User Training and Feedback: Users may require training or education
to effectively use NLI systems and understand their capabilities,
limitations, and optimal usage scenarios. Establishing feedback
mechanisms allows users to provide input, corrections, or feedback
on NLI responses, facilitating continuous improvement and
refinement of the system
Challenges and Considerations
• Domain Specificity: Expert systems often operate in specialized
domains with domain-specific terminology and jargon, requiring
robust domain adaptation and knowledge representation techniques.
• Scalability and Performance: Scaling NLI systems to handle large
volumes of user queries and interactions while maintaining
performance and responsiveness is a significant challenge, especially
in high-demand environments. Minimizing latency and response time
is essential for providing a seamless and interactive user experience,
requiring efficient processing and inference algorithms.
Challenges and Considerations
• Accuracy and Reliability: Ensuring the accuracy and reliability of NLI
responses is crucial, as errors or misunderstandings could lead to
incorrect decisions or recommendations.
• Ethical and Bias Considerations: NLI systems must be designed and
trained to mitigate biases and ensure fairness in their responses,
avoiding discriminatory or unethical outcomes. Ensuring transparency
and accountability in NLI systems' decision-making processes is
essential for building trust and confidence among users and
stakeholders.
Implementation Approaches
• Rule-Based Systems: Simple NLI systems can be implemented using
rule-based approaches, where predefined patterns or rules are used
to parse and interpret user queries.
• Rule-based systems are relatively straightforward to implement and
maintain, making them suitable for simple or deterministic domains.
• They may struggle with ambiguity, variability, and complex language
structures, requiring extensive rule sets and frequent updates
• Machine Learning Models: More advanced NLI systems leverage
machine learning techniques, such as deep learning and natural
language understanding, learn patterns and relationships from large
datasets of labeled examples to infer the meaning and intent of user
queries.
• Machine learning models can capture complex language patterns and
adapt to diverse user inputs, leading to more accurate and robust
performance.
• They require substantial amounts of labeled training data and
computational resources for training and inference, and may be
susceptible to biases in the training data.
• Hybrid Approaches: Hybrid approaches combine rule-based systems
with machine learning techniques to leverage the strengths of both
paradigms.
• Hybrid approaches offer flexibility and scalability by combining the
interpretability of rule-based systems with the adaptability of
machine learning models.
• Integrating and coordinating rule-based and machine learning
components may introduce complexity and overhead in the system
architecture.
• Pre-trained Language Models: Pre-trained language models, such as
BERT, GPT, and XLNet, are large-scale neural network architectures
trained on vast amounts of text data.
• Pre-trained language models can generalize well to a wide range of
NLP tasks, including natural language understanding and generation,
with minimal fine-tuning.
• Fine-tuning pre-trained models for specific domains or tasks may
require domain-specific datasets and expertise in transfer learning
techniques.
• Semantic Parsing: Semantic parsing involves mapping natural
language queries to formal representations, such as logical forms or
semantic graphs, that can be processed by expert systems.
• Semantic parsing enables precise interpretation and execution of user
queries, facilitating more accurate and reliable responses.
• Developing accurate semantic parsers requires careful attention to
domain-specific semantics, syntax, and pragmatics, which may be
challenging in complex or ambiguous domains.
Ambiguity
• Ambiguity in natural language arises when a word, phrase, or
sentence has multiple interpretations or meanings. Navigating these
ambiguities in natural language understanding requires context,
background knowledge, and sometimes additional clarification to
disambiguate the intended meaning.
• In the context of Natural Language Interfaces for Expert Systems,
handling these ambiguities accurately is crucial for providing
meaningful and relevant responses to user queries.
• Here are some examples of ambiguities:
• 1. Lexical Ambiguity:
• Example: "I saw a man on a hill with a telescope."
• Interpretations:
• The speaker used a telescope to see a man on a hill.
• The speaker saw a man who was on a hill, and the man also had a telescope.
• 2. Syntactic Ambiguity:
• Example: "The chicken is ready to eat."
• Interpretations:
• The chicken is ready for consumption.
• Someone is ready to eat the chicken.
• 3. Semantic Ambiguity:
• Example: "She is my old friend."
• Interpretations:
• The person has known the friend for a long time.
• The person's friend is elderly.
• 4. Structural Ambiguity:
• Example: "I saw the man with the binoculars."
• Interpretations:
• The speaker used binoculars to see the man.
• The man was holding binoculars.
• 5. Referential Ambiguity:
• Example: "She told her mother she would come home."
• Interpretations:
• She told her own mother she would come home.
• She told someone else's mother she would come home.
• 6. Pragmatic Ambiguity:
• Example: "Can you pass the salt?"
• Interpretations:
• A request to pass the salt.
• An inquiry about the listener's ability to pass the salt.
• 7. Homonymy:
• Example: "The bank is closed."
• Interpretations:
• The financial institution is closed.
• The side of a river is closed.
Applications
• Customer Support: NLI for expert systems is used in customer support
applications to provide automated assistance and troubleshooting,
FAQs, and product information.
• Healthcare: Patients can use NLI to interact with expert systems for
medical advice, symptom checking, and medication management. It
can offer personalized health recommendations and remote
monitoring services.
• Education: NLI is used in educational settings to provide tutoring,
homework help, feedback, and personalized learning experiences
based on students' queries and needs.
Applications
• Finance and Banking: Customers can use NLI to interact with financial expert
systems for banking transactions, investment advice, and financial planning. It
can offer personalized investment recommendations and portfolio
management services.
• Human Resources: Employees can use NLI to interact with HR expert systems
for self-service inquiries, policy information, and benefits administration. It
can streamline HR processes and provide on-demand support to employees.
• Legal Services: NLI enables clients to interact with legal expert systems for
legal advice, document review, and case analysis. It can offer personalized
legal guidance and support for common legal inquiries.
Applications
• Information Retrieval: Users can use NLI to interact with expert systems for
information retrieval, knowledge discovery, and data analysis. It can help users
access and navigate large volumes of information more effectively.
• Technical Support: Users can use NLI to interact with expert systems for
technical troubleshooting, software assistance, and IT support. User can
diagnose and resolve technical issues remotely.
• Travel and Hospitality: Travelers can use NLI to interact with expert systems for
travel planning, itinerary management, and booking assistance. It can offer
personalized travel recommendations and concierge services.
Applications
• E-commerce: Customers can use NLI to interact with expert systems
for product recommendations, shopping assistance, and order
tracking. It can provide personalized shopping experiences and
enhance customer satisfaction
Expert System Technology
Expert System Development Environment
• The ES development environment contains a set of hardware tools
(Workstations, minicomputers, mainframes), High level symbolic
programming languages [LISt Programming (LISP) and
PROgrammation en LOGique (PROLOG)], as well as large data bases;
CLIPS (C Language Integrated Production System)-a multi-paradigm
programming language that provides support for rule-based object
oriented and procedural programming.
Expert System Technology
• Programming Language for Developing Expert System
• Several programming languages are suitable for developing expert systems, each offering its own
advantages and considerations. Here are some commonly used programming languages for
developing expert systems:
• Prolog: Prolog is a logic programming language specifically designed for symbolic and rule-based
reasoning. Prolog's built-in support for pattern matching, backtracking, and logical inference
makes it well-suited for implementing expert system rules and knowledge representation. Prolog
may have a steeper learning curve for developers who are not familiar with logic programming
paradigms.
• Lisp: Lisp (List Processing) is a family of programming languages known for their support for
symbolic processing and dynamic programming. Lisp's flexibility and expressive power make it
suitable for implementing complex expert system algorithms and knowledge representation
structures. Common Lisp and Scheme may have a smaller user base compared to more
mainstream languages.
Expert System Technology
• Python: It is a versatile and widely used programming language known for its simplicity,
readability, and extensive libraries. Python's rich libraries, including libraries for artificial
intelligence and knowledge representation (e.g., PyKnow, CLIPS), makes it suitable for developing
expert systems. Python may not be as optimized for symbolic reasoning tasks as other languages
like Prolog or Lisp.
• Java: It is a widely used programming language known for its platform independence, object-
oriented design, and large ecosystem of libraries. Java is robust and scalable, hence its suitability
for developing large-scale expert systems with complex architectures. Java may have more code
compared to dynamically typed languages like Python or Lisp.
• CLIPS: CLIPS (C Language Integrated Production System) is a rule-based programming language
specifically designed for developing expert systems. CLIPS provides a dedicated environment and
syntax for expressing rules and knowledge representations, making it highly optimized for expert
system development. CLIPS may have a narrower focus and less community support compared to
more general-purpose programming languages.
Expert System Technology
• R: R is a programming language and environment specifically
designed for statistical computing and data analysis. R has extensive
libraries for data analysis and statistical modeling which can be
leveraged for developing expert systems in domains requiring
statistical reasoning. R may have a narrower focus and less support
for symbolic reasoning compared to languages like Prolog or Lisp.
• The choice of programming language for developing an expert system
depends on factors such as the developer's familiarity with the
language, the complexity of the problem domain, performance
requirements, and the availability of libraries and tools.
• Expert System Tools
• Language: A translator of commands written in a specific syntax. An expert
system language will also provide an inference engine to execute the
statement of the language. For example PROLOG
• Shells: A special purpose tool designed for certain types of application in
which the user must only supply the knowledge base (e.g. Emycin). A Shell is
an expert system that functions without a knowledge base. It provides
developers with knowledge acquisition, inference engine, user interface, and
explanation facility. For example – Java Expert System Shell (JESS), Vidwan, etc.
• Tools: A language + Utility programs to facilitate the development debugging
and delivery of application programs. Tools as an ES technology, assists in
reducing the effort and cost involved in developing an expert system to a large
extent.
• Shell Vs Programming Language
Rules (Production rules)
• Production rules are the most common method of knowledge
representation used in business. Rule-based expert systems are
expert systems in which the knowledge is represented by production
rules.
• A production rule, or simply a rule, consists of an IF part (a condition
or premise) and a THEN part (an action or conclusion). IF condition
THEN action (conclusion).
• The explanation facility explains how the system arrived at the
recommendation. Depending on the tool used to implement the
expert system, the explanation may be either be in a natural language
or simply a listing of rule numbers
Advantages of Rules
Disadvantages of Rules
Characteristics of Rules
Rule-Based Expert Systems
• Rule-based expert systems have a wide range of applications for
diagnostic tasks where expertise and experience are available but
deep understanding of the physical properties of the system is either
unavailable or too costly to obtain.
• In the rule-based systems, knowledge is represented in the form of
production rules. A rule describes the action that should be taken if a
symptom is observed. The empirical association between premises
and conclusions in the knowledge base is their main characteristic.
These associations describe cause effect relationships to determine
logical event chains that were used to represent the propagation of
complex phenomena.
Rule Based Expert Systems
When is Rule Based Expert Systems Preferred?
Rules as a knowledge representation technique

• The term rule which is the most commonly used type of knowledge
representation, can be defined as an IF-THEN structure that relates
given information or facts in the IF part to some action in the THEN
part. A rule provides some description of how to solve a problem.
Rules are relatively easy to create and understand.
• Any rule consists of two parts: the IF part, called the antecedent
(premise or condition) and the THEN part called the consequent
(conclusion or action).
IF <antecedent>
THEN <consequent>
• A rule can have multiple antecedents joined by the keywords AND
(conjunction), OR (disjunction) or a combination of both.
IF <antecedent 1> IF <antecedent 1>
AND <antecedent 2> OR <antecedent 2>
. .
. .
. .
AND <antecedent n> OR <antecedent n>
THEN <consequent> THEN <consequent>
• The antecedent of a rule incorporates two parts: an object (linguistic object)
and its value. The object and its value are linked by an operator.
• The operator identifies the object and assigns the value. Operators such as is,
are, is not, are not are used to assign a symbolic value to a linguistic object.
• Expert systems can also use mathematical operators to define an object as
numerical and assign it to the numerical value.
IF ‘age of the customer’ < 18
AND ‘cash withdrawal’ > 1000
THEN ‘signature of the parent’ is required
Rules can represent relations, recommendations, directives, strategies and heuristics:
• Relation
IF the ‘fuel tank’ is empty
THEN the car is dead
• Recommendation
IF the season is autumn
AND the sky is cloudy
AND the forecast is drizzle
THEN the advice is ‘take an umbrella’
• Directive
IF the car is dead
AND the ‘fuel tank’ is empty
THEN the action is ‘refuel the car’
• Strategy
IF the car is dead
THEN the action is ‘check the fuel tank’;
step1 is complete
IF step1 is complete
AND the ‘fuel tank’ is full
THEN the action is ‘check the battery’;
step2 is complete
• Heuristic
IF the spill is liquid
AND the ‘spill pH’ < 6
AND the ‘spill smell’ is vinegar
THEN the ‘spill material’ is ‘acetic acid’
Structure of a rule-based expert system
• In the early seventies, Newell and Simon from Carnegie-Mellon
University proposed a production system model, the foundation of
the modern rulebased expert systems.
• The production model is based on the idea that humans solve
problems by applying their knowledge (expressed as production
rules) to a given problem represented by problem-specific
information.
• The production rules are stored in the long-term memory and the
problem-specific information or facts in the short-term memory
Production system model
Basic structure of a rule-based expert system
• The knowledge base contains the domain knowledge useful for
problem solving. In a rulebased expert system, the knowledge is
represented as a set of rules. Each rule specifies a relation,
recommendation, directive, strategy or heuristic and has the IF
(condition) THEN (action) structure. When the condition part of a rule
is satisfied, the rule is said to fire and the action part is executed.

• The database includes a set of facts used to match against the IF


(condition) parts of rules stored in the knowledge base.
• The inference engine carries out the reasoning hereby the expert
system reaches a solution. It links the rules given in the knowledge
base with the facts provided in the database.
• The explanation facilities enable the user to ask the expert system
how a particular conclusion is reached and why a specific fact is
needed. An expert system must be able to explain its reasoning and
justify its advice, analysis or conclusion.
• The user interface is the means of communication between a user
seeking a solution to the problem and an expert system.
Complete structure of a rule-based expert system
Inference engine cycles via a match-fire procedure
An example of an inference chain
Rule 1: IF Y is true
AND D is true
THEN Z is true
Rule 2: IF X is true
AND B is true
AND E is true
THEN Y is true
Rule 3: IF A is true
THEN X is true
Advantages of rule-based expert systems
• Natural knowledge representation.
• An expert usually explains the problem solving procedure with such
expressions as this: ‘In such-and-such situation, I do so-and-so’.
• These expressions can be represented quite naturally as IF-THEN production
rules.
• Uniform structure.
• Production rules have the uniform IF-THEN structure.
• Each rule is an independent piece of knowledge.
• The very syntax of production rules enables them to be self-documented
Advantages of rule-based expert systems
• Separation of knowledge from its processing
• The structure of a rule-based expert system provides an effective separation
of the knowledge base from the inference engine.
• This makes it possible to develop different applications using the same expert
system shell
• Dealing with incomplete and uncertain knowledge
• Most rule-based expert systems are capable of representing and reasoning
with incomplete and uncertain knowledge
Disadvantages of rule-based expert systems
• Opaque relations between rules.
• Although the individual production rules are relatively simple and self-
documented, their logical interactions within the large set of rules may be
opaque.
• Rule-based systems make it difficult to observe how individual rules serve the
overall strategy.
• Ineffective search strategy
• The inference engine applies an exhaustive search through all the production
rules during each cycle.
• Expert systems with a large set of rules (over 100 rules) can be slow, and thus
large rule-based systems can be unsuitable for real-time applications
Disadvantages of rule-based expert systems
contd.
• Inability to learn
• In general, rule-based expert systems do not have an ability to learn from the
experience.
• Unlike human expert, who knows when to “break the rules”, an expert system
cannot automatically modify its knowledge base, or adjust existing rules or
add new ones.
• The knowledge engineer is still responsible for revising and maintaining the
system

You might also like