6CS4 AI Unit-5
6CS4 AI Unit-5
(6CS4-05)
Unit V
Introduction To Natural Language Processing
DIFFERENT ISSUE
INVOLVED IN NLP
INTRODUCTION
Artificial intelligence has become part of our everyday lives –
Alexa and Siri, text and email autocorrect, customer service
chatbots. They all use machine learning algorithms and
Natural Language Processing (NLP) to process, “understand”,
and respond to human language, both written and spoken.
Language Processing limitations and problems:
The same words and phrases can have different meanings according the context of a sentence and
many words – especially in English – have the exact same pronunciation but totally different
meanings.
For example:
I ran to the store because we ran out of milk.
Can I run something past you real quick?
The house is looking really run down.
These are easy for humans to understand because we read the context of the sentence and we
understand all of the different definitions. And, while NLP language models may have learned all of
the definitions, differentiating between them in context can present problems.
Homonyms – two or more words that are pronounced the same but have different definitions – can be
problematic for question answering and speech-to-text applications because they aren’t written in text
form. Usage of their and there, for example, is even a common problem for humans.
Synonyms
Ambiguity in NLP refers to sentences and phrases that potentially have two or more possible
interpretations.
Lexical ambiguity: a word that could be used as a verb, noun, or adjective.
Semantic ambiguity: the interpretation of a sentence in context. For example: I saw the boy
on the beach with my binoculars. This could mean that I saw a boy through my binoculars
or the boy had my binoculars with him
Syntactic ambiguity: In the sentence above, this is what creates the confusion of meaning.
The phrase with my binoculars could modify the verb, “saw,” or the noun, “boy.”
Even for humans this sentence alone is difficult to interpret without the context of
surrounding text. POS (part of speech) tagging is one NLP solution that can help solve the
problem, somewhat.
Errors in text and speech
AI machine learning NLP applications have been largely built for the most common,
widely used languages. And it’s downright amazing at how accurate translation
systems have become. However, many languages, especially those spoken by
people with less access to technology often go overlooked and under processed. For
example, by some estimations, (depending on language vs. dialect) there are over
3,000 languages in Africa, alone. There simply isn’t very much data on many of
these languages.
However, new techniques, like multilingual transformers (using Google’s BERT
“Bidirectional Encoder Representations from Transformers”) and
multilingual sentence embeddings aim to identify and leverage universal similarities
that exist between languages.
Lack of research and development
Morphological Processing
It is the first phase of NLP. The purpose of this phase is to break chunks of
language input into sets of tokens corresponding to paragraphs, sentences and
words. For example, a word like “uneasy” can be broken into two sub-word
tokens as “un-easy”.
Syntax Analysis
It is the second phase of NLP. The purpose of this phase is two folds: to check that
a sentence is well formed or not and to break it up into a structure that shows the
syntactic relationships between the different words. For example, the sentence
like “The school goes to the boy” would be rejected by syntax analyzer or parser.
Semantic Analysis
It is the third phase of NLP. The purpose of this phase is to draw exact
meaning, or you can say dictionary meaning from the text. The text is
checked for meaningfulness. For example, semantic analyzer would
reject a sentence like “Hot ice-cream”.
Pragmatic Analysis
It is the fourth phase of NLP. Pragmatic analysis simply fits the actual
objects/events, which exist in a given context with object references
obtained during the last phase (semantic analysis). For example, the
sentence “Put the banana in the basket on the shelf” can have two
semantic interpretations and pragmatic analyzer will choose between
these two possibilities.
EXPERT SYSTEM
INTRODUCTION
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 compsex 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.
INTRODUCTION
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.
Components of Expert System
2. Inference Engine(Rules of Engine)
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.
With the help of an inference engine, the system extracts the knowledge from the knowledge base.
There are two types of inference engine:
Deterministic Inference engine: The conclusions drawn from this type of inference engine are
assumed to be true. It is based on facts and rules.
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:
Forward Chaining: It starts from the known facts and rules, and applies the inference rules to add
their conclusion to the known facts.
Backward Chaining: It is a backward reasoning method that starts from the goal and works
backward to prove the known facts.
Components of Expert System
3. Knowledge Base
The knowledgebase is a type of storage that stores knowledge
acquired from the different experts of the particular domain.
It is considered as big storage of knowledge. The more the
knowledge base, the more precise will be the Expert System.
It is similar to a database that contains information and rules
of a particular domain or subject.
One can also view the knowledge base as collections of
objects and their attributes. Such as a Lion is an object and its
attributes are it is a mammal, it is not a domestic animal, etc.
Components of Knowledge Base
Factual Knowledge: The knowledge which is based on facts and
accepted by knowledge engineers comes under factual knowledge.
Heuristic Knowledge: This knowledge is based on practice, the
ability to guess, evaluation, and experiences.
Knowledge Representation: It is used to formalize the
knowledge stored in the knowledge base using the If-else rules.
Knowledge Acquisitions: It is the process of extracting,
organizing, and structuring the domain knowledge, specifying the
rules to acquire the knowledge from various experts, and store that
knowledge into the knowledge base.
Development of Expert System
Here, we will explain the working of an expert system by taking an example of MYCIN
ES. Below are some steps to build an MYCIN:
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.
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.
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.
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.
In the end, it will provide a response to the patient by using the user interface.
Participants in the development of Expert System
The response of the expert system may get wrong if the knowledge
base contains the wrong information.
Like a human being, it cannot produce a creative output for different
scenarios.
Its maintenance and development costs are very high.
Knowledge acquisition for designing is much difficult.
For each domain, we require a specific ES, which is one of the big
limitations.
It cannot learn from itself and hence requires manual updates.
Applications of Expert System
This involves −
1. Power supply
2. Image acquisition device such as camera
3. A processor
4. A software
5. A display device for monitoring the system
6. Accessories such as camera stands, cables, and connectors
Tasks of Computer Vision