SlideShare a Scribd company logo
George F Luger
ARTIFICIAL INTELLIGENCE 6th edition
Structures and Strategies for Complex Problem Solving
Understanding Natural Language
Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009
15.0 Role of Knowledge in Language
Understanding
15.1 Deconstructing Language: A
Symbolic Analysis
15.2 Syntax
15.3 Syntax and Knowledge with ATN
Parsers
15.4 Stochastic Tools for Language Analysis
15.5 Natural Language Applications
15.6 Epilogue and References
15.7 Exercises
1
Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009
Fig 15.1 A blocks world, adapted from Winograd (1972).
2
Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009
To manage this complexity, linguists have defined different levels of analysis for
natural language:
3
Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009
Fig 15.2 Stages in producing an internal representation of a sentence.
4
Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009
Fig 15.3 Parse tree for the sentence “The man bites the dog.”
5
Sentence −−> . Noun Verb predict: Noun followed by a Verb
Noun −−> . mary predict: mary
Noun --> mary . scanned: mary
Sentence --> Noun . Verb completed: Noun; predict: Verb
Verb --> . runs predict: runs
Verb --> runs . scanned: runs
Sentence --> Noun Verb . completed: Verb,
completed: sentence
Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 6
Figure 15.4 The relationship of dotted r ules to the generation of a parse tree.
Noun .Verb Noun Verb .
Noun
mary .
mar y
runs .
runs
Sentence
.Noun Verb
.
..
.
.
Verb
Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 7
The chart for mary runs, with three state lists, is:
S0: [($ --> . S), start
(S --> . Noun Verb)] predictor
S1: [(Noun --> mary .), scanner
(S --> Noun . Verb)] completer
S2: [(Verb --> runs .)] scanner
(S --> Noun Verb .), completer
($ --> S .)] completer
Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 8
function EARLEY-PARSE(words, grammar) returns chart
begin
chart := empty
ADDTOCHART(($ Æ . S, [0, 0]), chart[0]) % dummy start state
for i from 0 to LENGTH(words) do
for each state in chart[i] do
if rule_rhs(state) = … . A … and A is not a part of speech
then PREDICTOR(state)
else if rule_rhs(state) = … . L … % L is part of speech
then SCANNER(state)
else COMLETER(state) % rule_rhs = RHS
end
Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 9
procedure PREDICTOR((A Æ … . B …, [i, j]))
begin
for each (B Æ RHS) in grammar do
ADDTOCHART((B Æ . RHS, [j, j]), chart[j])
end
procedure SCANNER((A Æ … . L …, [i, j]))
begin
if (L Æ word[j]) is_in grammar
then ADDTOCHART((L Æ word[j] ., [j, j + 1]), chart[j + 1])
end
procedure COMPLETER((B Æ … ., [j, k]))
begin
for each (A Æ … . B …, [i, j]) in chart[j] do
ADDTOCHART((A Æ … B . …, [i, k]), chart[k])
end
procedure ADDTOCHART(state, state-list)
begin
if state is not in state-list
then ADDTOEND(state, state-list)
end
Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 10
Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009
Fig 15.5 Transition network definition of a simple English grammar.
11
Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009
Pseudo-code for a transition network parser appears on the following two slides. It
is defined using two mutually recursive functions, parse and transition.
continued…
12
Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009
continued from previous slide
13
Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009
Fig 15.6 Trace of a transition network parse of the sentence “Dog bites.”
14
Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009
Fig 15.7 Structures representing the sentence, noun phrase, and verb phrase
nonterminals of the grammar.
15
Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009
Fig 15.8 Dictionary entries for a simple ATN
16
Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009
Fig 15.9 An ATN grammar that checks number agreement and builds a parse tree.
continued…
17
Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009
Fig 15.9 continued from previous slide.
continued…
18
Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009
continued…
Fig 15.9 continued from previous slide.
19
Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009
Fig 15.8 continued from previous slide.
20
Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009
Fig 10 Parse tree for the sentence “The dog likes a man” returned by an ATN
parser.
21
Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009
Fig 15.11 Type hierarchy used in “dogs world” example.
22
Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009
Fig 15.12 Case frames for the verbs “like” and “bite.”
23
Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009
Rules for our example are described as pseudo-code procedures. In each
procedure, if a specified join or other test fails, that interpretation is rejected as
semantically incorrect.
continued…
24
Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009
continued from previous slide.
25
Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009
Fig 15.13 Construction of a semantic representation from the parse tree of Figure
15.10.
26
Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009
Fig 15.14 Two different parses of “Print the file on the printer.”
27
Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009
Fig 15.15 Conceptual graph for the question “Who loves Jane?”
28
Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009
Fig 15.16 Two relations in an employee database.
29
Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009
Fig 15.17 Entity-relationship diagrams of the manager_of_hire and
employee_salary relations.
30
Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009
Fig 15.18 Knowledge base entry for “hire” queries.
31
Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009
Fig 15.19 Development of a database query from the graph of a natural language
input..
32
Fig 15.20 Sample text, template summary, and information extraction for computer
science advertisement.
Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 33
Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009
Fig 15.21 An architecture for information extraction, from Cardie (1997).
34

More Related Content

PPT
Artificial Intelligence
PPT
Artificial Intelligence
PPT
Artificial Intelligence
PPT
Artificial Intelligence
PPT
Artificial Intelligence
PPT
Artificial Intelligence
PPT
Artificial Intelligence
PPT
Artificial Intelligence
Artificial Intelligence
Artificial Intelligence
Artificial Intelligence
Artificial Intelligence
Artificial Intelligence
Artificial Intelligence
Artificial Intelligence
Artificial Intelligence

What's hot (6)

PPT
Artificial Intelligence
PPT
Artificial Intelligence
PPT
Artificial Intelligence
PPT
Artificial Intelligence
PPT
Artificial Intelligence
PDF
THE RESULT FOR THE GRUNDY NUMBER ON P4- CLASSES
Artificial Intelligence
Artificial Intelligence
Artificial Intelligence
Artificial Intelligence
Artificial Intelligence
THE RESULT FOR THE GRUNDY NUMBER ON P4- CLASSES
Ad

Viewers also liked (17)

PDF
Deep Learning - The Past, Present and Future of Artificial Intelligence
PPT
Artificial Intelligence
PDF
Key Expert Systems Concepts
PPTX
Prepping the Analytics organization for Artificial Intelligence evolution
PPTX
artificial Intelligence
PPTX
Rules in Artificial Intelligence
PDF
RULE-BASED INFERENCING SYSTEM FOR INFERTILITY DIAGNOSIS IN WOMEN
PPT
Artificial Intelligence
PPTX
Artificial intelligence bsc - iso 27001 information security
PPT
Encyclopedic Intelligence as Artificial Super Intelligence: Are You Ready To ...
PPT
Artificialintelligenceandexpertsystems 121119234025-phpapp02
PDF
"Smart Data Web: Connecting data and extracting knowledge", Prof. Dr. Hans Us...
PDF
1ii. Mandarine.Tech AI MINT - JOIN US AS A THOUGHT LEADER - edited
PDF
Extending and integrating a hybrid knowledge representation system into the c...
PPTX
Artificial intelligence
PDF
Expert Systems
Deep Learning - The Past, Present and Future of Artificial Intelligence
Artificial Intelligence
Key Expert Systems Concepts
Prepping the Analytics organization for Artificial Intelligence evolution
artificial Intelligence
Rules in Artificial Intelligence
RULE-BASED INFERENCING SYSTEM FOR INFERTILITY DIAGNOSIS IN WOMEN
Artificial Intelligence
Artificial intelligence bsc - iso 27001 information security
Encyclopedic Intelligence as Artificial Super Intelligence: Are You Ready To ...
Artificialintelligenceandexpertsystems 121119234025-phpapp02
"Smart Data Web: Connecting data and extracting knowledge", Prof. Dr. Hans Us...
1ii. Mandarine.Tech AI MINT - JOIN US AS A THOUGHT LEADER - edited
Extending and integrating a hybrid knowledge representation system into the c...
Artificial intelligence
Expert Systems
Ad

More from Muhammad Ahad (20)

PPTX
11. operating-systems-part-2
PPTX
11. operating-systems-part-1
PPTX
10. compute-part-2
PPTX
10. compute-part-1
PPTX
09. storage-part-1
PPTX
08. networking-part-2
PPTX
08. networking
PPTX
07. datacenters
PPTX
06. security concept
PPTX
05. performance-concepts-26-slides
PPTX
05. performance-concepts
PPTX
04. availability-concepts
PPTX
03. non-functional-attributes-introduction-4-slides
PPTX
01. 03.-introduction-to-infrastructure
PPTX
01. 02. introduction (13 slides)
PPT
Chapter14
PPT
Chapter13
PPT
Chapter12
PPT
Chapter11
PPT
Chapter10
11. operating-systems-part-2
11. operating-systems-part-1
10. compute-part-2
10. compute-part-1
09. storage-part-1
08. networking-part-2
08. networking
07. datacenters
06. security concept
05. performance-concepts-26-slides
05. performance-concepts
04. availability-concepts
03. non-functional-attributes-introduction-4-slides
01. 03.-introduction-to-infrastructure
01. 02. introduction (13 slides)
Chapter14
Chapter13
Chapter12
Chapter11
Chapter10

Recently uploaded (20)

PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
MYSQL Presentation for SQL database connectivity
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Empathic Computing: Creating Shared Understanding
PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PPTX
Cloud computing and distributed systems.
PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
PPTX
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
cuic standard and advanced reporting.pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
Review of recent advances in non-invasive hemoglobin estimation
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Unlocking AI with Model Context Protocol (MCP)
“AI and Expert System Decision Support & Business Intelligence Systems”
MYSQL Presentation for SQL database connectivity
NewMind AI Weekly Chronicles - August'25 Week I
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Empathic Computing: Creating Shared Understanding
GamePlan Trading System Review: Professional Trader's Honest Take
Cloud computing and distributed systems.
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
Chapter 3 Spatial Domain Image Processing.pdf
Network Security Unit 5.pdf for BCA BBA.
cuic standard and advanced reporting.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Per capita expenditure prediction using model stacking based on satellite ima...

Artificial Intelligence

  • 1. George F Luger ARTIFICIAL INTELLIGENCE 6th edition Structures and Strategies for Complex Problem Solving Understanding Natural Language Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 15.0 Role of Knowledge in Language Understanding 15.1 Deconstructing Language: A Symbolic Analysis 15.2 Syntax 15.3 Syntax and Knowledge with ATN Parsers 15.4 Stochastic Tools for Language Analysis 15.5 Natural Language Applications 15.6 Epilogue and References 15.7 Exercises 1
  • 2. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 Fig 15.1 A blocks world, adapted from Winograd (1972). 2
  • 3. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 To manage this complexity, linguists have defined different levels of analysis for natural language: 3
  • 4. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 Fig 15.2 Stages in producing an internal representation of a sentence. 4
  • 5. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 Fig 15.3 Parse tree for the sentence “The man bites the dog.” 5
  • 6. Sentence −−> . Noun Verb predict: Noun followed by a Verb Noun −−> . mary predict: mary Noun --> mary . scanned: mary Sentence --> Noun . Verb completed: Noun; predict: Verb Verb --> . runs predict: runs Verb --> runs . scanned: runs Sentence --> Noun Verb . completed: Verb, completed: sentence Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 6
  • 7. Figure 15.4 The relationship of dotted r ules to the generation of a parse tree. Noun .Verb Noun Verb . Noun mary . mar y runs . runs Sentence .Noun Verb . .. . . Verb Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 7
  • 8. The chart for mary runs, with three state lists, is: S0: [($ --> . S), start (S --> . Noun Verb)] predictor S1: [(Noun --> mary .), scanner (S --> Noun . Verb)] completer S2: [(Verb --> runs .)] scanner (S --> Noun Verb .), completer ($ --> S .)] completer Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 8
  • 9. function EARLEY-PARSE(words, grammar) returns chart begin chart := empty ADDTOCHART(($ Æ . S, [0, 0]), chart[0]) % dummy start state for i from 0 to LENGTH(words) do for each state in chart[i] do if rule_rhs(state) = … . A … and A is not a part of speech then PREDICTOR(state) else if rule_rhs(state) = … . L … % L is part of speech then SCANNER(state) else COMLETER(state) % rule_rhs = RHS end Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 9
  • 10. procedure PREDICTOR((A Æ … . B …, [i, j])) begin for each (B Æ RHS) in grammar do ADDTOCHART((B Æ . RHS, [j, j]), chart[j]) end procedure SCANNER((A Æ … . L …, [i, j])) begin if (L Æ word[j]) is_in grammar then ADDTOCHART((L Æ word[j] ., [j, j + 1]), chart[j + 1]) end procedure COMPLETER((B Æ … ., [j, k])) begin for each (A Æ … . B …, [i, j]) in chart[j] do ADDTOCHART((A Æ … B . …, [i, k]), chart[k]) end procedure ADDTOCHART(state, state-list) begin if state is not in state-list then ADDTOEND(state, state-list) end Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 10
  • 11. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 Fig 15.5 Transition network definition of a simple English grammar. 11
  • 12. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 Pseudo-code for a transition network parser appears on the following two slides. It is defined using two mutually recursive functions, parse and transition. continued… 12
  • 13. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 continued from previous slide 13
  • 14. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 Fig 15.6 Trace of a transition network parse of the sentence “Dog bites.” 14
  • 15. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 Fig 15.7 Structures representing the sentence, noun phrase, and verb phrase nonterminals of the grammar. 15
  • 16. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 Fig 15.8 Dictionary entries for a simple ATN 16
  • 17. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 Fig 15.9 An ATN grammar that checks number agreement and builds a parse tree. continued… 17
  • 18. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 Fig 15.9 continued from previous slide. continued… 18
  • 19. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 continued… Fig 15.9 continued from previous slide. 19
  • 20. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 Fig 15.8 continued from previous slide. 20
  • 21. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 Fig 10 Parse tree for the sentence “The dog likes a man” returned by an ATN parser. 21
  • 22. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 Fig 15.11 Type hierarchy used in “dogs world” example. 22
  • 23. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 Fig 15.12 Case frames for the verbs “like” and “bite.” 23
  • 24. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 Rules for our example are described as pseudo-code procedures. In each procedure, if a specified join or other test fails, that interpretation is rejected as semantically incorrect. continued… 24
  • 25. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 continued from previous slide. 25
  • 26. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 Fig 15.13 Construction of a semantic representation from the parse tree of Figure 15.10. 26
  • 27. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 Fig 15.14 Two different parses of “Print the file on the printer.” 27
  • 28. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 Fig 15.15 Conceptual graph for the question “Who loves Jane?” 28
  • 29. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 Fig 15.16 Two relations in an employee database. 29
  • 30. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 Fig 15.17 Entity-relationship diagrams of the manager_of_hire and employee_salary relations. 30
  • 31. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 Fig 15.18 Knowledge base entry for “hire” queries. 31
  • 32. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 Fig 15.19 Development of a database query from the graph of a natural language input.. 32
  • 33. Fig 15.20 Sample text, template summary, and information extraction for computer science advertisement. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 33
  • 34. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 Fig 15.21 An architecture for information extraction, from Cardie (1997). 34