Expert System
Expert System
The expert system is a part of AI, and the first ES was developed in the year 1970,
which was the first successful approach of artificial intelligence. It solves the most
complex issue as an expert by extracting the knowledge stored in its knowledge
base. The system helps in decision making for complex problems using both facts
and heuristics like a human expert. It is called so because it contains the expert
knowledge of a specific domain and can solve any complex problem of that
particular domain. These systems are designed for a specific domain, such
as medicine, science, etc.
Below is the block diagram that represents the working of an expert system:
Note: It is important to remember that an expert system is not used to replace the
human experts; instead, it is used to assist the human in making a complex decision.
These systems do not have human capabilities of thinking and work on the basis of the
knowledge base of the particular domain.
o High Performance: The expert system provides high performance for solving
any type of complex problem of a specific domain with high efficiency and
accuracy.
o Understandable: It responds in a way that can be easily understandable by
the user. It can take input in human language and provides the output in the
same way.
o Reliable: It is much reliable for generating an efficient and accurate output.
o Highly responsive: ES provides the result for any complex query within a very
short period of time.
o User Interface
o Inference Engine
o Knowledge Base
1. User Interface
With the help of a user interface, the expert system interacts with the user, takes
queries as an input in a readable format, and passes it to the inference engine. After
getting the response from the inference engine, it displays the output to the user. In
other words, it is an interface that helps a non-expert user to communicate with
the expert system to find a solution.
o The inference engine is known as the brain of the expert system as it is the
main processing unit of the system. It applies inference rules to the
knowledge base to derive a conclusion or deduce new information. It helps in
deriving an error-free solution of queries asked by the user.
o With the help of an inference engine, the system extracts the knowledge from
the knowledge base.
o There are two types of inference engine:
o Deterministic Inference engine: The conclusions drawn from this type of
inference engine are assumed to be true. It is based on facts and rules.
o Probabilistic Inference engine: This type of inference engine contains
uncertainty in conclusions, and based on the probability.
Inference engine uses the below modes to derive the solutions:
o Forward Chaining: It starts from the known facts and rules, and applies the
inference rules to add their conclusion to the known facts.
o Backward Chaining: It is a backward reasoning method that starts from the
goal and works backward to prove the known facts.
3. Knowledge Base
o Firstly, ES should be fed with expert knowledge. In the case of MYCIN, human
experts specialized in the medical field of bacterial infection, provide
information about the causes, symptoms, and other knowledge in that
domain.
o The KB of the MYCIN is updated successfully. In order to test it, the doctor
provides a new problem to it. The problem is to identify the presence of the
bacteria by inputting the details of a patient, including the symptoms, current
condition, and medical history.
o The ES will need a questionnaire to be filled by the patient to know the
general information about the patient, such as gender, age, etc.
o Now the system has collected all the information, so it will find the solution
for the problem by applying if-then rules using the inference engine and using
the facts stored within the KB.
o In the end, it will provide a response to the patient by using the user interface.
Before using any technology, we must have an idea about why to use that
technology and hence the same for the ES. Although we have human experts in
every field, then what is the need to develop a computer-based system. So below are
the points that are describing the need of the ES:
o Advising: It is capable of advising the human being for the query of any
domain from the particular ES.
o Provide decision-making capabilities: It provides the capability of decision
making in any domain, such as for making any financial decision, decisions in
medical science, etc.
o Demonstrate a device: It is capable of demonstrating any new products such
as its features, specifications, how to use that product, etc.
o Problem-solving: It has problem-solving capabilities.
o Explaining a problem: It is also capable of providing a detailed description of
an input problem.
o Interpreting the input: It is capable of interpreting the input given by the
user.
o Predicting results: It can be used for the prediction of a result.
o Diagnosis: An ES designed for the medical field is capable of diagnosing a
disease without using multiple components as it already contains various
inbuilt medical tools.
o The response of the expert system may get wrong if the knowledge base
contains the wrong information.
o Like a human being, it cannot produce a creative output for different
scenarios.
o Its maintenance and development costs are very high.
o Knowledge acquisition for designing is much difficult.
o For each domain, we require a specific ES, which is one of the big limitations.
o It cannot learn from itself and hence requires manual updates.
Expert Systems
Artificial Intelligence is a piece of software that simulates the behaviour and
judgement of a human or an organization that has experts in a particular domain is
known as an expert system. It does this by acquiring relevant knowledge from its
knowledge base and interpreting it according to the user’s problem. The data in the
knowledge base is added by humans that are expert in a particular domain and this
software is used by a non-expert user to acquire some information. It is widely used
in many areas such as medical diagnosis, accounting, coding, games etc.
An expert system is AI software that uses knowledge stored in a knowledge base to
solve problems that would usually require a human expert thus preserving a human
expert’s knowledge in its knowledge base. They can advise users as well as provide
explanations to them about how they reached a particular conclusion or
advice. Knowledge Engineering is the term used to define the process of building
an Expert System and its practitioners are called Knowledge Engineers. The
primary role of a knowledge engineer is to make sure that the computer possesses all
the knowledge required to solve a problem. The knowledge engineer must choose
one or more forms in which to represent the required knowledge as a symbolic
pattern in the memory of the computer.
Example : There are many examples of an expert system. Some of them are given
below –
MYCIN –
One of the earliest expert systems based on backward chaining. It can
identify various bacteria that can cause severe infections and can also
recommend drugs based on the person’s weight.
DENDRAL –
It was an artificial intelligence-based expert system used for chemical
analysis. It used a substance’s spectrographic data to predict its molecular
structure.
R1/XCON –
It could select specific software to generate a computer system wished by
the user.
PXDES –
It could easily determine the type and the degree of lung cancer in a
patient based on the data.
CaDet –
It is a clinical support system that could identify cancer in its early stages
in patients.
DXplain –
It was also a clinical support system that could suggest a variety of
diseases based on the findings of the doctor.
Components of an Expert System :
Knowledge Base –
The knowledge base represents facts and rules. It consists of knowledge in
a particular domain as well as rules to solve a problem, procedures and
intrinsic data relevant to the domain.
Inference Engine –
The function of the inference engine is to fetch the relevant knowledge
from the knowledge base, interpret it and to find a solution relevant to the
user’s problem. The inference engine acquires the rules from its
knowledge base and applies them to the known facts to infer new facts.
Inference engines can also include an explanation and debugging abilities.
Knowledge Acquisition and Learning Module –
The function of this component is to allow the expert system to acquire
more and more knowledge from various sources and store it in the
knowledge base.
User Interface –
This module makes it possible for a non-expert user to interact with the
expert system and find a solution to the problem.
Explanation Module –
This module helps the expert system to give the user an explanation about
how the expert system reached a particular conclusion.
The Inference Engine generally uses two strategies for acquiring knowledge from
the Knowledge Base, namely –
Forward Chaining
Backward Chaining
Forward Chaining –
Forward Chaining is a strategic process used by the Expert System to answer the
questions – What will happen next. This strategy is mostly used for managing tasks
like creating a conclusion, result or effect. Example – prediction or share market
movement status.
Forward Chaining
Backward Chaining –
Backward Chaining is a strategy used by the Expert System to answer the questions
– Why this has happened. This strategy is mostly used to find out the root cause or
reason behind it, considering what has already happened. Example – diagnosis of
stomach pain, blood cancer or dengue, etc.
Backward Chaining
What is NLP?
NLP stands for Natural Language Processing, which is a part of Computer Science,
Human language, and Artificial Intelligence. It is the technology that is used by
machines to understand, analyse, manipulate, and interpret human's languages. It
helps developers to organize knowledge for performing tasks such as translation,
automatic summarization, Named Entity Recognition (NER), speech
recognition, relationship extraction, and topic segmentation.
History of NLP
(1940-1960) - Focused on Machine Translation (MT)
1950s - In the Year 1950s, there was a conflicting view between linguistics and
computer science. Now, Chomsky developed his first book syntactic structures and
claimed that language is generative in nature.
In 1957, Chomsky also introduced the idea of Generative Grammar, which is rule
based descriptions of syntactic structures.
Case Grammar
Case Grammar was developed by Linguist Charles J. Fillmore in the year 1968. Case
Grammar uses languages such as English to express the relationship between nouns
and verbs by using the preposition.
In Case Grammar, case roles can be defined to link certain kinds of verbs and objects.
For example: "Neha broke the mirror with the hammer". In this example case
grammar identify Neha as an agent, mirror as a theme, and hammer as an
instrument.
SHRDLU
LUNAR
LUNAR is the classic example of a Natural Language database interface system that is
used ATNs and Woods' Procedural Semantics. It was capable of translating elaborate
natural language expressions into database queries and handle 78% of requests
without errors.
1980 - Current
Till the year 1980, natural language processing systems were based on complex sets
of hand-written rules. After 1980, NLP introduced machine learning algorithms for
language processing.
In the beginning of the year 1990s, NLP started growing faster and achieved good
process accuracy, especially in English Grammar. In 1990 also, an electronic text
introduced, which provided a good resource for training and examining natural
language programs. Other factors may include the availability of computers with fast
CPUs and more memory. The major factor behind the advancement of natural
language processing was the Internet.
Advantages of NLP
o NLP helps users to ask questions about any subject and get a direct response
within seconds.
o NLP offers exact answers to the question means it does not offer unnecessary
and unwanted information.
o NLP helps computers to communicate with humans in their languages.
o It is very time efficient.
o Most of the companies use NLP to improve the efficiency of documentation
processes, accuracy of documentation, and identify the information from large
databases.
Disadvantages of NLP
A list of disadvantages of NLP is given below:
Components of NLP
There are the following two components of NLP -
NLU NLG
Applications of NLP
There are the following applications of NLP -
1. Question Answering
2. Spam Detection
Sentiment Analysis is also known as opinion mining. It is used on the web to analyse
the attitude, behaviour, and emotional state of the sender. This application is
implemented through a combination of NLP (Natural Language Processing) and
statistics by assigning the values to the text (positive, negative, or natural), identify
the mood of the context (happy, sad, angry, etc.)
4. Machine Translation
Machine translation is used to translate text or speech from one natural language to
another natural language.
Example: Google Translator
5. Spelling correction
6. Speech Recognition
Speech recognition is used for converting spoken words into text. It is used in
applications, such as mobile, home automation, video recovery, dictating to
Microsoft Word, voice biometrics, voice user interface, and so on.
7. Chatbot
Information extraction is one of the most important applications of NLP. It is used for
extracting structured information from unstructured or semi-structured machine-
readable documents.
It converts a large set of text into more formal representations such as first-order
logic structures that are easier for the computer programs to manipulate notations of
the natural language processing.
Sentence Segment is the first step for building the NLP pipeline. It breaks the
paragraph into separate sentences.
Independence Day is one of the important festivals for every Indian citizen. It is
celebrated on the 15th of August each year ever since India got independence
from the British rule. The day celebrates independence in the true sense.
1. "Independence Day is one of the important festivals for every Indian citizen."
2. "It is celebrated on the 15th of August each year ever since India got
independence from the British rule."
3. "This day celebrates independence in the true sense."
Word Tokenizer is used to break the sentence into separate words or tokens.
Example:
JavaTpoint offers Corporate Training, Summer Training, Online Training, and Winter
Training.
Word Tokenizer generates the following result:
Step3: Stemming
Stemming is used to normalize words into its base form or root form. For example,
celebrates, celebrated and celebrating, all these words are originated with a single
root word "celebrate." The big problem with stemming is that sometimes it produces
the root word which may not have any meaning.
For Example, intelligence, intelligent, and intelligently, all these words are originated
with a single root word "intelligen." In English, the word "intelligen" do not have any
meaning.
Step 4: Lemmatization
In English, there are a lot of words that appear very frequently like "is", "and", "the",
and "a". NLP pipelines will flag these words as stop words. Stop words might be
filtered out before doing any statistical analysis.
Note: When you are building a rock band search engine, then you do not ignore the
word "The."
Dependency Parsing is used to find that how all the words in the sentence are
related to each other.
POS stands for parts of speech, which includes Noun, verb, adverb, and Adjective. It
indicates that how a word functions with its meaning as well as grammatically within
the sentences. A word has one or more parts of speech based on the context in
which it is used.
Named Entity Recognition (NER) is the process of detecting the named entity such as
person name, movie name, organization name, or location.
Step 9: Chunking
Chunking is used to collect the individual piece of information and grouping them
into bigger pieces of sentences.
Phases of NLP
There are the following five phases of NLP:
1. Lexical Analysis and Morphological
The first phase of NLP is the Lexical Analysis. This phase scans the source code as a
stream of characters and converts it into meaningful lexemes. It divides the whole
text into paragraphs, sentences, and words.
Syntactic Analysis is used to check grammar, word arrangements, and shows the
relationship among the words.
In the real world, Agra goes to the Poonam, does not make any sense, so this
sentence is rejected by the Syntactic analyzer.
3. Semantic Analysis
Semantic analysis is concerned with the meaning representation. It mainly focuses on
the literal meaning of words, phrases, and sentences.
4. Discourse Integration
Discourse Integration depends upon the sentences that proceeds it and also invokes
the meaning of the sentences that follow it.
5. Pragmatic Analysis
Pragmatic is the fifth and last phase of NLP. It helps you to discover the intended
effect by applying a set of rules that characterize cooperative dialogues.
Ambiguity
o Lexical Ambiguity
Lexical Ambiguity exists in the presence of two or more possible meanings of the
sentence within a single word.
Example:
In the above example, the word match refers to that either Manya is looking for a
partner or Manya is looking for a match. (Cricket or other match)
o Syntactic Ambiguity
Syntactic Ambiguity exists in the presence of two or more possible meanings within
the sentence.
Example:
o Referential Ambiguity
Referential Ambiguity exists when you are referring to something using the pronoun.
In the above sentence, you do not know that who is hungry, either Kiran or Sunita.
NLP APIs
Natural Language Processing APIs allow developers to integrate human-to-machine
communications and complete several useful tasks such as speech recognition,
chatbots, spelling correction, sentiment analysis, etc.
NLP Libraries
Scikit-learn: It provides a wide range of algorithms for building machine learning
models in Python.
Natural language Toolkit (NLTK): NLTK is a complete toolkit for all NLP techniques.
TextBlob: It provides an easy interface to learn basic NLP tasks like sentiment
analysis, noun phrase extraction, or pos-tagging.
SpaCy: SpaCy is an open-source NLP library which is used for Data Extraction, Data
Analysis, Sentiment Analysis, and Text Summarization.
Gensim: Gensim works with large datasets and processes data streams.
Natural language has a very large Computer language has a very limited
vocabulary. vocabulary.
Prerequisite
Before learning NLP, you must have the basic knowledge of Python.
Audience
Our NLP tutorial is designed to help beginners.
Problem
We assure that you will not find any problem in this NLP tutorial. But if there is any
mistake or error, please post the error in the contact form.