50
Computational Grammars Azadeh Maghsoodi

Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

Embed Size (px)

Citation preview

Page 1: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

Computational Grammars

Azadeh Maghsoodi

Page 2: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

History

Before 18001800-1900First 20s20sWorld War IILast 1950sNowadays

Page 3: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

Before 1800

Traditional Grammar Correct Speech of a specific language Not scientific Rejected Useful issues: POS

Page 4: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

1800-1900

Indian-European languages Language vs. Other languages Language vs. its history

Page 5: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

Early 20s

Enough Philology! Language in a specific time

Page 6: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

20s

America & Western Europe Intellectual Pattern Understanding Processes in human being

Page 7: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

World War II

Math. Logic as a study tool Computer invention caused new App Abstract Mind model ends Behaviorism

Page 8: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

Late 1950

Chomsky is coming! Formal Language Theory “Syntactic Structures” Language Categories

– Type 0: Natural (Irregular)– Type 1: Context sensitive– Type 2: Context free– Type 3: Regular

Page 9: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

Late 1950 (continue)

Chomsky followers professes:– Generative grammar: Accurate and definite

enough for testing Generative Grammars

– Goal: Unaware knowledge of users– Biologic and inborn basis for linguistic abilities

Universal Grammar Shared structures

Page 10: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

Nowadays

Motives – Discover human mind structure – Language process technology

Applications – Word processors– MT– Word predictors– Text predictors– UFIs / DB Queries– Information retrieval

Page 11: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

Syntactic Model

Grammars

Parse Algorithms

Page 12: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

Computational Grammars

Generative Grammars– Caused by Natural Language Theory– Introduced by Chomsky– Accurate and definite structures– Transformational grammar (TG)– Constraint-Based Lexicalist grammar (CBLG)

Page 13: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

TG

Less computational efficiency Theoretical basis Complex rules Simple lexicons

Page 14: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

TG (continue)

Chomsky hierarchy & First TG Standard Theory (1965) Extended Standard Theory Government & Binding Theory (1981-1988)

Page 15: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

Standard Theory

Sentence – Deep structure– Surface structure

Generative TG– Basic part

Produce deep structure CFG

– Transformational part Transformational Rules

Page 16: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

Transformational Rules

Convert deep structure to surface structure Transformational Rule ~ Transformation Example: (same deep structures)

– (i) The boys place the book on the table.– (ii) The boy has placed the book on the table.– (iii) Did the boy place the book on the table?

Page 17: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

Transformational Rules (example)

A deep structure:

S

NP VP

N D

the boy

Aux V NP

will place The book

Page 18: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

Transformational Rules (example)

To produce yes/no question:– Using a Move Transformation– S[NP VP [AUX V NP]] S[AUX NP VP[V NP]]

S

NP VP

Aux V NP

S

Aux NP VP

V NP

Page 19: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

Government and Binding Theory (GB)

Universal grammar theory Learning a language = confirming a small set

of parameters + learning lexicons Move α: deep structure to surface structure ‘Move α’ moves anything to anywhere Some constraints correct ‘Move α’

Page 20: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

GB (continue)

Lexicons

Deep Struct

Surface Struct

Logical FormPhonological Form

Move-α

LF Move-αStylistic &

Phonological Rules

Page 21: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

GB (continue)

Minimalist Program (MP)– Choose the best candidate instead of direct

production– Under study

Page 22: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

CBLG

Based on TGs Increase computational efficiency of

grammars Simple rules Complex lexicons Psychological Computational

Page 23: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

CBLG (continue)

Constraint-Based architecture– Constraint satisfaction more important than

transformational derivation

Strict lexicalism– Lexicons: syntactic atoms of a language– Independent Internal structure from syntactic

constraints

Page 24: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

CBLG (continue)

Surface structures are produced directly Most computational grammars are CBLG

Page 25: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

Computational Grammars

Unification grammar (UG) Categorical grammar (CG) Dependency grammar (DG) Link grammar Lexical/Functional grammar (LFG) Tree Adjoining grammar (TAG) Generalized Phrase Structure grammar (GPSG) Head Driven Phrase Structure grammar (HPSG)

Page 26: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

Unification Grammar (UG)

Lots of CBLs are UG Augmented CFG

– CFG can’t recognize long distance dependencies– A generalized form of CFG + A set of features– Augmented Transition Network (ATN)– Definite Clause Grammar (DCG)

Unification Grammars

Page 27: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

UG (continue)

Unification Grammars– Feature structures are extended– No need to CFGs– Grammar ~ A set of constraints between feature

structures– Key concept: Subsumption relation

Page 28: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

UG (continue)

CAT verb

ROOT cry CAT verb

ROOT cry

CAT verb VFORM present

VFORM present

(Unificator)

Page 29: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

UG (example)

S NP VP Unification grammar:

X0 X1 X2 CAT 0 = 5

CAT 1 = NP

CAT 2 VP

AGR 0 = AGR 1 = AGR 2

VFORM 0 = VORM 2

Page 30: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

UG (continue)

More grammar information are stored in lexicons

Less grammar rules Using DAGs

Page 31: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

ATN Grammar

Transitive network ~ Expanded Finite-State machine

ATN Grammar ~ A set of transitive networks Features Constraints

Page 32: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

Categorical Grammar (CG)

Lots of bases are omitted No difference between lexicons and none-

lexicons Part Of Speech is replaced by some complex

category NP/S : NP is on the right NP\S : NP is on the left

Page 33: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

CG (example)

Peter : NP

Likes : (NP\S)/NP

Peanuts : NP

Passionately : (NP\S)\(NP\S)

Peter likes peanuts passionately.

Page 34: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

CG (example)

S

NP NP\S

Peter NP\S (NP\S)\(NP\S)

(NP\S)/NP NP

Likes peanuts

passionately

Page 35: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

Dependency Grammar (DG)

American linguists Based on TGs Dependencies between words Dependency tree

V

N play Adv

boys well

Page 36: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

Link Grammar

Planarity phenomenon Legal sequence of words:

– Satisfy local necessities (satisfaction)– No crossed conjunctions (planarity)– One connected graph (connectivity)

CFG Lexical grammars

– Grammar is distributed between words Probability models Voice recognition Hand-written recognition

Page 37: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

Link Grammar (example)

linking requirements:

Page 38: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

Link Grammar (example)

linking requirements are satisfied

Page 39: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

Link grammar (example)

Not part of a language

Page 40: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

Lexical-Functional Grammar (LFG)

Unification grammar Not TG ATN research and its deficiencies introduced

LFG Group structures 4 structures

Page 41: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

Tree Adjoining Grammar (TAG)

Between CFG and CSG Grammar rules are a set of initial trees Initial trees are anchored trees Two main operations:

– Substitution– Adjoin

High accuracy

Page 42: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

TAG (example)

S VP S

NP VP + VP ADV NP VP

V NP VP ADV

V NP

Page 43: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

TAG (continue)

High accuracy Apps in NLP

– MT– Information retrieval– …

Page 44: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

Generalized Phrase Structure grammar (GPSG)

Only CFLs CFG Rules

– Immediate Dominance (ID)– Linear Precedence (LP)

Page 45: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

Head Driven Phrase Structure grammar (HPSG)

Lexical grammar Based on unification Increase computational potency of GPSG Simple CFG Complex lexicons

Page 46: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

Applications

Page 47: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

Parse Algorithms

Top-Down parsing Bottom-Up parsing (*)

Page 48: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

Parse Algorithms

Top-Down parsing Chart parser

– Dynamic Programming Recursive Transition Network (RTN)

– ATN grammar LR parser

– Shift-Reduce algorithms Cocke-Younger-Kasami parser (CYK)

– Dynamic Programming– CNF grammar

Page 49: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

Efficient Algorithms

Chart parser CYK parser

Page 50: Computational Grammars Azadeh Maghsoodi. History Before 1800 1800-1900 First 20s 20s World War II Last 1950s Nowadays

Questions???