290 likes | 518 Views
Algorithm Schemata and Data Structures in Syntactic Processing. By Martin Kay. 발표자 : 임성신 E-mail : sslim@pusan.ac.kr. Contents. Parsing Top-down parsing Buttom-up parsing Chart parsing CKY Bottom-up Chart Parsing Top-down Chart Parsing. What is parsing?.
E N D
Algorithm Schemata and Data Structures in Syntactic Processing By Martin Kay 발표자 : 임성신 E-mail : sslim@pusan.ac.kr
Contents • Parsing • Top-down parsing • Buttom-up parsing • Chart parsing • CKY • Bottom-up Chart Parsing • Top-down Chart Parsing
What is parsing? • parsing involves recognising an input string and assigning a structure to it • parsing involves: • a grammar e.g. a context-free grammar • an input string • a parsing algorithm: a set of instructions for applying the grammar to the input stringe.g. whether to use top-down or bottom-up methods
Applications of Parsing • grammar checking in word processing systems • as a basis for semantic analysis • to support applications of NLP such as • machine translation • question answering • information extraction
Top-down production 예문 : radio broadcasts pay
Start Top-down Parsing S NP VP D N V NP D N the dog saw the cat
Bottom-up parsing S NP VP D N V NP D N the dog chased the cat Start
Parsed Sentence S NP VP VP PP Verb NP Prep NP Det Noun Det Noun Det Noun the boy hits the dog with a rod
NP VP Verb VP NP PP Verb Det NP Noun Prep NP Det Noun Det Noun Det Noun Top-down Parsing S Failed the boy hits the dog with a rod
S S Prep NP NP Verb VP NP PP S Verb NP Prep NP Det Noun Det Noun Det Noun Bottom-up Parsing Failed the with hits boy the a dog rod NP S Det VP Prep Noun PP Verb NP Det Det NP Noun Noun the boy hits the dog with a rod
NP S NP NP NP VP VP Prep VP NP VP VP PP Verb NP Prep NP Det Noun Det Noun Det Noun the boy hits the dog Bottom-up Parsing with a rod S VP Prep PP Det NP Noun with a rod
Chart Parsing • chart parsing is a form of dynamic programming • dynamic programming solves problems by filling in tables with solutions to sub-problems • when complete, the tables contain all the solutions to the sub-problems needed to solve the problem • in chart parsing, this involves storing subtrees for constituents that are found • once found and stored, subtrees can be looked up - this avoids reparsing
the boy hits the dog with a rod CKY(Cocke-Kasami-Younger) S VP S VP PP NP NP NP Det Noun Verb Det Noun Prep Det Noun
예문 : Failing students looked hard. • S → NP VP • NP → A N • NP → PRP N • VP → V A • VP → V AV • A → failing, hard, … • PRP → failing, … • N → students, … • V → looked, … • AV → hard, …
S NP NP S AV PRP A N V N N A Bottom-up Chart Parsing(1/4) VP N VP N Failing student looked hard
VP VP AV AV A V V V A Bottom-up Chart Parsing(2/4) AV A Failing student looked hard
S S VP VP VP VP NP NP N N AV AV PRP PRP A V A V N N Bottom-up Chart Parsing(3/4) Failing student looked hard
VP VP NP NP AV S S AV A VP VP A N A V N V A N N Bottom-up Chart Parsing(4/4) Failing student looked hard
? S AV PRP A N V A Top-down Chart Parsing Initial Step Failing student looked hard
? S ? ? ? ? ? NP VP N N A ? NP NP S PRP Top-down Chart Parsing(1/6) Failing student looked hard
? VP ? Failing ? Failing ? ? student Failing student ? A A NP VP N A N N N A S N A NP NP NP NP S Top-down Chart Parsing(2/6) Failing student looked hard
? ? ? VP Failing student NP VP S N PRP Failing Failing ? student ? ? NP NP NP PRP PRP PRP N N N N NP S PRP Top-down Chart Parsing(3/6) Failing student looked hard
looked ? looked ? ? hard VP VP VP V V V A A A A V Top-down Chart Parsing(4/6) Failing student looked hard
looked ? looked ? ? hard VP VP VP V V V AV AV AV V AV Top-down Chart Parsing(5/6) Failing student looked hard
? looked hard VP VP student looked Failing Failing student hard V A V A A A N N S S VP NP NP Top-down Chart Parsing(6/6) Failing student looked hard