0% found this document useful (0 votes)
18 views63 pages

Unit III

35643

Uploaded by

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

Unit III

35643

Uploaded by

rlekha1902
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 63

UNCERTAINTY AND

AI TECHNOLOGIES
UNIT III
Contents
• Introduction
• Non-Monotonic and Monotonic Reasoning
• Bayes Theorem
• Bayesian Networks
• Fuzzy Logic
• NLP
• Speech Recognition
Uncertainty
• Till now, we have learned knowledge representation using
first-order logic and propositional logic with certainty, which
means we were sure about the predicates.
• With this knowledge representation, we might write A→B,
which means if A is true then B is true, but consider a situation
where we are not sure about whether A is true or not then we
cannot express this statement, this situation is called
uncertainty.
• So to represent uncertain knowledge, where we are not sure
about the predicates, we need uncertain reasoning or
probabilistic reasoning.
Uncertainty
• Causes of uncertainty:
• Following are some leading causes of
uncertainty to occur in the real world.
• Information occurred from unreliable sources.
• Experimental Errors
• Equipment fault
• Temperature variation
• Climate change.
Symbolic versus statistical
reasoning
• The (Symbolic) methods basically represent uncertainty belief
as being
• True,
• False, or
• Neither True nor False.
• Some methods also had problems with
• Incomplete Knowledge
• Contradictions in the knowledge.
Symbolic versus statistical
reasoning
• Statistical methods provide a method for representing beliefs
that are not certain (or uncertain) but for which there may be
some supporting (or contradictory) evidence.
• Statistical methods offer advantages in two broad scenarios:
• Genuine Randomness-- Card games are a good example. We
may not be able to predict any outcomes with certainty but we
have knowledge about the likelihood of certain items (e.g. like
being dealt an ace) and we can exploit this.
• Exceptions-- Symbolic methods can represent this. However if
the number of exceptions is large such system tend to break down.
Many common sense and expert reasoning tasks for example.
Statistical techniques can summarise large exceptions without
resorting enumeration.
Probability
• The basic approach statistical methods adopt to deal with
uncertainty is via the axioms of probability:
• Probabilities are (real) numbers in the range 0 to 1.
• A probability of P(A) = 0 indicates total uncertainty in A,
• P(A) = 1 total certainty
• Values in between some degree of (un)certainty.
• Probabilities can be calculated in a number of ways
• Probability =
Probability
• So given a pack of playing cards the probability of being dealt
an ace from a full normal deck is
= 4 (no.of aces) / 52 (no. of cards in deck)
= 1/13.
• Similarly the probability of being dealt a spade suit is
= 13 / 52 = 1/4.
• If you have a choice of number of items k from a set of
items n then the formula is applied to find the number of ways
of making this choice. (! = factorial).
• Conditional probability, P(A|B), indicates the probability of
event A given that we know event B has occurred.
Monotonic Reasoning
• In monotonic reasoning, once the conclusion is taken, then it
will remain the same even if we add some other information to
existing information in our knowledge base. In monotonic
reasoning, adding knowledge does not decrease the set of
prepositions that can be derived.
• To solve monotonic problems, we can derive the valid
conclusion from the available facts only, and it will not be
affected by new facts.
• Monotonic reasoning is not useful for the real-time systems, as
in real time, facts get changed, so we cannot use monotonic
reasoning.
• Monotonic reasoning is used in conventional reasoning systems,
and a logic-based system is monotonic.
• Any theorem proving is an example of monotonic reasoning.
Monotonic Reasoning
• Example:
Earth revolves around the Sun.
It is a true fact, and it cannot be changed even if we add another
sentence in knowledge base like, "The moon revolves around the
earth" Or "Earth is not round," etc.
Monotonic Reasoning
• Advantages of Monotonic Reasoning:
• In monotonic reasoning, each old proof will always remain valid.
• If we deduce some facts from available facts, then it will remain
valid for always.
• Disadvantages of Monotonic Reasoning:
• We cannot represent the real world scenarios using Monotonic
reasoning.
• Hypothesis knowledge cannot be expressed with monotonic
reasoning, which means facts should be true.
• Since we can only derive conclusions from the old proofs, so new
knowledge from the real world cannot be added.
Non-monotonic Reasoning
• In Non-monotonic reasoning, some conclusions may be
invalidated if we add some more information to our knowledge
base.
• Logic will be said as non-monotonic if some conclusions can
be invalidated by adding more knowledge into our knowledge
base.
• Non-monotonic reasoning deals with incomplete and uncertain
models.
• "Human perceptions for various things in daily life, "is a
general example of non-monotonic reasoning.
• Example: Let suppose the knowledge base contains the
following knowledge:
• Birds can fly
• Penguins cannot fly
• Pitty is a bird
• So from the above sentences, we can conclude that Pitty can fly.
• However, if we add one another sentence into knowledge base
"Pitty is a penguin", which concludes "Pitty cannot fly", so it
invalidates the above conclusion.
Non-monotonic Reasoning
• Advantages of Non-monotonic reasoning:
• For real-world systems such as Robot navigation, we can use non-
monotonic reasoning.
• In Non-monotonic reasoning, we can choose probabilistic facts or
can make assumptions.
• Disadvantages of Non-monotonic Reasoning:
• In non-monotonic reasoning, the old facts may be invalidated by
adding new sentences.
• It cannot be used for theorem proving.
Monotonic Reasoning Non-Monotonic Reasoning

1
Monotonic
Monotonic Reasoning is theReasoning
process which Non-monotonicvs Non-
Reasoning is the process
does not change its direction or can say that which changes its direction or values as the
monotonic Reasoning
it moves in the one direction. knowledge base increases.

Monotonic Reasoning deals with very


Non-monotonic reasoning deals with
2 specific type of models, which has valid
incomplete or not known facts.
proofs.

The addition in knowledge will invalidate


The addition in knowledge won’t change
3 the result.
the previous conclusions and change the
result.

In non-monotonic reasoning, results and


In monotonic reasoning, results are always
set of prepositions will increase and
4 true, therefore, set of prepositions will only
decrease based on condition of added
increase.
knowledge.

Non-monotonic Reasoning is based on


5 Monotonic Reasoning is based on true facts.
assumptions.

Abductive Reasoning and Human


Deductive Reasoning is the type of
6 monotonic reasoning.
Reasoning is a non-monotonic type of
reasoning.
Bayes' theorem
• Bayes' theorem is also known as Bayes' rule, Bayes' law,
or Bayesian reasoning, which determines the probability of an
event with uncertain knowledge.
• In probability theory, it relates the conditional probability and
marginal probabilities of two random events.
• Bayes' theorem was named after the British
mathematician Thomas Bayes. The Bayesian inference is an
application of Bayes' theorem, which is fundamental to
Bayesian statistics.
• It is a way to calculate the value of P(B|A) with the knowledge
of P(A|B).
Bayes' theorem
• Example: If cancer corresponds to one's age then by using Bayes'
theorem, we can determine the probability of cancer more
accurately with the help of age.
• Bayes' theorem can be derived using product rule and conditional
probability of event A with known event B:

P(A ⋀ B)= P(A|B) P(B) or


• As from product rule we can write:

P(A ⋀ B)= P(B|A) P(A)


• Similarly, the probability of event B with known event A:

• Equating right hand side of both the equations, we will get:

• The above equation (a) is called as Bayes' rule or Bayes' theorem.


Bayes' theorem
• This equation is basic of most modern AI systems
for probabilistic inference.
• It shows the simple relationship between joint and conditional
probabilities. Here,
• P(A|B) is known as posterior, which we need to calculate, and it
will be read as Probability of hypothesis A when we have
occurred an evidence B.
• P(B|A) is called the likelihood, in which we consider that
hypothesis is true, then we calculate the probability of evidence.
• P(A) is called the prior probability, probability of hypothesis
before considering the evidence
• P(B) is called marginal probability, pure probability of an
evidence.
Bayes' theorem
• In the equation (a), in general,
• we can write P (B) = P(A)*P(B|Ai), hence the Bayes' rule can be
written as:
Bayes' theorem
• Applying Bayes' rule:
• Bayes' rule allows us to compute the single term P(B|A) in terms
of P(A|B), P(B), and P(A). This is very useful in cases where we
have a good probability of these three terms and want to
determine the fourth one. Suppose we want to perceive the effect
of some unknown cause, and want to compute that cause, then the
Bayes' rule becomes:
Bayes' theorem
• Question: From a standard deck of playing cards, a single
card is drawn. The probability that the card is king is 4/52,
then calculate posterior probability P(King|Face), which
means the drawn face card is a king card.
• Solution:

• P(king): probability that the card is King= 4/52= 1/13


• P(face): probability that a card is a face card= 3/13
• P(Face|King): probability of face card when we assume it is a
king = 1
• Putting all values in equation (i) we will get:
Bayes' theorem
• Application of Bayes' theorem in Artificial intelligence:
• Following are some applications of Bayes' theorem:
• It is used to calculate the next step of the robot when the already
executed step is given.
• Bayes' theorem is helpful in weather forecasting.
• It can solve the Monty Hall problem
Bayesian networks
• These are also called Belief Networks or Probabilistic
Inference Networks. Initially developed by Pearl (1988).
• The basic idea is:
• Knowledge in the world is modular -- most events are
conditionally independent of most other events.
• Adopt a model that can use a more local representation to allow
interactions between events that only affect each other.
• Some events may only be unidirectional others may
be bidirectional -- make a distinction between these in model.
• Events may be causal and thus get chained together in a network.
Bayesian networks
• Implementation
• A Bayesian Network is a directed acyclic graph:
• A graph where the directions are links which indicate
dependencies that exist between nodes.
• Nodes represent propositions about events or events themselves.
• Conditional probabilities quantify the strength of dependencies.
Bayesian networks
• Implementation
• Consider the following example:
• The probability, that my car won't start.
• If my car won't start then it is likely that
• The battery is flat or
• The staring motor is broken.
• In order to decide whether to fix the car myself or send it to the
garage I make the following decision:
• If the headlights do not work then the battery is likely to be flat so i
fix it myself.
• If the starting motor is defective then send car to garage.
• If battery and starting motor both gone send car to garage.
• The network to represent this is as follows:
Bayesian networks
Fuzzy Logic
• Fuzzy logic is a totally different approach to representing
uncertainty:
• It focuses on ambiguities in describing events rather the
uncertainty about the occurrence of an event.
• Changes the definitions of set theory and logic to allow this.
• Traditional set theory defines set memberships as a boolean
predicate.
Fuzzy Logic
• Fuzzy set theory defines set membership as a possibility
distribution.
• The general rule for this can expressed as:

• where n some number of possibilities.


• This basically states that we can take n possible events and
f to generate as single possible outcome.
Fuzzy Logic
• The 'Fuzzy' word means the things that are not clear or are
vague. Sometimes, we cannot decide in real life that the given
problem or statement is either true or false.
• At that time, this concept provides many values between the
true and false and gives the flexibility to find the best solution
to that problem.
Fuzzy Logic
• Fuzzy logic contains the multiple logical values and these values are the
truth values of a variable or problem between 0 and 1. This concept was
introduced by Lofti Zadeh in 1965 based on the Fuzzy Set Theory. This
concept provides the possibilities which are not given by computers, but
similar to the range of possibilities generated by humans.

• In the Boolean system, only two possibilities (0 and 1) exist, where 1


denotes the absolute truth value and 0 denotes the absolute false value.
But in the fuzzy system, there are multiple possibilities present between
the 0 and 1, which are partially false and partially true.

• The Fuzzy logic can be implemented in systems such as micro-


controllers, workstation-based or large network-based systems for
achieving the definite output. It can also be implemented in both
hardware or software.
Architecture of a Fuzzy Logic System
• In the architecture of the Fuzzy Logic system, each component
plays an important role. The architecture consists of the
different four components which are given below.
• Rule Base
• Fuzzification
• Inference Engine
• Defuzzification
Architecture of a Fuzzy Logic System
Architecture of a Fuzzy Logic
System
• Rule Base
• Rule Base is a component used for storing the set of
rules and the If-Then conditions given by the experts
are used for controlling the decision-making
systems.
• There are so many updates that come in the Fuzzy
theory recently, which offers effective methods for
designing and tuning of fuzzy controllers.
• These updates or developments decreases the
number of fuzzy set of rules.
Architecture of a Fuzzy Logic
System
• Fuzzification
• Fuzzification is a module or component for
transforming the system inputs, i.e., it converts the
crisp number into fuzzy steps.
• The crisp numbers are those inputs which are
measured by the sensors and then fuzzification
passed them into the control systems for further
processing.
• This component divides the input signals into
following five states in any Fuzzy Logic system:
• Large Positive (LP)
• Medium Positive (MP)
• Small (S)
• Medium Negative (MN)
• Large negative (LN)
Architecture of a Fuzzy Logic
System
• Inference Engine
• This component is a main component in any Fuzzy
Logic system (FLS), because all the information is
processed in the Inference Engine.
• It allows users to find the matching degree
between the current fuzzy input and the rules.
• After the matching degree, this system
determines which rule is to be added according to
the given input field.
• When all rules are fired, then they are combined
for developing the control actions.
Architecture of a Fuzzy Logic
System
• Defuzzification
• Defuzzification is a module or component, which
takes the fuzzy set inputs generated by
the Inference Engine, and then transforms them
into a crisp value.
• It is the last step in the process of a fuzzy logic
system. The crisp value is a type of value which is
acceptable by the user.
• Various techniques are present to do this, but the
user has to select the best one for reducing the
errors.
Applications of Fuzzy logic
• It is used in Businesses for decision-making support system.
• It is used in Automative systems for controlling the traffic and
speed, and for improving the efficiency of automatic
transmissions. Automative systems also use the shift scheduling
method for automatic transmissions.
• This concept is also used in the Defense in various areas.
Defense mainly uses the Fuzzy logic systems for underwater
target recognition and the automatic target recognition of
thermal infrared images.
• It is also widely used in the Pattern Recognition and
Classification in the form of Fuzzy logic-based recognition and
handwriting recognition. It is also used in the searching of fuzzy
images.
• Fuzzy logic systems also used in Securities.
Applications of Fuzzy logic
• It is also used in microwave oven for setting the lunes power and
cooking strategy.
• This technique is also used in the area of modern control
systems such as expert systems.
• Finance is also another application where this concept is used for
predicting the stock market, and for managing the funds.
• It is also used for controlling the brakes.
• It is also used in the industries of chemicals for controlling the
ph, and chemical distillation process.
• It is also used in the industries of manufacturing for the
optimization of milk and cheese production.
• It is also used in the vacuum cleaners, and the timings of
washing machines.
• It is also used in heaters, air conditioners, and humidifiers.
Advantages of Fuzzy Logic
• The methodology of this concept works similarly as the human
reasoning.
• Any user can easily understand the structure of Fuzzy Logic.
• It does not need a large memory, because the algorithms can be easily
described with fewer data.
• It is widely used in all fields of life and easily provides effective
solutions to the problems which have high complexity.
• This concept is based on the set theory of mathematics, so that's why
it is simple.
• It allows users for controlling the control machines and consumer
products.
• The development time of fuzzy logic is short as compared to
conventional methods.
• Due to its flexibility, any user can easily add and delete rules in the
FLS system.
Disadvantages of Fuzzy Logic
• The run time of fuzzy logic systems is slow and takes a long
time to produce outputs.
• Users can understand it easily if they are simple.
• The possibilities produced by the fuzzy logic system are not
always accurate.
• Many researchers give various ways for solving a given
statement using this technique which leads to ambiguity.
• Fuzzy logics are not suitable for those problems that require
high accuracy.
• The systems of a Fuzzy logic need a lot of testing for
verification and validation.
NATURAL LANGUAGE PROCESSING
Natural Language Processing
• 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.
NLP
• Modern NLP consists of various applications, like speech
recognition, machine translation, and machine text
reading.

• When we combine all these applications then it allows the


artificial intelligence to gain knowledge of the world.

• Let's consider the example of AMAZON ALEXA, using this


robot you can ask the question to Alexa, and it will reply to
you.
Advantages of NLP
• NLP helps users to ask questions about any subject and get a
direct response within seconds.
• NLP offers exact answers to the question means it does not
offer unnecessary and unwanted information.
• NLP helps computers to communicate with humans in their
languages.
• It is very time efficient.
• 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
• NLP may not show context.
• NLP is unpredictable
• NLP may require more keystrokes.
• NLP is unable to adapt to the new domain, and it has a limited
function that's why NLP is built for a single and specific task
only.
Components of NLP
• Natural Language Understanding (NLU)
helps the machine to understand and
Natural Language analyse human language by extracting the
Understanding(NLU) metadata from content such as concepts,
entities, keywords, emotion, relations, and
semantic roles.

• Natural Language Generation (NLG) acts


as a translator that converts the
Natural Language computerized data into natural language
Generations (NLG) representation. It mainly involves Text
planning, Sentence planning, and Text
Realization.
Steps to Build NLP
Steps to Build NLP
• Lexical Analysis
• It involves identifying and analyzing the structure of words.
Lexicon of a language means the collection of words and phrases
in a language. Lexical analysis is dividing the whole chunk of txt
into paragraphs, sentences, and words.
• For example,
irrationally can be broken into
ir (prefix),
rational (root) and
-ly (suffix).
• Lexical Analysis finds the relation between these morphemes and
converts the word into its root form.
• A lexical analyzer also assigns the possible Part-Of-Speech (POS)
to the word. It takes into consideration the dictionary of the
language.
Steps to Build NLP
• Syntactic Analysis (Parsing)
• It involves analysis of words in the sentence for grammar and
arranging words in a manner that shows the relationship among
the words. The sentence such as “The school goes to boy” is
rejected by English syntactic analyzer.
Syntactic Analysis
• There are a number of algorithms researchers have developed
for syntactic analysis, but we consider only the following
simple methods −
• Context-Free Grammar
• Top-Down Parser
Syntactic Analysis
• It is the grammar that consists rules with a single symbol on the left-hand side of the
rewrite rules. Let us create grammar to parse a sentence −

“The bird pecks the grains”

• Articles (DET) − a | an | the

• Nouns − bird | birds | grain | grains

• Noun Phrase (NP) − Article + Noun | Article + Adjective + Noun

• = DET N | DET ADJ N

• Verbs − pecks | pecking | pecked

• Verb Phrase (VP) − NP V | V NP

• Adjectives (ADJ) − beautiful | small | chirping


Syntactic Analysis
• The parse tree breaks down the sentence into structured parts
so that the computer can easily understand and process it. In
order for the parsing algorithm to construct this parse tree, a set
of rewrite rules, which describe what tree structures are legal,
need to be constructed.

• These rules say that a certain symbol may be expanded in the


tree by a sequence of other symbols. According to first order
logic rule, if there are two strings Noun Phrase (NP) and Verb
Phrase (VP), then the string combined by NP followed by VP
is a sentence.
Syntactic Analysis
• The rewrite rules for the sentence are as follows −
• S → NP VP
• NP → DET N | DET ADJ N
• VP → V NP
• Lexicon −
• DET → a | the
• ADJ → beautiful | perching
• N → bird | birds | grain | grains
• V → peck | pecks | pecking
Syntactic Analysis
• Top-Down Parser
• Here, the parser starts with the S symbol and attempts to rewrite it
into a sequence of terminal symbols that matches the classes of
the words in the input sentence until it consists entirely of
terminal symbols.
• These are then checked with the input sentence to see if it
matched. If not, the process is started over again with a different
set of rules. This is repeated until a specific rule is found which
describes the structure of the sentence.
• Merit − It is simple to implement.
• Demerits −
• It is inefficient, as the search process has to be repeated if an error
occurs.
• Slow speed of working.
Steps to Build NLP
• Semantic Analysis
• It draws the exact meaning or the dictionary meaning from the text.
The text is checked for meaningfulness. It is done by mapping
syntactic structures and objects in the task domain. The semantic
analyzer disregards sentence such as “hot ice-cream”.

• Consider the sentence: “The apple ate a banana”. Although the


sentence is syntactically correct, it doesn’t make sense because apples
can’t eat. Semantic analysis looks for meaning in the given sentence. It
also deals with combining words into phrases.

• For example, “red apple” provides information regarding one object;


hence we treat it as a single phrase. Similarly, we can group names
referring to the same category, person, object or organisation. “Robert
Hill” refers to the same person and not two separate names – “Robert”
and “Hill”.
Steps to Build NLP
• Discourse Integration
• The meaning of any sentence depends upon the meaning of the
sentence just before it. In addition, it also brings about the
meaning of immediately succeeding sentence.

• Discourse deals with the effect of a previous sentence on the


sentence in consideration. In the text,
“Jack is a bright student. He spends most of the time in the library.”
Here, discourse assigns “he” to refer to “Jack”.
Steps to Build NLP
• Pragmatic Analysis
• During this, what was said is re-interpreted on what it actually
meant. It involves deriving those aspects of language which
require real world knowledge.

• “Turn off the lights” is an order or request to switch off the


lights.
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.

• Speech is the most basic means of adult human communication. The basic goal
of speech processing is to provide an interaction between a human and a
machine.

• Speech processing system has mainly three tasks −

• First, speech recognition that allows the machine to catch the words, phrases and
sentences we speak

• Second, natural language processing to allow the machine to understand what we


speak, and

• Third, speech synthesis to allow the machine to speak.


Speech Recognition
• Models
• Acoustic models. These represent the relationship between
linguistic units of speech and audio signals.
• Language models. Here, sounds are matched with word
sequences to distinguish between words that sound similar.
Speech Recognition - Features
• Language weighting. This feature tells the algorithm to give
special attention to certain words, such as those spoken
frequently or that are unique to the conversation or subject. For
example, the software can be trained to listen for specific
product references.
• Acoustic training. The software tunes out ambient noise that
pollutes spoken audio. Software programs with acoustic
training can distinguish speaking style, pace and volume amid
the din of many people speaking in an office.
• Speaker labeling. This capability enables a program to label
individual participants and identify their specific contributions
to a conversation.
• Profanity filtering. Here, the software filters out undesirable
words and language.
What are the advantages of
speech recognition?
• Machine-to-human communication. The technology enables
electronic devices to communicate with humans in natural
language or conversational speech.
• Readily accessible. This software is frequently installed in
computers and mobile devices, making it accessible.
• Easy to use. Well-designed software is straightforward to
operate and often runs in the background.
• Continuous, automatic improvement. Speech recognition
systems that incorporate AI become more effective and easier
to use over time. As systems complete speech recognition
tasks, they generate more data about human speech and get
better at what they do.
What are the disadvantages of
speech recognition?
• Inconsistent performance. The systems may be unable to
capture words accurately because of variations in
pronunciation, lack of support for some languages and inability
to sort through background noise. Ambient noise can be
especially challenging. Acoustic training can help filter it out,
but these programs aren't perfect. Sometimes it's impossible to
isolate the human voice.
• Speed. Some speech recognition programs take time to deploy
and master. The speech processing may feel relatively slow.
• Source file issues. Speech recognition success depends on the
recording equipment used, not just the software.

You might also like