Download presentation
Presentation is loading. Please wait.
Published byBrianna Howard Modified over 8 years ago
1
Constraint Grammar ESSLLI Thursday: Dependency
2
CG Input ➢ remember CG is modular! output from one module becomes input to the next module pre- process or analyzer nomor ph CG text your CG output cat file | preprocessor | analyzer | vislcg3 -g engcg.nomorph.cg | vislcg3 -g yourcgfile... echo ”text” | preprocessor | analyzer | vislcg3 -g engcg.nomorph.cg | vislcg3 -g yourcgfile...
3
CG Contexts ● Context conditon: word form “ ”, base form “....”, tag A-Z, @[A-Z], combinations... ● direction: + (right), - (left) ● Position marker: – 0 self – local right: 1, 2, 3..., local left: -1, -2, -3,... ● Globality – * continue until match is found – ** continue also across context match to fulfil further (linked) conditions – 0* nearest neighbour: search in both directions ● Careful: C, e.g. *1C (only unambiguous readings)
4
CG contexts 2 ● NOT: conditions can be negated – (NOT *1 VFIN) ● contexts can be LINKed – (*1C xxx LINK 0 yyy LINK *1 zzz) ● searches can have a BARRIER – (*1 N BARRIER VFIN) ● contexts can be ANDed – IF (0 xxx) (*1 yyy) (NOT *-1 zzz) ● contexts can be negated as a whole – (NEGATE *1 ART LINK 1 ADJ LINK 1 N)
5
NEGATE ● implements aspects of the TEMPLATE idea (being able to refer to - and to negate - chunks of internally linked tokens ● will invert the result of the entire LINK'ed chain that follows ● whereas NOT will only invert the result of the immediately following test (NEGATE *1 (AUX) LINK 1 (@AUX<)) ; (NEGATE *-1 N LINK -1 DEF) ;
6
CBARRIER ● like BARRIER, but only if unambiguous ● i.e. less strict than BARRIER (**1 N CBARRIER VFIN) ;
7
2. Dependency grammar ➢ strictly token based (e.g. Tesnière) expresses syntactic form as asymmetrical relations (“arcs”) between head tokens and dependent tokens no zero tokens, no nonterminal nodes ➢ each dependent is allowed 1 head (exc. secondary arcs) ➢ directed acyclic graphs ➢ projective or non-projective (crossing branches / discontinuity) Myfatcat never eats fish.
8
Graphical dependency tree with CG function labels reached sattelitesnever orbit Thelastlaunched by US the @>N @P< @<PASS @>N @ICL-N< @SUBJ> @ADVL> @<ACC
10
Format 1: Dependency trees Word-lemma extra PoS morphologysyntacticdependency form functionlink $¿ #1->0 Cuáles [cuál] DET MF P @SC> #2- >3Which son [ser] V PR 3P IND VFIN @FS-QUE #3->0are los [el] DET M P @>N #4->5the motivos [motivo] N M P @ 3motives que [que] SPEC MF SP @SUBJ> #6->7that han [haber] V PR 3P IND@FS-N 5have hecho [hacer] V PCP M S @ICL-AUX 7 made resurgir [resurgir] V INF @ICL- 8 resurface este [este] DET M S @>N #10->11this debate [debate] N M S @ 9debate $ #12->0? What are the motives that have made this debate resurface?
11
Creating Dependencies ● create dependencies on the fly ● change existing dependencies ● circularity – a rule won't be applied if it introduces circularity – however, if there IS circularity further up in the ancestor chain from a previous module, then it will be accepted SETPARENT (@>N) (0 (ART DET)) TO (*1 (N)) ; SETPARENT (@P<) TO (*-1 (PRP)) ; = SETCHILD (PRP) TO (*1 @P<) ; SETPARENT (@FS-N LINK *-1 N) ~ TO (**-1 N) ;
12
Using Dependencies ● accepts input from other programs in cg-format: –... #n->m – where n is assumed unique and m is an element of n's – id-input-window is reset for each #1 (e.g. sentence-wise) ● adds its own layer of running dependency numbering (i.e. over the whole corpus, not just the individual sentence) SELECT (%hum) (0 @SUBJ) (p ) -> assign +HUM to subjects of cognitive verbs SELECT (@ACC) (NOT s @ACC) -> uniqueness principle (*-1 N LINK c DEF) -> definite np recognized through dependent ADD (§AG) TARGET @SUBJ (p V-HUM LINK c @ACC LINK 0 N-NON-HUM) ;
13
● in a rule, dep-relations (letters) replace positions (numbers) – Parent/Mother (p) – Child/Daughter (c) – Sibling/Sister (s) ● Complex relations can be expressed as combinations: – Niece: s LINK c (c LINK s = 2 c-tests) – Aunt: p LINK s(s LINK p = p) – Cousin: p LINK s LINK c Dependency relations
14
● NONE regards relation existence, not tags – NONE c @>N = no prenominal – c @>N LINK NOT 0 P = at least one prenominal child that isn't plural (e.g. grammar checking for agreement) ● * means deep scan of all ancestors (*p) or offspring (*c) ● ALL means all-relations-match, not all-readings-match – ALL s (P) = all siblings have a plural reading (but possibly others) – s (P) LINK 0C (P) = there is a sibling with only plural readings ● S means and-self – *pS (@FS-N<) = if self or any ancestor is marked relative clause (good for verb chain testing where you don't know if you are looking at the first or later elements) Operators
15
The noun phrase bottom up ● SETPARENT (@>A) TO (*1 ATTR OR ADV) ● SETPARENT (@>N) TO (*1 N BARRIER NON-PRE-N/ADV) ● SETPARENT (@N<) TO (*-1 N OR ADJ OR DET) – circularity-check will make superfluous a LINK NOT 0 @>N ● SETPARENT (@N<PRED) OR (@APP) TO (*-1 N OR ADJ OR DET)
16
The prepositional phrase ● SETPARENT (@P<) TO (*-1 PRP)
17
The clause ● clause constituents: – SETPARENT @FUNC> - @SUBJ> TO (*1 &MV) – SETPARENT @<FUNC TO (*-1 &MV) ● verb chain before subclause attachment: – SETPARENT @ICL-AUX< TO (*-1 &AUX) # or vice versa, depending on descriptive conventions ● subclause attachment: – SETPARENT @FS-FUNC> (*1 &MV) # circularity exception will prevent a VFIN auxiliary from attaching to its own (dependent) main verb – SETPARENT @FS-<FUNC TO (*-1 &MV) – same for @ICL, or include in the target set of previous rules
18
Coordination of e.g. direct objects ● (a) parallel attachment: – automatically achieved by iteration of FUNC attachment rules ● Mark conjuncthood – ADD ( ) TARGET @ACC (s @ACC) ● (b) chaining conjuncts: – SETPARENT @<ACC TO (*-1 &MV BARRIER CLB) (c @<ACC) – SETPARENT $$@<FUNC TO (*-1 $$@<FUNC BARRIER &MV) – SETPARENT $$@<FUNC TO (*-1 &MV BARRIER LINK c $$@<FUNC) ● Mark conjuncthood – ADD ( ) TARGET @ACC (c @ACC) – ADD ( ) TARGET @ACC (p @ACC)
19
The challenge of the relative clause ● SETCHILD &MV TO (*-1 @SUBJ>) (NEGATE *1 @<SUBJ BARRIER CLB OR VV) – inverted attachment, because of relative clauses attaching to subjects, where the left subject should not attach to the closest verb, but the right subject is still the closest to its verb, with the BARRIER between the verbs being stronger than between the subjects (e.g. Danish comma traditions) ● SETPARENT @FS-N< TO (*-1 @FS-N< BARRIER VFIN OR CLB) unless you want parallel conjunct attachment ● SETPARENT @FS-N< TO (**-1 @FUNC) (NOT 0 CLB) – verb can't attach to it's own subject due to circularity exeption ● SETPARENT @SUBJ> TO (*1 VFIN) ; # or: LINK -1 (*) LINK *1 &MV) – parent will now be the next finite or main verb, after @FS-N<, due to the circularity exception
20
labelled arcs for secondary dependencies or other purposes ● instead of the default dependency arcs, other relations can be defined: ● SETRELATION (referent) TARGET ( ) TO (*-1 N) ; (Set a ”referent” relaton from a relative pronoun to a noun occurring earlier in the sentence.) ● leads to: ID:n R:identity:m – n: arc base (here pronoun) word number – identity: relation name introduced by R – m: arc head (here the referent noun) word number
21
Secondary dependency types ● SETRELATION (nexus) TARGET @SC TO (p V LINK c @SUBJ) ; – subject complements to subjects ● SETRELATION (nexus) TARGET @OC TO (p V LINK c @ACC) ; – obect complements to objects ● SETRELATION (coord) TARGET @ACC TO (s @ACC) ; – if parallel attachment for conjuncts has been used ● SETRELATION (relref) TARGET TO (*1 @FS-N< LINK p (*)) ; – to link relatives to their semantic referents ● SETRELATION (semhead) TARGET @SUBJ TO (p VFIN LINK *Sc &MV) ; - to link subjects to their semantic heads (&MV) rather than syntactic heads (agreement-carrying VFIN) ● SETRELATION (semhead) TARGET @P OR LINK p V) ; – transparent quantified expression: drank 2 bottles of beer
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.