Understanding Natural Language

Slides:



Advertisements
Similar presentations
 Christel Kemke 2007/08 COMP 4060 Natural Language Processing Feature Structures and Unification.
Advertisements

Augmented Transition Networks
Natural Language Processing - Parsing 1 - Language, Syntax, Parsing Problems in Parsing Ambiguity, Attachment / Binding Bottom vs. Top Down Parsing.
Structures and Strategies For Space State Search
1 CS 385 Fall 2006 Chapter 14 Understanding Natural Language Problems.
For Monday Read Chapter 23, sections 3-4 Homework –Chapter 23, exercises 1, 6, 14, 19 –Do them in order. Do NOT read ahead.
HEURISTIC SEARCH ARTIFICIAL INTELLIGENCE 5th edition George F Luger
Artificial Intelligence 2004 Natural Language Processing - Syntax and Parsing - Language, Syntax, Parsing Problems in Parsing Ambiguity, Attachment.
Understanding Natural Language
 Christel Kemke /08 COMP 4060 Natural Language Processing PARSING.
NLP and Speech 2004 Feature Structures Feature Structures and Unification.
1 Understanding Natural Language The Natural Language Understanding Problem 14.1Deconstructing Language: A Symbolic Analysis 14.2Syntax 14.3Syntax.
A basis for computer theory and A means of specifying languages
Chapter 9 Compilers and Language Translation. The Compilation Process Phase I: Lexical analysis Phase I: Lexical analysis Phase II: Parsing Phase II:
1 Understanding Natural Language The Natural Language Understanding Problem 14.1Deconstructing Language: A Symbolic Analysis 14.2Syntax 14.3Syntax.
Artificial Intelligence 2004 Natural Language Processing - Syntax and Parsing - Language Syntax Parsing.
Chapter 2 A Simple Compiler
Structures and Strategies For Space State Search
Automated Reasoning ARTIFICIAL INTELLIGENCE 6th edition George F Luger
Strong Method Problem Solving.
2.2 A Simple Syntax-Directed Translator Syntax-Directed Translation 2.4 Parsing 2.5 A Translator for Simple Expressions 2.6 Lexical Analysis.
Knowledge Representation
Grammars.
Computer Science 112 Fundamentals of Programming II Recursive Processing of Languages.
CCSB354 ARTIFICIAL INTELLIGENCE (AI)
ICS611 Introduction to Compilers Set 1. What is a Compiler? A compiler is software (a program) that translates a high-level programming language to machine.
1 CS 385 Fall 2006 Chapter 14 Understanding Natural Language (omit 14.4)
For Friday Finish chapter 23 Homework: –Chapter 22, exercise 9.
Parsing arithmetic expressions Reading material: These notes and an implementation (see course web page). The best way to prepare [to be a programmer]
Chapter 1 Introduction Dr. Frank Lee. 1.1 Why Study Compiler? To write more efficient code in a high-level language To provide solid foundation in parsing.
The Predicate Calculus
AN IMPLEMENTATION OF A REGULAR EXPRESSION PARSER
Winter 2007SEG2101 Chapter 71 Chapter 7 Introduction to Languages and Compiler.
10. Parsing with Context-free Grammars -Speech and Language Processing- 발표자 : 정영임 발표일 :
Building Control Algorithms For State Space Search.
Reasoning in Uncertain Situations
Lectures on Artificial Intelligence – CS435 Conceptual Graphs
Structures and Strategies For Space State Search
George F Luger ARTIFICIAL INTELLIGENCE 6th edition Structures and Strategies for Complex Problem Solving Artificial Intelligence as Empirical Enquiry Luger:
Notes on Pinker ch.7 Grammar, parsing, meaning. What is a grammar? A grammar is a code or function that is a database specifying what kind of sounds correspond.
George F Luger ARTIFICIAL INTELLIGENCE 6th edition Structures and Strategies for Complex Problem Solving Machine Learning: Symbol-Based Luger: Artificial.
Syntax Why is the structure of language (syntax) important? How do we represent syntax? What does an example grammar for English look like? What strategies.
Artificial Intelligence: Natural Language
KNOWLEDGE REPRESENTATION 6 6.0Issues in Knowledge Representation 6.1A Brief History of AI Representational Systems 6.2Conceptual Graphs: A Network Language.
Grammars Grammars can get quite complex, but are essential. Syntax: the form of the text that is valid Semantics: the meaning of the form – Sometimes semantics.
Artificial Intelligence: Natural Language
Sentence Parsing Parsing 3 Dynamic Programming. Jan 2009 Speech and Language Processing - Jurafsky and Martin 2 Acknowledgement  Lecture based on  Jurafsky.
1 Using Yacc. 2 Introduction Grammar –CFG –Recursive Rules Shift/Reduce Parsing –See Figure 3-2. –LALR(1) –What Yacc Cannot Parse It cannot deal with.
Syntax The Structure of a Language. Lexical Structure The structure of the tokens of a programming language The scanner takes a sequence of characters.
George F Luger ARTIFICIAL INTELLIGENCE 6th edition Structures and Strategies for Complex Problem Solving Machine Learning: Probabilistic Luger: Artificial.
CSE573 Autumn /23/98 Natural Language Processing Administrative –PS3 due today –PS4 out Wednesday, due Friday 3/13 (last day of class) special.
Computerlinguistik II / Sprachtechnologie Vorlesung im SS 2010 (M-GSW-10) Prof. Dr. Udo Hahn Lehrstuhl für Computerlinguistik Institut für Germanistische.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
PZ03BX Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ03BX –Recursive descent parsing Programming Language.
Parsing and Code Generation Set 24. Parser Construction Most of the work involved in constructing a parser is carried out automatically by a program,
George F Luger ARTIFICIAL INTELLIGENCE 5th edition Structures and Strategies for Complex Problem Solving HEURISTIC SEARCH Luger: Artificial Intelligence,
STRUCTURES AND STRATEGIES FOR STATE SPACE SEARCH 3 3.0Introduction 3.1Graph Theory 3.2Strategies for State Space Search 3.3Using the State Space to Represent.
GRAMMARS & PARSING. Parser Construction Most of the work involved in constructing a parser is carried out automatically by a program, referred to as a.
NATURAL LANGUAGE PROCESSING
George F Luger ARTIFICIAL INTELLIGENCE 5th edition Structures and Strategies for Complex Problem Solving STOCHASTIC METHODS Luger: Artificial Intelligence,
By Kyle McCardle.  Issues with Natural Language  Basic Components  Syntax  The Earley Parser  Transition Network Parsers  Augmented Transition Networks.
Welcome to the flashcards tool for ‘The Study of Language, 5 th edition’, Chapter 8 This is designed as a simple supplementary resource for this textbook,
Machine Learning: Symbol-Based
Machine Learning: Symbol-Based
Natural Language Understanding
Natural Language - General
Natural Language Understanding
Lec00-outline May 18, 2019 Compiler Design CS416 Compiler Design.
Artificial Intelligence 2004 Speech & Natural Language Processing
COP 4620 / 5625 Programming Language Translation / Compiler Writing Fall 2003 Lecture 2, 09/04/2003 Prof. Roy Levow.
Presentation transcript:

Understanding Natural Language 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 George F Luger ARTIFICIAL INTELLIGENCE 6th edition Structures and Strategies for Complex Problem Solving Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 1

Fig 15.1 A blocks world, adapted from Winograd (1972). Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 2

To manage this complexity, linguists have defined different levels of analysis for natural language: Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 3

Fig 15.2 Stages in producing an internal representation of a sentence. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 4

Fig 15.3 Parse tree for the sentence “The man bites the dog.” Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 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

Luger: Artificial Intelligence, 6th edition 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])) if (L Æ word[j]) is_in grammar then ADDTOCHART((L Æ word[j] ., [j, j + 1]), chart[j + 1]) procedure COMPLETER((B Æ … ., [j, k])) for each (A Æ … . B …, [i, j]) in chart[j] do ADDTOCHART((A Æ … B . …, [i, k]), chart[k]) procedure ADDTOCHART(state, state-list) if state is not in state-list then ADDTOEND(state, state-list) Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 10

Fig 15.5 Transition network definition of a simple English grammar. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 11

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… Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 12

continued from previous slide Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 13

Fig 15.6 Trace of a transition network parse of the sentence “Dog bites.” Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 14

Fig 15.7 Structures representing the sentence, noun phrase, and verb phrase nonterminals of the grammar. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 15

Fig 15.8 Dictionary entries for a simple ATN Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 16

Fig 15.9 An ATN grammar that checks number agreement and builds a parse tree. continued… Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 17

Fig 15.9 continued from previous slide. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 18

Fig 15.9 continued from previous slide. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 19

Fig 15.8 continued from previous slide. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 20

Fig 10 Parse tree for the sentence “The dog likes a man” returned by an ATN parser. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 21

Fig 15.11 Type hierarchy used in “dogs world” example. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 22

Fig 15.12 Case frames for the verbs “like” and “bite.” Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 23

Rules for our example are described as pseudo-code procedures 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… Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 24

continued from previous slide. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 25

Fig 15.13 Construction of a semantic representation from the parse tree of Figure 15.10. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 26

Fig 15.14 Two different parses of “Print the file on the printer.” Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 27

Fig 15.15 Conceptual graph for the question “Who loves Jane?” Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 28

Fig 15.16 Two relations in an employee database. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 29

Fig 15. 17 Entity-relationship diagrams of the manager_of_hire and Fig 15.17 Entity-relationship diagrams of the manager_of_hire and employee_salary relations. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 30

Fig 15.18 Knowledge base entry for “hire” queries. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 31

Fig 15.19 Development of a database query from the graph of a natural language input.. Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 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

Fig 15.21 An architecture for information extraction, from Cardie (1997). Luger: Artificial Intelligence, 6th edition. © Pearson Education Limited, 2009 34