790 likes | 877 Views
Week 12: Automatisch Vertalen Jurafsky & Martin (ed. 1), Hoofdstuk 21: Machine Translation. Taaltheorie & Taalverwerking. Automatisch Vertalen (Machine Translation). Vol-automatische vertaling van een tekst van de ene taal naar de andere. Automatisch Vertalen.
E N D
Week 12: Automatisch Vertalen Jurafsky & Martin (ed. 1), Hoofdstuk 21: Machine Translation Taaltheorie & Taalverwerking
Automatisch Vertalen(Machine Translation) Vol-automatische vertaling van een tekst van de ene taal naar de andere.
Automatisch Vertalen • Het probleem: verschillen tussen talen • Vier benaderingen van MT • Direct • Transfer • Interlingua • Statistisch • Toepassingen
Machine Translation: Vol-automatische vertaling van een tekst van de ene taal naar de andere. Waarom is dat moeilijk?
Voorbeeld Jurafsky & Martin: Vertaling van 18e-eeuwse Chinese literatuur naar hedendaags Engels.
Voorbeeld: Chinees-Engels Dai-yu alone on bed top think-with-gratitude-about Bao-chai again listen to window outside bamboo tip plantain leaf of on-top rain sound sigh drop clear cold penetrate curtain not feeling again fall down tears come
Voorbeeld: Chinees-Engels Dai-yu alone on bed top think-with-gratitude-about Bao-chai again listen to window outside bamboo tip plantain leaf of on-top rain sound sigh drop clear cold penetrate curtain not feeling again fall down tears come As she lay there alone, Dai-yu’s thoughts turned to Bao-chai… Then she listened to the insistent rustle of the rain on the bamboos and plantains outside her window. The coldness penetrated the curtains of her bed. Almost without noticing it she had begun to cry.
Iets letterlijkere vertaling Dai-yu alone on bed top think-with-gratitude-about Bao-chai again listen to window outside bamboo tip plantain leaf of on-top rain sound sigh drop clear cold penetrate curtain not feeling again fall down tears come Alone on her bed, Dai-yu thought again with gratitude about Bao-chai. She listened to the rustle of the rain on the tips of the bamboos and the leaves of the plantains outside her window. The clear cold penetrated the curtains. Without noticing it, she started to cry again.
Probleem: lidwoorden Dai-yu alone on bed top think-with-gratitude-about Bao-chai again listen to window outside bamboo tip plantain leaf of on-top rain sound sigh drop clear cold penetrate curtain not feeling again fall down tears come Alone on her/the bed, Dai-yu thought again with gratitude about Bao-chai. She listened to the rustle of (the) rain on (the) tips of (the) bamboos and (the) leaves of (the) plantains outside her/the window. The clear cold penetrated the curtains. Without noticing it, she started to cry again.
Probleem: "zero anaphora" Dai-yu alone on bed top think-with-gratitude-about Bao-chai again listen to window outside bamboo tip plantain leaf of on-top rain sound sigh drop clear cold penetrate curtain not feeling again fall down tears come Alone on her bed, Dai-yu thought again with gratitude about Bao-chai. She listened to the rustle of the rain on the tips of the bamboos and the leaves of the plantains outside her window. The clear cold penetrated the curtains. Without noticing (it), she started to cry again.
Probleem: werkwoordstijden Dai-yu alone on bed top think-with-gratitude-about Bao-chai again listen to window outside bamboo tip plantain leaf of on-top rain sound sigh drop clear cold penetrate curtain not feeling again fall down tears come Alone on her bed, Dai-yu thought again with gratitude about Bao-chai. She listened to the rustle of the rain on the tips of the bamboos and the leaves of the plantains outside her window. The clear cold penetrated the curtains. Without noticing it, she started to cry again.
Probleem: lexicon Dai-yu alone on bed top think-with-gratitude-about Bao-chai again listen to window outside bamboo tip plantain leaf of on-top rain sound sigh drop clear cold penetrate curtain not feeling again fall down tears come Alone on her bed, Dai-yu thought again with gratitude about Bao-chai. She listened to the rustle of the rain on the tips of the bamboos and the leaves of the plantains outside her window. A cold draught penetrated the curtains of her bed. Without noticing it, she started to cry again.
Probleem: woordvolgorde Dai-yu alone on bed top think-with-gratitude-about Bao-chai again listen to window outsidebamboo tipplantain leaf ofon-top rain sound sigh drop clear cold penetrate curtain not feeling again fall down tears come Alone on her bed, Dai-yu thought again with gratitude about Bao-chai. She listened to the rustle of the rain onthe tips of the bamboosandthe leaves of the plantainsoutside her window. A cold draught penetrated the curtains of her bed. Without noticing it, she started to cry again.
Verschillen tussen talen Theoretische taalwetenschap: taal-typologie:taxonomie van de verschillen en overeenkomsten tussen de verschillende talen
Morphologie vs. Syntax • Isolerende talen • Chinees, Vietnamees: 1 word – 1 morpheem • Polysynthetische talen • Eskimo-talen, Koreaans: 1 woord veel morphemen • Ertussenin (Engels, Nederlands)
Morphologie vs. Syntax Rijkere morphologie correleert met vrijere woordvolgorde. B.v.: klassiek Latijn: “casus-markering”: de rol van een NP in de zin wordt aangegeven door de verbuiging van de Noun (“Rosa, Rosae, Rosam...”);de plaats van de NP in de zin is vrij.
Syntax: verschillende “basis-volgordes” • SVO (Subject-Verb-Object) talen • Engels, Mandarijns • SOV talen • Japans, Hindi, Nederlands • VSO talen • Iers, Klassiek Arabisch
Syntax • SVO-talen: preposities: Engels: "to Yuriko" • "echte" SOV-talen: postposities: Japans: "Yuriko ni"
Segmentatie • Woordgrenzen worden niet in alle talen gemarkeerd! • Chinees, Japans, Thai, Vietnamees
Syntax vs. Discourse • Zeer lange zinnen (te vertalen als alinea's) • Modern Standaard Arabisch, Chinees • Zeer korte zinnen (te combineren tot complexe zinnen) • Papoea-talen, Aboriginal-talen
Lexical Divergence: Gaps • Japanese: no word for "privacy" • English: no word for Cantonese ‘haauseun’ or Japanese ‘oyakoko’ (something like `filial piety’)
3 methoden voor MT • Direct • Transfer • Interlingua
3 methoden voor MT Interlingua expression Semantic Analysis Syntactic Structure Syntactic Structure (Syntactic) Transfer Syntactic Analysis Morpheme Sequence Morpheme Sequence Direct Morphological Generation Morphological Analysis Source Text Target Text
Direct Translation • Morfologische analyse van brontaal-zin morfeem-sequentie. • Transformaties op deze morfeem-sequentie doeltaal-zin.
Direct MT: Japans Engels Wa ta shi ha tsu kue no ue no pen wo jon ni a ge ta 1. Morfologische analyse Wa ta shi ha tsu kue no ue no pen wo jon ni a ge ta Watashi ha tsukue no ue no pen wo jon ni ageruPAST 2) Woordenboek: vertaling van inhoudswoorden Watashi ha tsukue no ue no pen wo jon ni ageru PAST I ha desk no ue no pen wo John ni give PAST 3) PP-transformaties I ha desk no ue no pen wo John ni give PAST I ha pen on desk wo to John give PAST
Direct MT: Japans Engels 4) Werkwoordsverplaatsing I ha pen on desk wo to John give PAST. I give PAST pen on desk to John. 5) Lidwoord-insertie I give PAST pen on desk to John. I give PAST thepen on the desk to John. 6) morphological generation I give PAST the pen on the desk to John. I gave the pen on the desk to John.
Direct MT: pros & cons • Pros • Computationeel overzichtelijk • Snel • Cons • Conceptueel onoverzichtelijk • Linguïstisch onbetrouwbaar
B.v.: Engels Frans • Engels: Adjective Noun • Frans: Noun AdjectiveN.B. Er zijn uitzonderingen: B.v.: • "route mauvaise": ‘slechte weg’ • "mauvaise route": ‘verkeerde weg’
Engels: Adjective Noun • Frans: Noun Adjective Regel: noun phrase adjective noun noun phrase noun adjective
existential-there-sentence Transfer voorbeeld: Engels Japans there BE NP VP-ing There is [a black swan] [swimming in the pond]. Existential-There-Sentence There1 BE2 NP3 VP-ing4 S (NP NP3 VP-ing4 ) BE2 S NP [[A black swan] [swimming in the pond] is. NP VP-ing BE Regel voor Existential-there: deleer constituent 1 en maak van constituent 4 een rechter-modifier van constituent 3; verplaats constituent 2 naar het eind.
NP Transfer voorbeeld: Engels Japans [a black swan] [swimming in the pond]. NP VP-ing NP [swimming in the pond] [a black swan]. VP-ing NP NP NP1 VP-ing2 NP VP-ing2 NP1 Regel voor Relative Clause: Keer constituentenvolgorde om.
existential-there-sentence Transfer voorbeeld: Engels Japans there was (an old man) gardening Regel voor Existential-there Regel voor relative clauses Lexicon
English to Japanese Transfer Niwa no teire o suru ojiisan ita • Insereer “ga” na het onderwerp • Congruentie tussen werkwoord en onderwerp • Werkwoordsvervoeging Niwa no teire o shite ita ojiisan ga ita Gardening old man SUBJ was Garden GEN upkeep OBJ do PASTPROG
Transfer: enkele beperkingen • Specifieke regels voor elk taal-paar • Houdt geen rekening met semantiek • Houdt geen rekening met statistiek
MT Methode 3: Interlingua 1) Vertaal brontaal-zin naar betekenis-representatie 2) Genereer doeltaal-zin op grond van betekenis-representatie.
Interlingua voor"There was an old man gardening" EVENT: GARDENING AGENT: [MAN NUMBER: SG DEFINITENESS: INDEF] ASPECT: PROGRESSIVE TENSE: PAST
Interlingua MT: pros & cons • Pros • Één stelsel regels voor elke taal (i.p.v. voor elk paar talen). • Cons: • Semantiek is moeilijk • Syntactische informatie gaat verloren!
What makes a good translation Translators often talk about two factors we want to maximize: • Faithfulness or fidelity • How close is the meaning of the translation to the meaning of the original • Fluency or naturalness • How natural the translation is, just considering its fluency in the target language
Naar analogie van spraakherkenning: Regel van Bayes: Kans op target-zin T gegeven source-zin S: P(T|S) = P(S|T) * P(T)
Afleiding van de regel van Bayes: P(S & T) = P(S|T) * P(T) en P(S & T) = P(T|S) * P(S) Dus: P(T|S) * P(S) = P(S|T) * P(T) Als S gegeven is: P(T|S) = P(S|T) * P(T)
Kans op target-zin T gegeven source-zin S: P(T|S) = P(S|T) * P(T) P(T|S) = Faithfulness(S,T) * Fluency(T)