statistical machine translation · 2 machine translation. organizational i n vorlesung { artem...

77
Statistical Machine Translation -introduction- Artem Sokolov Computerlinguistik Universit¨ at Heidelberg Sommersemester 2015 material from A. Fraser, P. Koehn, S. Vogel, B. Dorr, C. Monz, S. Riezler, C. Botet, H. Thompson 1 Organization 2 Machine Translation

Upload: others

Post on 08-Aug-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Statistical Machine Translation

-introduction-

Artem SokolovComputerlinguistik

Universitat HeidelbergSommersemester 2015

material from A. Fraser, P. Koehn, S. Vogel, B. Dorr, C. Monz, S. Riezler, C. Botet, H. Thompson

1 Organization2 Machine Translation

Page 2: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Organizational I

n Vorlesung – Artem Sokolov

á Thursdays, 11:15-12:45á INF 325 / SR 3

n holiday on Thursdays

á 14.05 Himmelfahrtá 04.06 Fronleichnam

n Sprechstunde

á Thursdays, 14:00-15:00á email beforehand to sokolov@cl...

á business trip on 1.06

1 / 32

Page 3: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Organizational II

n Ubung – Sariya Karimova

á Tuesdays, 14:15-15:45á INF 346 / SR 10

n no sessions after lectures that fall on holidays

á 19.05 first Tuesday after Himmelfahrtá 09.06 first Tuesday after Fronleichnam

n Sprechstunde

á Wednesdays, 14:00-15:00

2 / 32

Page 4: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Schein

n attendance of lectures and practice sessions

n developed SMT system

n homework

n exam 23.07

3 / 32

Page 5: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Goals

You will learn:

n basics of learning to translate from corpus data

n basics of internals of mainstream SMT systems

n mathematical details necessary

n analyze the bottlenecks of SMT

4 / 32

Page 6: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Relation to other courses

1 Softwareprojekt,Tuesdays, 14:15-17:45(partial overlap with SMT Ubung should be no problem)

2 Hauptseminar “Learning and Search in Structured Prediction”,Tuesdays, 11:15-12:45

5 / 32

Page 7: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Book

6 / 32

Page 8: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

questions?

7 / 32

Page 9: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Outline

1 Organization

2 Machine Translation

8 / 32

Page 10: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Brief History

n dreams about automating translation at least since ..th century

n some amateur attempts since 1930sn war anecdotes / ‘code talkers’:

á WW1, 1918, Choctawá WW2, 1942-1945, Navajo, Basqueá Balkans, 1990s, Welsh

n serious projects conceived after 1947á Warren Weaver, “Translation” memorandum

language as a code“This is really written in English, but it has been coded in some strangesymbols. I will now proceed to decode.”language & invariants (interlingua)meaning & context (window context to disambiguate)EN: ‘fast’ → DE: ‘schnell’, ‘rasch’ oder ‘bewegungslos’, ‘fest’language & logic(translation as formal “proof” from source “assumptions”)

á controlled language (tech. manual, internal docs of corporations)

n first system in 1954 (Georgetown experiment)

n IBM model 1980s

9 / 32

Page 11: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Brief History

n dreams about automating translation at least since ..th century

n some amateur attempts since 1930s

n war anecdotes / ‘code talkers’:á WW1, 1918, Choctawá WW2, 1942-1945, Navajo, Basqueá Balkans, 1990s, Welsh

n serious projects conceived after 1947á Warren Weaver, “Translation” memorandum

language as a code“This is really written in English, but it has been coded in some strangesymbols. I will now proceed to decode.”language & invariants (interlingua)meaning & context (window context to disambiguate)EN: ‘fast’ → DE: ‘schnell’, ‘rasch’ oder ‘bewegungslos’, ‘fest’language & logic(translation as formal “proof” from source “assumptions”)

á controlled language (tech. manual, internal docs of corporations)

n first system in 1954 (Georgetown experiment)

n IBM model 1980s

9 / 32

Page 12: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Brief History

n dreams about automating translation at least since ..th century

n some amateur attempts since 1930sn war anecdotes / ‘code talkers’:

á WW1, 1918, Choctawá WW2, 1942-1945, Navajo, Basqueá Balkans, 1990s, Welsh

n serious projects conceived after 1947á Warren Weaver, “Translation” memorandum

language as a code“This is really written in English, but it has been coded in some strangesymbols. I will now proceed to decode.”language & invariants (interlingua)meaning & context (window context to disambiguate)EN: ‘fast’ → DE: ‘schnell’, ‘rasch’ oder ‘bewegungslos’, ‘fest’language & logic(translation as formal “proof” from source “assumptions”)

á controlled language (tech. manual, internal docs of corporations)

n first system in 1954 (Georgetown experiment)

n IBM model 1980s

9 / 32

Page 13: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Brief History

n dreams about automating translation at least since ..th century

n some amateur attempts since 1930sn war anecdotes / ‘code talkers’:

á WW1, 1918, Choctawá WW2, 1942-1945, Navajo, Basqueá Balkans, 1990s, Welsh

n serious projects conceived after 1947á Warren Weaver, “Translation” memorandum

language as a code“This is really written in English, but it has been coded in some strangesymbols. I will now proceed to decode.”language & invariants (interlingua)meaning & context (window context to disambiguate)EN: ‘fast’ → DE: ‘schnell’, ‘rasch’ oder ‘bewegungslos’, ‘fest’language & logic(translation as formal “proof” from source “assumptions”)

á controlled language (tech. manual, internal docs of corporations)

n first system in 1954 (Georgetown experiment)

n IBM model 1980s

9 / 32

Page 14: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Brief History

n dreams about automating translation at least since ..th century

n some amateur attempts since 1930sn war anecdotes / ‘code talkers’:

á WW1, 1918, Choctawá WW2, 1942-1945, Navajo, Basqueá Balkans, 1990s, Welsh

n serious projects conceived after 1947á Warren Weaver, “Translation” memorandum

language as a code“This is really written in English, but it has been coded in some strangesymbols. I will now proceed to decode.”language & invariants (interlingua)meaning & context (window context to disambiguate)EN: ‘fast’ → DE: ‘schnell’, ‘rasch’ oder ‘bewegungslos’, ‘fest’language & logic(translation as formal “proof” from source “assumptions”)

á controlled language (tech. manual, internal docs of corporations)

n first system in 1954 (Georgetown experiment)

n IBM model 1980s

9 / 32

Page 15: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Brief History

n dreams about automating translation at least since ..th century

n some amateur attempts since 1930sn war anecdotes / ‘code talkers’:

á WW1, 1918, Choctawá WW2, 1942-1945, Navajo, Basqueá Balkans, 1990s, Welsh

n serious projects conceived after 1947á Warren Weaver, “Translation” memorandum

language as a code“This is really written in English, but it has been coded in some strangesymbols. I will now proceed to decode.”language & invariants (interlingua)meaning & context (window context to disambiguate)EN: ‘fast’ → DE: ‘schnell’, ‘rasch’ oder ‘bewegungslos’, ‘fest’language & logic(translation as formal “proof” from source “assumptions”)

á controlled language (tech. manual, internal docs of corporations)

n first system in 1954 (Georgetown experiment)

n IBM model 1980s

9 / 32

Page 16: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Motivation for MT

1 commercial

á governments invest in MT languages used by countries that poseeconomic/military threats

á online translation is VERY popular(the most used of Google’s special projects)

á EU spends more than $1 billion on translation costs each yeará (semi-)automated translation leads to huge savings for businesses

Systran, Unbabel (internships!), Duolingo, Safaba, Fliplingo, ...

2 academic

á (probably) the most challenging problem in NLPá requires knowledge from many NLP sub-areas

(semantics, parsing, morphology, stat. modeling)á enables resource transfer from one language to another over an

established link between them

10 / 32

Page 17: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Motivation for MT

1 commercial

á governments invest in MT languages used by countries that poseeconomic/military threats

á online translation is VERY popular(the most used of Google’s special projects)

á EU spends more than $1 billion on translation costs each yeará (semi-)automated translation leads to huge savings for businesses

Systran, Unbabel (internships!), Duolingo, Safaba, Fliplingo, ...

2 academic

á (probably) the most challenging problem in NLPá requires knowledge from many NLP sub-areas

(semantics, parsing, morphology, stat. modeling)á enables resource transfer from one language to another over an

established link between them

10 / 32

Page 18: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Goals of MT

11 / 32

Page 19: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Goals of MT

the goal is not to build C-3PO!

11 / 32

Page 20: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Goals of MT

n gisting

and grounding

á get core message (newsdigests, hotel reviews)

á enable action (shopping,booking)

n integration with speech(ambiguity propagation,real-time)

n MT on portable devices(tourists, medicalworkers, soldiers,augmented reality)

n support of professionaltranslations

á rough translation,then post-editing

á translation memory

12 / 32

Page 21: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Goals of MT

n gisting and grounding

á get core message (newsdigests, hotel reviews)

á enable action (shopping,booking)

n integration with speech(ambiguity propagation,real-time)

n MT on portable devices(tourists, medicalworkers, soldiers,augmented reality)

n support of professionaltranslations

á rough translation,then post-editing

á translation memory

12 / 32

Page 22: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Goals of MT

n gisting and grounding

á get core message (newsdigests, hotel reviews)

á enable action (shopping,booking)

n integration with speech(ambiguity propagation,real-time)

n MT on portable devices(tourists, medicalworkers, soldiers,augmented reality)

n support of professionaltranslations

á rough translation,then post-editing

á translation memory

12 / 32

Page 23: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Goals of MT

n gisting and grounding

á get core message (newsdigests, hotel reviews)

á enable action (shopping,booking)

n integration with speech(ambiguity propagation,real-time)

n MT on portable devices(tourists, medicalworkers, soldiers,augmented reality)

n support of professionaltranslations

á rough translation,then post-editing

á translation memory

12 / 32

Page 24: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Goals of MT

n gisting and grounding

á get core message (newsdigests, hotel reviews)

á enable action (shopping,booking)

n integration with speech(ambiguity propagation,real-time)

n MT on portable devices(tourists, medicalworkers, soldiers,augmented reality)

n support of professionaltranslations

á rough translation,then post-editing

á translation memory

12 / 32

Page 25: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Goals of MT

n gisting and grounding

á get core message (newsdigests, hotel reviews)

á enable action (shopping,booking)

n integration with speech(ambiguity propagation,real-time)

n MT on portable devices(tourists, medicalworkers, soldiers,augmented reality)

n support of professionaltranslations

á rough translation,then post-editing

á translation memory

12 / 32

Page 26: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Goals of MT

n gisting and grounding

á get core message (newsdigests, hotel reviews)

á enable action (shopping,booking)

n integration with speech(ambiguity propagation,real-time)

n MT on portable devices(tourists, medicalworkers, soldiers,augmented reality)

n support of professionaltranslations

á rough translation,then post-editing

á translation memory

12 / 32

Page 27: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Sentence versus Documents

n MT task: generate medium- or high-quality translations of documents

n all current MT systems work only at sentence level!

n independent translation of sentences is already a very difficult problem

n important discourse phenomena are ignored:Example: How to translate English ‘it’ to German(feminine/masculine/neutral) if object referred to was in previoussentences?

13 / 32

Page 28: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Approaches to MT

n grammar-based / rule-based

á interlinguaá transfer

n direct

á statisticalá example-based

14 / 32

Page 29: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Approaches to MT

n grammar-based / rule-based

á interlinguaá transfer

n direct

á statisticalá example-based

14 / 32

Page 30: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Approaches to MT

n grammar-based / rule-based

á interlinguaá transfer

n direct

á statisticalá example-based

14 / 32

Page 31: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Statistical Approach

n using statistical models

á create many alternatives, hypothesesá give a score to each hypothesisá select the best → search

n advantages

á avoids hard decisionsá speed can be traded with quality, no all-or-nothingá works better in the presence of unexpected/disfluent inputá learns from real world, abundant dataá high model and methods reusability

n disadvantages

á difficulties handling structurally rich models, mathematically andcomputationally

á need more data to train the model with increasing number ofparameters

á not easily interpretable, difficult to distill rules by observing the system

15 / 32

Page 32: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Statistical Approach

n using statistical models

á create many alternatives, hypothesesá give a score to each hypothesisá select the best → search

n advantages

á avoids hard decisionsá speed can be traded with quality, no all-or-nothingá works better in the presence of unexpected/disfluent inputá learns from real world, abundant dataá high model and methods reusability

n disadvantages

á difficulties handling structurally rich models, mathematically andcomputationally

á need more data to train the model with increasing number ofparameters

á not easily interpretable, difficult to distill rules by observing the system

15 / 32

Page 33: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Statistical Approach

n using statistical models

á create many alternatives, hypothesesá give a score to each hypothesisá select the best → search

n advantages

á avoids hard decisionsá speed can be traded with quality, no all-or-nothingá works better in the presence of unexpected/disfluent inputá learns from real world, abundant dataá high model and methods reusability

n disadvantages

á difficulties handling structurally rich models, mathematically andcomputationally

á need more data to train the model with increasing number ofparameters

á not easily interpretable, difficult to distill rules by observing the system

15 / 32

Page 34: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

How to Build an SMT System

Training:

1 large parallel corpusá consists of document pairs (document and its translation)

2 sentence alignment: in each document pair find those sentenceswhich are translations of one another

á results in sentence pairs (sentence and its translation)

3 word alignment: in each sentence pair annotate those words whichare translations of one another

á results in aligned word-phrases

4 estimate a statistical model from the word-aligned sentence pairs

á results in translation model parameters

Language Modeling:

5 large monolingual corpusá texts in target language

6 estimate a statistical model from examples of well-formed language

á results in language model: how likely a word will follow a given history

16 / 32

Page 35: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

How to Build an SMT System

Training:

1 large parallel corpusá consists of document pairs (document and its translation)

2 sentence alignment: in each document pair find those sentenceswhich are translations of one another

á results in sentence pairs (sentence and its translation)

3 word alignment: in each sentence pair annotate those words whichare translations of one another

á results in aligned word-phrases

4 estimate a statistical model from the word-aligned sentence pairs

á results in translation model parameters

Language Modeling:

5 large monolingual corpusá texts in target language

6 estimate a statistical model from examples of well-formed language

á results in language model: how likely a word will follow a given history

16 / 32

Page 36: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

How to Build an SMT System

Training:

1 large parallel corpusá consists of document pairs (document and its translation)

2 sentence alignment: in each document pair find those sentenceswhich are translations of one another

á results in sentence pairs (sentence and its translation)

3 word alignment: in each sentence pair annotate those words whichare translations of one another

á results in aligned word-phrases

4 estimate a statistical model from the word-aligned sentence pairs

á results in translation model parameters

Language Modeling:

5 large monolingual corpusá texts in target language

6 estimate a statistical model from examples of well-formed language

á results in language model: how likely a word will follow a given history

16 / 32

Page 37: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

How to Build an SMT System

Training:

1 large parallel corpusá consists of document pairs (document and its translation)

2 sentence alignment: in each document pair find those sentenceswhich are translations of one another

á results in sentence pairs (sentence and its translation)

3 word alignment: in each sentence pair annotate those words whichare translations of one another

á results in aligned word-phrases

4 estimate a statistical model from the word-aligned sentence pairs

á results in translation model parameters

Language Modeling:

5 large monolingual corpusá texts in target language

6 estimate a statistical model from examples of well-formed language

á results in language model: how likely a word will follow a given history

16 / 32

Page 38: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

How to Build an SMT System

Training:

1 large parallel corpusá consists of document pairs (document and its translation)

2 sentence alignment: in each document pair find those sentenceswhich are translations of one another

á results in sentence pairs (sentence and its translation)

3 word alignment: in each sentence pair annotate those words whichare translations of one another

á results in aligned word-phrases

4 estimate a statistical model from the word-aligned sentence pairs

á results in translation model parameters

Language Modeling:

5 large monolingual corpusá texts in target language

6 estimate a statistical model from examples of well-formed language

á results in language model: how likely a word will follow a given history

16 / 32

Page 39: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

How to Build an SMT System

Training:

1 large parallel corpusá consists of document pairs (document and its translation)

2 sentence alignment: in each document pair find those sentenceswhich are translations of one another

á results in sentence pairs (sentence and its translation)

3 word alignment: in each sentence pair annotate those words whichare translations of one another

á results in aligned word-phrases

4 estimate a statistical model from the word-aligned sentence pairs

á results in translation model parameters

Language Modeling:

5 large monolingual corpusá texts in target language

6 estimate a statistical model from examples of well-formed language

á results in language model: how likely a word will follow a given history

16 / 32

Page 40: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

How to Build an SMT System

Training:

1 large parallel corpusá consists of document pairs (document and its translation)

2 sentence alignment: in each document pair find those sentenceswhich are translations of one another

á results in sentence pairs (sentence and its translation)

3 word alignment: in each sentence pair annotate those words whichare translations of one another

á results in aligned word-phrases

4 estimate a statistical model from the word-aligned sentence pairs

á results in translation model parameters

Language Modeling:

5 large monolingual corpusá texts in target language

6 estimate a statistical model from examples of well-formed language

á results in language model: how likely a word will follow a given history

16 / 32

Page 41: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

How to Build an SMT System

Tuning:

6 define how important is every model for translation quality

á results in a complete model

Testing:

n given new text to translate, apply model to get most likely translation

17 / 32

Page 42: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

How to Build an SMT System

Tuning:

6 define how important is every model for translation quality

á results in a complete model

Testing:

n given new text to translate, apply model to get most likely translation

17 / 32

Page 43: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

How to Build an SMT System

Tuning:

6 define how important is every model for translation quality

á results in a complete model

Testing:

n given new text to translate, apply model to get most likely translation

17 / 32

Page 44: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

1. Parallel Data

Traditional focus was on high-resourced languages:

n high demand ⇒ data collection efforts

n available data ⇒ spawns research

n quality systems ⇒ proliferation, new markets ⇒ more demand

No clear-cut definition in number of words:

n > 200M high-resourced French, Chinese, Arabic

n ∼ 50M medium-resourced German, Portuguese, Italian

n < 5M under-resourced Tatar, Uzbek, Estonian

n < 100K close to none Chechen, Udmurt, Silbo, Klingon :)

n heavily depends on a language pair and direction:for example: ZH-EN is well-resourced, FR-ZH is much less so

18 / 32

Page 45: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

1. Parallel Data

Traditional focus was on high-resourced languages:

n high demand ⇒ data collection efforts

n available data ⇒ spawns research

n quality systems ⇒ proliferation, new markets ⇒ more demand

No clear-cut definition in number of words:

n > 200M high-resourced French, Chinese, Arabic

n ∼ 50M medium-resourced German, Portuguese, Italian

n < 5M under-resourced Tatar, Uzbek, Estonian

n < 100K close to none Chechen, Udmurt, Silbo, Klingon :)

n heavily depends on a language pair and direction:for example: ZH-EN is well-resourced, FR-ZH is much less so

18 / 32

Page 46: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

1. Example

english german

Diverging opinions about plannedtax reform

Unterschiedliche Meinungen zurgeplanten Steuerreform

The discussion around the envis-aged major tax reform continues .

Die Diskussion um die vorgesehenegrosse Steuerreform dauert an .

The FDP economics expert , GrafLambsdorff , today came out in fa-vor of advancing the enactment ofsignificant parts of the overhaul ,currently planned for 1999 .

Der FDP - WirtschaftsexperteGraf Lambsdorff sprach sich heutedafuer aus , wesentliche Teileder fuer 1999 geplanten Reformvorzuziehen .

n note some pre-processing (tokenization, normalization)

19 / 32

Page 47: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

1. Example

english german

Diverging opinions about plannedtax reform

Unterschiedliche Meinungen zurgeplanten Steuerreform

The discussion around the envis-aged major tax reform continues .

Die Diskussion um die vorgesehenegrosse Steuerreform dauert an .

The FDP economics expert , GrafLambsdorff , today came out in fa-vor of advancing the enactment ofsignificant parts of the overhaul ,currently planned for 1999 .

Der FDP - WirtschaftsexperteGraf Lambsdorff sprach sich heutedafuer aus , wesentliche Teileder fuer 1999 geplanten Reformvorzuziehen .

n note some pre-processing (tokenization, normalization)

19 / 32

Page 48: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

2. Sentence Alignment

n if document De is translation of document Df , how to find thetranslation for each sentence?

n the n-th sentence in De is not necessarily the translation of the n-thsentence in Df

n in addition to 1:1 alignments, there are also 1:0, 0:1, 1:n, and n:1n in EuroParl proceedings, ∼ 90% of the sentence alignments are 1:1

20 / 32

Page 49: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

3. Word Alignment

n given sentences that are translation of one another, how to knowwhich words are mutual translations?

21 / 32

Page 50: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

3. Word Alignment

n given sentences that are translation of one another, how to knowwhich words are mutual translations?

das Haus ist klitzeklein

the house is very small1 2 3 4

1 2 3 4

5

21 / 32

Page 51: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

4. Translation Model Estimation

Goal:

n get a score function p(e|f) – goodness of translation e given foreigninput f

1 p(‘die Waschmaschine lauft’, ‘the washing machine is running’) = 0.952 p(‘die Waschmaschine lauft’, ‘the car drove’) = 0.03

n convenient to think of p as probability

n models to some extent natural language’s uncertainty and ambiguity

n translation: argmaxe p(e|f)What kind of function can p(e|f) be?:

n one naıve way to determine p(e|f):1 count how many times f was translated by e1 or e2 in the training data

2 set p(e1|f) = #{f→e1}#{f→?}

3 set p(e2|f) = #{f→e2}#{f→?}

n only works of we saw exactly the f and e1,e2 in our training datan we can’t generalize to unseen sentences

á solution – decompose input and output into parts

22 / 32

Page 52: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

4. Translation Model - Maximum Likelihood Estimation

das Haus ist klitzeklein

the house is very small1 2 3 4

1 2 3 4

5

n generate a word alignment for each sentence pair

n count the number of times every source word was linked to everytarget word:

1 #{das→ the} = 1

2 #{Haus→ house} = 1

3 #{ist→ is} = 1

4 #{klitzeklein→ very} = 1

5 #{klitzeklein→ small} = 1

n divide by the number of occurrences of the source word

n this is our word/phrase translation probability p(we|wf )

23 / 32

Page 53: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

4. Translation Model - Maximum Likelihood Estimation

das Haus ist klitzeklein

the house is very small1 2 3 4

1 2 3 4

5

n generate a word alignment for each sentence pair

n count the number of times every source word was linked to everytarget word:

1 #{das→ the} = 1.0

2 #{Haus→ house} = 1.0

3 #{ist→ is} = 1.0

4 #{klitzeklein→ very} = 0.5

5 #{klitzeklein→ small} = 0.5

n divide by the number of occurrences of the source word

n this is our word/phrase translation probability p(we|wf )

23 / 32

Page 54: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

4. Translation Model - Maximum Likelihood Estimation

das Haus ist klitzeklein

the house is very small1 2 3 4

1 2 3 4

5

n generate a word alignment for each sentence pair

n count the number of times every source word was linked to everytarget word:

1 #{das→ the} =2 #{Haus→ house} =3 #{ist→ is} =4 #{klitzeklein→ very} =5 #{klitzeklein→ small} =

n divide by the number of occurrences of the source word

n this is our word/phrase translation probability p(we|wf )

23 / 32

Page 55: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

5. Language Model

n decomposing can introduce output disfluencies

n need to somehow improve fluency in translations

n learn what is “fluent” from examples of well-formed language

n results in language model: how likely a word will follow a givenhistory

á p(Haus|Das kleine) > p(Haus|Die kleine)

24 / 32

Page 56: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Decoding

Translating is usually referred to as decoding (W. Weaver, 1947)

Noisy Channel Model

argmaxe

p(e|f)

SMT was born from automatic speech recognition:

n p(e) = language model

n p(f |e) = acoustic model

n however, SMT must deal with word reordering!

25 / 32

Page 57: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Decoding

Translating is usually referred to as decoding (W. Weaver, 1947)

Noisy Channel Model

argmaxe

p(e|f) = argmaxe

p(f |e)p(e)

SMT was born from automatic speech recognition:

n p(e) = language model

n p(f |e) = acoustic model

n however, SMT must deal with word reordering!

25 / 32

Page 58: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Decoding

Translating is usually referred to as decoding (W. Weaver, 1947)

Noisy Channel Model

argmaxe

p(e|f) = argmaxe

p(f |e)︸ ︷︷ ︸transl. model

p(e)︸︷︷︸lang. model

SMT was born from automatic speech recognition:

n p(e) = language model

n p(f |e) = acoustic model

n however, SMT must deal with word reordering!

25 / 32

Page 59: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Decoding

Injecting Domain Knowledge

argmaxe

p(e|f) = argmaxe

p(f |e)p(e)

n move to log-space

n models may have different importance (weight)

n we may want to add more models

n they even need not to be log-probabilities (features)

n maximize score function – a weighted linear combination of features

26 / 32

Page 60: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Decoding

Injecting Domain Knowledge

argmaxe

log p(e|f) = argmaxe

log p(f |e) + log p(e)

n move to log-space

n models may have different importance (weight)

n we may want to add more models

n they even need not to be log-probabilities (features)

n maximize score function – a weighted linear combination of features

26 / 32

Page 61: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Decoding

Injecting Domain Knowledge

argmaxe

log p(e|f) = argmaxe

α log p(f |e) + β log p(e)

n move to log-space

n models may have different importance (weight)

n we may want to add more models

n they even need not to be log-probabilities (features)

n maximize score function – a weighted linear combination of features

26 / 32

Page 62: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Decoding

Injecting Domain Knowledge

argmaxe

log p(e|f) = argmaxe

α log p(f |e) + β log p(e) + γf(·)

n move to log-space

n models may have different importance (weight)

n we may want to add more models

n they even need not to be log-probabilities (features)

n maximize score function – a weighted linear combination of features

26 / 32

Page 63: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Decoding

Injecting Domain Knowledge

argmaxe

log p(e|f) = argmaxe

αf1(·) + βf2(·) + γf3(·)

n move to log-space

n models may have different importance (weight)

n we may want to add more models

n they even need not to be log-probabilities (features)

n maximize score function – a weighted linear combination of features

26 / 32

Page 64: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Decoding

Generalization

argmaxe

log p(e|f) = argmax

n∑i=1

wifi(e, f)

n move to log-space

n models may have different importance (weight)

n we may want to add more models

n they even need not to be log-probabilities (features)

n maximize score function – a weighted linear combination of features

26 / 32

Page 65: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

6. Tuning

Generalization

argmaxe

log p(e|f) = argmax

n∑i=1

wifi(e, f)

1 find such wi that maximize translation quality

2 many methods exist and still an active research area

27 / 32

Page 66: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Testing

n how to know if your SMT system works well?

n run it on a large number of unseen sentences and evaluate the quality

n but what is ‘quality’?

á can evaluate MT at corpus, document, sentence or word level..á in the MT the unit of translation is the sentence

n human evaluation of MT quality is difficult (expensive)

n need an abstract measure of usefulness of the output

á evaluation metric: assigns a score to a hypothesized translationá automatic evaluation metrics rely on comparison with selected human

translations

28 / 32

Page 67: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Evaluation metrics

n WER (word error rate)á edit distance to reference translation (insertion, deletion, substitution)á captures fluency well, adequacy not so wellá rigid: gives no credit for translating ‘Frau’ instead of ‘Fraulein’

n TER (translation error rate)á edit distance to reference translation (+ block moves)á captures reordering freedom better, very good correlation with humansá common problems: synonyms,

n BLEU (most popular)á counts matching n-gramsá captures fluency, rewards long and fluent matchesá penalizes the noisy channel model’s tendency to produce short outputsá well-correlates with humans, very intuitive, easier then TER for learningá cons: no credit for synonyms, for legitimate but slightly reordered

outputsn METEOR

á combines synonyms, stemming, WordNet synsetsá most “human like”á attempts to capture language flexibilityá cons: language dependent (stemmer, WordNet)

29 / 32

Page 68: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Challenges

Our groups research directions

1 cross-lingual information retrieval (e.g., patents)

2 grounded learning

3 learning from weak feedback (‘under-paid turkers’)

4 learning in non-cooperative environment

5 learning from non-parallel data

6 SMT with neural networks

7 include over-sentential context

30 / 32

Page 69: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Challenges

Our groups research directions

1 cross-lingual information retrieval (e.g., patents)

2 grounded learning

3 learning from weak feedback (‘under-paid turkers’)

4 learning in non-cooperative environment

5 learning from non-parallel data

6 SMT with neural networks

7 include over-sentential context

30 / 32

Page 70: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Challenges

Our groups research directions

1 cross-lingual information retrieval (e.g., patents)

2 grounded learning

3 learning from weak feedback (‘under-paid turkers’)

4 learning in non-cooperative environment

5 learning from non-parallel data

6 SMT with neural networks

7 include over-sentential context

30 / 32

Page 71: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Challenges

Our groups research directions

1 cross-lingual information retrieval (e.g., patents)

2 grounded learning

3 learning from weak feedback (‘under-paid turkers’)

4 learning in non-cooperative environment

5 learning from non-parallel data

6 SMT with neural networks

7 include over-sentential context

30 / 32

Page 72: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Challenges

Our groups research directions

1 cross-lingual information retrieval (e.g., patents)

2 grounded learning

3 learning from weak feedback (‘under-paid turkers’)

4 learning in non-cooperative environment

5 learning from non-parallel data

6 SMT with neural networks

7 include over-sentential context

30 / 32

Page 73: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Challenges

Our groups research directions

1 cross-lingual information retrieval (e.g., patents)

2 grounded learning

3 learning from weak feedback (‘under-paid turkers’)

4 learning in non-cooperative environment

5 learning from non-parallel data

6 SMT with neural networks

7 include over-sentential context

30 / 32

Page 74: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Challenges

Our groups research directions

1 cross-lingual information retrieval (e.g., patents)

2 grounded learning

3 learning from weak feedback (‘under-paid turkers’)

4 learning in non-cooperative environment

5 learning from non-parallel data

6 SMT with neural networks

7 include over-sentential context

30 / 32

Page 75: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Challenges

Our groups research directions

1 cross-lingual information retrieval (e.g., patents)

2 grounded learning

3 learning from weak feedback (‘under-paid turkers’)

4 learning in non-cooperative environment

5 learning from non-parallel data

6 SMT with neural networks

7 include over-sentential context

SMT projects from this term’s SWP (today, 16:15, INF327 SR2):

n quasi-parallel corpus creation

n kernel-SMT without alignments

n SMT on character levels

n neural networks for bilingual word representations

n user feedback based SMT learning

30 / 32

Page 76: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

SMT Course Overview

1 Word-Based Models

2 Phrase-Based SMT

3 Decoding

4 Language Models

5 Evaluation

6 Tree-Based SMT

31 / 32

Page 77: Statistical Machine Translation · 2 Machine Translation. Organizational I n Vorlesung { Artem Sokolov Æ Thursdays, 11:15-12:45 Æ INF 325 / SR 3 n holiday on Thursdays Æ 14.05

Next meeting

see you the day after tomorrow at 11:15, INF 327 SR3

32 / 32