Machine Translation implementation Classical and Statistical - - PowerPoint PPT Presentation

machine translation
SMART_READER_LITE
LIVE PREVIEW

Machine Translation implementation Classical and Statistical - - PowerPoint PPT Presentation

Session 3: Constraint-based Transfer Lab1: Syntactic Transfer a Prolog Machine Translation implementation Classical and Statistical Approaches Background on Lexical-Functional Grammar (LFG) Session 3: Constraint-based Transfer


slide-1
SLIDE 1

Machine Translation

– Classical and Statistical Approaches

Session 3: Constraint-based Transfer

Jonas Kuhn Universität des Saarlandes, Saarbrücken The University of Texas at Austin jonask@coli.uni-sb.de

DGfS/CL Fall School 2005, Ruhr-Universität Bochum, September 19-30, 2005

Jonas Kuhn: MT 2

Session 3: Constraint-based Transfer

Lab1: Syntactic Transfer – a Prolog

implementation

Background on Lexical-Functional Grammar

(LFG)

Constraint-based Transfer

Kaplan et al. 1989: Translation by Structural

Correspondence

Jonas Kuhn: MT 3

Lab1: Syntactic Transfer

A Prolog implementation

Analysis Transfer Generation

Each part: processing engine + declarative rules

Variants of this lab exercise depending on

Prolog background:

Use given Prolog implementation of the

processing systems + concentrate on specifying rules

Use given parser and generator, but specify

Prolog predicate for transfer

Implement all parts from scratch (not

recommended due to time constraits)

Jonas Kuhn: MT 4

Lab1: Suggested exercises

1.

Specify simple rules required for some of the English Spanish divergence examples from Trujillo chapter

2.

Change the lexicon: distinguish a surface form and an underlying citation form

  • The transfer rules can be expressed more generally
  • The language-specific grammars should constrain

possible combinations of morphological variants

  • You can try to add certain ideas from interlingua-

based translation (language-independent citation forms, e.g., for definite articles) 3.

Add a new language pair (e.g., English German)

slide-2
SLIDE 2

Jonas Kuhn: MT 5

Some additional background on lab

The given parser and generator do not use the built-in DCG rule

format, but a slightly different format

The parse-tree building argument is automatically added in a

compilation step

Each rule has an argument for the language it belongs to

(this could be exploited for language-independent rules, using “_”)

Each category is represented as a Prolog list: the first

element is the main category label, the remaining elments can be used for linguistic features

rule(en, [np,Agr] ---> [ [det,Agr], [n1,Agr] ] ). rule(en, [n1,Agr] ---> [ [n,Agr] ] ). rule(en, [n1,Agr] ---> [ [adj,Agr], [n,Agr] ] ). word(en, [det,_]/the ---> [the]). word(en, [n, agr(sg)]/soup ---> [soup]). word(en, [adj, agr(sg)]/delicious ---> [delicious]).

Jonas Kuhn: MT 6

Given code for the lab

The Prolog predicates for processing are

defined in a file engine.pl, separate from the grammar rules

The engine.pl file is consulted automatically

when the grammar file is loaded

This is triggered by the following line at the

beginning of the grammar file:

:- ensure_loaded('engine.pl').

Jonas Kuhn: MT 7

Given code for the lab

When the grammar rules are consulted, they

are automatically compiled into a special internal format

This is triggered by the following line at the

end:

:- compile_grammars.

You can look at the effect of the compilation

  • n tree representations by parsing a string

(using the given parse predicates)

Jonas Kuhn: MT 8

Given code for the lab

Parsing predicate

parse(Lang,StartSymbol,String,Tree)

Example: ?- parse(en, [np|_]/_, [the,soup], T).

Short parse predicate:

p(String)

The language and start symbol are “guessed” The resulting tree is printed using the

pretty_print predicate

slide-3
SLIDE 3

Jonas Kuhn: MT 9

Given code for the lab

Generation predicate

generate(Lang,Tree,String)

Example: ?- parse(en, [np|_]/_, [the,soup], T), generate(en,T,X).

Short generation predicate:

g(Tree)

Again, the language is “guessed” The resulting string is printed

Jonas Kuhn: MT 10

Given code for the lab

Transfer predicate

translate(SourceLang,TargetLang, SourceString,TargetString)

The translation predicates

calls the parsing predicate (guessing the start symbol) prints the resulting source tree recursively traverses the source tree, applying

transformation rules

prints the resulting (underspecified) target tree calls the generation predicate returns the resulting string as TargetString

Example: ?- translate(en,es,[the,delicious,soup],S). Short translation predicate: t(SourceString)

Jonas Kuhn: MT 11

Transformation rules

The rules will be applied top-down in the

  • rder they are specified

A cut (“!”) is used to exclude backtracking The more specific rules should go to the top!

Jonas Kuhn: MT 12

Lexical-Functional Grammar

Grammar formalism originally proposed by Joan

Bresnan and Ron Kaplan in the early 1980s

Non-derivational Lexicalist Parallel levels of representation

C(onstituent)-structure [Phrase structure tree repr.] F(unctional)-structure [Complex feature structure

repr.]

(Lexicosemantic) A(rgument)-structure Semantic Structure

Grammar specification as constraint schemata

describing projection functions across the levels of representation

slide-4
SLIDE 4

Jonas Kuhn: MT 13

Lexical-Functional Grammar

Computational perspective:

One of the best high-level grammar development

system (with a very fast parser/generator) is based on an LFG implementation

XLE – developed over c. 15 years by Ron Kaplan,

John Maxwell and colleagues at the Palo Alto Research Center (formerly Xerox PARC)

Broad-coverage LFG grammars for a growing number

  • f languages have been developed in the Parallel

Grammar development project (ParGram)

English, German, French, Japanese, Norwegian,

Korean, Arabic, …

Jonas Kuhn: MT 14

Lexical-Functional Grammar

Constraints describing the relation between

various levels of representation

C-Structure F-Structure (φ(n1) SUBJ) = φ(n2)

Jonas Kuhn: MT 15

Lexical-Functional Grammar

F-Structure as a syntactic representation abstracting

away from most language-specific aspects of realization

Constraints on F-Structure are specified as

annotations in (C-Structure) rewrite rules

S NP VP

(↑SUBJ)=↓ ↑=↓ Read: (1) the f-structure projected from the NP node (↓) is the same as the f-structure embedded under the feature SUBJ in the f-structure projected from the S node (↑) ; (2) the f-structure projected from the VP node (↓) is identical to the f-structure projected from the S node (↑)

Jonas Kuhn: MT 16

LFG-based Machine Translation

Additional “tau projection” to describe cross-

linguistic relation

slide-5
SLIDE 5

Jonas Kuhn: MT 17

Tau projection: structural divergence

Example

German: Der Student beantwortet die Frage French: L’étudiant répond à la question

Jonas Kuhn: MT 18

Source language information from the verb’s lexical entry:

Tau projection: structural divergence

NP Student der N DET S VP beantwortet V NP die N DET Frage φ ↑ (↑SUBJ) (↑OBJ) S NP VP (↑SUBJ)=↓ ↑=↓ VP V NP ↑=↓ (↑OBJ)=↓ SUBJ OBJ

Jonas Kuhn: MT 19

Tau projection: structural divergence

  • Information from the transfer lexicon entry for the verb beantworten:

τ τ ↑ τ (↑SUBJ) τ (↑OBJ)

φ ↑

beantwortet

SUBJ AOBJ OBJ

Jonas Kuhn: MT 20

Tau projection: head switching

Example:

English: The baby just fell French: Le bébé vient de tomber

Assuming that at f-structure adverbs like just

introduce a grammatical function that embeds the f-structure of the rest of the sentence

slide-6
SLIDE 6

Jonas Kuhn: MT 21

Tau projection: head switching

NP baby the N DET S fell VP φ just ADV

Jonas Kuhn: MT 22

Tau projection: head switching

NP baby the N DET S fell VP just ADV φ Transfer entry for adverb:

Jonas Kuhn: MT 23

Tau projection: head switching

Transfer entry for adverb:

τ τ ↑

Jonas Kuhn: MT 24

Issues in the tau projection approach

Kaplan et al. 1989 paper is the beginning of a

debate:

Kaplan et al. 1989

(original proposal)

Sadler/Thompson 1991 (criticism: problem

with head-switching in embedded contexts)

Kaplan/Wedekind 1993

(reply: extension of LFG formalism by the restriction operator to deal with mismatches between syntactic and semantic heads)

slide-7
SLIDE 7

Jonas Kuhn: MT 25

LFG-based Machine Translation

Conclusion: Flexible approach taking advantage of

linguistic generalizations at various levels

Modularization of transfer information (separate from

language-specific grammatical information) is somewhat problematic