Handling Questions in Context
Download
Report
Transcript Handling Questions in Context
Chapter 5
Grammars for Natural Language
5.1 Auxiliary Verbs and Verb Phrases
5.2 Movement Phenomena in Language
5.3 Handling Questions in Context-Free Grammars
5.4 Relative Clauses
5.5 The Hold Mechanism in ATNs
5.6 Gap Threading
1
Auxiliary Verbs and Verb Phrases (I)
Lexically different auxiliaries are:
Have : followed by past participle
Be : followed by present participle (when passive by past participle)
Do : alone but a base form after
Modal (can , must ,..) : base form
In a sentence the first auxiliary must agree with the subject as below:
Auxiliary
Modal
Have
Be
Be
COMPFORM
base
pastprt
ing
pastprt
Construction
modal
perfect
progressive
passive
Example
can see the house
have seen the house
is lifting the box
was seen by the crowd
2
Auxiliary Verbs and Verb Phrases (II)
How to handle auxiliary verbs:
The main idea is to treat them as verbs that take VP as a complement.
The rule then is:
VP (AUX COMPFORM ?s)(VP VFORM ?s)
And auxiliary sequence:
Modal + have + be (prograssive) + be (passive)
Next problem is how to handle this sequence.
The above rule solves the problem for most of the cases :
*He has might see the movie already.
Modals after “has” is illegal because modals don’t have past participle
form.
3
Auxiliary Verbs and Verb Phrases (III)
What about have preceding be:
*I must be having been singing
We solve this problem with two binary feature:
+main : the VP contains the main verb
+pass : the VP is passive
VP AUX[be] VP [ing, +main]
VP AUX[be] VP[ing ,+pass]
Or:
VP[+pass] AUX[be] VP[ pastprt ,main]
Passive sentences :
In passive the VP misses the object . we define a new binary feature.
VP[-passgap] V[ _np] NP
VP[+passgap] V[ _np]
Passgap a binary feature to -, and will get the value + if a passive rule is used.
4
Movement Phenomena in Language (I)
Two most popular movement :
Yes/no Question (local or bounded movement)
wh_Question (unbounded movement)
This movement can be handled easily but after transformation some
constituent is missed. The main problem is to handle the missing.
Two new feature definition :
Gap : the place where subconstituent is missing
Filler :the constituent which is moved
What will the fat man angrily put __ in the corner?
angrily put what in the corner
Different Types of Movement
1- wh-movement
2-topicalization
3-adverb preposing
4-extraposition
5
Movement Phenomena in Language(II)
S[-inv]
NP
Jack
S[-inv]
VP[pres,-pass]
AUX[+modal]
can
NP
VP[base,-passgap]
V[_np,base]
see
active form
NP
Jack
VP[past,+pass]
AUX[be]
was
The dog
VP[pastprt,+passgap]
V[_np,pastprt]
seen
passive form
Figure 1:movement for active to passive transform
6
Handling Questions in Context-Free Grammars(I)
Rule for extending the CFG to cover yes/no question:
S[+inv] (AUX AGR ?a SUBCAT ?v)(NP AGR ?a)(VP VFORM ?v)
It enforces the subject-verb agreement & right VFORM that follows VP.
GAP feature passes from the mother to the sub constituent to be placed
correctly . there the appropriate constituent will be accepted using no input.
The below rule shows this substitution
(NP GAP ((CAT NP)(AGR ?a)) AGR ?a) ε
Rules to pass the GAP feature:
1-head constituent is non-lexical category
(S GAP ?g) (NP GAP --)(VP GAP ?g)
Head
constituent
Head constituent
2-head constituent is lexical category
VP V[_np_vp:inf] NP PP
(VP GAP ?g) V[_np_vp:inf] (NP GAP ?g)(PP GAP --)
(VP GAP ?g) V[_np_vp:inf] (NP GAP --)(PP GAP ?g)
Wh-words are identified as filler and introduced by feature WH.
WH feature has two value Q and R.
7
Handling Questions in Context-Free Grammars(II)
A phrase contains a subphrase that has WH feature then the main
phrase also has the same WH feature.
In what store did you buy the picture?
Rules to generate wh-questions
With the above discussion we can add two rule to CFG to handle wh-questions
S (NP[Q,-gap] AGR ?a)(S[+inv] GAP (NP AGR ?a)
S (PP[Q,-gap] PFORM ?p)(S[+inv] GAP (PP PFORM ?p)
8
Handling Questions in Context-Free Grammars(II)
Parsing with Gap
S2
VFORM past
1 NP1
2 S1
NP1
WH Q
AGR 3p
1 DET1
2 CNP1
S1
INV+
GAP (NP AGR 3p)
VFORM past
1 AUX1 2 NP2 3 VP1
DET1
WH Q
AGR 3p
1 QDET1
CNP1
AGR 3p
1 N1
QDET1
WH Q
AGR 3p
N1
AGR 3p
Which
dogs
NP2
AGR 3s
1 PRO1
AUX1
AGR 3s
VFORM past
SUBCAT base
did
Figure 2: Chart for parsing gaps in CFG
VP1
VFORM inf
GAP (NP AGR 3p)
1 V1
2 EMPTY-NP1
PRO1
AGR 3s
he
see
9
Relative Clauses
Rule to produce relative clauses:
CNP CNP REL
REL (NP WH R AGR ?a)(S[-inv,fin] GAP (NP AGR ?a))
REL (PP WH R PFORM ?p)(S[-inv,fin] GAP (NP PFORM ?a))
What about that-clauses:
If that be a relative pronoun whit WH feature R then the above rule
covers that-clauses.
the above rule does not allow the Q feature to move to relative clauses
because REL is not the head feature.
(CNP GAP ?g) (CNP GAP ?g)(REL GAP --)
Head
constituent
10
The Hold Mechanism in ATNs
A data structure called hold list maintains the constituent that are to be
moved .
Hold action : takes a constituent and places it on the hold list.
Acceptation condition==The hold list is empty.
VIR arc:
takes a constituent name and if it is in the hold list removes it from
the hold list.
VP
NP
NP
aux
NP
S
NP
aux
VIR NP
aux
WH-S
VP-AUX
WH*∩ {Q R}
VCOMP
pop
aux
S-INV
S/2
NP
OBJ
pop
VIR NP
NP
WH:=WH*
Action:=HOLD
Figure 3: An S Network for question and relative clauses
11
Comparing the methods
Three important property
1-coverage
2-selectivity
3-conciseness
1-Both method have necessary coverage.
2-But
*Who did the man who saw hit the boy?
Will be accepted in ATN.
A way is the mechanism of HIDE and UNHIDE action.
HIDE : hide the existing constituents on the hold list.
UNHIDE : unhides the constiuents.
We can execute HIDE action before the hold action.
3-it is hard to write a grammar that handles the movement constrains.
12
Gap Threading
Gap Treading is the combination of both two previously stated
methods.
It is often used in logic programming .
S(position-in,position-out,filler-in,filler-out)
Position-in :the beginning of the phrase .
Position-out:end of the phrase.
Filler-in:the list of fillers in current constituent.
Filler-out:the resulting list of fillers that were not used.
This method is much the same of a logic implementation of the hold list
method.
But the mechanism to allow the propagation of the filler list or not can
avoid the problem discussed in previous section.
13