You are on page 1of 7

CIT 6261:

Advanced Artificial Intelligence

Natural Language
Processing: Communication

Lecturer: Dr. Md. Saiful Islam

Outline

Communication as Action
Grammar
Syntactic Analysis
Augmented Grammars
Semantic Interpretation
Communication
Communication: intentional exchange of information brought about by
the production and perception of signs.

Why Speech Act?


In a multiagent environment agents can communicate to help arrive at
joint plans.

Speech acts achieve the speaker's goals:


ƒ Inform “There's a pit in front of you"
ƒ Query “Can you see the gold?"
ƒ Command “Pick it up"
ƒ Promise “I'll share the gold with you"
ƒ Acknowledge “OK"
1 3

Stages in communication (informing)

Intention S wants to inform H that P


Generation S selects words W to express P in context C
Synthesis S utters words W
Perception H perceives W' in context C'
Analysis H infers possible meanings P1,… Pn
Disambiguation H infers intended meaning Pi
Incorporation H incorporates Pi into KB

4
Stages in communication

Grammar
Vervet monkeys, antelopes, dolphins etc. use isolated symbols for
sentences ⇒ restricted set of communicable propositions, no
generative capacity
Humans can reliably communicate an unbounded number of
qualitative different messages.

Grammar species the compositional structure of complex messages


e.g., speech (linear), text (linear), music (two-dimensional)
A formal language is a set of strings of terminal symbols
Each string in the language can be analyzed/generated by the
grammar
The grammar is a set of rewrite rules, e.g.,
S → NP VP
Article → the | a | an | …
Here S is the sentence symbol, NP and VP are nonterminals.
1 6
Grammar Types
Regular: nonterminal → terminal [ nonterminal]
S → aS
S→ A

Context-free: nonterminal → anything


S → aSb

Context-sensitive: S can be rewrite as X in the context of a preceding A


and a following B
ASB → AXB

Recursively enumerable: no constraints


both side of rewrite rule can use terminal and nonterminal symbols

Natural languages probably context-free, parsable in real time!

1 7

Lexicon (Wumpus world)


Lexicon: List of allowable words

1 8
Grammar (Wumpus world)

1 9

Syntactic Analysis (Parsing)


Parsing: The process of finding a parse tree for a given input string.
PARSE (“the wumpus is dead”, ε0, S)
returns a parse tree with root S.

In linear text the tree can be written:


[S: [NP: [Article: the] [Noun: wumpus]]
[VP: [verb: is][adjective: dead]]]
Two type of parsing:
i. Top-down
ii. Bottom-up

110
Top-down Parsing
We start with the S symbol and search for a tree that has the words as the
leaves.
Steps:
i. Initial state: a parse tree consisting of root and unknown children: [S:
?]
ii. Successor function:
• Select the leftmost node in the tree with unknown children.
• It then look into the grammar for rules that have the root level on the left-
hand side.
• Each such rules, it creates a successor state
iii. Goal test: checks the leave of the parse tree correspond exactly the
input string

Problems:
• Infinite loop: X → X
• for invalid sentences we would get stuck in an infinite search space.

111

Bottom-up Parsing

We start with the words and search for a tree with the root S.
Steps:
i. Initial state: a list of words in the input string, each viewed as a
parse tree that is just a single leaf node
ii. Successor function:
• Looks for every position i in the list of the tree and at every right had
side of a rule in the grammar.
• If a subsequence matches with the right hand side the
subsequence is replaced with a new tree.
iii. Goal test: checks for a state consisting a single tree with root S.

112
Augmented Grammar

Self study

113

Semantic Interpretation

Self study: (pp. 810 – 813)

114

You might also like