430 likes | 570 Views
LFG-based syntactic transfer from English to French with XTE The Xerox Translation Environment. Overview.
E N D
LFG-based syntactic transfer from English to Frenchwith XTE The Xerox Translation Environment
Overview The Translation Architecture Source and Target LFG GrammarsSome Examples from the Corpus Transfer CoverageRule Ordering in a Transfer GrammarExamples of “stepwise” Transfer: Nominalization and CoordinationMore on Coordination:Structure Deletion and Root Node RewritingTranslation Cycles and Optional Rules
Translation Architecture • The XTE Xerox Translation Environment XTE term rewriting system Transfer rules TL f-structure terms SL f-structure terms pred(f,marcher), subj(f,g), pred(g,’Jean’) pred(f,walk) subj(f,g), pred(g,’John’) pred(A,walk) ==> pred(X,marcher). pred(A,’John’) ==> pred(X,’Jean’). disambiguation underspecified TL f-structure SL f-structure XLE parsing XLE generation Source language string Target language strings
Translation Architecture • The XTE Xerox Translation Environment XTE term rewriting system Transfer rules TL f-structure terms SL f-structure terms pred(f,marcher), subj(f,g), pred(g,’Jean’) pred(f,walk) subj(f,g), pred(g,’John’) pred(A,walk) ==> pred(X,marcher). pred(A,’John’) ==> pred(X,’Jean’). disambiguation addonly Internal Attributes External Attributes underspecified TL f-structure SL f-structure XLE parsing XLE generation Source language string Target language strings
Source and Target Language LFG Grammars • Source language grammar: English (Tracy Holloway King - PARC) • Target language grammar: French (Anette Frank, Veronika Lux - XRCE) • Special focus on generation from underspecified structures • Use of ``optimality’’ (preference) marks and surface order constraints • to define e.g. • preferred default positions for adverbs of different types • preferred default positions of adjuncts • LFG grammars are reversible, • but specify different preference rankings for analysis and generation mode
Some Examples from the Corpus To keep your HomeCentre in good operating condition, you need to perform periodic maintenance tasks.Pour assurer le bon fonctionnement du HomeCentre, vous devez effectuer périodiquement des tâches d’entretien.HEADER: Removing and Replacing the Paper CassetteHEADER: Retrait et mise en place de la cassette papierBefore you add paper, make sure that the paper matches the paper size setting in Windows.Avant d’ajouter du papier, assurez-vous que le papier correspond au format de papier sélectionné.Keep in mind that you can’t use paper that is wider than 8 inches in the HomeCentre.N’oubliez pas que vous ne pouvez pas utiliser du papier qui dépasse 8 inches dans le HomeCentre.Fan the paper and put up to 125 sheets into the paper tray.Ventilez le papier et placez jusqu’à 125 feuilles dans le plateau de départ papier.Make sure that the green carriage lock lever is STILL moved all the way forward before you reinstall the print head.Assurez-vous que le levier vert de verrouillage du chariot est TOUJOURS repoussé complètement vers l’avant avant de remettre la tête d’impression en place.
Transfer Coverage • The transfer corpus: • A contiguous section of the HomeCentre user manual -- Chapter 6 • (99 sentences/text items) • A basic transfer “grammar” for translation from English to French • 545 compiled transfer rules: • 171 structural transfer rules • 76 lexicalized transfer rule templates (374 instantiated lexical transfer rules; • approx. 5 entries per rule template) • Translations for 94 sentences
Overall Organization of a Transfer Grammar Input Deleting grammar specific features of SL grammar Adjusting minor differences between SL and TL f-structures (e.g. create uniform feature space for nominals) General transformations on feature structures adjunct(A,B), in_set(C,B) ==> adjunct_x(A,C). nominalization verbs nouns adjectives adverbs conjunctions prepositions Lexical and structural transfer rules General transformations on feature structures (ADJUNCT) Final adjustments to match TL feature structures Output
Defining Optionality and Restrictions % Simple verbsrestriction/A :: 0 ==> 0.opt :: 0 ?=> 0.Source -> Target :: % main transfer rule pred(A,Source), +vtype(A,_) ==> pred(A, Target) && opt && restriction/A.open -> soulever. % optional opt :: 0 ==> 0.open -> ouvrir. % obligatoryfan -> ventiler.restriction/A :: -obj(A,_) ==> inhrefl/A. print -> imprimer. % intransitive to intransitive reflexive appear -> afficher.
Nominalization HEADER: Removing the print head -- Retrait de la tête d’impression
Nominalization … when moving the printer -- .. lors du déplacement de l’imprimante
“Stepwise” Transfer nominal_or_verbal/A :: nominal_gerund_features/A, spectype(_)/A ==> spectype(def)/A ; verbal_gerund_features/A ==> spectype(def)/A, ntype(A,_), default_nominal_agr/A.nominalization(SourceVerb,TargetNoun) :: pred(A,SourceVerb), tns_features/A ?=> pred(A,TargetNoun), nominalized(A) && nominal_or_verbal/A.nominalization(print, impression).nominalization(move, déplacement). nominalization(remove, retrait). First step: The nominalization rule Rewriting a verbal head with verbal features into a nominal head with nominal features
pred(0,remove)subj(0,1), pred(1,pro), pron_type(1,null)obj(0,2), pred(2,print head), ntype(2,2), grain(2,count), spec(2,4), spec_type(4,def), pers(2,’2’), num(2,sg),tns_asp(0,5), prog(5,+), perf(5,-),passive(0,-), pers(0,’2’), layout_type(0,header), stmt_type(0,header), vtype(0,main), num(0,sg),ntype(0,6), gerund(6,+), type(6,eventive).pred(A,remove), tns_asp(A,B), perf(B,_), prog(B,_), vtype(A,_),+ntype(A,C), gerund(C,+), type(C,eventive) ?=> pred(A,retrait), nominalized(A). Applying the nominalization rule to the input
pred(0,retrait), nominalized(0),subj(0,1), pred(1,pro), pron_type(1,null)obj(0,2), pred(2,print head), ntype(2,2), grain(2,count), spec(2,4), spec_type(4,def), pers(2,’2’), num(2,sg),passive(0,-), pers(0,’2’), layout_type(0,header), stmt_type(0,header), num(0,sg),ntype(0,6).
+nominalized(A), passive(A,-) subj(A,B), null_pron/B, obj(A,C) ==> adjunct_x(A,D), prepsem(de)/[D,C]. Second step: Relation changes in nominalization Case 1: active transitive verbs rewrite transitive object into de-adjunct; delete null subject Ex: start printing the page again ==> reprenezl’impression de la page
+nominalized(A), passive(A,-), subj(A,B), null_pron/B ==>0. Second step: Relation changes in nominalization Case 2: active intransitive delete null subject Ex: start printingagain ==> reprenezl’impression
+nominalized(A), passive(A,-), subj(A,B), null_pron/B ==>adjunct_x(A,C), prepsem(de)/[C,B]. Second step: Relation changes in nominalization Case 3: passive rewrite passive subject into de-adjunct Ex: when the scanner is being calibrated ==> pendant l’ étalonnagedu scanner
pred(0,retrait), nominalized(0), spec(0,7), spec_type(7,def),subj(0,1), pred(1,pro), pron_type(1,null) obj(0,2), pred(2,print head), ntype(2,2), grain(2,count), spec(2,4), spec_type(4,def), pers(2,’2’), num(2,sg),passive(0,-), pers(0,’2’), layout_type(0,header), stmt_type(0,header), num(0,sg), ntype(0,6). +nominalized(A), passive(A,-) subj(A,B), null_pron/B, obj(A,C) ==> adjunct_x(A,D), prepsem(de)/[D,C]. Applying ``relation changes’’ to the (new) input
pred(0,retrait), nominalized(0),spec(0,7), spec_type(7,def),adjunct_x(0,8), pred(8,de), ptype(8,sem), obj(8,2), pcase(2,de),pred(2,print head), ntype(2,2), grain(2,count), spec(2,4), spec_type(4,def), pers(2,’2’), num(2,sg),pers(0,’2’), layout_type(0,header), stmt_type(0,header), num(0,sg),ntype(0,6).nominalized(A) ==> 0. pred(A,print head) ==> pred(A,tête d’impression). Retrait de la tête d’impression
Another Example of “stepwise” Transfer: Head Switching in Coordination You print a test page when you move the HomeCentre or replace an ink cartridge.Vous imprimez une page de test lorsque vous déplacez le HomeCentre ou (lors)que vous remplacez une cartouche d’encre.
Head Switching in Coordination You print a test page when you move the HomeCentre or replace an ink cartridge. Source Structure: pred(0,print), subj(0,1), pred(1,pro), pron_type(1,pers), pers(1,’2’), num(1,sg), obj(0,2), pred(2,test page), spec(2,3), spec_type(3,indef), pers(2,’3’), num(2,sg), tns_asp(0,4), tense(4,pres), perf(4,-), prog(4,-), passive(0,-), stmt_type(0,declarative), adjunct_x(0,5), pred(5,when), obj(5,6), conj_level(6,vp), conj_form(6,or), in_set(7,6), pred(7,move), subj(7,8), pred(8,pro), pron_type(8,pers), pers(8,’2’),num(8,sg), obj(7,9), pred(9,HomeCentre), ….. tns_asp(7,10), tense(10,pres), … passive(7,-), stmt_type(7,declarative) in_set(8,6), pred(8,replace), subj(8,9), pred(9,pro), pron_type(9,pers), pers(9,’2’),.. obj(8,10), pred(10,HomeCentre), ….. tns_asp(8,11), tense(11,pres), … passive(8,-), stmt_type(8,declarative).
Head Switching in Coordination Vous imprimez une page de test lorsque vous déplacez le HomeCentre ou (lors)que vous remplacez une cartouche d’encre. Target Structure: pred(0,imprimer), subj(0,1), pred(1,pro), pron_type(1,pers), pers(1,’2’), num(1,sg), obj(0,2), pred(2,page de test), spec(2,3), spec_type(3,indef), pers(2,’3’), num(2,sg), tns_asp(0,4), tense(4,pres), perf(4,-), passive(0,-), stmt_type(0,declarative), adjunct_x(0,6), conj_level(6,vp), conj_form(6,or), in_set(7,6),pred(7,lorsque), obj(7,8), pred(8,deplacer), subj(8,9), pred(9,pro), pron_type(9,pers), pers(9,’2’), ... obj(8,10), pred(10,HomeCentre), ….. tns_asp(8,11), tense(11,pres), … passive(8,-), stmt_type(8,declarative) in_set(12,6),pred(12,lorsque), obj(12,13), pred(13,remplacer), subj(13,14), pred(14,pro), pron_type(14,pers), ... obj(13,15), pred(15,HomeCentre), ….. tns_asp(13,16), tense(16,pres), … passive(13,-), stmt_type(13,declarative).
Head Switching in Coordination A simple way: Doing it in one step- rewrite the coordination structure, raise it to the level of the original conjunction (when)- rewrite the conjunction (when) twice as new conjuncts of new coordination structure, - let them embed the original conjuncts (B,C) semconj(CompForm,AdvType)/[A,Coord], coord(ConjForm)/[Coord,B,C] ==> coord(ConjForm)/[A,Bnew,Cnew], semconj(CompForm,AdvType)/[Bnew,B], semconj(CompForm,AdvType)/[Cnew,C].
Head Switching in Coordination A simple way: Doing it in one step- rewrite the coordination structure, raise it to the level of the original conjunction (when)- rewrite the conjunction (when) twice as new conjuncts of new coordination structure, - let them embed the original conjuncts (B,C) semconj(CompForm,AdvType)/[A,Coord], coord(ConjForm)/[Coord,B,C] ==> coord(ConjForm)/[A,Bnew,Cnew], semconj(CompForm,AdvType)/[Bnew,B], semconj(CompForm,AdvType)/[Cnew,C]. This rule only accounts for two-conjunct coordination !
“Stepwise” Transfer A better, more general way: Doing it in two steps- rewrite the coordination structure, raise it to the higher level (A)- delete the conjunction (when) - but transmit the conjunction form and the upper and lower nodes (Coord,A) to the next rule- the next rule creates, for each conjunct (B) of the raised coordination (Coord) a new conjunction (when) that embeds the original conjunct semconj(CompForm,AdvType)/[A,Coord], conj_form(Coord,ConjForm) ==> conj_form(A,ConjForm), raise_conjuncts_into_compl(CompForm,AdvType, Coord, A). +raise_conjuncts_into_compl(CompForm,AdvType, Coord, A), in_set(B,Coord), +subj(B,_) ==> in_set(Bnew,A), semconj(CompForm,AdvType)/[Bnew,B]. raise_conjuncts_into_compl(_,_,_,_) ==> 0.
More on Coordination: Structure Deletion and Root Node Rewriting
Structure Deletion and Root Node Rewriting hold Press and release the green LED button. prolongée Exercez une pression brève sur le voyant vert.
v_coord_v(SourceV1, SourceV2, InterimV) :: conj_form(A,_), in_set(B,A), pred(B,SourceV1), in_set(C,A), pred(C,SourceV2), scopes(B,C) ==> pred(B,InterimV), rewrite(A,B), delete_structure(C).v_coord_v(press, hold, ’press-hold’).v_coord_v(press, hold, ’press-release’). Press and hold the green LED button.Exercez une pression prolongée sur le voyant vert. First step: structure deletion Second step: (root) node rewriting rewrite(A,B), { A == var(0) } ==> move_structure(B, var(0)). rewrite(A,B), adjunct_x(X,A) ==> adjunct_x(X,B).
v v_v_s_o2v_s_obl_o_adj(InterimV, TargetV, TargetSpecType, TargetNoun, TargetAdj, TargetPrep) :: pred(A,InterimV), x_arg/[obj,2,A,B] ==> pred(A,TargetV), x_arg/[obj,2,A,C], pred(C,TargetNoun), spectype(TargetSpecType)/C, ntype(C,_), default_nominal_agr/C, adjunct_x_adjective(TargetAdj)/C, x_arg/[obl,3,A,D], prepsem(TargetPrep)/[D,B]. v_v_s_o2v_s_obl_o_adj(‘press-hold’, exercer, indef, pression, prolongé, sur). v_v_s_o2v_s_obl_o_adj(‘press-release’, exercer, indef, pression, bref, sur). Press and hold the green LED button.Exercez une pression prolongée sur le voyant vert. Third step: defining the target predicate and its arguments
Translation Cycles and FilteringSource and target language markingFiltering ``spurious’’ ambiguity paths from optional rules
Translation Cycles Source and Target Language Marking Reinstall the print head -- Remettre la têted’impression en placereinstall X ==> mettre X en placeKeep it in a safe place -- Rangez-la en lieu sûrplace ==> lieu* Remettre la têted’impression en lieu
Translation Cycles Source and Target Language Marking Introduce source language parameters pred(X,Pred) ==> pred(X,Pred,src). Rewriting source into target predicates pred(0,reinstall,src), +obj(0,_) ==> pred(0,remettre,trg), adjunct_x(0,1), pred(1,en,trg), arg(1,1,2), obj(1,2), ptype(1,sem), pcase(2,en), pred(2,place,trg), pers(2,’3’), num(2,sg), spec(2,3), spec_type(3,def). Eliminating target predicate marking pred(X,Pred,trg) ==> pred(X,Pred).
Translation Cycles Source and Target Language Marking Reinstall the print head -- Remettre la têted’impression en placereinstall X (src) ==> mettre X en place (trg)Keep it in a safe place -- Rangez-la en lieu sûrplace (src) ==> lieu (trg)Remettre la têted’impression en place
Ambiguity paths introduced by optional rules pred(A,need,src)need ?=> il vous fautpred(A,need,src)pred(A,falloir,trg)need ?=> il est nécessaire depred(A,need,src)pred(A, nécessaire,trg)need ==> devoirpred(A,devoir,trg)
need ==> devoirYou need to perform periodic maintenance tasks. -- Vous devez effectuer périodiquement des tâches d’entretien.You do not need to perform maintenance tasks.-- * Vous ne devez pas effectuer des tâches d’entretien.-- Il n’est pas nécessaire d’effectuer des tâches d’entretien. restriction/A :: -adjunct_x(A,B) ==> 0; +adjunct_x(A,B), -adjunct_type(B,neg) ==> 0. SourceV ->TargetV :: pred(A,SourceV,src) ==> pred(A,TargetV,_), +vtype(A,_) && restriction/A. need -> devoir.
Ambiguity paths introduced by optional rules pred(A,need,src)need ?=> il vous fautpred(A,need,src)pred(A,falloir,trg)need ?=> il est nécessaire depred(A,need,src)pred(A, nécessaire,trg)need ==> devoirpred(A,need,src) You do not need to perform maintenance tasks no application adjunct_type(_,neg)
Filtering ambiguity paths introduced by optional rules pred(A,need,src)need ?=> il vous fautpred(A,need,src)pred(A,falloir,trg)need ?=> il est nécessaire depred(A,need,src)pred(A, nécessaire,trg)need ==> devoirpred(A,need,src) ``Stop’’ Predicate pred(_,_,src) ==> stop.