0% found this document useful (0 votes)
37 views66 pages

AI Lecture Notes Chapter 3 To 6

Uploaded by

Reis Dura
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)
37 views66 pages

AI Lecture Notes Chapter 3 To 6

Uploaded by

Reis Dura
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/ 66

July, 2022

COLLEGE OF COMPUTING AND INFORMATICS


SCHOOL OF INFORMATION SYSTEMS

Fundamentals of Artificial Intelligence

Chapter Three
Problem Solving :
Goal based Agents
Kedir Genna (MSc.)

Compiled by Kedir G for FINAL 1


July, 2022

Contents
1. What is a
Problem
Problem solving?
2. Problem Solving by Searching
3. Problem Formulation
4. Search Strategies
5. Avoiding Repeated States
6. Constraint Satisfaction Search

What is Problem
 Problem is a collection of information that the agent will use to decide
what to do
 Problems have the general form: given such-and-such information,
find x.
 Problems are the issues which comes across any system.

 A solution is needed to solve that particular problem.


Example: Route-finding problem.

Compiled by Kedir G for FINAL 2


July, 2022

What is problem solving-agent


• When the correct action to take is not immediately obvious, an agent may need to
plan ahead: to consider a sequence of actions that form a path to a goal state.

• Such an agent is called a problem-solving agent, and the computational process it


undertakes is called search.

• Problem-solving agents in AI mostly uses search strategies or algorithms to solve a


specific problem and provide the best result.

• The problem-solving agent preforms precisely by defining problems and its several
solutions.

What is problem solving-agent……


• Problem Solving Agent an agent that tries to come up with a sequence of actions
that will bring the environment into a desired state.

• The process of looking for such a sequence of actions is called search

• Search techniques are universal problem-solving methods.

• Problem-solving agents are the goal-based agents.

• They use atomic representations

• Goal-based agents using factored or structured representations are called Planning


agents.

Compiled by Kedir G for FINAL 3


July, 2022

Four steps in problem solving process


 Having some information about its environment
(for instance, maps), the agent can follow four-phase
problem-solving process:
1. Goal Formulation: It organizes the steps/sequence required to formulate one
goal out of multiple goals as well as actions to achieve that goal.
2. Problem Formulation: is the process of deciding what actions and states to
consider, to achieve the formulated goal.

Four steps in problem solving process……


There are following five components involved in problem
formulation:
 Initial State: It is the starting state or initial step of the agent towards its goal.
 Actions: It is the description of the possible actions available to the agent.
 Transition Model: other states in between initial and goal states
 Goal Test: It determines if the given state is a goal state.
 Path cost: It assigns a numeric cost to each path that follows the goal to the
number of paths

Compiled by Kedir G for FINAL 4


July, 2022

Four steps in problem solving process……


3. Search: Searching is a step by step procedure to solve a search-problem in a given
search space.
• Before taking any action in the real world, the agent simulates sequences of actions in
its model, searching until it finds a sequence of actions that reaches the goal.
• Such a sequence is called a solution.
• A search algorithm takes a problem as input and returns a solution in the form of
an action sequence.
4. Execute the Solution: It is an action sequence which leads from the start state to the goal
 Select the solution with lowest cost among all solutions(Optimal solution).
 Solution can be provided as state sequence or action sequence

* Well defined Problems and Solutions


To define a problem, we need the following elements:
states, operators, transition model, goal test function and action cost
function.
1. States
• The initial state is the state that the agent starts in or begins with.
• Example- the initial state for each of the following:
• Route finding problem
• The point where the agent start its journey (SidistKilo?)
• 8-puzzle problem ??

Compiled by Kedir G for FINAL 5


July, 2022

Well defined Problems and Solutions


2. Operators
•The set of possible actions available to the agent, i.e.
•which state(s) will be reached by carrying out the action in a particular
state
•What the agent can do.
•A Successor function S(x)ACTION(x), x is a state
• Is a function that returns the set of states that are reachable from a single state by
any single action/operator
• Given state x, S(x) returns the set of states reachable from x by any single action
• Example: Route finding problem: Drive through cities/places
drive (place x, place y)
•8-puzzle ??

Well defined Problems and Solutions


3. Transition Model:
• Describes what each action does.
• RESULT(s, a) returns the state that results from doing action in state. For
example;
RESULT(Harar, ToAdama) =Adama

• If an environment is observable, discrete, unknown and deterministic


then the solution to any problem in that environment will be a fixed
sequence of actions.

Compiled by Kedir G for FINAL 6


July, 2022

Well defined Problems and Solutions


4. Goal test function
•The agent execute to determine if it has reached the goal
state or not
• Is a function which determines if the state is a goal state or not
•Example:
• Route finding problem: Reach Addis Ababa airport on time
 IsGoal(x, Addis_Ababa)
• 8-puzzle ??

Well defined Problems and Solutions


5. Path cost function/ Action Cost Function
• A function that assigns a cost (numeric value) to each path (sequence of
actions).
• Is often denoted by g. Usually, it is the sum of the costs of the individual actions along the
path (from one state to another state)
• Measure path cost of a sequence of actions in the state space. For example, we
may prefer paths with fewer or less costly actions
• Example:
• Route finding problem:
• Path cost from initial to goal state
• Coloring problem:
• One for each transition from state to state until goal state is reached
• 8-puzzle?

Compiled by Kedir G for FINAL 7


July, 2022

Well defined Problems and Solutions

A sequence of actions forms a path, and a solution is a path


from the initial state to a goal state.

We assume that action costs are additive; that is, the total cost of a
path is the sum of the individual action costs.

 An optimal solution has the lowest path cost among all


solutions.

Problem solving agent algorithm


function SIMPLE-PROBLEM-SOLVING-AGENT(percept)
returns an action
static: seq, an action sequence, initially empty
state, some description of the current world state
goal, a goal initially null
problem, a problem formulation
state  UPDATE-STATE(state,percept)
if seq is empty then do
goal  FORMULATE-GOAL(state)
problem FORMULATE-PROBLEM(state,goal)
seq  SEARCH(problem)
action  FIRST(seq)
seq  REST(seq)
return action

Compiled by Kedir G for FINAL 8


July, 2022

Search Strategies
Searching algorithms are one of the most important areas of AI.

Searching algorithms are used to find the solutions.

A search algorithm takes a search problem as input and returns a solution, or an


indication of failure.

Two types
Uninformed (unguided) and Informed (little guided).

Search is figuring out the sequences of actions to reach the goal.

Problem -----> Search ----> Solution

Search Strategies
The first three components of problem formulation (initial state,
actions and transition models) defines the problems’ state space.

Forms a graph of states (nodes) connected by actions (edges).

A path in the space state is a sequence of states connected by a


sequence of actions.

Compiled by Kedir G for FINAL 9


July, 2022

Search Strategies: Terminologies


Search: searching is a step by step procedure to solve a search-problem in a given
search space.
Examine different possible sequences of actions & states, and come up with
specific sequence of operators/actions that will take you from the initial state to
the goal state.

A search problem can have three main factors.


I. Search Space: represents a set of possible solution, which a system may have.

II. Start state: it is a state from where agent begins search.

III. Goal test: is a function which observe the current state and returns weather the goal state is achieved or not.

Search Strategies: Terminologies


Search Tree: is a tree representation of search problem.
The searching process is like building the search tree that is super imposed over
the state space

Search tree forms various paths from the initial state, trying to find a
path that reaches a goal state.
Each node in the search tree corresponds to a state in the state space
and the edges in the search tree correspond to actions.
The root of the tree corresponds to the initial state of the problem.

Compiled by Kedir G for FINAL 10


July, 2022

Search Strategies: Terminologies


Action: gives description of all the available cations to the agent.

Transition Model: A description of what each action does.

Path Cost: is a function which assign a numeric value cost to each path.

Solution: is a action sequence which leads from the start node to the goal
node.

Optimal Solution: a solution which has a minimal cost among all


solutions.

Search Strategies: Search Tree


Search Tree: is a tree representation of search problem.
Search tree forms various paths from the initial state, trying to find a
path that reaches a goal state.
Each node in the search tree corresponds to a state in the state space
and the edges in the search tree correspond to actions.
The root of the tree corresponds to the initial state of the problem.

What is the difference between state space and Search Tree?

Compiled by Kedir G for FINAL 11


July, 2022

Search Strategies: Search Tree


The state space describes the (possibly infinite) set of states in the
world, and the actions that allow transitions from one state to another.

The search tree describes paths between these states, reaching towards
the goal.

The search tree may have multiple paths to (and thus multiple nodes for)
any given state, but each node in the tree has a unique path back to the
root (as in all trees).

Search Strategies: Search Tree


In steps in finding a path from Harar city to Adama city.
The root node of the search tree is at the initial state, Harar.

We can EXPAND the node, by considering the available ACTIONS for that
state, using the RESULT function to see where those actions lead to, and
GENERATING a new node (called a child node or successor node) for each
of the resulting states.
 For instance Awaday is child node of a parent Harar.
Each child node has Harar as its parent node.

Compiled by Kedir G for FINAL 12


July, 2022

Search Strategies: Search Tree


Now we must choose which of these three child nodes (Awaday, Kombolcha, Babile)
to consider next. This is the essence of search—following up one option now and
putting the others aside for later.

Suppose we choose to expand Babile first. We call this the Frontier of the search
tree. We say that any state that has had a node generated for it has been reached
(whether or not that node has been expanded)

The FRONTIER separates two regions of the state-space graph: an interior region
where every state has been expanded, and an exterior region of states that have not
yet been reached.

Search Strategies: Search Tree


How do we decide which node from the frontier to expand next?
A very general approach is called best-first search, in which we choose a node n,
with minimum value of some evaluation function, f(n).
On each iteration we choose a node on the frontier with minimum value, return it
if its state is a goal state, and otherwise apply EXPAND to generate child nodes.
Each child node is added to the frontier if it has not been reached before, or is re-added if it is
now being reached with a path that has a lower path cost than any previous path.

The algorithm returns either an indication of failure, or a node that represents a


path to a goal.

Compiled by Kedir G for FINAL 13


July, 2022

Search Strategies: Properties


 A search strategy is defined by picking the order of node expansion

 Strategies are evaluated along the following dimensions:

 The following properties are essential search algorithms properties to compare the efficiency of
these algorithms.

completeness: does it always find a solution if one exists?

time complexity: how many operations are needed? Is a measure of time for an algorithm to
complete its task.

space complexity: maximum number of nodes in memory. Is the maximum storage space
required at any point during the search, as the complexity of the problem.

optimality: does it always find a least-cost solution?

Search Strategies: Properties


• Time and space complexity are measured in terms of

b: maximum branching factor of the search tree

d: depth of the least-cost solution

m: maximum depth of the state space (may be ∞)

d
m
b G

• Generally, searching strategies can be classified in to two as uninformed and informed search strategies

Compiled by Kedir G for FINAL 14


July, 2022

Search Strategies: Types


Based on the search problems we can classify the search
algorithms into Uninformed (Blind) and Informed
(Heuristic/little Guided) search algorithms.

Search Strategies: Types


Uninformed/Blind Search Informed/Heuristic Search
 Informed search algorithms attempt to use extra
 The uninformed search does not contain any domain domain knowledge to inform the search, in an
knowledge such as closeness, the location of the goal. attempt to reduce search time.
 Problem information is available which guide the
 Use no knowledge about which path is likely to be search.
best  Have knowledge about how far are the various
state from the goal
 It can be divided into five main types:  Can solve much complex problem which could
not be solved in another way.
I. Breadth-first search  Can be divided into two main types
II. Uniform cost search I. Greedy Best-first Search
III. Depth-first search(Depth-limited search) II. A* Search
IV. Iterative deepening depth-first search
III. Iterative improvement,
IV. Constraint satisfaction Search
V. Bidirectional Search

Compiled by Kedir G for FINAL 15


July, 2022

1. Breadth-first Search
•Expand shallowest unexpanded node,
 •i.e. expand all nodes on a given level of the search tree before moving to
the next level
•Implementation: fringe/open list is a first-in-first-out (FIFO) Queue, i.e.,
•new successors go at end of the queue.
-Is A a goal state?
•Expand: -fringe = [B,C] ,Is B a goal state?
•Expand: fringe=[C,D,E],Is C a goal state?
•Expand: fringe=[D,E,F,G],is D a goal state?
• Pop nodes from the front of the queue
•Then return the final path
•{A,C,G} The solution path is recovered by following the back pointers
starting at the goal state
•Properties:
•Takes space: keeps every node in memory
•Optimal and complete: guarantees to find solution

2. Uniform cost Search


 Strategy to select state to expand next
 Use the state with the smallest value of g() so far
 Use priority queue for efficient access to minimum g at every iteration
 The goal of this technique is to find the shortest path to the goal in terms of cost.
 It modifies the BFS by always expanding least-cost unexpanded node
 Implementation: nodes in list keep track of total path length from start to that
node
 List kept in priority queue ordered by path cost

•Properties:
• This strategy finds the cheapest solution provided the cost of a path must never decrease as
we go along the path
• Takes space since it keeps every node in memory

Compiled by Kedir G for FINAL 16


July, 2022

3. Depth-first Search
•Expand one of the node at the deepest level of the tree.

•It is called the depth-first search because it starts from the root
node and follows each path to its greatest depth node before
moving to the next path.
•Implementation: DFS uses a stack data structure for its
implementation.
•Pop nodes from the top of the stack
•Properties
•Incomplete and not optimal: fails in infinite-depth spaces,
spaces with loops.
• Modify to avoid repeated states along the path
•Takes less space (Linear): Only needs to remember up to the
depth expanded,

4. Depth-Limited Search
• Search depth-first, but terminate a path either if a goal state is found, or if the
maximum depth allowed is reached.

• Unlike DFS, this algorithm always terminates

• Avoids the problem of search never terminating by imposing a hard limit on the
depth of any search path

•However, it is still not complete(the goal depth may be greater than the limit allowed.

• It return solution if solution exist.

Compiled by Kedir G for FINAL 17


July, 2022

Depth-first Search and Breadth-first Search


• In the case of DFS and BFS a search is
determined by the order in which the nodes are
examined.
• Consider the following graph:

• DFS examines the nodes in the following order:


A, B, E, K, S, L, T, F, M, C, G, N, H, O, P,
U, D, I, Q, J, R
• BFS examines the nodes in the following order:
A, B, C, D, E, F, G, H, I, J, K, L, M, N, O,
P, Q, R, S, T, U

5. Iterative deepening search


•To avoid the infinite depth problem of DFS, we can decide to only search until depth
L, i.e. we don’t expand beyond depth L.
•Depth-Limited Search
•What if solution is deeper than L? Increase L iteratively.
•Iterative Deepening Search
• This search combines the benefits of DFS and BFS
•DFS is efficient in space, but has no path-length guarantee
•BFS finds min-step path towards the goal, but requires memory space
•IDS performs a sequence of DFS searches with increasing depth-cutoff until goal is
found
•IDS solves the issue of choosing the best depth limit by trying all possible depth
limit.

Compiled by Kedir G for FINAL 18


July, 2022

….. 5. Iterative deepening search


6. Bidirectional Search
 Simultaneously search both forward from the initial state to the goal and
backward from the goal to the initial state, and stop when the two
searches meet somewhere in the middle
 Requires an explicit goal state and invertible operators (or backward chaining).
 Decide what kind of search is going to take place in each half using BFS, DFS,
uniform cost search, etc.

Start Goal

Compiled by Kedir G for FINAL 19


July, 2022

6. Bidirectional Search ……….


• Advantages:
• Only need to go to half depth
• It can enormously reduce time complexity, but is not always applicable

• Difficulties
• Do you really know solution? Unique?
• Cannot reverse operators
• Memory requirements may be important: Record all paths to check
they meet
• Memory intensive

• Note that if a heuristic function is inaccurate, the two searches


might miss one another.

Comparing Uninformed Search


Strategies Complete Optimal Time complexity Space complexity

Breadth first search yes yes O(bd) O(bd)


Depth first search no no O(bm) O(bm)
Uniform cost search yes yes O(bd) O(bd)
Iterative deepening search yes yes O(bd) O(bd)
bi-directional search yes yes O(bd/2) O(bd/2)

• b is branching factor,
• d is depth of the shallowest solution,
• m is the maximum depth of the search tree,
• l is the depth limit

Compiled by Kedir G for FINAL 20


July, 2022

When to use what?


Depth-First Search:
• Many solutions exist
• Know (or have a good estimate of) the depth of solution
Breadth-First Search:
• Some solutions are known to be shallow
Uniform-Cost Search:
• Actions have varying costs
• Least cost solution is the required
This is the only uninformed search that worries about costs.
Iterative-Deepening Search:
• Space is limited and the shortest solution path is required

Uninformed Search Strategies: Exercises


A. Assume node 3 is initial state
and node 5 is goal state B.
S
1 8
5

A B C
3 9
7 4
5

D E G

Compiled by Kedir G for FINAL 21


July, 2022

Informed Search
•Search efficiency would improve greatly if there is a way to order
the choices so that the most promising are explored first.
•This requires domain knowledge of the problem.
•Add domain specific knowledge to select what is the best one to
continue searching along the path
•Define a heuristic function, h(n) that estimates the goodness of a node
n, based on domain specific information that is computable from the
current state description.
•Heuristics is knowledge about the domain that helps to undertake
focused search.

……Informed Search
• Informed search algorithms attempt to use extra domain knowledge to inform the
search, in an attempt to reduce search time.
• A particular class of informed search algorithms is known as best-first
search.
• In best-first search, we use a heuristic function to estimate which of the
nodes in the fringe is the “best” node for expansion.
• This heuristic function, h(n), estimates the cost of the cheapest path from
node n to the goal state. In other words, it tells us which of the nodes in
the fringe it think is “closest” to the goal.
• best-first search algorithms examples are :-
• greedy best-first and A* search.

Compiled by Kedir G for FINAL 22


July, 2022

Greedy best-first search


• The simplest best-first search algorithm is greedy best-first search

• Simply expands the node that is estimated to be closest to the


goal

• Which means the lowest value of the heuristic function h(n).

……. Greedy Best-First Search


 Evaluation function f(n) = h(n) (heuristic) = estimate of cost from n to
goal

 That means the agent prefers to choose the action which is assumed to
be best after every action

 e.g., hSLD(n) = straight-line distance from n to X (destination)

 Greedy best-first search expands the node that appears to be closest to


goal (It tries to minimizes the estimated cost to reach the goal)

Compiled by Kedir G for FINAL 23


July, 2022

……. Greedy Best-First Search

f(n)= h(n)
# of nodes tested 1, S
h=8
expanded 1 1 8
5

A B C
h=8 h=4 h=3
Expanded Node OPEN list 9 4
3
(S:8) 7 5

S not goal (C:3,B:4,A:8) D G


E
h= h=0
h=

……. Greedy Best-First Search

f(n)= h(n)
# of nodes tested 2, expanded 2
S
h=8
Expanded Node OPEN list
1 8
(S:8) 5

A B C
S (C:3,B:4,A:8) h=4
h=8 h=3
C not goal (G:0,B:4,A:8) 9 4
3
7 5

D G
E
h= h=0
h=

Compiled by Kedir G for FINAL 24


July, 2022

……. Greedy Best-First Search


.
f(n)= h(n)
# of nodes tested 3, expanded 2
S
h=8
Expanded Node OPEN list
1 8
(S:8) 5

S (C:3,B:4,A:8) A B C
h=8 h=4 h=3
C (G:0,B:4,A:8)
G goal (B:4.A:8) 9 4
3
7 5

D G
E
* Fast but not optimal h= h=
h=0

Path: S,C,G
Cost: 13

……. Greedy Best-First Search


Properties of Greedy Search Algorithm

• Complete? Yes if repetition is controlled otherwise it can get


stuck in loops
• Time? O(bm), but a good heuristic can give dramatic improvement
• Space? O(bm), keeps all nodes in memory
• Optimal? No

Compiled by Kedir G for FINAL 25


July, 2022

A* Search
Idea: avoid expanding paths that are already expensive
Evaluation function f(n) = g(n) + h(n) where
g(n) = cost so far to reach n
h(n) = estimated cost from n to goal
f(n) = estimated total cost of path through n to goal
It tries to minimizes the total path cost to reach into the
goal at every node N.

……. A* Search
example
Heuristic
• Given the following tree structure, show the content of the
open list and closed list generated by A* best first search S  G -------------- 90
algorithm A  G -------------- 70
B  G -------------- 70
S
70
35
40
C  G -------------- 60
A B C D  G -------------- 55
25 10 62 45
18 21 E  G -------------- 30

D E F G1 H F  G -------------- 35
15 20 5 H  G ---------------10

I G3 J I  G ---------------- 20
J  G ---------------- 8
G1,G2,G3  G ------------ 0

Compiled by Kedir G for FINAL 26


July, 2022

Admissible heuristic
A heuristic h(n) is admissible if for every node n,
h(n) ≤ h*(n), where h*(n) is the true cost to reach the goal state
from n.
An admissible heuristic never overestimates the cost to reach the
goal, i.e., it is optimistic
Example: hSLD(n) (never overestimates the actual road distance)
Theorem: If h(n) is admissible, A* using TREE-SEARCH is
optimal

……. Admissible heuristic


Example
n g(n) h(n) f(n) h*(n)
S 0 8 8 11 S
h=8
A 2 8 10 10
2 9
B 6 4 10 5 6

C 9 3 12 6 A B C
h=8 h=4 h=3
D 6   
10 5
E 12    4
6
8
G 12/11/15 0 12/11/15 0 D E
G
h= h=0
h=

Since h(n)  h*(n)  n, h is admissible.

Compiled by Kedir G for FINAL 27


July, 2022

Exercise
• Consider the following state space.
• There are five locations, identified by the letters A to E, and the
numbers shown are the step costs to move between them.
• Also shown is the value of a heuristic function for each state:
• the straight-line distance to reach E.
• The initial state of the problem is A, and the goal is to reach E

……. Exercise
1. Draw the search tree that would result after each iteration
of greedy best-first search. Is the solution optimal?

2. Draw the search tree that would result after each iteration
of A* search. Is the solution optimal

Compiled by Kedir G for FINAL 28


July, 2022

Avoiding Repeated States


•In increasing order of effectiveness in reducing size
of state space (and with decreasing computational
costs.)
1. Do not return to the state you just came from.
2. Do not create paths with cycles in them.
3. Do not generate any state that was ever created
before.
•Net effect depends on ”loops” in state-space.

Chapter Four
Knowledge Based Agents
Kedir Genna (MSc.)

Compiled by Kedir G for FINAL 29


July, 2022

Contents
1. Logical Agents
2. Propositional Logic
3. Inference in Propositional Logic
4. Predicate (First-order) Logic
5. Inference in first-order logic
6. Knowledge Representation
7. Knowledge based system

Knowledge-based Agents
 An intelligent agent needs knowledge about the real world for taking decisions and
reasoning to act efficiently.
 Knowledge-based agents are those agents who have the capability of
 Maintaining an internal state of knowledge,
 Reason over that knowledge,
 Update their knowledge after observations and take actions.
 These agents can represent the world with some formal representation and act
intelligently.

Compiled by Kedir G for FINAL 30


July, 2022

………Knowledge-based Agents
 A knowledge-based agent is an agent that consists of two parts:
 a knowledge base and an inference engine

 The central component of a knowledge-based agent is its knowledge base.

 A knowledge base is a set of sentences.


 Each sentence is expressed in a language called a knowledge representation
language and represents some assertion about the world.

 The inference engine is consists of algorithms that take the contents of the
knowledge base and infer (i.e. deduce) new knowledge about the world.

Knowledge Base (KB)


• Contains set of facts about the domain expressed in a suitable
representation language
• Each individual representation are called sentences
• Sentences are expressed in a (formal) knowledge representation (KR) language
• A KBA is designed such that there is a way to:-
• TELL it (i.e. to add new sentences to the KB) and ASK it (i.e. to query the KBA)
• TELLs the knowledge base what it perceives.
• When one ASKs a question, the answer should follow from what has been
TELLed to the KB previously.
• ASKs the knowledge base what action to perform.
• Inference mechanism determines what follows from what has been TELLed to
the KB

Compiled by Kedir G for FINAL 31


July, 2022

The structure of a knowledge-based agent

……
• The agent receives precepts from the environment they will be converted
into sentences and added to the KB

• Inference engine generates new knowledge it is also added to the KB

• When the agent needs to make an action, we must ask the KB what the
optimal action will be at that time
• There must be some way of telling the KB a new piece of information;

• and there must be some way of asking the KB some question about the environment

Compiled by Kedir G for FINAL 32


July, 2022

Logic as KR
 Knowledge can also be represented by the symbols of logic, which is the
study of the rules of exact reasoning.

 Logic is also of primary importance in expert systems in which the


inference engine reasons from facts to conclusions.

 A descriptive term for logic programming and expert systems is


automated reasoning systems.

 A Logic is a formal language in which knowledge can be represented,


such that conclusions can be drawn.

…….
 Logic is a declarative language to assert sentences and deduce from
sentences.
Components of a formal logic
 Syntax: what expressions/structures are allowed in the language. Describes how to
make sentences
 E.g. red(mycar) is ok, but mycar(grey or green) is not.
 Semantics: express what sentences mean, in terms of a mapping to real
world.
 Semantics relate sentences to reality.
 E.g. red(mycar) means that my car is red.
 Proof Theory: how we can draw new conclusions from existing statements in the logic.
 It is a means of carrying our reasoning using a set of rules.
 Reasoning: is the process of constructing new sentences from existing facts in the
KB.

Compiled by Kedir G for FINAL 33


July, 2022

……
Logic accepted rules for making precise statements.

Logic essential for computer science: programming, artificial


intelligence, logic circuits...

Logic
 Represents knowledge precisely
 Helps to extract information (inference)

Logical arguments
•An argument is a sequence of statements.

•The last statement is called the conclusion, all the previous


statements are premises (or assumptions/ hypotheses).

•A valid argument is an argument where the conclusion is


true if the premises are true.

Compiled by Kedir G for FINAL 34


July, 2022

………Logical representation of knowledge

Logical representation can be categorized into mainly two


logics:
1. Propositional logic
2. First order logic

Propositional (Boolean) Logic /PL


 Propositional logic (PL) is the simplest form of logic where all the statements are made by
propositions.
 A proposition is a declarative statement which is either true or false but not both at any time.
 It is a technique of knowledge representation in logical and mathematical form.
 Proposition can be conditional or unconditional
• Examples
• It is Sunday.
• The Sun rises from West (False proposition)
• Socrates is mortal
• If the winter is severe, then students will not succeed.
• All are the same iff their color is black
 In propositional logic, symbols represent the whole proposition.
• Examples:
• M = Socrates is mortal
• W = winter is sever
• S = students will not succeed

Compiled by Kedir G for FINAL 35


July, 2022

………..Propositional Logic /PL


 In propositional logic, we use symbolic variables to represent the logic, and we can use any
symbol for a representing a proposition, such A, B, C, P, Q, R, etc.

 Propositional logic consists of an object, relations or function, and logical connectives.

 These connectives are also called logical operators which connects two sentences.

 The propositions and connectives are the basic elements of the propositional logic.

 A proposition formula which is always true is called tautology, and it is also called a valid sentence.

 A proposition formula which is always false is called Contradiction.

 Statements which are questions, commands, or opinions are not propositions such as "Where is
Rohini", "How are you", "What is your name", are not propositions.

…Propositional Logic /PL: Syntax


 The syntax of propositional logic defines the allowable sentences for the
knowledge representation.
 There are two types of Propositions:
 Atomic Proposition: Atomic propositions are the simple propositions.
 It consists of a single proposition symbol. These are the sentences which
must be either true or false.
 a) 2+2 is 4, it is an atomic proposition as it is a true fact.
 b) "The Sun is cold" is also a proposition as it is a false fact.
 Compound proposition: Compound propositions are constructed by
combining .
 Example
 a)It is raining today, and street is wet."
 b) “Jemal is a doctor, and his clinic is in harar."

Compiled by Kedir G for FINAL 36


July, 2022

….. PL: Logical Connectives


• Logical connectives are used to connect two simpler propositions or representing a
sentence logically.

• We can create compound propositions with the help of logical connectives.

• There are mainly five connectives, which are given as follows:

….. PL: Logical Connectives

Compiled by Kedir G for FINAL 37


July, 2022

….. PL: Precedence of Connectives


Just like arithmetic operators, there is a precedence order for
propositional connectors or logical operators.
Precedence Operators
First Precedence Parenthesis
Second Precedence Negation
Third Precedence Conjunction(AND)
Fourth Precedence Disjunction(OR)
Fifth Precedence Implication
Six Precedence Bi conditional

….. PL: Syntax


A proposition is simply a statement that is either true or false.

The syntax of PL defines the allowable sentences

The proposition symbols S1, S2 etc are sentences


 If S is a sentence, S is a sentence (negation)
 If S1 and S2 are sentences, S1  S2 is a sentence (conjunction)
 If S1 and S2 are sentences, S1  S2 is a sentence (disjunction)
 If S1 and S2 are sentences, S1  S2 is a sentence (implication)
 If S1 and S2 are sentences, S1  S2 is a sentence (biconditional)

Compiled by Kedir G for FINAL 38


July, 2022

….. PL: sentences in PL


Examples: Convert from English sentence to PL
Let A = Lectures are active, R = Text is readable, and P = Kebede will pass the exam,
then represent the following:
1. the lectures are not active: A

2. the lectures are active and the text is readable: A^R

3. either the lectures are active or the text is readable: AVR

4. if the lectures are active, then the text is not readable: AR

5. the lectures are active if and only if the text is readable: A  R

6. if the lectures are active, then if the text is not readable, Kebede will not pass the exam:

A(R  P )

….. PL: Syntax Exercise


Convert P sentences to PL:
 “It is humid.”:
 “If it is humid, then it is hot” :
 “If it is hot and humid, then it is raining”:

Compiled by Kedir G for FINAL 39


July, 2022

….. PL: Semantics


•Specify the interpretation of the proposition symbols & constants, and the
meanings of the logical connectives
•Truth Tables: define the semantics of sentences. The following table shows truth
table for the five logical connectives.
Note: P and Q can be any sentence, including complex sentences.
P Q P PQ PQ PQ P Q
True True False True True True True
True False False False True False False
False True True False True True False
False False True False False True True

….. PL: Semantics (Complex Sentences)


• Complex sentences such as (RS)(RS) are defined by a process of
decomposition.
• First determine the meaning of (RS) and of (RS).
• Then combine them using the definition of the  function

R S R RS RS (RS)(RS)


True True False True True True
True False False False False True
False True True False True True
False False True False True True

Can you write the truth table for:


(P  Q)  (R  P)

Compiled by Kedir G for FINAL 40


July, 2022

….. PL: Logical Equivalence


• Logical equivalence is one of the features of propositional logic.

• Two propositions are said to be logically equivalent if and only if


the columns in the truth table are identical to each other.

….. PL: Logical Equivalence

Compiled by Kedir G for FINAL 41


July, 2022

….. PL: Logical Equivalence


 Is (P  Q)  R same as P  (Q  R) ?
 Is (P  Q)  R same as P  (Q  R) ?
 Is (P  Q)  R same as P  (Q  R) ?

….. PL: Logical Equivalence


• Consider the following three statements
• Helen is not married but Biniam is not single
¬h ∧ ¬b
• Biniam is not single and Helen is not married
¬b ∧ ¬h
• Neither Biniam is single nor Helen is married
¬(b ∨ h)
• These three statements are equivalent
¬h ∧ ¬b ≡ ¬b ∧ ¬h ≡ ¬(b ∨ h)

Compiled by Kedir G for FINAL 42


July, 2022

Inference Rule for PL


 In artificial intelligence, we need intelligent computers which can create
new logic from old logic or by evidence, so generating the conclusions
from evidence and facts is termed as Inference.

 To prove validity of a sentence, there are a set of already identified


patterns called inference rules.

 Inference is the process of finding what sentences are entailed

….. Inference Rules


. RULE PREMISE CONCLUSION
Modus Ponens A, A  B B
Modus Tolens B, A  B A
And Elimination AB A
And Introduction A, B AB
Or Introduction A A1  A2 …  An
Double Negation Elimination  A A

Unit Resolution A  B, B A
Resolution A  B, B  C AC
Hypothetical Syllogism PQ, QR PR

In the case of modus ponens, if A is true and A  B is true, then conclude B is true.

Compiled by Kedir G for FINAL 43


July, 2022

….. Inference Rules: Soundness and Completeness


 Soundness: If KB ⊢Q then KB ⊨ Q

– If Q is derived from a set of sentences KB using a given set of rules of


inference, then Q is entailed by KB.

 A rule is sound if its conclusion is true whenever the premise is true

– Hence, inference produces only real entailments, or any sentence that


follows deductively from the premises is valid.

….. Inference Rules: Soundness and Completeness


Completeness: If KB Q then KB Q

– If Q is entailed by a set of sentences KB, then Q can be derived from KB


using the rules of inference.

Soundness means that you cannot prove anything that's


wrong.
Completeness means that you can prove anything that's
right.

Compiled by Kedir G for FINAL 44


July, 2022

….. Inference Rules: Soundness and Completeness

….. Inference Rules: Validity


•Valid sentence: A sentence is valid sentence or tautology if and only if
it is True under all possible interpretations in all possible worlds.
Example: “It’s raining or it’s not raining.” (R  R).
•Satisfiable: A sentence is satisfiable if and only if there is some
interpretations in some world for which the sentence is True.
Example: “It is raining or it is humid”. R v Q, R
•Unsatisfiable: A sentence is unsatisfiable (inconsistent sentence or self-
contradiction) if and only if it is not satisfiable, i.e. a sentence that is False
under all interpretations. The world is never like what it describes.
Example: “It’s raining and it's not raining.” R  R

Compiled by Kedir G for FINAL 45


July, 2022

Formal Proofs
• A proof is a sequence of sentences, where each sentence is either a
premise or a sentence derived from earlier sentences in the proof by one
of the rules of inference.
•The last sentence is the theorem (also called goal or query) that we want to
prove.
Example1: The “weather problem”. Proof whether it is raining or not.
1. Q Premise “It is humid”
2. Q  P Premise “If it is humid, it is hot”
3. (PQ)  R Premise “If it’s hot & humid, it’s raining”
4. P Modus Ponens(1,2) “It is hot”
5. PQ And Introduction(1,4) “It is hot and humid”
6. R Modus Ponens(3,5) “It is raining”

….. Formal Proofs


 Construct formal proof of validity for the following problem:
If the investigation continues, then new evidence is brought to light.
If new evidence is brought to light, then several leading citizens are implicated.
If several leading citizens are implicated, then the newspapers stop publicizing the
case.
If continuation of the investigation implies that the newspapers stop publicizing the
case, then the bringing to light of new evidence implies that the investigation
continues.
The investigation does not continue. Therefore, new evidence is not brought to light.
Represent using PL and proof the conclusion that “new evidence is not brought
to light”.

Compiled by Kedir G for FINAL 46


July, 2022

….. Formal Proofs


solution
Let

C: The investigation continues.

B: New evidence is brought to light.

I: Several leading citizens are implicated.

S: The newspapers stop publicizing the case.

1. CB
2. BI
3. IS
4. (C  S)  (B  C)
5. C
6. CI 1,2 (Hypothetical Syllogism)
7. CS 6,3 (Hypothetical Syllogism)
8. B C 7,4 (Modus Ponens)
9. B 8,5 (Modus Tollens)

….. Formal Proofs: Main steps


1. Translate the statements into propositional logic.
2. Write a formal proof, a sequence of steps that state hypotheses or apply inference
rules to previous steps.

Compiled by Kedir G for FINAL 47


July, 2022

….. Formal Proofs: Exercise 1


 During a murder investigation, you have gathered the following clues:
1. if the knife is in the store room, then we saw it when we cleared the
store room;
2. the murder was committed at the basement or inside the apartment;
3. if the murder was committed at the basement, then the knife is in the
yellow dust bin;
4. We did not see a knife when we cleared the store room;
5. If the murder was committed outside the building, then we are unable
to find the knife;
6. If the murder was committed inside the apartment, then the knife is in
the store room.
The question is: where is the knife?"

………
• First, we assigned symbols to the above clues:

• s : the knife is in the store room;

• c : we saw the knife when we clear the store room;

• b : the murder was committed at the basement;

• a : murder was committed inside the apartment;

• y : the knife is in the yellow dust bin;

• o : the murder was committed outside the building;

• u : we are unable to find the knife;

Compiled by Kedir G for FINAL 48


July, 2022

….. Formal Proofs: Exercise 2


• Let p stand for the proposition “I bought a lottery ticket” and q for “I won the
jackpot”.
• Express the following as English sentences:
(a) ¬p
(b) p  q
(c) p  q
(d) p  q
(e) ¬p  ¬q
(f) ¬p  (p  q)

Limitations of Propositional Logic


 Propositional logic has limited expressive power.

 PL cannot handle even a domain with small worlds. The problem is that there are just too many
propositions to handle since it only has one representational device: the proposition
 In PL, the world consists of just facts. It is hard to :
• Identify individuals: E.g., Mary, 3
• Describe properties of (or logical relations between) individuals. E.g. Belete is taller than Gelaw
• Generalize for a given universe. (We cannot represent relations like ALL, some, or none.)

• E.g., all triangles have 3 sides, All the girls are intelligent, Some apples are sweet.

 Example: Prove that “my dog Buchi is Nice, given that “all dogs are Nice.”
•This requires to get at the structure and meanings of statements (where first order logic (FOL) is
useful).

Compiled by Kedir G for FINAL 49


July, 2022

First-Order Logic /FOL


• First-order logic (FOL) is another way of knowledge representation in artificial
intelligence sometime is called Predicate logic.
• First-Order Logic (FOL) is expressive enough to concisely represent any kind of
situation that are expressed in natural language.
• First-order logic (like natural language) does not only assume that the world contains
facts like propositional logic but also assumes the following things in the world:

………First-Order Logic /FOL


• FOL represents objects and relations between objects, variables, and quantifiers in
addition to propositions
Every elephant is gray:
 x (elephant(x) → gray(x))
There is a white alligator:
 x (alligator(X) ^ white(X))

Compiled by Kedir G for FINAL 50


July, 2022

….FOL: syntax of FOL


 As a natural language, first-order logic also has two main parts:
 Syntax
Semantics
 The syntax of FOL determines which collection of symbols is a logical
expression in first-order logic.
 The basic syntactic elements of first-order logic are symbols.

…...FOL: Atomic and Complex sentences


• In FOL sentences are formed from a predicate symbol followed by a
parenthesis with a sequence of terms.
Atomic Sentences
 We can represent atomic sentences as Predicate (term1, term2, ...,
term n).
• Example: Abebe and Dereje are brothers: Brothers(Abebe, Dereje).
Chinky is a cat: cat (Chinky).
Complex Sentences:
• Complex sentences are made by combining atomic sentences using
connectives.
• Abebe like both Mathematics and Science.

Compiled by Kedir G for FINAL 51


July, 2022

…….FOL: Quantifiers
 These are the symbols that permit to determine or identify the range and scope of
the variable in the logical expression.
 There are two types of quantifier:
 Universal Quantifier, (for all, everyone, everything)
 Existential quantifier, (for some, at least one).
 All men drink coffee.
 ∀x men(x) → drink (x, coffee).
 It will be read as: There are all x where x is a men who drink coffee.
 Some boys are intelligent.
 ∃x: boys(x) ∧ intelligent(x)
 It will be read as: There are some x where x is a boy who is intelligent.
 The main connective for universal quantifier ∀ is implication →.
 The main connective for existential quantifier ∃ is and ∧.

…….FOL: Quantifiers (Universal)


• Universal Quantifiers: makes statements about every object
<variables> <sentence>
•Everyone at AAU is smart:
x At(x,AAU)  Smart(x)
•All cats are mammals:
x cat(x)  mammal(x)
• x sentence P is true iff P is true with x being each possible object in the given universe
•The above statement is equivalent to the conjunction

At(Jone, AAU)  Smart(Jone) 


At(Jemal, AAU)  Smart(Jemal)  ….

Typically,  is the main connective with 


•Common mistake: the use of  as the main connective with :

Compiled by Kedir G for FINAL 52


July, 2022

…….FOL: Quantifiers (Existential)


 Makes statements about some objects in the universe
<variables> <sentence>
 Someone at AAU is smart:
x At(x,AAU)  Smart(x)
 Spot has a sister who is a cat:
x sister(spot,x)  cat(x)
 x sentence P is true iff P is true with x being some possible objects
 The above statement is equivalent to the disjunction
At(Jone, AAU)  Smart(Jone) 
At(Alemu, AAU)  Smart(Alemu)  ….
 Common mistake to avoid
 Typically,  is the main connective with 
 Common mistake: using  as the main connective with :

…….FOL: Nested Quantifiers


•x,y parent(x,y)  child(y,x)
•for all x and y, if x is the parent of y then y is the child of x.
•x y Loves(x,y)
•There is a person who loves everyone in the given world
•y x Loves(x,y)
•Everyone in the given universe is loved by at least one person
Properties of quantifiers
•x y is the same as y x
•x y is the same as y x
•x y is not the same as y x
•Quantifier duality: each can be expressed using the other, using negation ()
x Likes(x,icecream) x Likes(x,icecream)
•Everyone likes ice cream means that there is nobody who dislikes ice cream
x Likes(x,cake) x Likes(x,cake)
•There is someone who likes cake means that not every one dislikes cake

Compiled by Kedir G for FINAL 53


July, 2022

……..English sentence to FOL


Represent the following using variables & quantifiers:

• Everything in the garden is lovely  x in(x, garden)  lovely(x)


•Everyone likes ice cream  x likes(x, icecream)
•Peter has some friends  y friends(Peter,y)
•John plays the piano or the violin
plays(john, piano) v plays(john, violin)
•Some people like snakes -- x(person(x) Λ likes(x, snakes))
•Jones did not write thesis – write( Jones, thesis)
•Nobody wrote thesis – x write(x, thesis)

155

……..English sentence to FOL


1. All birds fly.
2. Every man respects his parent.
3. Some boys play cricket.
4. Not all students like both Mathematics and Science.

Compiled by Kedir G for FINAL 54


July, 2022

Inference in FOL
• Inference in First-Order Logic is used to deduce new facts or sentences
from existing sentences.

• FOL inference rules for quantifier:

• As propositional logic we also have inference rules in first-order logic, so


following are some basic inference rules in FOL:
1. Universal Generalization
2. Universal Instantiation
3. Existential Instantiation
4. Existential introduction

……..
• Universal Generalization:
• Universal generalization is a valid inference rule which states that if premise P(c) is true for any
arbitrary element c in the universe of discourse, then we can have a conclusion as ∀ x P(x).
• Example: Let's represent, P(c): "A byte contains 8 bits", so for ∀ x P(x) "All bytes contain
8 bits.", it will also be true.
•Universal Elimination: If "x P(x) is true, then P(c) is true, where c is a constant in
the domain of x.
Example: "x eats(x, IceCream).
Using the substitution (x/Helen) we can infer eats(Helen, Icecream).
• The variable symbol can be replaced by any constant symbol or function symbol.
• Existential Introduction: If P(c) is true, then $x P(x) is inferred.
Example: eats(John, IceCream) we can infer $x eats(x, icecream).
• Existential Elimination: From $x P(x) infer P(c).
Example: $x eats(Sol, x) infer eats(Sol, Pizza)

Compiled by Kedir G for FINAL 55


July, 2022

Chapter Five
Learning Agents
Kedir Genna (MSc.)

Contents
1.Factors for Designing Learning Agents
2.Learning from Examples/Observations
3.Knowledge in Learning

Compiled by Kedir G for FINAL 56


July, 2022

What is learning?
•In the psychology literature, learning is considered one of
the keys to human intelligence.
•what learning is? Learning is:
• memorizing something
• Knowing facts through observation and exploration
• improving motor and/or cognitive skills through practice
• The idea behind learning is that percepts should not only be used for
acting now, but also for improving the agent’s ability to act in the
future.

……What is learning
Some Examples of learning are :

 Riding a bike (improve motor skills)


 Memorizing Telephone number (memorizing)
 Reading textbook (memorizing and operationalizing rules)
 Playing chess and football (understanding the strategy and rule of the
game)
 Understanding Language (memorizing grammar and practicing)
 Recognize face, signature and fraudulent credit card transactions
(recalling patterns/features)

Compiled by Kedir G for FINAL 57


July, 2022

Why we need learning


Factors for designing Learning Agent are:
 Learning is essential for unknown environments, i.e. when
designer lacks omniscience. It enables to organize new
knowledge into general, effective representations
 Learning modifies the agent's decision mechanisms to improve
performance.
 Learning is useful as a system construction method, i.e. expose
the agent to reality rather than trying to write it down

Machine Learning: Learning Agent


A computer program is said to learn from experience E with respect to some
class of tasks T and performance measure P, if its performance at tasks T, as
measured by P, improves with experience E.
Learning agents consist of four main components:
Learning element – the part of the agent responsible for improving its performance
Performance element – the part that chooses the actions to take.
Critic – provides feedback for the learning element how the agent is doing with
respect to a performance standard
Problem generator – suggests actions that could lead to new, informative experiences
(suboptimal from the point of view of the performance element, but designed to
improve that element).

Compiled by Kedir G for FINAL 58


July, 2022

…….
In Machine Learning: learning is a two step process.
• Model construction: The training set is used to create the model.
The model is represented as classification rules, decision trees, or
mathematical formulae
• A training set is a set of problem instances (described as a set of
properties and their values), together with a classification of the
instance.
• Model evaluation and usage: the test set is used to see how well
it works for classifying future or unknown objects
• Test set is a set of instances and their classifications used to test the
accuracy of a learned hypothesis.

Step 1: Model Construction

Classification
Algorithms
Training
Data

NAME RANK YEARS TENURED Classifier


M ike A ssistan t P ro f 3 no (Model)
M ary A ssistan t P ro f 7 yes
B ill P ro fesso r 2 yes
J im A sso c iate P ro f 7 yes
IF rank = ‘professor’
D ave A ssistan t P ro f 6 no
OR years > 6
Anne A sso c iate P ro f 3 no
THEN tenured = ‘yes’

Compiled by Kedir G for FINAL 59


July, 2022

Step 2: Using the Model in Prediction

Classifier
model

Testing
Data Unseen Data

(Jeff, Professor, 4)
NA M E RA NK Y EA RS T EN UR ED
Tom Assistant P rof 2 no Tenured?
M erlisa A ssociate P rof 7 no
G eorge Professor 5 yes
Joseph Assistant P rof 7 yes
167

Types of Machine Learnings


• Supervised learning: occurs where a set of input/output pairs are explicitly
presented to the agent by a teacher
• The teacher provides a category label for each pattern in a training set, then the
learning algorithm finds a rule that does a good job of predicting the output
associated with a new input.
• Unsupervised learning: Learning when there is no information about what the
correct outputs are.
• In unsupervised learning or clustering there is no explicit teacher, the system
forms clusters or natural groupings of the input patterns.
• Reinforcement learning: an agent interacting with the world makes observations,
takes actions, & is rewarded or punished; it should learn to choose actions in order to
obtain a lot of reward.
• The agent is given an evaluation of its action, but not told the correct action.
Reward strengthens likelihood of its action. Typically, the environment is assumed
to be stochastic.

Compiled by Kedir G for FINAL 60


July, 2022

Learning methods
• There are various learning methods. Popular learning techniques include
the following.
• K Nearest Neighbors:
• Decision tree : divide decision space into piecewise constant regions.
• Neural networks: partition by non-linear boundaries
• Bayesian network: a probabilistic model.

Chapter Six
Communicating, Perceiving and Acting
Kedir Genna (MSc.)

Compiled by Kedir G for FINAL 61


July, 2022

Contents
1.Natural Language Processing
2.Natural Language for Communication
3.Perception

Natural Language Processing


Natural language processing (NLP) is a field of computer
science, artificial intelligence (also called machine learning), and
linguistics concerned with the interactions between computers
and human through (natural) languages.

 The process of a computer extracting meaningful information from


natural language input and/or producing natural language output
 Natural language understanding is sometimes referred an AI-complete
problem because it seems to require extensive knowledge about the
outside world and the ability to manipulate it

Compiled by Kedir G for FINAL 62


July, 2022

Natural Language Processing :HLT


 Human Language Technologies are information
technologies that are specialized for dealing with the most
complex information medium in our world: human
language.
 Covers a broad range of activities with the eventual goal

of enabling people to communicate with machines


using natural communication skills.
 Consists of: computational linguistics (CL) and speech
technology as its core

……
 CL is an interdisciplinary field dealing with the statistical and/or
rule-based modeling of natural language from a computational
perspective.
 Speech Technology relates to the technologies designed to
duplicate and respond to the human voice.
 to aid the voice-disabled, the hearing-disabled, the blind, and to
communicate with computers without a keyboard, to market goods or
services by telephone and to enhance game software
 Consists of speech recognition, speech synthesis, speaker recognition,
speaker verification

Compiled by Kedir G for FINAL 63


July, 2022

Levels of Language Processing


 Phonetics and Phonology: The study of linguistic sounds
 Morphology: The study of the meaningful components of
words
 Syntax: The study of the structural relationships b/n words
 Semantics: The study of meaning
 Pragmatics: The study of how language is used to accomplish
goals
 Discourse: The study of linguistic units larger than a single
utterance

Major Tasks in NLP


• Speech recognition  Information retrieval (IR)
•. Text-to-speech  Query expansion
 Natural language search
• Speech segmentation
 Automatic summarization
• Optical character recognition  Natural language generation
• Morphological segmentation  Text simplification
• Stemming  Text-proofing
• Part-of-speech tagging  Topic segmentation and recognition
• Word segmentation  Coreference resolution
 Relationship extraction
• Word sense disambiguation
 Sentiment analysis
• Named entity recognition  Automated essay scoring
• Sentence breaking  Natural language understanding
• Parsing  Discourse analysis
• Question answering  Machine translation
• Information extraction (IE)

Compiled by Kedir G for FINAL 64


July, 2022

NLP from different Perspectives


 Engineering:
 How to build a system?
 How to select a suitable approach/tool/data source?
 How to combine different approaches/tools/data source?
 How to optimize the performance with respect to quality and resource
requirements?
 Science:
 Why an approach/tool/data source works/fails?
 Why an approach/tool/data source A works better than B?

……
 Linguistics:
 What are suitable description levels for language?
 What are the rules of a language?
 How meaning is established and communicated?
 What have languages in common? How do they differ?
 How languages can be learnt?

Compiled by Kedir G for FINAL 65


July, 2022

Compiled by Kedir G for FINAL 66

You might also like