0% found this document useful (0 votes)
57 views21 pages

HTML and CSS PDF

The document defines key concepts in artificial intelligence including defining AI, providing a brief history, describing intelligent agents and common programming languages used for AI. It also covers knowledge representation methods such as semantic networks, frames, predicate logic and rule-based systems.

Uploaded by

Sara Jodayree
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)
57 views21 pages

HTML and CSS PDF

The document defines key concepts in artificial intelligence including defining AI, providing a brief history, describing intelligent agents and common programming languages used for AI. It also covers knowledge representation methods such as semantic networks, frames, predicate logic and rule-based systems.

Uploaded by

Sara Jodayree
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
You are on page 1/ 21

In this section we first try to define the term artificial intelligence (AI) informally

and give
a brief history of it. We also define an intelligent agent and its two broad
categories. Finally,
we mention two programming languages that are commonly used in artificial
intelligence.
18.1.1 What is artificial intelligence?
Although there is no universally agreed definition of artificial intelligence, we
accept the
following definition that matches the topics covered in this chapter:
18.1.2 A brief history of artificial intelligence
Although artificial intelligence as an independent field of study is relatively new, it
has
some roots in the past. We can say that it started 2400 years ago when the Greek
philosopher
Aristotle invented the concept of logical reasoning. The effort to finalize the
language
of logic continued with Leibniz and Newton. George Boole developed Boolean
algebra in the nineteenth century (Appendix E) that laid the foundation of
computer
circuits. However, the main idea of a thinking machine came from Alan Turing,
who proposed
the Turing test. The term ‘artificial intelligence’ was first coined by John
McCarthy
in 1956.
18.1.3 The Turing test
In 1950, Alan Turing proposed the Turing Test, which provides a definition of
intelligence
in a machine. The test simply compares the intelligent behavior of a human being
with
that of a computer. An interrogator asks a set of questions that are forwarded to
both a
computer and a human being. The interrogator receives two sets of responses, but
does
not know which set comes from the human and which set from the computer. After
careful
examination of the two sets, if the interrogator cannot definitely tell which set has
come from the computer and which from the human, the computer has passed the
Turing
test for intelligent behavior.
18.1.4 Intelligent agents
An intelligent agent is a system that perceives its environment, learns from it, and
interacts
with it intelligently. Intelligent agents can be divided into two broad categories:
software
agents and physical agents.
Software agents
A software agent is a set of programs that are designed to do particular tasks. For
example,
some intelligent systems can be used to organize electronic mail (email). This type
of
agent can check the contents of received emails and classify them into different
categories
(junk, less important, important, very important, and so on). Another example of
software
agents is a search engine used to search the World Wide Web and find sites that
can provide
information about a requested subject.
Physical agents
A physical agent (robot) is a programmable system that can be used to perform a
variety
of tasks. Simple robots can be used in manufacturing to do routine jobs such as
assembling,
welding, or painting. Some organizations use mobile robots that do delivery jobs
such as distributing mail or correspondence to different rooms. There are mobile
robots
that are used underwater for prospecting for oil.
A humanoid robot is an autonomous mobile robot that is supposed to behave like a
human. Although humanoid robots are prevalent in science fiction, there is still a
lot of
work to do before such robots will be able to interact properly with their
surroundings
and learn from events that occur there.
18.1.5 Programming languages
Although some all-purpose languages such as C, C++, and Java are used to create
intelligent
software, two languages are specifically designed for AI: LISP and PROLOG.
LISP
LISP (LISt Programming) was invented by John McCarthy in 1958. As the name
implies,
LISP is a programming language that manipulates lists. LISP treats data as well as
programs
as lists, which means that a LISP program can change itself. This feature matches
the idea of an intelligent agent that can learn from its environment and improve its
behavior.
However, one drawback of LISP is its sluggishness. It is slow if the list to be
handled
is long. Another drawback is the complexity of its syntax.
PROLOG
PROLOG (PROgramming in LOGic) is a language that can build a database of
facts and
a knowledge base of rules. A program in PROLOG can use logical reasoning to
answer
questions that can be inferred from the knowledge base. However, PROLOG is not
a very
efficient programming language. Some complex problems can be more efficiently
solved
using other languages, such as C, C++, or Java.
18.2 KNOWLEDGE REPRESENTATION
If an artificial agent is supposed to solve some problems related to the real world, it
needs
to be able to represent knowledge somehow. Facts are represented as data
structures that
can be manipulated by programs stored inside the computer. In this section, we
describe
four common methods for representing knowledge: semantic networks, frames,
predicate
logic, and rule-based systems.
18.2.1 Semantic networks
Semantic networks were developed in the early 1960s by Richard H. Richens. A
semantic
network uses directed graphs to represent knowledge. A directed graph, as
discussed in
Chapter 12, is made of vertices (nodes) and edges (arcs). Semantic networks use
vertices
to represent concepts, and edges (denoted by arrows) to represent the relation
between
two concepts (Figure 18.1).
Concepts
To develop an exact definition of a concept, experts have related the definition of
concepts
to the theory of sets. A concept, therefore, can be thought of as a set or a subset.
For example,
animal defines the set of all animals, horse defines the set of all horses and is a
subset of
the set animal. An object is a member (instance) of a set. Concepts are shown by
vertices.
Relations
In a semantic network, relations are shown by edges. An edge can define a
subclass relation—
the edge is directed from the subclass to its superclass. An edge can also define an
instance
relation—the edge is directed from the instance to the set to which it belongs. An
edge can
also define an attribute of an object (color, size, …). Finally, an edge can define a
property
of an object, such as possessing another object. One of the most important relations
that
can be well defined in a semantic network is inheritance. An inheritance relation
defines the
fact that all the attributes of a class are present in an inherited class. This can be
used to
infer new knowledge from the knowledge represented by the graph.
18.2.2 Frames
Frames are closely related to semantic networks. In semantic networks, a graph is
used to
represent knowledge: in frames, data structures (records) are used to represent the
same
knowledge. One advantage of frames over semantic networks is that programs can
handle
frames more easily than semantic networks. Figure 18.2 shows how the semantic
network
shown in Figure 18.1 can be implemented using frames.
Objects
A node in a semantic network becomes an object in a set of frames, so an object
can define
a class, a subclass, or an instance of a class. In Figure 18.2 reptile, mammal, dog,
Roxy, and
Ringo are objects.
Slots
Edges in semantic networks are translated into slots—fields in the data structure.
The
name of the slot defines the type of the relationship and the value of the slot
completes
the relationship. In Figure 18.2, for example, animal is a slot in the reptile object.
18.2.3 Predicate logic
The most common knowledge representation is predicate logic. Predicate logic can
be
used to represent complex facts. It is a well-defined language developed via a long
history
of theoretical logic. Although this section defines predicate logic, we first
introduce
propositional
logic, a simpler language. We then discuss predicate logic, which employs
propositional logic.
Propositional logic
Propositional logic is a language made up from a set of sentences that can be used
to carry
out logical reasoning about the world.
Operators
Propositional logic uses five operators, as shown below:
The first operator is unary—the operator takes only one sentence: the other four
operators
are binary—they take two sentences. The logical value (true or false) of each
sentence
depends on the logical value of the atomic sentences (sentences with no operators)
of
which the complex sentence is made. Figure 18.3 shows the truth table for each
logical
operator in propositional logic. Truth tables were introduced in Chapter 4 and
explained
in Appendix E.
Sentence
A sentence in this language is defined recursively as shown below:
1. An uppercase letter, such as A, B, S, or T, that represents a statement in a natural
languages,
is a sentence.
2. Any of the two constant values (true and false) is a sentence.
3. If P is a sentence, then Å P is a sentence.
4. If P and Q are sentences, then P ∨ Q, P ∧ Q, P → Q, and P ↔ Q are sentences.
Example 18.1
The following are sentences in propositional language:
a. Today is Sunday (S).
b. It is raining (R).
c. Today is Sunday or Monday (S ∨ M).
d. It is not raining (Å R)
e. If a dog is a mammal then a cat is a mammal (D → C)
Deduction
In AI we need to create new facts from the existing facts. In propositional logic,
the process
is called deduction. Given two presumably true sentences, we can deduce a new
true
sentence. The first two sentences are called premisses: the deduced sentence is
called the
conclusion. The whole is called an argument. For example:
If we use H for ‘he is at home’, O for ‘he is at office’, and the symbol |- for the
‘therefore’,
then we can show the above argument as:
The question is how we can prove if a deductive argument is valid. A valid
deductive
argument is an argument whose conclusions follow necessarily from its premisses.
In other
words, in a valid deductive argument, it is impossible for the conclusion to be false
while
its premisses all are true.
One way to do this is to create a truth table for the premisses and the conclusion.
A conclusion is invalid if we can find a counterexample case: a case in which both
premisses
are true, but the conclusion is false.
Example 18.2
The validity of the argument {H ∨ O, Å H} |- O can be proved using the following
truth
table:
The only row to be checked is the second row. This row does not show a
counterexample,
so the argument is valid. There are however arguments that are not logically valid.
For
example
It can be seen that even if the first two sentences are true, the conclusion can be
false. We
can show the above argument as {R → C, C} |- R, in which R means ‘She is rich’,
and C
means ‘she has a car’.
Example 18.3
The argument {R → C, C} |- R is not valid because a counterexample can be found
Here row 2 and row 4 need to be checked. Although row 4 is ok, row 2 shows a
counter
example
(two true premisses result in a false conclusion). The argument is therefore
invalid.
Predicate logic
In propositional logic, a symbol that represents a sentence is atomic: it cannot be
broken
up to find information about its components. For example, consider the sentences:
We can combine these two sentences in many ways to create other sentences, but
we
cannot extract any relation between Linda and Anne. For example, we cannot infer
from
the above two sentences that Linda is the grandmother of Anne. To do so, we need
predicate
logic: the logic that defines the relation between the parts in a proposition.
In predicate logic, a sentence is divided into a predicate and arguments. For
example,
each of the following propositions can be written as predicates with two
arguments:
The relationship of motherhood in each of the above sentences is defined by the
predicate
mother. If the object Mary in both sentences refers to the same person, we can infer
a new
relation between Linda and Anne: grandmother (Linda, Anne). This is the whole
purpose
of predicate logic.
Sentence
A sentence in predicate language is defined as follows:
1. A predicate with n arguments such as predicate_name (argument1, …,
argumentn)
is a sentence. The predicate_name relates arguments to each other. Each argument
can be:
a. A constant, such as human, animal, John, Mary.
b. A variable, such as x, y, and z.
c. A function such as mother (Anne). Note that a function is a predicate that is
used as an argument: a function returns an object that can takes the place of an
argument.
2. Any of the two constant values (true and false) is a sentence.
3. If P is a sentence, then Å P is a sentence.
4. If P and Q are sentences, then P ∨ Q, P ∧ Q, P → Q, and P ↔ Q are sentences.
Example 18.4
1. The sentence ‘John works for Ann’s sister’ can be written as:
works [John, sister (Ann)]
in which the function sister (Ann) is used as an argument.
2. The sentence ‘John’s father loves Ann’s sister’ can be written as:
loves [father (John), sister (Ann)]
Quantifiers
Predicate logic allows us to use quantifiers. Two quantifiers are common in
predicate
logic: ∀ and ∃.
1. The first, ∀, which is read as ‘for all’, is called the universal quantifier: it states
that
something is true for every object that its variable represents.
2. The second, ∃, which is read as ‘there exists’, is called the existential quantifier:
it states
that something is true for one or more objects that its variable represents.
Example 18.5
The following shows how English sentences can be written as sentences in
predicate logic
(X is a placeholder):
1. The sentence ‘All men are mortals’ can be written as:
∀x [man (x) → mortal (x)]
2. The sentence ‘Frogs are green’ can be written as:
∀x [frog (x) → green (x)]
because the sentence can be written as ‘All frogs are green’ or ‘Any frog is green’.
The
predicate greenness is applied to all frogs.
3. The sentence ‘Some flowers are red’ can be written as:
∃x [flower (x) ∧ red(x)]
Note that the operator inside the bracket is ∧ instead of →, but the reason for this is
beyond the scope of this book.
4. The sentence ‘John has a book’ can be written as:
∃ x [book (x) ∧ has (John, x)]
In other words, the sentence is changed to ‘There exists a book that belongs to
John’.
5. The sentence ‘No frog is yellow’ can be written as:
∀x[frog (x) → Å yellow (x)] or as Å ∃x [frog (x) ∧ yellow (x)]
which means that ‘It is not the case that there exists a frog and it is yellow’.
Deduction
In predicate logic, if there is no quantifier, the verification of an argument is the
same as
that which we discussed in propositional logic. However, the verification becomes
more
complicated if there are quantifiers. For example, the following argument is
completely
valid:
Verification of this simple argument is not difficult. We can write this argument as:
Since the first premises talks about all men, we can replace one instance of the
class man
(Socrates) in that premiss to get the following argument:
which is reduced to M1 → M2, M1 |- M2, in which M1 is man (Socrates) and M2
is mortal
(Socrates). The result is an argument in propositional logic and can be easily
validated.
However, there are many arguments in predicate logic that cannot be validated so
easily.
We need a set of systematic proofs that are beyond the scope of this book.
Beyond predicate logic
There have been further developments in logic to include the need of logical
reasoning.
Some examples of these include high-order logic, default logic, modal logic, and
temporal
logic. We briefly mention these topics here only for interest: their discussion is
beyond the
scope of this book.
High-order logic
High-order logic extends the scope of quantifiers ∀ and ∃ in predicate logic. These
quantifiers
in predicate logic bind variables x and y to instances (when instantiating). In high-
order
logic we can use these quantifiers for binding variables that stand for properties
and
relations. In this case, during instantiation, these variables are replaced by
predicates. For
example, we can have ∀P (Pj ∧ Pa), where the subscripts j and a denote John and
Anne,
which means that John and Anne have exactly the same properties.
Modal logic
One fast-growing trend in logic is modal logic, which includes expressions such as
‘could’,
‘should’, ‘may’, ‘might’, ‘ought’, and so on, to express the grammatical mood of a
sentence.
In this logic, we can have symbols to denote operators such as ‘it is possible that’.
Temporal logic
Temporal logic, like modal logic, extends predicate logic with a set of temporal
operators
such as ‘from now on’ or ‘at some point in time’ to include the time factor in the
validity
of the argument.
Default logic
In default logic, we assume that the default conclusion of an argument is
acceptable if it
is consistent with the contents of the knowledge base. For example, we assume that
all
birds fly unless there is something in the knowledge base that annuls this general
fact.
18.2.4 Rule-based systems
A rule-based system represents knowledge using a set of rules that can be used to
deduce
new facts from known facts. The rules express what is true if specific conditions
are met.
A rule-based database is a set of if… then… statements in the form
in which A is called the antecedent and B is called the consequent. Note that in a
rule-based
system, each rule is handled independently without any connection to other rules.
Components
A rule-based system is made up of three components: an interpreter (or inference
engine),
a knowledge base, and a fact database, as shown in Figure 18.4.
Knowledge base
The knowledge base component in a rule-based system is a database (repository)
of rules.
It contains a set of pre-established rules that can be used to draw conclusions from
the
given facts.
Database of facts
The database of facts contains a set of conditions that are used by the rules in the
knowledge
base.
The interpreter (inference engine) is a processor or controller—a program, for
example—
that combines rules and facts. Interpreters are of two types: forward chaining and
backward
chaining, as we briefly explain.
Forward chaining
Forward chaining is the process in which an interpreter uses a set of rules and a set
of facts
to perform an action. The action can be just adding a new fact to the base of facts,
or issuing
some commands, such as start another program or a machine. The interpreter
interprets
and executes rules until no more rules can be interpreted. Figure 18.5 shows the
basic algorithm.
If there is any conflict in which two different rules can be applied to one fact or
one rule
can be applied to two facts, the system needs to call a conflict resolution procedure
to
solve the problem. This guarantees that only one of the outputs should be added to
the
database of facts or only one action should be taken. The discussion of conflict
resolution
is complex and beyond the scope of this book.
Backward chaining
Forward chaining is not very efficient if the system tries to prove a conclusion. All
facts
must be checked by all rules to come up with the given conclusion. In this case, it
may be
more efficient if backward chaining is used. Figure 18.6 shows the procedure for
backward
chaining.
The process starts with the conclusion (goal). If the goal is already in the fact
database, the
process stops and the conclusion is proved. If the goal is not in the fact database,
the system
finds the rule that has the goal in its conclusion. However, instead of firing that
rule,
backward chaining is now applied to each fact in the rule (recursion). If all of the
facts in
that rule are found in the database fact, the original goal is proved.
18.3 EXPERT SYSTEMS
Expert systems use the knowledge representation languages discussed in the
previous
section to perform tasks that normally need human expertise. They can be used in
situations
in which that expertise is in short supply, expensive, or unavailable when required.
For example, in medicine, an expert system can narrow down a set of symptoms to
a likely
subset of causes, a task normally carried out by a doctor.
18.3.1 Extracting knowledge
An expert system is built on predefined knowledge about its field of expertise. An
expert
system in medicine, for example, is built on the knowledge of a doctor specialized
in the
field for which the system is built: an expert system is supposed to do the same job
as the
human expert. The first step in building an expert system is therefore to extract the
knowledge from a human expert. This extracted knowledge becomes the
knowledge base
we discussed in the previous section.
Extracting knowledge from an expert is normally a difficult task, for several
reasons:
1. The knowledge possessed by the expert is normally heuristic: it is based on
probability
rather than certainty.
2. The expert often finds it hard to express their knowledge in such a way that it
can
be stored in a knowledge base as exact rules. For example, it is hard for an
electrical
engineer to show how, step by step, a faulty electric motor can be diagnosed. The
knowledge is normally intuitive.
3. Knowledge acquisition can only be done via personal interview with the expert,
which can be a tiring and boring task if the interviewer is not an expert in this type
of interview.
The knowledge-extraction process is normally done by a knowledge engineer, who
may not
be expert in the field for which the expert system is to be built, but has the
expertise to
know how to do the interview and how to interpret the answers so that they can be
used
in building the knowledge base.
18.3.2 Extracting facts
To be able to infer new facts or perform actions, a fact database is needed in
addition to
the knowledge base for a knowledge representation language. The fact database in
an
expert system is case-based, in which facts collected or measured are entered into
the
system to be used by the inference engine.
18.3.3 Architecture
Figure 18.7 shows the general idea behind the architecture of an expert system. As
the
figure shows, an expert system can have up to seven components: user, user
interface, inference
engine, knowledge base, fact database, explanation system, and knowledge base
editor.
The inference engine is the heart of an expert system: it communicates with the
knowledge base, fact database, and the user interface. Four of the seven
components of an
expert system—user interface, inference engine, explanation system, and
knowledge base
editor—can be made once and used for many applications, as they are not
dependent on
the particular knowledge base or fact database. The figure shows these components
in the
shaded box, normally called an expert system shell.
User
The user is the entity that uses the system to benefit from the expertise offered.
User interface
The user interface allows the user to interact with the system. The user interface
can
accept natural language from the user and interpret it for the system. Most user
interfaces
also offer a user-friendly menu system.
Inference engine
The inference engine is the heart of the system that uses the knowledge base and
the fact
database to infer the action to be taken.
Knowledge base
The knowledge base is a collection of knowledge based on interviews with experts
in the
relevant field of expertise.
Fact database
The fact database in an expert system is case-based. For each case, the user enters
the
available or measured data into the fact database to be used by the inference engine
for
that particular case.
Explanation system
The explanation system, which may not be included in all systems, is used to
explain the
rationale behind the decision made by the inference engine.
Knowledge base editor
The knowledge base editor, which may not be included in all systems, is used to
update
the knowledge base if new experience has been obtained from experts in the field.
18.4 PERCEPTION
One of the goals in artificial intelligence is to create a machine that behaves like an
expert—an expert system. Another goal is to create a machine that behaves like an
ordinary
human. One of the meanings of the word ‘perception’ is understanding what is
received through the senses—sight, hearing, touch, smell, taste. A human being
sees a
scene through the eyes, and the brain interprets it to extract the type of the objects
in the
scene. A human being hears a set of voice signals through the ears, and the brain
interprets
it as a meaningful sentence, and so on.
An intelligent agent should be able to perceive if it needs to act like a human being.
AI has been particularly involved in two types of perception, sight and hearing,
although
other types of perception may be implemented in the future. In this section we
briefly
discuss these two areas of research.
18.4.1 Image processing
Image processing or computer vision is an area of AI that deals with the perception
of
objects through the artificial eyes of an agent, such as a camera. An image
processor takes
a two-dimensional image from the outside world and tries to create a description of
the
three-dimensional objects present in the scene. Although this is an easy task for a
human
being, it turns out to be a difficult task for an artificial agent. The input presented
to an
image processor is one or more images from the scene, while the output is a
description
of the objects in the scene. The processor uses a database containing the
characteristics of
objects for comparison (Figure 18.8).
We need to emphasize that image acquisition uses photography and television
technology
to creates images. The concern of AI is how to interpret the images and extract the
characteristics
of the objects.
Edge detection
The first stage in image processing is edge detection: finding where the edges in
the image
are. Edges can define the boundaries between an object and its background in the
image.
Normally there is a sharp contrast between the surfaces belonging to an object and
the
environment, assuming that there is no camouflage. Edges show discontinuity in
surface,
in depth, or in illumination. For example, Figure 18.9 shows a very simple image
and the
intensity of pixels on a scale 0 to 9, where 0 is black and 9 is white. The edges can
be
detected by finding adjacent pixels with a large difference in intensity.
There are several mathematical methods that use the intensity of the pixels to find
the
boundary of the objects with respect to the background. The simplest method is to
differentiate
the matrix of intensities. The areas that have consistent intensity will produce low
differentials (0 or 1): the edges will produce greatest differentials. Discussion of
these
methods is beyond the scope of this book: we recommend the reference books
listed at
the end of this chapter for further study.
Segmentation
Segmentation is the next stage in image analysis. Segmentation divides the image
into
homogeneous segments or areas. The definition of homogeneity differs in different
methods,
but in general a homogeneous area is an area in which the intensity of pixels varies
smoothly. Segmentation is very similar to edge detection. In edge detection, the
boundaries
of the object and the background are found: in segmentation, the boundaries
between
different areas inside the object are found. After segmentation, the object is divided
into
different areas.
Several methods have been used for segmentation. One is called thresholding, in
which a pixel with a specific intensity is selected and the process tries to find all
the
pixels with the same or very close intensity. All pixels found in this way make a
segment.
Another method is called splitting. Splitting takes an area that is not homogeneous
and
divides it into several homogeneous areas. Still another method is called merging,
which
can be used to merge areas with the same pixel intensity.
Finding depth
The next step in image analysis is to find the depth of the object or objects in the
image.
Depth finding can help the intelligent agent to gauge how far the object is from it.
Two
general methods have been used for this purpose: stereo vision and motion.
Stereo vision
Stereo vision (sometimes called stereopsis) uses the technique deployed by human
eyes to
find the depth of the object. To have good distance recognition, a human being
needs two
eyes. If the object is very close, the two images created in our eyes are different,
but if the
object is far away the two images are almost the same. Without delving into
mathematical
calculation and proof, we can say that one of the tools for recognizing the distance
of
objects is to use two eyes or two cameras. The picture created from two cameras
can help
the intelligent agent to gauge if the object is close or far away.
Motion
Another method that can help to find the distance of objects in an image is to
create several
images when one or more objects are moving. The relative position of a moving
object
with respect to other objects in the scene can give a clue to the distance of objects.
For
example, assume that a video shows a person moving in front of a house. The
relative
position of the person and house (a close object) will change, but the relative
position of
the person and a distant mountain will remain the same. The intelligent agent can
conclude
that the house is close but the mountain is far away.
Finding orientation
Orientation of the object in the scene can be found using two techniques: shading
and
texture.
Shading
The amount of light reflected from a surface depends on several factors. If the
optical
properties of the different surfaces of an object are the same, the amount of
reflection
depends on the orientation of the surface (its relative position) which reflects the
light
source. Figure 18.10 shows two drawn objects. The one that is shaded definitely
shows the
orientation of the object’s surfaces more accurately.
Texture
Texture (a regularly repeated pattern) can also help in finding the orientation or the
curvature
of a surface. If an intelligent agent can recognize the pattern, it can help it to find
an object’s orientation or curvature.
Object recognition
The last step in image processing is object recognition. To recognize an object, the
agent
needs to have a model of the object in memory for comparison. However, creating
and
storing a model for each object in the view is an impossible task. One solution is to
assume
that the objects to be recognized are compound objects made of a set of simple
geometric
shapes. These primitive shapes can be created and stored in the intelligent agent’s
memory,
then classes of object that we need the agent to recognize can be created from a
combination of these objects, and stored.
When an agent ‘sees’ an object, it tries to decompose the object into a combination
of
the primitives. If the combination matches one of the classes already known to the
object,
the object is recognized. Figure 18.11 shows a small set of primitive geometric
shapes
Applications
One of the areas in which image processing has found application is in
manufacturing,
particularly on assembly lines. A robot with image-processing capability can be
used to
determine the position of an object on the assembly line. In this environment,
where the
number of objects to be perceived is limited, an image processor can be very
helpful.
18.4.2 Language understanding
One of the inherent capabilities of a human being is to understand—that is,
interpret—
the audio signals that they perceive. A machine that can understand natural
language can
be very useful in daily life. For example, it can replace—most of the time—a
telephone
operator. It can also be used on occasions when a system needs a predefined format
of
queries. For example, the queries given to a database must normally follow the
format
used by that specific system. A machine that can understand queries in natural
language
and translate them to formal queries can be very useful.
We can divide the task of a machine that understands natural language into four
consecutive steps: speech recognition, syntactic analysis, semantic analysis, and
pragmatic
analysis.
Speech recognition
The first step in natural language processing is speech recognition. In this step, a
speech
signal is analyzed and the sequence of words it contains are extracted. The input to
the
speech recognition subsystem is a continuous (analog) signal: the output is a
sequence of
words. The signal needs to be divided into different sounds, sometimes called
phonemes.
The sounds then need to be combined into words. The detailed process, however,
is beyond
the scope of this book: we leave the task to specialized books in speech
recognition.
Syntactic analysis
The syntactic analysis step is used to define how words are to be grouped in a
sentence.
This is a difficult task in a language like English, in which the function of a word
in a sentence
is not determined by its position in the sentence. For example, in the following two
sentences:
it is always John who is rewarded, but in the first sentence John is in the last
position and
Mary is in the first position. A machine that hears any of the above sentences needs
to interpret
them correctly and come to the same conclusion no matter which sentence is heard.
Grammar
The first tool to correctly analyze a sentence is a well-defined grammar. A fully
developed
language like English has a very long set of grammatical rules. We assume a very
small
subset of the English language and define a very small set of rules just to show the
idea.
The grammar of a language can be defined using several methods: we use a simple
version of BNF (Backus–Naur Form) that is used in computer science to define the
syntax
of a programming language (Table 18.1).
The first rule defines a sentence as a noun phrase followed by a verb phrase. The
second
rule defines three choices for a noun phrase: a single noun, an article followed by a
noun,
or an article followed by an adjective and a noun. The fourth rule explicitly defines
what
a noun can be. In our simple language, we have defined only seven nouns: in a
language
like English the list of nouns is defined in a dictionary. The sixth rule also defines a
very
small set of adjectives and the seventh rule a small set of verbs.
Although the syntax of our language is very primitive, we can make many
sentences
out of it. For example, we can have:
Parser
It should be clear that even a simple grammar as defined in Table 18.1 uses
different
options. A machine that determines if a sentence is grammatically (syntactically)

You might also like