<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mttalks.ufal.ms.mff.cuni.cz/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Bojar</id>
	<title>MT Talks - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://mttalks.ufal.ms.mff.cuni.cz/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Bojar"/>
	<link rel="alternate" type="text/html" href="https://mttalks.ufal.ms.mff.cuni.cz/index.php/Special:Contributions/Bojar"/>
	<updated>2026-05-25T22:09:19Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=MT_Talks&amp;diff=53662</id>
		<title>MT Talks</title>
		<link rel="alternate" type="text/html" href="https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=MT_Talks&amp;diff=53662"/>
		<updated>2019-11-06T11:01:10Z</updated>

		<summary type="html">&lt;p&gt;Bojar: a paragraph on NMT&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:banner.png]]&lt;br /&gt;
&lt;br /&gt;
MT Talks is a series of mini-lectures on machine translation.&lt;br /&gt;
&lt;br /&gt;
Our goal is to hit just the right level of detail and technicality to make the talks interesting and attractive to people who are not yet familiar with the field but mix in new observations and insights so that even old pals will have a reason to watch us.&lt;br /&gt;
&lt;br /&gt;
MT Talks and the expanded notes on this wiki will never be the ultimate resource for MT, but we would be very happy to serve as an ultimate commented &#039;&#039;directory&#039;&#039; of good pointers.&lt;br /&gt;
&lt;br /&gt;
By the way, this is indeed a Wiki, so your contributions are very welcome! Please register and feel free to add comments, corrections or links to useful resources.&lt;br /&gt;
&lt;br /&gt;
== Relation to Neural MT ==&lt;br /&gt;
&lt;br /&gt;
MT Talks were created &#039;&#039;&#039;before&#039;&#039;&#039; neural MT (NMT) was seriously considered. Some of the talks have thus lost their relevance when describing pre-neural solutions and some problems (e.g. morphological richness) have become substantially less severe.&lt;br /&gt;
&lt;br /&gt;
For an example of top-performing neural MT systems, see e.g. our [http://lindat.cz/services/translation/ Demo at Lindat].&lt;br /&gt;
&lt;br /&gt;
== Our Talks ==&lt;br /&gt;
&lt;br /&gt;
01 &#039;&#039;&#039;[[Intro]]&#039;&#039;&#039;: Why is MT difficult, approaches to MT.&lt;br /&gt;
&lt;br /&gt;
02 &#039;&#039;&#039;[[MT that Deceives]]&#039;&#039;&#039;: Serious translation errors even for short and simple inputs.&lt;br /&gt;
&lt;br /&gt;
03 &#039;&#039;&#039;[[Pre-processing]]&#039;&#039;&#039;: Normalization and other technical tricks bound to help your MT system.&lt;br /&gt;
&lt;br /&gt;
04 &#039;&#039;&#039;[[MT Evaluation in General]]&#039;&#039;&#039;: Techniques of judging MT quality, dimensions of translation quality, number of possible translations.&lt;br /&gt;
&lt;br /&gt;
05 &#039;&#039;&#039;[[Automatic MT Evaluation]]&#039;&#039;&#039;: Two common automatic MT evaluation methods: PER and BLEU&lt;br /&gt;
&lt;br /&gt;
06 &#039;&#039;&#039;[[Data Acquisition]]&#039;&#039;&#039;: The need and possible sources of training data for MT. And the diminishing utility of the new data additions due to Zipf&#039;s law.&lt;br /&gt;
&lt;br /&gt;
07 &#039;&#039;&#039;[[Sentence Alignment]]&#039;&#039;&#039;: An introduction to the Gale &amp;amp; Church sentence alignment algorithm.&lt;br /&gt;
&lt;br /&gt;
08 &#039;&#039;&#039;[[Word Alignment]]&#039;&#039;&#039;: Cutting the chicken-egg problem.&lt;br /&gt;
&lt;br /&gt;
09 &#039;&#039;&#039;[[Phrase-based Model]]&#039;&#039;&#039;: Copy if you can.&lt;br /&gt;
&lt;br /&gt;
10 &#039;&#039;&#039;[[Constituency Trees]]&#039;&#039;&#039;: Divide and conquer.&lt;br /&gt;
&lt;br /&gt;
11 &#039;&#039;&#039;[[Dependency Trees]]&#039;&#039;&#039;: Trees with gaps.&lt;br /&gt;
&lt;br /&gt;
12 &#039;&#039;&#039;[[Rich Vocabulary]]&#039;&#039;&#039;: Rindfleischetikettierungsüberwachungsaufgabenübertragungsgesetz.&lt;br /&gt;
&lt;br /&gt;
13 &#039;&#039;&#039;[[Scoring and Optimization]]&#039;&#039;&#039;: Features your model features.&lt;br /&gt;
&lt;br /&gt;
14 &#039;&#039;&#039;[[Deep Syntax]]&#039;&#039;&#039;: Prague Family Jewels.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
== CodEx – Coding Exercises ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [https://codex3.ms.mff.cuni.cz/codex-trans/ Log in to CodEx] and solve programming exercises that complement our talks.&lt;br /&gt;
* [[CodEx-Introduction|Brief description of CodEx]]: how to get an account and submit a solution.&lt;br /&gt;
* [[CodEx - Important Notes|Important Notes]] on technical issues&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contributing ==&lt;br /&gt;
&lt;br /&gt;
Due to spamming, we had to restrict permissions for editing the Wiki. If you&#039;re interested in contributing, please write an email to &#039;&#039;&#039;tamchyna -at- ufal.mff.cuni.cz&#039;&#039;&#039; to obtain a username.&lt;br /&gt;
&lt;br /&gt;
== Other Videolectures on MT ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.upc.edu/learning/courses/mooc/2014-2015/approaches-to-machine/approaches-to-machine Approaches to Machine Translation: Rule-Based, Statistical, Hybrid] (an online course on MT by UPC Barcelona)&lt;br /&gt;
* [https://www.coursera.org/course/nlangp Natural Language Processing at Coursera] by Michael Collins, includes lectures on word-based and phrase-based models. [http://www.cs.columbia.edu/~mcollins/notes-spring2013.html Further notes]&lt;br /&gt;
* [https://www.youtube.com/playlist?list=PLVjXYOjST-AokmIxpCr4GexcdtpeOliBc TAUS Machine Translation and Moses Tutorial] (a series of commented slides, MT overview and practical aspects of the Moses Toolkit)&lt;br /&gt;
&lt;br /&gt;
== Acknowledgement ==&lt;br /&gt;
&lt;br /&gt;
The work on this project has been supported by the grant FP7-ICT-2011-7-288487 ([http://www.statmt.org/mosescore/ MosesCore]).&lt;/div&gt;</summary>
		<author><name>Bojar</name></author>
	</entry>
	<entry>
		<id>https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=CodEx-Introduction&amp;diff=53661</id>
		<title>CodEx-Introduction</title>
		<link rel="alternate" type="text/html" href="https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=CodEx-Introduction&amp;diff=53661"/>
		<updated>2019-05-23T11:34:39Z</updated>

		<summary type="html">&lt;p&gt;Bojar: codex discontinued&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;When reading this page, you&#039;ve probably already gone a long way in learning about machine translation. Nice work!&lt;br /&gt;
&lt;br /&gt;
Our MT Talks are occasionally complemented with programming exercises. We invite you (and strongly recommend) to go beyond watching our videos and try solving some or all of these exercises. Pick a programming language from our choice, write the short program and submit it to our system for evaluation -- a set of fully automatic tests.&lt;br /&gt;
&lt;br /&gt;
The exercises are implemented in The Code Examiner (&#039;&#039;&#039;CodEx&#039;&#039;&#039;, https://codex3.ms.mff.cuni.cz/codex-trans/).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;UNFORTUNATELY, CODEX HAS BEEN REPLACED WITH A NEWER VERSION&#039;&#039;&#039; but we don&#039;t have the capacity to redo our exercises in the new version. Please get in touch if you would be able to help us in porting the old exercises.&lt;br /&gt;
&lt;br /&gt;
This page briefly describes how to use CodEx in general:&lt;br /&gt;
&lt;br /&gt;
* How to get a CodEx account&lt;br /&gt;
* How to login to CodEx&lt;br /&gt;
* How to pick a task to solve&lt;br /&gt;
* How to submit a solution for evaluation&lt;br /&gt;
&lt;br /&gt;
The individual exercises are described both in the CodEx system, as well as on the corresponding MT talk page here.&lt;br /&gt;
&lt;br /&gt;
== How to get a CodEx account ==&lt;br /&gt;
&lt;br /&gt;
Before venturing your journey though all the tasks, you need to get an account. There are two options to obtain an account in CodEx&lt;br /&gt;
&lt;br /&gt;
=== For CUNI students ===&lt;br /&gt;
&lt;br /&gt;
[[File:codex-registration.png|thumb|200px|&#039;&#039;&#039;Codex Registration&#039;&#039;&#039; CUNI students]]&lt;br /&gt;
&lt;br /&gt;
Please access the SIS registration page: https://codex3.ms.mff.cuni.cz/codex-trans/?module=sisregistration. You will be asked to verify your account, then click &#039;&#039;&#039;verify&#039;&#039;&#039;. If everything is fine, you could proceed to create your own account by following the instruction.&lt;br /&gt;
&lt;br /&gt;
=== For non-CUNI students ===&lt;br /&gt;
&lt;br /&gt;
Please send an email to [mailto:mttalks@ufal.mff.cuni.cz?Subject=Request%20for%20MT%20Talks%20CodEx%20account&amp;amp;body=Hello!%0D%0A%0D%0APlease%20create%20a%20CodEx%20account%20for%20me.%0D%0A%0D%0AMy%20name:%09%0D%0AInstitution:%09%0D%0A%0D%0A%20Thank%20you. mttalks@ufal.mff.cuni.cz] mentioning your name and institution to request an account. He will create the account for you and add it to &#039;&#039;&#039;MT talks&#039;&#039;&#039; CodEx group right away.&lt;br /&gt;
&lt;br /&gt;
== How to login and join a group ==&lt;br /&gt;
&lt;br /&gt;
[[File:codex-welcome-page.png|thumb|200px|&#039;&#039;&#039;Codex Welcome&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Once you have your login alias/password, come back to the login page: https://codex3.ms.mff.cuni.cz/codex-trans. After logging in, you are directed to the welcome page which displays all documentation and news related to your account.&lt;br /&gt;
&lt;br /&gt;
In the left hand column, there is an internal link &#039;&#039;&#039;group&#039;&#039;&#039;. It directs to the list of all groups that you could join. When you join a group, you are responsible to do all the exercises of the group.&lt;br /&gt;
&lt;br /&gt;
[[File:codex-group.png|thumb|200px|&#039;&#039;&#039;List of groups&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
For MT talks exercises, please join the group &#039;&#039;&#039;MT talks&#039;&#039;&#039; if you have not done it yet (shown in picture: list of groups).&lt;br /&gt;
&lt;br /&gt;
== How to pick an exercise, solve it and submit your solution ==&lt;br /&gt;
&lt;br /&gt;
After joining a group, you are able to see all the exercises assigned to that group. &lt;br /&gt;
In the left-handed sidebar, under &#039;&#039;&#039;group -&amp;gt; task&#039;&#039;&#039;, there are three options: &#039;&#039;specification, new submit, submits&#039;&#039;. They mean &#039;&#039;read the specification, submit a new solution&#039;&#039; and &#039;&#039;manage old submissions&#039;&#039;, respectively.&lt;br /&gt;
&lt;br /&gt;
[[File:codex-submit.png|thumb|200px|&#039;&#039;&#039;Submit a new solution&#039;&#039;&#039;]]&lt;br /&gt;
[[File:codex-eval.png|thumb|200px|&#039;&#039;&#039;Manage your submissions&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
For every exercise, please read the specification carefully. You are asked to write a complete program (not just a function). You can pick any of these programming languages: &#039;&#039;Pascal, C, C++, C#, Haskell, Python and Java&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
Your solution has to fit in one single file and process standard input to standard output. &lt;br /&gt;
&lt;br /&gt;
To submit a solution, there are two ways:&lt;br /&gt;
* Upload from text area: You write your solution into the text box directly on the web page, select the extension according to your programming language, then submit. &lt;br /&gt;
* Upload from file: Simply write your solution into a file with an appropriate extension, upload and submit it.&lt;br /&gt;
&lt;br /&gt;
In the evaluation process, your program is run several times with several inputs to validate the correctness. There are also built-in time and memory limits, which any sensible solution should easily meet. You will pass the exercise if your program passes a given number of these tests, we generally require to pass all the tests.&lt;br /&gt;
&lt;br /&gt;
In the left-handed sidebar, under &#039;&#039;&#039;group&#039;&#039;&#039;, there are links to page &#039;&#039;&#039;results&#039;&#039;&#039; and &#039;&#039;&#039;bonus points&#039;&#039;&#039; where you can keep track of your results throughout the course.&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
&lt;br /&gt;
Exercise &#039;&#039;&#039;Hello World!&#039;&#039;&#039;: Your task is to write a program which reads names of people and says &#039;Hello&#039; to each of them. Each input line should be turned into a greeting.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Input&#039;&#039;&#039;: &amp;lt;&amp;lt; standard input &amp;gt;&amp;gt; &amp;lt; sample.in&lt;br /&gt;
&lt;br /&gt;
    John&lt;br /&gt;
    Marry&lt;br /&gt;
    Marry and Kate&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ouput&#039;&#039;&#039;: &amp;lt;&amp;lt;standard output &amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Hello John!&lt;br /&gt;
    Hello Marry!&lt;br /&gt;
    Hello Marry and Kate!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Sample solution&#039;&#039;&#039;: Read the input file line-by-line, trim the string, concatenate the line with &amp;quot;Hello &amp;quot; and &amp;quot;!&amp;quot; then print it.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Python&#039;&#039;&#039;&lt;br /&gt;
    #!/usr/bin/env python&lt;br /&gt;
    import fileinput&lt;br /&gt;
    if __name__ == &#039;__main__&#039;:&lt;br /&gt;
        for line in fileinput.input():&lt;br /&gt;
            print &amp;quot;Hello &amp;quot; + line.strip() + &amp;quot;!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To test it manually, run: ./helloworld.py sample.in&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Java&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    import java.io.BufferedReader;&lt;br /&gt;
    import java.io.InputStreamReader;&lt;br /&gt;
    import java.io.IOException;&lt;br /&gt;
    public class CodEx{&lt;br /&gt;
        public static void main(String[] args) {&lt;br /&gt;
            BufferedReader br = null;&lt;br /&gt;
            try {&lt;br /&gt;
                br = new BufferedReader(new InputStreamReader(System.in));&lt;br /&gt;
                String line;&lt;br /&gt;
                while ((line = br.readLine()) != null) {&lt;br /&gt;
                    System.out.println(&amp;quot;Hello &amp;quot; + line + &amp;quot;!&amp;quot;);&lt;br /&gt;
                }&lt;br /&gt;
            } catch (IOException e) {&lt;br /&gt;
                e.printStackTrace();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
To test it manually, run: javac CodEx.java; java CodEx &amp;lt; sample.in&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you choose Java to be your programming language, your program must not declare any package, the main class must be &amp;quot;CodEx&amp;quot;. For CodEx limitiations for other languages, please read the CodEx manual.&lt;/div&gt;</summary>
		<author><name>Bojar</name></author>
	</entry>
	<entry>
		<id>https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=MT_Talks&amp;diff=53660</id>
		<title>MT Talks</title>
		<link rel="alternate" type="text/html" href="https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=MT_Talks&amp;diff=53660"/>
		<updated>2019-05-23T11:32:23Z</updated>

		<summary type="html">&lt;p&gt;Bojar: codex no longer avaliable&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:banner.png]]&lt;br /&gt;
&lt;br /&gt;
MT Talks is a series of mini-lectures on machine translation.&lt;br /&gt;
&lt;br /&gt;
Our goal is to hit just the right level of detail and technicality to make the talks interesting and attractive to people who are not yet familiar with the field but mix in new observations and insights so that even old pals will have a reason to watch us.&lt;br /&gt;
&lt;br /&gt;
MT Talks and the expanded notes on this wiki will never be the ultimate resource for MT, but we would be very happy to serve as an ultimate commented &#039;&#039;directory&#039;&#039; of good pointers.&lt;br /&gt;
&lt;br /&gt;
By the way, this is indeed a Wiki, so your contributions are very welcome! Please register and feel free to add comments, corrections or links to useful resources.&lt;br /&gt;
&lt;br /&gt;
== Our Talks ==&lt;br /&gt;
&lt;br /&gt;
01 &#039;&#039;&#039;[[Intro]]&#039;&#039;&#039;: Why is MT difficult, approaches to MT.&lt;br /&gt;
&lt;br /&gt;
02 &#039;&#039;&#039;[[MT that Deceives]]&#039;&#039;&#039;: Serious translation errors even for short and simple inputs.&lt;br /&gt;
&lt;br /&gt;
03 &#039;&#039;&#039;[[Pre-processing]]&#039;&#039;&#039;: Normalization and other technical tricks bound to help your MT system.&lt;br /&gt;
&lt;br /&gt;
04 &#039;&#039;&#039;[[MT Evaluation in General]]&#039;&#039;&#039;: Techniques of judging MT quality, dimensions of translation quality, number of possible translations.&lt;br /&gt;
&lt;br /&gt;
05 &#039;&#039;&#039;[[Automatic MT Evaluation]]&#039;&#039;&#039;: Two common automatic MT evaluation methods: PER and BLEU&lt;br /&gt;
&lt;br /&gt;
06 &#039;&#039;&#039;[[Data Acquisition]]&#039;&#039;&#039;: The need and possible sources of training data for MT. And the diminishing utility of the new data additions due to Zipf&#039;s law.&lt;br /&gt;
&lt;br /&gt;
07 &#039;&#039;&#039;[[Sentence Alignment]]&#039;&#039;&#039;: An introduction to the Gale &amp;amp; Church sentence alignment algorithm.&lt;br /&gt;
&lt;br /&gt;
08 &#039;&#039;&#039;[[Word Alignment]]&#039;&#039;&#039;: Cutting the chicken-egg problem.&lt;br /&gt;
&lt;br /&gt;
09 &#039;&#039;&#039;[[Phrase-based Model]]&#039;&#039;&#039;: Copy if you can.&lt;br /&gt;
&lt;br /&gt;
10 &#039;&#039;&#039;[[Constituency Trees]]&#039;&#039;&#039;: Divide and conquer.&lt;br /&gt;
&lt;br /&gt;
11 &#039;&#039;&#039;[[Dependency Trees]]&#039;&#039;&#039;: Trees with gaps.&lt;br /&gt;
&lt;br /&gt;
12 &#039;&#039;&#039;[[Rich Vocabulary]]&#039;&#039;&#039;: Rindfleischetikettierungsüberwachungsaufgabenübertragungsgesetz.&lt;br /&gt;
&lt;br /&gt;
13 &#039;&#039;&#039;[[Scoring and Optimization]]&#039;&#039;&#039;: Features your model features.&lt;br /&gt;
&lt;br /&gt;
14 &#039;&#039;&#039;[[Deep Syntax]]&#039;&#039;&#039;: Prague Family Jewels.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
== CodEx – Coding Exercises ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [https://codex3.ms.mff.cuni.cz/codex-trans/ Log in to CodEx] and solve programming exercises that complement our talks.&lt;br /&gt;
* [[CodEx-Introduction|Brief description of CodEx]]: how to get an account and submit a solution.&lt;br /&gt;
* [[CodEx - Important Notes|Important Notes]] on technical issues&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Contributing ==&lt;br /&gt;
&lt;br /&gt;
Due to spamming, we had to restrict permissions for editing the Wiki. If you&#039;re interested in contributing, please write an email to &#039;&#039;&#039;tamchyna -at- ufal.mff.cuni.cz&#039;&#039;&#039; to obtain a username.&lt;br /&gt;
&lt;br /&gt;
== Other Videolectures on MT ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.upc.edu/learning/courses/mooc/2014-2015/approaches-to-machine/approaches-to-machine Approaches to Machine Translation: Rule-Based, Statistical, Hybrid] (an online course on MT by UPC Barcelona)&lt;br /&gt;
* [https://www.coursera.org/course/nlangp Natural Language Processing at Coursera] by Michael Collins, includes lectures on word-based and phrase-based models. [http://www.cs.columbia.edu/~mcollins/notes-spring2013.html Further notes]&lt;br /&gt;
* [https://www.youtube.com/playlist?list=PLVjXYOjST-AokmIxpCr4GexcdtpeOliBc TAUS Machine Translation and Moses Tutorial] (a series of commented slides, MT overview and practical aspects of the Moses Toolkit)&lt;br /&gt;
&lt;br /&gt;
== Acknowledgement ==&lt;br /&gt;
&lt;br /&gt;
The work on this project has been supported by the grant FP7-ICT-2011-7-288487 ([http://www.statmt.org/mosescore/ MosesCore]).&lt;/div&gt;</summary>
		<author><name>Bojar</name></author>
	</entry>
	<entry>
		<id>https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=Scoring_and_Optimization&amp;diff=53597</id>
		<title>Scoring and Optimization</title>
		<link rel="alternate" type="text/html" href="https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=Scoring_and_Optimization&amp;diff=53597"/>
		<updated>2015-08-25T08:03:59Z</updated>

		<summary type="html">&lt;p&gt;Bojar: /* Optimization of Feature Weights */ links to tuning tasks&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox&lt;br /&gt;
|title = Lecture 13: Scoring and Optimization&lt;br /&gt;
|image = [[File:features.png|200px]]&lt;br /&gt;
|label1 = Lecture video:&lt;br /&gt;
|data1 = [http://example.com web &#039;&#039;&#039;TODO&#039;&#039;&#039;] &amp;lt;br/&amp;gt; [https://www.youtube.com/watch?v=rDkZOINdPhw&amp;amp;index=11&amp;amp;list=PLpiLOsNLsfmbeH-b865BwfH15W0sat02V Youtube]}}&lt;br /&gt;
&lt;br /&gt;
{{#ev:youtube|https://www.youtube.com/watch?v=rDkZOINdPhw&amp;amp;index=11&amp;amp;list=PLpiLOsNLsfmbeH-b865BwfH15W0sat02V|800|center}}&lt;br /&gt;
&lt;br /&gt;
== Features of MT Models ==&lt;br /&gt;
&lt;br /&gt;
=== Phrase Translation Probabilities ===&lt;br /&gt;
&lt;br /&gt;
Phrase translation probabilities are calculated from occurrences of phrase pairs extracted from the parallel training data. Usually, MT systems work with the following two conditional probabilities:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;P(\mathbf{e}|\mathbf{f})&amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;P(\mathbf{f}|\mathbf{e})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These probabilities are estimated by simply counting how many times (for the first formula) we saw &amp;lt;math&amp;gt;\mathbf{e}&amp;lt;/math&amp;gt; aligned to &amp;lt;math&amp;gt;\mathbf{f}&amp;lt;/math&amp;gt; and how many times we saw &amp;lt;math&amp;gt;\mathbf{f}&amp;lt;/math&amp;gt; in total. For example, based on the following excerpt from (sorted) extracted phrase pairs, we estimate that &amp;lt;math&amp;gt;P(\text{naznačena v programu} | \text{estimated in the programme}) = 3/9&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 estimated in the programme ||| naznačena v programu&lt;br /&gt;
 estimated in the programme ||| naznačena v programu&lt;br /&gt;
 estimated in the programme ||| naznačena v programu&lt;br /&gt;
 estimated in the programme ||| odhadován v programu&lt;br /&gt;
 estimated in the programme ||| odhadovány v programu&lt;br /&gt;
 estimated in the programme ||| odhadovány v programu &lt;br /&gt;
 estimated in the programme ||| předpokládal program&lt;br /&gt;
 estimated in the programme ||| v programu uvedeným&lt;br /&gt;
 estimated in the programme ||| v programu uvedeným&lt;br /&gt;
&lt;br /&gt;
=== Lexical Weights ===&lt;br /&gt;
&lt;br /&gt;
Lexical weights are a method for smoothing the phrase table. Infrequent phrases have unreliable&lt;br /&gt;
probability estimates; for instance many long phrases occur together only once&lt;br /&gt;
in the corpus, resulting in &amp;lt;math&amp;gt;P(\mathbf{e}|\mathbf{f}) = P(\mathbf{f}|\mathbf{e})&lt;br /&gt;
= 1&amp;lt;/math&amp;gt;. Several methods exist for computing lexical weights. The most common one&lt;br /&gt;
is based on word alignment inside the phrase. The&lt;br /&gt;
probability of each &#039;&#039;foreign&#039;&#039; word &amp;lt;math&amp;gt;f_j&amp;lt;/math&amp;gt; is estimated as the average of&lt;br /&gt;
lexical translation probabilities &amp;lt;math&amp;gt;w(f_j, e_i)&amp;lt;/math&amp;gt; over the English words aligned&lt;br /&gt;
to it.  Thus for the phrase &amp;lt;math&amp;gt;(\mathbf{e},\mathbf{f})&amp;lt;/math&amp;gt; with the set of alignment&lt;br /&gt;
points &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, the lexical weight is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\text{lex}(\mathbf{f}|\mathbf{e},a) = \prod_{j=1}^{l_f}&lt;br /&gt;
  \frac{1}{|{i|(i,j) \in a}|} \sum_{\forall(i,j) \in a}w(f_j, e_i)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Language Model ===&lt;br /&gt;
&lt;br /&gt;
https://www.coursera.org/course/nlp&lt;br /&gt;
&lt;br /&gt;
https://www.youtube.com/playlist?list=PLaRKlIqjjguC-20Glu7XVAXm6Bd6Gs7Qi&lt;br /&gt;
&lt;br /&gt;
=== Word and Phrase Penalty ===&lt;br /&gt;
&lt;br /&gt;
=== Distortion Penalty ===&lt;br /&gt;
&lt;br /&gt;
== Decoding ==&lt;br /&gt;
&lt;br /&gt;
=== Phrase-Based Search ===&lt;br /&gt;
&lt;br /&gt;
=== Decoding in SCFG ===&lt;br /&gt;
&lt;br /&gt;
== Optimization of Feature Weights ==&lt;br /&gt;
&lt;br /&gt;
Note that there have even been shared tasks in model optimization. One, by invitation only, in [http://www.statmt.org/wmt11/tunable-metrics-task.html 2011] and one in 2015: [http://www.statmt.org/wmt15/tuning-task/ WMT15 Tuning Task].&lt;/div&gt;</summary>
		<author><name>Bojar</name></author>
	</entry>
	<entry>
		<id>https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=Phrase-based_Model&amp;diff=443</id>
		<title>Phrase-based Model</title>
		<link rel="alternate" type="text/html" href="https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=Phrase-based_Model&amp;diff=443"/>
		<updated>2015-04-07T21:24:14Z</updated>

		<summary type="html">&lt;p&gt;Bojar: /* Phrase Scoring */ drobnost&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox&lt;br /&gt;
|title = Lecture 8: Phrase-based model&lt;br /&gt;
|image = [[File:computer-copies.png|200px]]&lt;br /&gt;
|label1 = Lecture video:&lt;br /&gt;
|data1 = [http://example.com web &#039;&#039;&#039;TODO&#039;&#039;&#039;] &amp;lt;br/&amp;gt; [https://www.youtube.com/watch?v=aA4jFayPNeQ Youtube]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{#ev:youtube|https://www.youtube.com/watch?v=aA4jFayPNeQ|800|center}}&lt;br /&gt;
&lt;br /&gt;
Phrase-based machine translation (PBMT) is probably the most widely used approach to MT today. It is relatively simple and easy to adapt to new languages.&lt;br /&gt;
&lt;br /&gt;
== Phrase Extraction ==&lt;br /&gt;
&lt;br /&gt;
PBMT uses &#039;&#039;&#039;phrases&#039;&#039;&#039; as the basic unit of translation. Phrases are simply contiguous sequences of words which have been observed in the training data, they don&#039;t correspond to any linguistic notion of phrases.&lt;br /&gt;
&lt;br /&gt;
In order to obtain a &#039;&#039;&#039;phrase table&#039;&#039;&#039; (a probabilistic dictionary of phrases), we need [[Word Alignment|word-aligned]] parallel data. Using the alignment links, a simple heuristic is applied to extract &#039;&#039;&#039;consistent&#039;&#039;&#039; phrase pairs. Consider the word-aligned example sentence:&lt;br /&gt;
&lt;br /&gt;
[[File:phrase-extraction.png|400px]]&lt;br /&gt;
&lt;br /&gt;
Phrase pairs are contiguous spans where all alignment points from the source side of the span fall within its target side and vice versa. These are examples of phrases consistent with this word alignment:&lt;br /&gt;
&lt;br /&gt;
[[File:phrase-extraction-okay.png|400px]] [[File:phrase-extraction-okay2.png|400px]]&lt;br /&gt;
&lt;br /&gt;
On the other hand, if either a source word or a target word is aligned outside of the current span, the phrase cannot be extracted. The conflicting alignment points are drawn in yellow:&lt;br /&gt;
&lt;br /&gt;
[[File:phrase-extraction-short.png|400px]] [[File:phrase-extraction-long.png|400px]]&lt;br /&gt;
&lt;br /&gt;
In practice, only phrases up to a certain length are extracted (e.g. 7 words). Longer phrases would hardly ever be used by the translation model (unless it was presented with a sentence from the training data) and the phrase table would be extremely large.&lt;br /&gt;
&lt;br /&gt;
== Phrase Scoring ==&lt;br /&gt;
&lt;br /&gt;
Once we have extracted all consistent phrase pairs from our training data, we can assign translation probabilities to them using maximum likelihood estimation. To estimate the probability of phrase &amp;lt;math&amp;gt;e&amp;lt;/math&amp;gt; being the translation of phrase &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt;, we simply count:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
P(e|f) = \frac{\text{count}(e,f)}{\text{count}(f)}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The formula tells us to simply count how many times we saw &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; translated as &amp;lt;math&amp;gt;e&amp;lt;/math&amp;gt; in our training data and divide that by the number of times we saw &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; in total.&lt;br /&gt;
&lt;br /&gt;
In practice, several other scores are also computed (including the reverse phrase translation probability &amp;lt;math&amp;gt;P(f|e)&amp;lt;/math&amp;gt;) but that&#039;s a topic for another lecture.&lt;br /&gt;
&lt;br /&gt;
== Decoding ==&lt;br /&gt;
&lt;br /&gt;
When we get an input sentence for translation, the first step is to look up &#039;&#039;&#039;translation options&#039;&#039;&#039; (possible translations) for each source span in the phrase table. These can be thought of as jigsaw puzzle pieces which are combined to get as good final translation as possible. The task for the &#039;&#039;&#039;decoder&#039;&#039;&#039; (the translation program) is to find a combination which covers the whole input sentence and is the most probable according to the model (this procedure is usually called decoding).&lt;br /&gt;
&lt;br /&gt;
Here we describe the stack-based &#039;&#039;&#039;beam search&#039;&#039;&#039; algorithm which is commonly used for phrase-based decoding, although other algorithms exist.&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
&lt;br /&gt;
The search begins with an empty hypothesis: no part of the input is covered and nothing has been produced. We can start covering the input sentence by translating any span, and for each span, we can choose any of its possible translations. The decoder produces all of these partial hypotheses.&lt;br /&gt;
&lt;br /&gt;
In the next step, we try to expand our partial translations further by covering the remaining parts of the input sentence. We continue expanding our partial hypotheses until we cover the whole source sentence. We choose the most probable translation.&lt;br /&gt;
&lt;br /&gt;
In the following example, we try to translate the Czech sentence:&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;Honza miluje Marii&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
With the following phrase table:&lt;br /&gt;
&lt;br /&gt;
  Honza ||| John&lt;br /&gt;
  Honza ||| Johny&lt;br /&gt;
  miluje ||| loves&lt;br /&gt;
  miluje ||| is fond of&lt;br /&gt;
  miluje ||| likes&lt;br /&gt;
  Marii ||| Mary&lt;br /&gt;
&lt;br /&gt;
This is an excerpt of the space where the decoder searches for the best translation. One (the most reasonable) full translation is illustrated but the decoder theoretically needs to evaluate all possible combinations.&lt;br /&gt;
&lt;br /&gt;
[[File:beam-search.png|350px]]&lt;br /&gt;
&lt;br /&gt;
Note that we keep track of covered input spans in a Boolean array (1 for covered words, 0 for untranslated ones) -- we know that we have a full translation once the &#039;&#039;&#039;coverage vector&#039;&#039;&#039; has no more zeroes.&lt;br /&gt;
  &lt;br /&gt;
=== Stacks, Pruning ===&lt;br /&gt;
&lt;br /&gt;
It is obvious that with realistic sentence lengths and translation dictionaries, the search space very quickly explodes and it becomes impossible to go through all the possible combinations of span translations and their orderings.&lt;br /&gt;
&lt;br /&gt;
First, we need to impose a limit on reordering (how far we can jump in the input), otherwise the search would be intractable. In practice, the limit is set to roughly 6 words.&lt;br /&gt;
&lt;br /&gt;
Furthermore, we need to prune our partial hypotheses as there are still too many combinations. Our model assigns a score to each of them (more on that in later lectures) so we can sort our translations according to it and only keep several most promising candidates.&lt;br /&gt;
&lt;br /&gt;
However, it would be unfair to compare a score of a full translation with a partial hypothesis that e.g. only had to translate one phrase. The full hypothesis contains more decisions =&amp;gt; more uncertainty =&amp;gt; almost surely, the full translation has a lower score. For this reason, partial hypotheses are organized into &#039;&#039;&#039;stacks&#039;&#039;&#039; according to the number of covered input words. For each number, we have a separate stack. That way, only hypotheses which cover the same &amp;quot;amount&amp;quot; of input are compared.&lt;br /&gt;
&lt;br /&gt;
The algorithm can then proceed from stack &amp;quot;0&amp;quot; (which contains the empty hypothesis) to the final stack where full hypotheses compete for the best score. Each stack has a limited size which keeps the search tractable.&lt;br /&gt;
&lt;br /&gt;
There is one more caveat -- not all input words (or spans -- phrases) are created equal. Some are difficult to translate and some only have one or a few possible translations. To account for this discrepancy, phrase-based decoders estimate the &#039;&#039;&#039;future cost&#039;&#039;&#039; of translating the remainder of the input sentence. This estimation is on the score of the most probable translation of the remaining spans and can be efficiently pre-computed using dynamic programming. Without accounting for future cost, hypotheses which translate the easiest words first would dominate the stacks and the search would lead to heavily suboptimal solutions.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.statmt.org/book/slides/05-phrase-based-models.pdf Philipp Koehn&#039;s slides on PBMT]&lt;br /&gt;
* [http://www.statmt.org/book/slides/06-decoding.pdf Decoding in PBMT]&lt;/div&gt;</summary>
		<author><name>Bojar</name></author>
	</entry>
	<entry>
		<id>https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=Admin_RootPage&amp;diff=376</id>
		<title>Admin RootPage</title>
		<link rel="alternate" type="text/html" href="https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=Admin_RootPage&amp;diff=376"/>
		<updated>2015-03-12T13:12:48Z</updated>

		<summary type="html">&lt;p&gt;Bojar: youtube playlist&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;0x : How to get started with CodEx MT exercises&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Our [https://www.youtube.com/playlist?list=PLpiLOsNLsfmbeH-b865BwfH15W0sat02V YouTube playlist] -- shows some total number of views, although different from individual video views.&lt;/div&gt;</summary>
		<author><name>Bojar</name></author>
	</entry>
	<entry>
		<id>https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=MT_Talks&amp;diff=375</id>
		<title>MT Talks</title>
		<link rel="alternate" type="text/html" href="https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=MT_Talks&amp;diff=375"/>
		<updated>2015-03-12T13:05:05Z</updated>

		<summary type="html">&lt;p&gt;Bojar: /* Other Videolectures on MT */  TAUS lectures&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:banner.png]]&lt;br /&gt;
&lt;br /&gt;
MT Talks is a series of mini-lectures on machine translation.&lt;br /&gt;
&lt;br /&gt;
Our goal is to hit just the right level of detail and technicality to make the talks interesting and attractive to people who are not yet familiar with the field but mix in new observations and insights so that even old pals will have a reason to watch us.&lt;br /&gt;
&lt;br /&gt;
MT Talks and the expanded notes on this wiki will never be the ultimate resource for MT, but we would be very happy to serve as an ultimate commented &#039;&#039;directory&#039;&#039; of good pointers.&lt;br /&gt;
&lt;br /&gt;
By the way, this is indeed a Wiki, so your contributions are very welcome! Please register and feel free to add comments, corrections or links to useful resources.&lt;br /&gt;
&lt;br /&gt;
== Our Talks ==&lt;br /&gt;
&lt;br /&gt;
01 &#039;&#039;&#039;[[Intro]]&#039;&#039;&#039;: Why is MT difficult, Approaches to MT.&lt;br /&gt;
&lt;br /&gt;
02 &#039;&#039;&#039;[[MT that Deceives]]&#039;&#039;&#039;: Serious translation errors even for short and simple inputs.&lt;br /&gt;
&lt;br /&gt;
03 &#039;&#039;&#039;[[Pre-processing]]&#039;&#039;&#039;: Normalization and other technical tricks bound to help your MT system.&lt;br /&gt;
&lt;br /&gt;
04 &#039;&#039;&#039;[[MT Evaluation in General]]&#039;&#039;&#039;: Techniques of judging MT quality, dimensions of translation quality, number of possible translations.&lt;br /&gt;
&lt;br /&gt;
05 &#039;&#039;&#039;[[Automatic MT Evaluation]]&#039;&#039;&#039;: Two common automatic MT evaluation methods: PER and BLEU&lt;br /&gt;
&lt;br /&gt;
06 &#039;&#039;&#039;[[Data Acquisition]]&#039;&#039;&#039;: The need and possible sources of training data for MT. And the diminishing utility of the new data additions due to Zipf&#039;s law.&lt;br /&gt;
&lt;br /&gt;
07 &#039;&#039;&#039;[[Sentence Alignment]]&#039;&#039;&#039;: An introduction to the Gale &amp;amp; Church sentence alignment algorithm.&lt;br /&gt;
&lt;br /&gt;
== CodEx – Coding Exercises ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [https://codex3.ms.mff.cuni.cz/codex-trans/ Log in to CodEx] and solve programming exercises that complement our talks.&lt;br /&gt;
* [[CodEx-Introduction|Brief description of CodEx]]: how to get an account and submit a solution.&lt;br /&gt;
&lt;br /&gt;
== Other Videolectures on MT ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.upc.edu/learning/courses/mooc/2014-2015/approaches-to-machine/approaches-to-machine Approaches to Machine Translation: Rule-Based, Statistical, Hybrid] (an online course on MT by UPC Barcelona)&lt;br /&gt;
* [https://www.coursera.org/course/nlangp Natural Language Processing at Coursera] by Michael Collins, includes lectures on word-based and phrase-based models. [http://www.cs.columbia.edu/~mcollins/notes-spring2013.html Further notes]&lt;br /&gt;
* [https://www.youtube.com/playlist?list=PLVjXYOjST-AokmIxpCr4GexcdtpeOliBc TAUS Machine Translation and Moses Tutorial] (a series of commented slides, MT overview and practical aspects of the Moses Toolkit)&lt;br /&gt;
&lt;br /&gt;
== Acknowledgement ==&lt;br /&gt;
&lt;br /&gt;
The work on this project has been supported by the grant FP7-ICT-2011-7-288487 ([http://www.statmt.org/mosescore/ MosesCore]).&lt;/div&gt;</summary>
		<author><name>Bojar</name></author>
	</entry>
	<entry>
		<id>https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=Admin_RootPage&amp;diff=373</id>
		<title>Admin RootPage</title>
		<link rel="alternate" type="text/html" href="https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=Admin_RootPage&amp;diff=373"/>
		<updated>2015-03-10T16:36:44Z</updated>

		<summary type="html">&lt;p&gt;Bojar: published 07&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;0x : How to get started with CodEx MT exercises&lt;/div&gt;</summary>
		<author><name>Bojar</name></author>
	</entry>
	<entry>
		<id>https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=MT_Talks&amp;diff=372</id>
		<title>MT Talks</title>
		<link rel="alternate" type="text/html" href="https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=MT_Talks&amp;diff=372"/>
		<updated>2015-03-10T15:49:51Z</updated>

		<summary type="html">&lt;p&gt;Bojar: publishing 07&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:banner.png]]&lt;br /&gt;
&lt;br /&gt;
MT Talks is a series of mini-lectures on machine translation.&lt;br /&gt;
&lt;br /&gt;
Our goal is to hit just the right level of detail and technicality to make the talks interesting and attractive to people who are not yet familiar with the field but mix in new observations and insights so that even old pals will have a reason to watch us.&lt;br /&gt;
&lt;br /&gt;
MT Talks and the expanded notes on this wiki will never be the ultimate resource for MT, but we would be very happy to serve as an ultimate commented &#039;&#039;directory&#039;&#039; of good pointers.&lt;br /&gt;
&lt;br /&gt;
By the way, this is indeed a Wiki, so your contributions are very welcome! Please register and feel free to add comments, corrections or links to useful resources.&lt;br /&gt;
&lt;br /&gt;
== Our Talks ==&lt;br /&gt;
&lt;br /&gt;
01 &#039;&#039;&#039;[[Intro]]&#039;&#039;&#039;: Why is MT difficult, Approaches to MT.&lt;br /&gt;
&lt;br /&gt;
02 &#039;&#039;&#039;[[MT that Deceives]]&#039;&#039;&#039;: Serious translation errors even for short and simple inputs.&lt;br /&gt;
&lt;br /&gt;
03 &#039;&#039;&#039;[[Pre-processing]]&#039;&#039;&#039;: Normalization and other technical tricks bound to help your MT system.&lt;br /&gt;
&lt;br /&gt;
04 &#039;&#039;&#039;[[MT Evaluation in General]]&#039;&#039;&#039;: Techniques of judging MT quality, dimensions of translation quality, number of possible translations.&lt;br /&gt;
&lt;br /&gt;
05 &#039;&#039;&#039;[[Automatic MT Evaluation]]&#039;&#039;&#039;: Two common automatic MT evaluation methods: PER and BLEU&lt;br /&gt;
&lt;br /&gt;
06 &#039;&#039;&#039;[[Data Acquisition]]&#039;&#039;&#039;: The need and possible sources of training data for MT. And the diminishing utility of the new data additions due to Zipf&#039;s law.&lt;br /&gt;
&lt;br /&gt;
07 &#039;&#039;&#039;[[Sentence Alignment]]&#039;&#039;&#039;: An introduction to the Gale &amp;amp; Church sentence alignment algorithm.&lt;br /&gt;
&lt;br /&gt;
== CodEx – Coding Exercises ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [https://codex3.ms.mff.cuni.cz/codex-trans/ Log in to CodEx] and solve programming exercises that complement our talks.&lt;br /&gt;
* [[CodEx-Introduction|Brief description of CodEx]]: how to get an account and submit a solution.&lt;br /&gt;
&lt;br /&gt;
== Other Videolectures on MT ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.upc.edu/learning/courses/mooc/2014-2015/approaches-to-machine/approaches-to-machine Approaches to Machine Translation: Rule-Based, Statistical, Hybrid] (an online course on MT by UPC Barcelona)&lt;br /&gt;
* [https://www.coursera.org/course/nlangp Natural Language Processing at Coursera] by Michael Collins, includes lectures on word-based and phrase-based models. [http://www.cs.columbia.edu/~mcollins/notes-spring2013.html Further notes]&lt;br /&gt;
&lt;br /&gt;
== Acknowledgement ==&lt;br /&gt;
&lt;br /&gt;
The work on this project has been supported by the grant FP7-ICT-2011-7-288487 ([http://www.statmt.org/mosescore/ MosesCore]).&lt;/div&gt;</summary>
		<author><name>Bojar</name></author>
	</entry>
	<entry>
		<id>https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=Data_Acquisition&amp;diff=339</id>
		<title>Data Acquisition</title>
		<link rel="alternate" type="text/html" href="https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=Data_Acquisition&amp;diff=339"/>
		<updated>2015-02-24T22:00:24Z</updated>

		<summary type="html">&lt;p&gt;Bojar: updated link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox&lt;br /&gt;
|title = Lecture 6: Data Acquisition&lt;br /&gt;
|image = [[File:bigbrother.png|200px]]&lt;br /&gt;
|label1 = Lecture video:&lt;br /&gt;
|data1 = [http://example.com web &#039;&#039;&#039;TODO&#039;&#039;&#039;] &amp;lt;br/&amp;gt; [https://www.youtube.com/watch?v=7obaii5xldQ&amp;amp;list=PLpiLOsNLsfmbeH-b865BwfH15W0sat02V&amp;amp;index=6 Youtube]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{#ev:youtube|https://www.youtube.com/watch?v=7obaii5xldQ|800|center}}&lt;br /&gt;
&lt;br /&gt;
There seems to be a universal rule for (not only) statistical methods in NLP: &#039;&#039;&#039;more data is better data.&#039;&#039;&#039; &amp;lt;ref name=effectiveness&amp;gt;A. Halevy, P. Norvig, F. Pereira. [http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=4804817&amp;amp;tag=1 &#039;&#039;The Unreasonable Effectiveness of Data&#039;&#039;]&amp;lt;/ref&amp;gt;&amp;lt;ref name=friends&amp;gt;Jan Hajič, Eva Hajičová. [http://link.springer.com/chapter/10.1007%2F978-3-540-74628-7_2#page-1 &#039;&#039;Some of Our Best Friends Are Statisticians&#039;&#039;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Translation systems have at their disposal (orders of magnitude) more training data than a person reads in a lifetime.&amp;lt;ref name=&amp;quot;inaug&amp;quot;&amp;gt;Philipp Koehn. [https://www.youtube.com/watch?v=6UVgFjJeFGY Inaugural lecture.]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Available Sources of Large Data ==&lt;br /&gt;
&lt;br /&gt;
This is definitely not a list of all possible sources, just a few of the interesting ones.&lt;br /&gt;
&lt;br /&gt;
=== Monolingual ===&lt;br /&gt;
&lt;br /&gt;
Google released [http://googleresearch.blogspot.cz/2006/08/all-our-n-gram-are-belong-to-you.html n-grams of the whole web] and of [http://storage.googleapis.com/books/ngrams/books/datasetsv2.html Google Books].&lt;br /&gt;
&lt;br /&gt;
[http://commoncrawl.org/ Common Crawl] is an initiative which builds an open repository of crawled web. [http://www.statmt.org/ngrams/ Moses n-grams] are similar to Google n-grams but have been computed on the Common Crawl. There is no pruning, so the data are much larger but can offer more detailed statistics.&lt;br /&gt;
&lt;br /&gt;
=== Parallel ===&lt;br /&gt;
&lt;br /&gt;
Politics has been the motivation for a lot of parallel corpora. Canadian Hansard is published both in French and English and is one of the best-known parallel corpora. [https://ec.europa.eu/jrc/en/language-technologies EU regulations] are published in all official European languages, providing an invaluable language resource (if nothing else).&lt;br /&gt;
&lt;br /&gt;
[http://opus.lingfil.uu.se/ OPUS] is a repository which contains most of the publicly available parallel corpora. The data is available for download in several formats, cleaned and processed with a unified pipeline.&lt;br /&gt;
&lt;br /&gt;
== Obtaining More Data ==&lt;br /&gt;
&lt;br /&gt;
More data, or more data of a specific kind, can be obtained e.g. via &#039;&#039;&#039;crowdsourcing&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
People also create large amounts of data every day and a good part of this is published via &#039;&#039;&#039;social media&#039;&#039;&#039;. It is therefore not surprising that some research in NLP focuses on leveraging these interesting new data sources.&lt;br /&gt;
&lt;br /&gt;
== Zipf&#039;s Law ==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Zipf%27s_law Zipf&#039;s law] states that given some corpus of natural language utterances, the frequency of any word is inversely proportional to its rank in the frequency table. Thus the most frequent word will occur approximately twice as often as the second most frequent word, three times as often as the third most frequent word, etc.&lt;br /&gt;
&lt;br /&gt;
Implications of this law can be observed everywhere in NLP. While just a few dozen most frequent words (&#039;&#039;types&#039;&#039;) will cover half of all &#039;&#039;tokens&#039;&#039; (word occurrences) in a natural language corpus, the tail (infrequent words) is extremely long.&lt;br /&gt;
&lt;br /&gt;
Moreover, even if we collect many times more data than we have at the moment, we will not cover much more of the tail and many infrequent words will remain &#039;&#039;out-of-vocabulary&#039;&#039; (OOV) for our NLP system.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bojar</name></author>
	</entry>
	<entry>
		<id>https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=Admin_RootPage&amp;diff=338</id>
		<title>Admin RootPage</title>
		<link rel="alternate" type="text/html" href="https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=Admin_RootPage&amp;diff=338"/>
		<updated>2015-02-24T16:21:08Z</updated>

		<summary type="html">&lt;p&gt;Bojar: published 06&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;0x : How to get started with CodEx MT exercises&lt;/div&gt;</summary>
		<author><name>Bojar</name></author>
	</entry>
	<entry>
		<id>https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=MT_Talks&amp;diff=337</id>
		<title>MT Talks</title>
		<link rel="alternate" type="text/html" href="https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=MT_Talks&amp;diff=337"/>
		<updated>2015-02-24T16:19:21Z</updated>

		<summary type="html">&lt;p&gt;Bojar: /* Our Talks */ publishing 06&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:banner.png]]&lt;br /&gt;
&lt;br /&gt;
MT Talks is a series of mini-lectures on machine translation.&lt;br /&gt;
&lt;br /&gt;
Our goal is to hit just the right level of detail and technicality to make the talks interesting and attractive to people who are not yet familiar with the field but mix in new observations and insights so that even old pals will have a reason to watch us.&lt;br /&gt;
&lt;br /&gt;
MT Talks and the expanded notes on this wiki will never be the ultimate resource for MT, but we would be very happy to serve as an ultimate commented &#039;&#039;directory&#039;&#039; of good pointers.&lt;br /&gt;
&lt;br /&gt;
By the way, this is indeed a Wiki, so your contributions are very welcome! Please register and feel free to add comments, corrections or links to useful resources.&lt;br /&gt;
&lt;br /&gt;
== Our Talks ==&lt;br /&gt;
&lt;br /&gt;
01 &#039;&#039;&#039;[[Intro]]&#039;&#039;&#039;: Why is MT difficult, Approaches to MT.&lt;br /&gt;
&lt;br /&gt;
02 &#039;&#039;&#039;[[MT that Deceives]]&#039;&#039;&#039;: Serious translation errors even for short and simple inputs.&lt;br /&gt;
&lt;br /&gt;
03 &#039;&#039;&#039;[[Pre-processing]]&#039;&#039;&#039;: Normalization and other technical tricks bound to help your MT system.&lt;br /&gt;
&lt;br /&gt;
04 &#039;&#039;&#039;[[MT Evaluation in General]]&#039;&#039;&#039;: Techniques of judging MT quality, dimensions of translation quality, number of possible translations.&lt;br /&gt;
&lt;br /&gt;
05 &#039;&#039;&#039;[[Automatic MT Evaluation]]&#039;&#039;&#039;: Two common automatic MT evaluation methods: PER and BLEU&lt;br /&gt;
&lt;br /&gt;
06 &#039;&#039;&#039;[[Data Acquisition]]&#039;&#039;&#039;: The need and possible sources of training data for MT. And the diminishing utility of the new data additions due to Zipf&#039;s law.&lt;br /&gt;
&lt;br /&gt;
== CodEx – Coding Exercises ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [https://codex3.ms.mff.cuni.cz/codex-trans/ Log in to CodEx] and solve programming exercises that complement our talks.&lt;br /&gt;
* [[CodEx-Introduction|Brief description of CodEx]]: how to get an account and submit a solution.&lt;br /&gt;
&lt;br /&gt;
== Other Videolectures on MT ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.upc.edu/learning/courses/mooc/2014-2015/approaches-to-machine/approaches-to-machine Approaches to Machine Translation: Rule-Based, Statistical, Hybrid] (an online course on MT by UPC Barcelona)&lt;br /&gt;
* [https://www.coursera.org/course/nlangp Natural Language Processing at Coursera] by Michael Collins, includes lectures on word-based and phrase-based models. [http://www.cs.columbia.edu/~mcollins/notes-spring2013.html Further notes]&lt;br /&gt;
&lt;br /&gt;
== Acknowledgement ==&lt;br /&gt;
&lt;br /&gt;
The work on this project has been supported by the grant FP7-ICT-2011-7-288487 ([http://www.statmt.org/mosescore/ MosesCore]).&lt;/div&gt;</summary>
		<author><name>Bojar</name></author>
	</entry>
	<entry>
		<id>https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=MT_Talks&amp;diff=321</id>
		<title>MT Talks</title>
		<link rel="alternate" type="text/html" href="https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=MT_Talks&amp;diff=321"/>
		<updated>2015-02-11T08:56:25Z</updated>

		<summary type="html">&lt;p&gt;Bojar: /* CodEx -- Coding Exercises */ endash&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:banner.png]]&lt;br /&gt;
&lt;br /&gt;
MT Talks is a series of mini-lectures on machine translation.&lt;br /&gt;
&lt;br /&gt;
Our goal is to hit just the right level of detail and technicality to make the talks interesting and attractive to people who are not yet familiar with the field but mix in new observations and insights so that even old pals will have a reason to watch us.&lt;br /&gt;
&lt;br /&gt;
MT Talks and the expanded notes on this wiki will never be the ultimate resource for MT, but we would be very happy to serve as an ultimate commented &#039;&#039;directory&#039;&#039; of good pointers.&lt;br /&gt;
&lt;br /&gt;
By the way, this is indeed a Wiki, so your contributions are very welcome! Please register and feel free to add comments, corrections or links to useful resources.&lt;br /&gt;
&lt;br /&gt;
== Our Talks ==&lt;br /&gt;
&lt;br /&gt;
01 &#039;&#039;&#039;[[Intro]]&#039;&#039;&#039;: Why is MT difficult, Approaches to MT.&lt;br /&gt;
&lt;br /&gt;
02 &#039;&#039;&#039;[[MT that Deceives]]&#039;&#039;&#039;: Serious translation errors even for short and simple inputs.&lt;br /&gt;
&lt;br /&gt;
03 &#039;&#039;&#039;[[Pre-processing]]&#039;&#039;&#039;: Normalization and other technical tricks bound to help your MT system.&lt;br /&gt;
&lt;br /&gt;
04 &#039;&#039;&#039;[[MT Evaluation in General]]&#039;&#039;&#039;: Techniques of judging MT quality, dimensions of translation quality, number of possible translations.&lt;br /&gt;
&lt;br /&gt;
05 &#039;&#039;&#039;[[Automatic MT Evaluation]]&#039;&#039;&#039;: Two common automatic MT evaluation methods: PER and BLEU&lt;br /&gt;
&lt;br /&gt;
== CodEx – Coding Exercises ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [https://codex3.ms.mff.cuni.cz/codex-trans/ Log in to CodEx] and solve programming exercises that complement our talks.&lt;br /&gt;
* [[CodEx-Introduction|Brief description of CodEx]]: how to get an account and submit a solution.&lt;br /&gt;
&lt;br /&gt;
== Other Videolectures on MT ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.upc.edu/learning/courses/mooc/2014-2015/approaches-to-machine/approaches-to-machine Approaches to Machine Translation: Rule-Based, Statistical, Hybrid] (an online course on MT by UPC Barcelona)&lt;br /&gt;
* [https://www.coursera.org/course/nlangp Natural Language Processing at Coursera] by Michael Collins, includes lectures on word-based and phrase-based models. [http://www.cs.columbia.edu/~mcollins/notes-spring2013.html Further notes]&lt;br /&gt;
&lt;br /&gt;
== Acknowledgement ==&lt;br /&gt;
&lt;br /&gt;
The work on this project has been supported by the grant FP7-ICT-2011-7-288487 ([http://www.statmt.org/mosescore/ MosesCore]).&lt;/div&gt;</summary>
		<author><name>Bojar</name></author>
	</entry>
	<entry>
		<id>https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=Automatic_MT_Evaluation&amp;diff=320</id>
		<title>Automatic MT Evaluation</title>
		<link rel="alternate" type="text/html" href="https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=Automatic_MT_Evaluation&amp;diff=320"/>
		<updated>2015-02-11T08:54:07Z</updated>

		<summary type="html">&lt;p&gt;Bojar: /* Other Metrics */ typos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox&lt;br /&gt;
|title = Lecture 5: Automatic MT Evaluation&lt;br /&gt;
|image = [[File:camel.png|200px]]&lt;br /&gt;
|label1 = Lecture video:&lt;br /&gt;
|data1 = [http://example.com web &#039;&#039;&#039;TODO&#039;&#039;&#039;] &amp;lt;br/&amp;gt; [https://www.youtube.com/watch?v=Bj_Hxi91GUM&amp;amp;index=5&amp;amp;list=PLpiLOsNLsfmbeH-b865BwfH15W0sat02V Youtube]&lt;br /&gt;
|label2 = Supplementary materials:&lt;br /&gt;
|data2 = [[File:bleu.pdf]]&lt;br /&gt;
|label3 = Exercises:&lt;br /&gt;
|data3 = [https://codex3.ms.mff.cuni.cz/codex-trans/?groupId=3&amp;amp;taskId=8&amp;amp;module=groups%2Ftasks&amp;amp;page=specification BLEU] &amp;lt;br/&amp;gt; [https://codex3.ms.mff.cuni.cz/codex-trans/?groupId=3&amp;amp;taskId=9&amp;amp;module=groups%2Ftasks&amp;amp;page=specification PER]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{#ev:youtube|https://www.youtube.com/watch?v=Bj_Hxi91GUM&amp;amp;index=5&amp;amp;list=PLpiLOsNLsfmbeH-b865BwfH15W0sat02V|800|center}}&lt;br /&gt;
&lt;br /&gt;
== Reference Translations ==&lt;br /&gt;
&lt;br /&gt;
The following picture&amp;lt;ref name=&amp;quot;deprefset&amp;quot;&amp;gt;Ondřej Bojar, Matouš Macháček, Aleš Tamchyna, Daniel Zeman. &#039;&#039;[https://ufal.mff.cuni.cz/~tamchyna/papers/2013-tsd.pdf Scratching the Surface of Possible Translations]&#039;&#039;&amp;lt;/ref&amp;gt; illustrates the issue of reference translations:&lt;br /&gt;
&lt;br /&gt;
[[File:references.png|650px]]&lt;br /&gt;
&lt;br /&gt;
Out of all possible sequences of words in the given language, only some are &#039;&#039;grammatically correct sentences&#039;&#039; (&amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;). An overlapping set is formed by &#039;&#039;understandable translations&#039;&#039;  (&amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;) of the source sentence (note that these are not necessarily grammatical). Possible &#039;&#039;reference translations&#039;&#039; can then be viewed as a subset of &amp;lt;math&amp;gt;G \cap T&amp;lt;/math&amp;gt;. Only some of these can be reached by the MT system. Typically, we only have several reference translations at our disposal; often we have just a single reference.&lt;br /&gt;
&lt;br /&gt;
== PER ==&lt;br /&gt;
&lt;br /&gt;
Position-independent error rate&amp;lt;ref name=&amp;quot;per&amp;quot;&amp;gt;C. Tillmann, S. Vogel, H. Ney, A. Zubiaga, H. Sawaf. &#039;&#039;[https://www-i6.informatik.rwth-aachen.de/publications/download/203/TillmannC.VogelS.NeyH.SawafH.ZubiagaA.--AcceleratedDP-basedSearchforStatisticalTranslation--1997.pdf Accelerated DP Based Search for Statistical Translation]&#039;&#039;&amp;lt;/ref&amp;gt; (PER) is a simple measure which counts the number of correct words in the MT output, regardless of their position. It is calculated using the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text{PER} = 1 - \frac{\text{correct} - \max(0, c - r)}{r}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; is the number of tokens in the reference translation and candidate translation, respectively.&lt;br /&gt;
&lt;br /&gt;
== BLEU ==&lt;br /&gt;
&lt;br /&gt;
BLEU&amp;lt;ref name=&amp;quot;bleu&amp;quot;&amp;gt;Kishore Papineni, Salim Roukos, Todd Ward, Wei-Jing Zhu. &#039;&#039;[http://www.aclweb.org/anthology/P02-1040.pdf BLEU: a Method for Automatic Evaluation of Machine Translation]&#039;&#039;&amp;lt;/ref&amp;gt; (Bilingual evaluation understudy) remains the most popular metric for automatic evaluation of MT output quality.&lt;br /&gt;
&lt;br /&gt;
While PER only looks at individual words, BLEU considers also sequences of words. Informally, we can describe BLEU as the amount of overlap of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-grams between the candidate translation and the reference (more specifically unigrams, bigrams, trigrams and 4-grams, in the standard formulation).&lt;br /&gt;
&lt;br /&gt;
The formal definition is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\text{BLEU} = \text{BP} \cdot \exp \sum_{i=1}^{n}(\lambda_i \log p_i)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where (almost always) &amp;lt;math&amp;gt;\lambda_i = 1/n&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 4&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;p_i&amp;lt;/math&amp;gt; stand for &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;-gram precision, i.e. the number of &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;-grams in the candidate translation which are confirmed by the reference.&lt;br /&gt;
&lt;br /&gt;
Each reference n-gram can be used to confirm the candidate n-gram only once (&#039;&#039;clipping&#039;&#039;), making it impossible to game BLEU by producing many occurrences of a single common word (such as &#039;&#039;&amp;quot;the&amp;quot;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
BP stands for &#039;&#039;brevity penalty&#039;&#039;. Since BLEU is a kind of precision, short outputs (which only contain words that the system is sure about) would score highly without BP. This penalty is defined simply as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\text{BP} = \begin{cases} 1, &amp;amp; \mbox{if }  c &amp;gt; r \\ \exp(1 - r/c),  &amp;amp; \mbox{if } c \leq r. \end{cases}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; is again the number of tokens in the reference translation and candidate translation, respectively.&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
&lt;br /&gt;
Consider the following situation:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!Source &lt;br /&gt;
|Vom Glück der traumenden Kamele&lt;br /&gt;
|colspan=&amp;quot;4&amp;quot;|Confirmed&lt;br /&gt;
|-&lt;br /&gt;
!Reference&lt;br /&gt;
|On the happiness of dreaming camels&lt;br /&gt;
|1&lt;br /&gt;
|2&lt;br /&gt;
|3&lt;br /&gt;
|4&lt;br /&gt;
|-&lt;br /&gt;
!MT Output&lt;br /&gt;
|The happiness of dreaming camels&lt;br /&gt;
|5&lt;br /&gt;
|4&lt;br /&gt;
|3&lt;br /&gt;
|2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The number of confirmed MT n-grams is 5, 4, 3, 2 respectively for unigrams, bigrams etc. The MT output is one word shorter than the reference, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text{BP} = \exp(1 - 6/5) \doteq 0.82&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The geometric mean of precisions is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\exp(\frac{1}{4} \log(\frac{5}{6}) + \frac{1}{4} \log (\frac{4}{5}) + \frac{1}{4} \log(\frac{3}{4}) + \frac{1}{4} \log(\frac{2}{3})) \doteq 0.76&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that you can equivalently take the fourth root of the product of the precisions, i.e. &amp;lt;math&amp;gt;\sqrt[4]{\frac{5}{6} \cdot \frac{4}{5} \cdot \frac{3}{4} \cdot \frac{2}{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The final BLEU score is then &amp;lt;math&amp;gt;0.82 \cdot 0.76 \doteq 0.62&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
BLEU is often mutliplied by 100 for readability.&lt;br /&gt;
&lt;br /&gt;
BLEU is a document-level metric. This means that counts of confirmed n-grams are collected for all sentences in the translated document and then the geometric mean of n-gram precisions is computed from the accumulated counts. For a single sentence, BLEU is often zero (since there is frequently no matching 4-gram or even trigram).&lt;br /&gt;
&lt;br /&gt;
=== Multiple Reference Translations ===&lt;br /&gt;
&lt;br /&gt;
BLEU supports multiple references. In that case, if an n-gram in the MT output is confirmed by &#039;&#039;any&#039;&#039; of the reference translations, it is counted as correct. If an n-gram occurs multiple times, it has to be seen in one of the references multiple times as well.&lt;br /&gt;
&lt;br /&gt;
The original paper is not clear about BP in this case. The usual practice is to take the reference translation which is closest in length to the MT output and calculate BP from that. (Note that even this specification is not unambiguous since there can be two closest references to the given hypothesis, the longer and the shorter one.)&lt;br /&gt;
&lt;br /&gt;
== Other Metrics ==&lt;br /&gt;
&lt;br /&gt;
* Results of the WMT14 Metrics Shared Task&amp;lt;ref name=&amp;quot;wmtmetrics&amp;quot;&amp;gt;Matouš Macháček and Ondřej Bojar. &#039;&#039;[http://www.statmt.org/wmt14/pdf/W14-3336.pdf Results of the WMT14 Metrics Shared Task]&#039;&#039;&amp;lt;/ref&amp;gt; (WMT metrics) -- an annual shared task in automatic evaluation of MT, see the [http://www.statmt.org/wmt15/metrics-task/ task web page].&lt;br /&gt;
&lt;br /&gt;
* Translation Error Rate&amp;lt;ref name=&amp;quot;ter&amp;quot;&amp;gt;Matthew Snover, Bonnie Dorr, Richard Schwartz, Linnea Micciulla, John Makhoul. &#039;&#039;[https://www.cs.umd.edu/~snover/pub/amta06/ter_amta.pdf A Study of Translation Edit Rate with Targeted Human Annotation]&#039;&#039;&amp;lt;/ref&amp;gt; (TER) -- an edit-distance based metric on the level of phrases&lt;br /&gt;
&lt;br /&gt;
* METEOR&amp;lt;ref name=&amp;quot;meteor&amp;quot;&amp;gt;Alon Lavie, Michael Denkowski. &#039;&#039;[http://www.cs.cmu.edu/afs/cs.cmu.edu/project/mteval-1/Papers/MT-Journal-2009/meteor-mtj-2009.pdf The METEOR Metric for Automatic Evaluation of Machine Translation]&#039;&#039;&amp;lt;/ref&amp;gt; -- a robust metric with support for paraphrasing&lt;br /&gt;
&lt;br /&gt;
== Exercises ==&lt;br /&gt;
&lt;br /&gt;
* [https://codex3.ms.mff.cuni.cz/codex-trans/?groupId=3&amp;amp;taskId=8&amp;amp;module=groups%2Ftasks&amp;amp;page=specification Implement BLEU] &lt;br /&gt;
* [https://codex3.ms.mff.cuni.cz/codex-trans/?groupId=3&amp;amp;taskId=9&amp;amp;module=groups%2Ftasks&amp;amp;page=specification Implement PER]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bojar</name></author>
	</entry>
	<entry>
		<id>https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=MT_Talks&amp;diff=319</id>
		<title>MT Talks</title>
		<link rel="alternate" type="text/html" href="https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=MT_Talks&amp;diff=319"/>
		<updated>2015-02-11T08:52:20Z</updated>

		<summary type="html">&lt;p&gt;Bojar: /* CodEx */ title improved&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:banner.png]]&lt;br /&gt;
&lt;br /&gt;
MT Talks is a series of mini-lectures on machine translation.&lt;br /&gt;
&lt;br /&gt;
Our goal is to hit just the right level of detail and technicality to make the talks interesting and attractive to people who are not yet familiar with the field but mix in new observations and insights so that even old pals will have a reason to watch us.&lt;br /&gt;
&lt;br /&gt;
MT Talks and the expanded notes on this wiki will never be the ultimate resource for MT, but we would be very happy to serve as an ultimate commented &#039;&#039;directory&#039;&#039; of good pointers.&lt;br /&gt;
&lt;br /&gt;
By the way, this is indeed a Wiki, so your contributions are very welcome! Please register and feel free to add comments, corrections or links to useful resources.&lt;br /&gt;
&lt;br /&gt;
== Our Talks ==&lt;br /&gt;
&lt;br /&gt;
01 &#039;&#039;&#039;[[Intro]]&#039;&#039;&#039;: Why is MT difficult, Approaches to MT.&lt;br /&gt;
&lt;br /&gt;
02 &#039;&#039;&#039;[[MT that Deceives]]&#039;&#039;&#039;: Serious translation errors even for short and simple inputs.&lt;br /&gt;
&lt;br /&gt;
03 &#039;&#039;&#039;[[Pre-processing]]&#039;&#039;&#039;: Normalization and other technical tricks bound to help your MT system.&lt;br /&gt;
&lt;br /&gt;
04 &#039;&#039;&#039;[[MT Evaluation in General]]&#039;&#039;&#039;: Techniques of judging MT quality, dimensions of translation quality, number of possible translations.&lt;br /&gt;
&lt;br /&gt;
05 &#039;&#039;&#039;[[Automatic MT Evaluation]]&#039;&#039;&#039;: Two common automatic MT evaluation methods: PER and BLEU&lt;br /&gt;
&lt;br /&gt;
== CodEx -- Coding Exercises ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [https://codex3.ms.mff.cuni.cz/codex-trans/ Log in to CodEx] and solve programming exercises that complement our talks.&lt;br /&gt;
* [[CodEx-Introduction|Brief description of CodEx]]: how to get an account and submit a solution.&lt;br /&gt;
&lt;br /&gt;
== Other Videolectures on MT ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.upc.edu/learning/courses/mooc/2014-2015/approaches-to-machine/approaches-to-machine Approaches to Machine Translation: Rule-Based, Statistical, Hybrid] (an online course on MT by UPC Barcelona)&lt;br /&gt;
* [https://www.coursera.org/course/nlangp Natural Language Processing at Coursera] by Michael Collins, includes lectures on word-based and phrase-based models. [http://www.cs.columbia.edu/~mcollins/notes-spring2013.html Further notes]&lt;br /&gt;
&lt;br /&gt;
== Acknowledgement ==&lt;br /&gt;
&lt;br /&gt;
The work on this project has been supported by the grant FP7-ICT-2011-7-288487 ([http://www.statmt.org/mosescore/ MosesCore]).&lt;/div&gt;</summary>
		<author><name>Bojar</name></author>
	</entry>
	<entry>
		<id>https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=Admin_RootPage&amp;diff=318</id>
		<title>Admin RootPage</title>
		<link rel="alternate" type="text/html" href="https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=Admin_RootPage&amp;diff=318"/>
		<updated>2015-02-11T08:45:34Z</updated>

		<summary type="html">&lt;p&gt;Bojar: released 05&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;0x : How to get started with CodEx MT exercises&lt;/div&gt;</summary>
		<author><name>Bojar</name></author>
	</entry>
	<entry>
		<id>https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=MT_Talks&amp;diff=317</id>
		<title>MT Talks</title>
		<link rel="alternate" type="text/html" href="https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=MT_Talks&amp;diff=317"/>
		<updated>2015-02-11T08:38:44Z</updated>

		<summary type="html">&lt;p&gt;Bojar: /* Our Talks */ releasing 05&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:banner.png]]&lt;br /&gt;
&lt;br /&gt;
MT Talks is a series of mini-lectures on machine translation.&lt;br /&gt;
&lt;br /&gt;
Our goal is to hit just the right level of detail and technicality to make the talks interesting and attractive to people who are not yet familiar with the field but mix in new observations and insights so that even old pals will have a reason to watch us.&lt;br /&gt;
&lt;br /&gt;
MT Talks and the expanded notes on this wiki will never be the ultimate resource for MT, but we would be very happy to serve as an ultimate commented &#039;&#039;directory&#039;&#039; of good pointers.&lt;br /&gt;
&lt;br /&gt;
By the way, this is indeed a Wiki, so your contributions are very welcome! Please register and feel free to add comments, corrections or links to useful resources.&lt;br /&gt;
&lt;br /&gt;
== Our Talks ==&lt;br /&gt;
&lt;br /&gt;
01 &#039;&#039;&#039;[[Intro]]&#039;&#039;&#039;: Why is MT difficult, Approaches to MT.&lt;br /&gt;
&lt;br /&gt;
02 &#039;&#039;&#039;[[MT that Deceives]]&#039;&#039;&#039;: Serious translation errors even for short and simple inputs.&lt;br /&gt;
&lt;br /&gt;
03 &#039;&#039;&#039;[[Pre-processing]]&#039;&#039;&#039;: Normalization and other technical tricks bound to help your MT system.&lt;br /&gt;
&lt;br /&gt;
04 &#039;&#039;&#039;[[MT Evaluation in General]]&#039;&#039;&#039;: Techniques of judging MT quality, dimensions of translation quality, number of possible translations.&lt;br /&gt;
&lt;br /&gt;
05 &#039;&#039;&#039;[[Automatic MT Evaluation]]&#039;&#039;&#039;: Two common automatic MT evaluation methods: PER and BLEU&lt;br /&gt;
&lt;br /&gt;
== CodEx ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [https://codex3.ms.mff.cuni.cz/codex-trans/ Log in to CodEx] and solve programming exercises that complement our talks.&lt;br /&gt;
* [[CodEx-Introduction|Brief description of CodEx]]: how to get an account and submit a solution.&lt;br /&gt;
&lt;br /&gt;
== Other Videolectures on MT ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.upc.edu/learning/courses/mooc/2014-2015/approaches-to-machine/approaches-to-machine Approaches to Machine Translation: Rule-Based, Statistical, Hybrid] (an online course on MT by UPC Barcelona)&lt;br /&gt;
* [https://www.coursera.org/course/nlangp Natural Language Processing at Coursera] by Michael Collins, includes lectures on word-based and phrase-based models. [http://www.cs.columbia.edu/~mcollins/notes-spring2013.html Further notes]&lt;br /&gt;
&lt;br /&gt;
== Acknowledgement ==&lt;br /&gt;
&lt;br /&gt;
The work on this project has been supported by the grant FP7-ICT-2011-7-288487 ([http://www.statmt.org/mosescore/ MosesCore]).&lt;/div&gt;</summary>
		<author><name>Bojar</name></author>
	</entry>
	<entry>
		<id>https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=Automatic_MT_Evaluation&amp;diff=316</id>
		<title>Automatic MT Evaluation</title>
		<link rel="alternate" type="text/html" href="https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=Automatic_MT_Evaluation&amp;diff=316"/>
		<updated>2015-02-11T08:26:18Z</updated>

		<summary type="html">&lt;p&gt;Bojar: /* Other Metrics */ link to metrics task&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox&lt;br /&gt;
|title = Lecture 5: Automatic MT Evaluation&lt;br /&gt;
|image = [[File:camel.png|200px]]&lt;br /&gt;
|label1 = Lecture video:&lt;br /&gt;
|data1 = [http://example.com web &#039;&#039;&#039;TODO&#039;&#039;&#039;] &amp;lt;br/&amp;gt; [https://www.youtube.com/watch?v=Bj_Hxi91GUM&amp;amp;index=5&amp;amp;list=PLpiLOsNLsfmbeH-b865BwfH15W0sat02V Youtube]&lt;br /&gt;
|label2 = Supplementary materials:&lt;br /&gt;
|data2 = [[File:bleu.pdf]]&lt;br /&gt;
|label3 = Exercises:&lt;br /&gt;
|data3 = [https://codex3.ms.mff.cuni.cz/codex-trans/?groupId=3&amp;amp;taskId=8&amp;amp;module=groups%2Ftasks&amp;amp;page=specification BLEU] &amp;lt;br/&amp;gt; [https://codex3.ms.mff.cuni.cz/codex-trans/?groupId=3&amp;amp;taskId=9&amp;amp;module=groups%2Ftasks&amp;amp;page=specification PER]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{#ev:youtube|https://www.youtube.com/watch?v=Bj_Hxi91GUM&amp;amp;index=5&amp;amp;list=PLpiLOsNLsfmbeH-b865BwfH15W0sat02V|800|center}}&lt;br /&gt;
&lt;br /&gt;
== Reference Translations ==&lt;br /&gt;
&lt;br /&gt;
The following picture&amp;lt;ref name=&amp;quot;deprefset&amp;quot;&amp;gt;Ondřej Bojar, Matouš Macháček, Aleš Tamchyna, Daniel Zeman. &#039;&#039;[https://ufal.mff.cuni.cz/~tamchyna/papers/2013-tsd.pdf Scratching the Surface of Possible Translations]&#039;&#039;&amp;lt;/ref&amp;gt; illustrates the issue of reference translations:&lt;br /&gt;
&lt;br /&gt;
[[File:references.png|650px]]&lt;br /&gt;
&lt;br /&gt;
Out of all possible sequences of words in the given language, only some are &#039;&#039;grammatically correct sentences&#039;&#039; (&amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;). An overlapping set is formed by &#039;&#039;understandable translations&#039;&#039;  (&amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;) of the source sentence (note that these are not necessarily grammatical). Possible &#039;&#039;reference translations&#039;&#039; can then be viewed as a subset of &amp;lt;math&amp;gt;G \cap T&amp;lt;/math&amp;gt;. Only some of these can be reached by the MT system. Typically, we only have several reference translations at our disposal; often we have just a single reference.&lt;br /&gt;
&lt;br /&gt;
== PER ==&lt;br /&gt;
&lt;br /&gt;
Position-independent error rate&amp;lt;ref name=&amp;quot;per&amp;quot;&amp;gt;C. Tillmann, S. Vogel, H. Ney, A. Zubiaga, H. Sawaf. &#039;&#039;[https://www-i6.informatik.rwth-aachen.de/publications/download/203/TillmannC.VogelS.NeyH.SawafH.ZubiagaA.--AcceleratedDP-basedSearchforStatisticalTranslation--1997.pdf Accelerated DP Based Search for Statistical Translation]&#039;&#039;&amp;lt;/ref&amp;gt; (PER) is a simple measure which counts the number of correct words in the MT output, regardless of their position. It is calculated using the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text{PER} = 1 - \frac{\text{correct} - \max(0, c - r)}{r}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; is the number of tokens in the reference translation and candidate translation, respectively.&lt;br /&gt;
&lt;br /&gt;
== BLEU ==&lt;br /&gt;
&lt;br /&gt;
BLEU&amp;lt;ref name=&amp;quot;bleu&amp;quot;&amp;gt;Kishore Papineni, Salim Roukos, Todd Ward, Wei-Jing Zhu. &#039;&#039;[http://www.aclweb.org/anthology/P02-1040.pdf BLEU: a Method for Automatic Evaluation of Machine Translation]&#039;&#039;&amp;lt;/ref&amp;gt; (Bilingual evaluation understudy) remains the most popular metric for automatic evaluation of MT output quality.&lt;br /&gt;
&lt;br /&gt;
While PER only looks at individual words, BLEU considers also sequences of words. Informally, we can describe BLEU as the amount of overlap of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-grams between the candidate translation and the reference (more specifically unigrams, bigrams, trigrams and 4-grams, in the standard formulation).&lt;br /&gt;
&lt;br /&gt;
The formal definition is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\text{BLEU} = \text{BP} \cdot \exp \sum_{i=1}^{n}(\lambda_i \log p_i)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where (almost always) &amp;lt;math&amp;gt;\lambda_i = 1/n&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 4&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;p_i&amp;lt;/math&amp;gt; stand for &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;-gram precision, i.e. the number of &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;-grams in the candidate translation which are confirmed by the reference.&lt;br /&gt;
&lt;br /&gt;
Each reference n-gram can be used to confirm the candidate n-gram only once (&#039;&#039;clipping&#039;&#039;), making it impossible to game BLEU by producing many occurrences of a single common word (such as &#039;&#039;&amp;quot;the&amp;quot;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
BP stands for &#039;&#039;brevity penalty&#039;&#039;. Since BLEU is a kind of precision, short outputs (which only contain words that the system is sure about) would score highly without BP. This penalty is defined simply as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\text{BP} = \begin{cases} 1, &amp;amp; \mbox{if }  c &amp;gt; r \\ \exp(1 - r/c),  &amp;amp; \mbox{if } c \leq r. \end{cases}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; is again the number of tokens in the reference translation and candidate translation, respectively.&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
&lt;br /&gt;
Consider the following situation:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!Source &lt;br /&gt;
|Vom Glück der traumenden Kamele&lt;br /&gt;
|colspan=&amp;quot;4&amp;quot;|Confirmed&lt;br /&gt;
|-&lt;br /&gt;
!Reference&lt;br /&gt;
|On the happiness of dreaming camels&lt;br /&gt;
|1&lt;br /&gt;
|2&lt;br /&gt;
|3&lt;br /&gt;
|4&lt;br /&gt;
|-&lt;br /&gt;
!MT Output&lt;br /&gt;
|The happiness of dreaming camels&lt;br /&gt;
|5&lt;br /&gt;
|4&lt;br /&gt;
|3&lt;br /&gt;
|2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The number of confirmed MT n-grams is 5, 4, 3, 2 respectively for unigrams, bigrams etc. The MT output is one word shorter than the reference, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text{BP} = \exp(1 - 6/5) \doteq 0.82&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The geometric mean of precisions is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\exp(\frac{1}{4} \log(\frac{5}{6}) + \frac{1}{4} \log (\frac{4}{5}) + \frac{1}{4} \log(\frac{3}{4}) + \frac{1}{4} \log(\frac{2}{3})) \doteq 0.76&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that you can equivalently take the fourth root of the product of the precisions, i.e. &amp;lt;math&amp;gt;\sqrt[4]{\frac{5}{6} \cdot \frac{4}{5} \cdot \frac{3}{4} \cdot \frac{2}{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The final BLEU score is then &amp;lt;math&amp;gt;0.82 \cdot 0.76 \doteq 0.62&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
BLEU is often mutliplied by 100 for readability.&lt;br /&gt;
&lt;br /&gt;
BLEU is a document-level metric. This means that counts of confirmed n-grams are collected for all sentences in the translated document and then the geometric mean of n-gram precisions is computed from the accumulated counts. For a single sentence, BLEU is often zero (since there is frequently no matching 4-gram or even trigram).&lt;br /&gt;
&lt;br /&gt;
=== Multiple Reference Translations ===&lt;br /&gt;
&lt;br /&gt;
BLEU supports multiple references. In that case, if an n-gram in the MT output is confirmed by &#039;&#039;any&#039;&#039; of the reference translations, it is counted as correct. If an n-gram occurs multiple times, it has to be seen in one of the references multiple times as well.&lt;br /&gt;
&lt;br /&gt;
The original paper is not clear about BP in this case. The usual practice is to take the reference translation which is closest in length to the MT output and calculate BP from that. (Note that even this specification is not unambiguous since there can be two closest references to the given hypothesis, the longer and the shorter one.)&lt;br /&gt;
&lt;br /&gt;
== Other Metrics ==&lt;br /&gt;
&lt;br /&gt;
* Results of the WMT14 Metrics Shared Task&amp;lt;ref name=&amp;quot;wmtmetrics&amp;quot;&amp;gt;Matouš Macháček and Ondřej Bojar. &#039;&#039;[http://www.statmt.org/wmt14/pdf/W14-3336.pdf Results of the WMT14 Metrics Shared Task&#039;&#039;&amp;lt;/ref&amp;gt; (WMT metrics) -- an annual shared task in automatic evaluation of MT, see the [http://www.statmt.org/wmt14/metrics-task/ task web page].&lt;br /&gt;
&lt;br /&gt;
* Translation Error Rate&amp;lt;ref name=&amp;quot;ter&amp;quot;&amp;gt;Matthew Snover, Bonnie Dorr, Richard Schwartz, Linnea Micciulla, John Makhoul. &#039;&#039;[https://www.cs.umd.edu/~snover/pub/amta06/ter_amta.pdf A Study of Translation Edit Rate with Targeted Human Annotation]&#039;&#039;&amp;lt;/ref&amp;gt; (TER) -- an edit-distance based metric on the level of phrases&lt;br /&gt;
&lt;br /&gt;
* METEOR&amp;lt;ref name=&amp;quot;meteor&amp;quot;&amp;gt;Alon Lavie, Michael Denkowski. &#039;&#039;[http://www.cs.cmu.edu/afs/cs.cmu.edu/project/mteval-1/Papers/MT-Journal-2009/meteor-mtj-2009.pdf The METEOR Metric for Automatic Evaluation of Machine Translation]&#039;&#039;&amp;lt;/ref&amp;gt; -- a robust metric with support for paraphrasing&lt;br /&gt;
&lt;br /&gt;
== Exercises ==&lt;br /&gt;
&lt;br /&gt;
* [https://codex3.ms.mff.cuni.cz/codex-trans/?groupId=3&amp;amp;taskId=8&amp;amp;module=groups%2Ftasks&amp;amp;page=specification Implement BLEU] &lt;br /&gt;
* [https://codex3.ms.mff.cuni.cz/codex-trans/?groupId=3&amp;amp;taskId=9&amp;amp;module=groups%2Ftasks&amp;amp;page=specification Implement PER]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bojar</name></author>
	</entry>
	<entry>
		<id>https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=Automatic_MT_Evaluation&amp;diff=315</id>
		<title>Automatic MT Evaluation</title>
		<link rel="alternate" type="text/html" href="https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=Automatic_MT_Evaluation&amp;diff=315"/>
		<updated>2015-02-11T08:18:35Z</updated>

		<summary type="html">&lt;p&gt;Bojar: /* Multiple Reference Translations */ closest ref is ambiguous&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox&lt;br /&gt;
|title = Lecture 5: Automatic MT Evaluation&lt;br /&gt;
|image = [[File:camel.png|200px]]&lt;br /&gt;
|label1 = Lecture video:&lt;br /&gt;
|data1 = [http://example.com web &#039;&#039;&#039;TODO&#039;&#039;&#039;] &amp;lt;br/&amp;gt; [https://www.youtube.com/watch?v=Bj_Hxi91GUM&amp;amp;index=5&amp;amp;list=PLpiLOsNLsfmbeH-b865BwfH15W0sat02V Youtube]&lt;br /&gt;
|label2 = Supplementary materials:&lt;br /&gt;
|data2 = [[File:bleu.pdf]]&lt;br /&gt;
|label3 = Exercises:&lt;br /&gt;
|data3 = [https://codex3.ms.mff.cuni.cz/codex-trans/?groupId=3&amp;amp;taskId=8&amp;amp;module=groups%2Ftasks&amp;amp;page=specification BLEU] &amp;lt;br/&amp;gt; [https://codex3.ms.mff.cuni.cz/codex-trans/?groupId=3&amp;amp;taskId=9&amp;amp;module=groups%2Ftasks&amp;amp;page=specification PER]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{#ev:youtube|https://www.youtube.com/watch?v=Bj_Hxi91GUM&amp;amp;index=5&amp;amp;list=PLpiLOsNLsfmbeH-b865BwfH15W0sat02V|800|center}}&lt;br /&gt;
&lt;br /&gt;
== Reference Translations ==&lt;br /&gt;
&lt;br /&gt;
The following picture&amp;lt;ref name=&amp;quot;deprefset&amp;quot;&amp;gt;Ondřej Bojar, Matouš Macháček, Aleš Tamchyna, Daniel Zeman. &#039;&#039;[https://ufal.mff.cuni.cz/~tamchyna/papers/2013-tsd.pdf Scratching the Surface of Possible Translations]&#039;&#039;&amp;lt;/ref&amp;gt; illustrates the issue of reference translations:&lt;br /&gt;
&lt;br /&gt;
[[File:references.png|650px]]&lt;br /&gt;
&lt;br /&gt;
Out of all possible sequences of words in the given language, only some are &#039;&#039;grammatically correct sentences&#039;&#039; (&amp;lt;math&amp;gt;G&amp;lt;/math&amp;gt;). An overlapping set is formed by &#039;&#039;understandable translations&#039;&#039;  (&amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;) of the source sentence (note that these are not necessarily grammatical). Possible &#039;&#039;reference translations&#039;&#039; can then be viewed as a subset of &amp;lt;math&amp;gt;G \cap T&amp;lt;/math&amp;gt;. Only some of these can be reached by the MT system. Typically, we only have several reference translations at our disposal; often we have just a single reference.&lt;br /&gt;
&lt;br /&gt;
== PER ==&lt;br /&gt;
&lt;br /&gt;
Position-independent error rate&amp;lt;ref name=&amp;quot;per&amp;quot;&amp;gt;C. Tillmann, S. Vogel, H. Ney, A. Zubiaga, H. Sawaf. &#039;&#039;[https://www-i6.informatik.rwth-aachen.de/publications/download/203/TillmannC.VogelS.NeyH.SawafH.ZubiagaA.--AcceleratedDP-basedSearchforStatisticalTranslation--1997.pdf Accelerated DP Based Search for Statistical Translation]&#039;&#039;&amp;lt;/ref&amp;gt; (PER) is a simple measure which counts the number of correct words in the MT output, regardless of their position. It is calculated using the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text{PER} = 1 - \frac{\text{correct} - \max(0, c - r)}{r}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; is the number of tokens in the reference translation and candidate translation, respectively.&lt;br /&gt;
&lt;br /&gt;
== BLEU ==&lt;br /&gt;
&lt;br /&gt;
BLEU&amp;lt;ref name=&amp;quot;bleu&amp;quot;&amp;gt;Kishore Papineni, Salim Roukos, Todd Ward, Wei-Jing Zhu. &#039;&#039;[http://www.aclweb.org/anthology/P02-1040.pdf BLEU: a Method for Automatic Evaluation of Machine Translation]&#039;&#039;&amp;lt;/ref&amp;gt; (Bilingual evaluation understudy) remains the most popular metric for automatic evaluation of MT output quality.&lt;br /&gt;
&lt;br /&gt;
While PER only looks at individual words, BLEU considers also sequences of words. Informally, we can describe BLEU as the amount of overlap of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-grams between the candidate translation and the reference (more specifically unigrams, bigrams, trigrams and 4-grams, in the standard formulation).&lt;br /&gt;
&lt;br /&gt;
The formal definition is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\text{BLEU} = \text{BP} \cdot \exp \sum_{i=1}^{n}(\lambda_i \log p_i)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where (almost always) &amp;lt;math&amp;gt;\lambda_i = 1/n&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 4&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;p_i&amp;lt;/math&amp;gt; stand for &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;-gram precision, i.e. the number of &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;-grams in the candidate translation which are confirmed by the reference.&lt;br /&gt;
&lt;br /&gt;
Each reference n-gram can be used to confirm the candidate n-gram only once (&#039;&#039;clipping&#039;&#039;), making it impossible to game BLEU by producing many occurrences of a single common word (such as &#039;&#039;&amp;quot;the&amp;quot;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
BP stands for &#039;&#039;brevity penalty&#039;&#039;. Since BLEU is a kind of precision, short outputs (which only contain words that the system is sure about) would score highly without BP. This penalty is defined simply as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\text{BP} = \begin{cases} 1, &amp;amp; \mbox{if }  c &amp;gt; r \\ \exp(1 - r/c),  &amp;amp; \mbox{if } c \leq r. \end{cases}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; is again the number of tokens in the reference translation and candidate translation, respectively.&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
&lt;br /&gt;
Consider the following situation:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!Source &lt;br /&gt;
|Vom Glück der traumenden Kamele&lt;br /&gt;
|colspan=&amp;quot;4&amp;quot;|Confirmed&lt;br /&gt;
|-&lt;br /&gt;
!Reference&lt;br /&gt;
|On the happiness of dreaming camels&lt;br /&gt;
|1&lt;br /&gt;
|2&lt;br /&gt;
|3&lt;br /&gt;
|4&lt;br /&gt;
|-&lt;br /&gt;
!MT Output&lt;br /&gt;
|The happiness of dreaming camels&lt;br /&gt;
|5&lt;br /&gt;
|4&lt;br /&gt;
|3&lt;br /&gt;
|2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The number of confirmed MT n-grams is 5, 4, 3, 2 respectively for unigrams, bigrams etc. The MT output is one word shorter than the reference, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text{BP} = \exp(1 - 6/5) \doteq 0.82&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The geometric mean of precisions is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\exp(\frac{1}{4} \log(\frac{5}{6}) + \frac{1}{4} \log (\frac{4}{5}) + \frac{1}{4} \log(\frac{3}{4}) + \frac{1}{4} \log(\frac{2}{3})) \doteq 0.76&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that you can equivalently take the fourth root of the product of the precisions, i.e. &amp;lt;math&amp;gt;\sqrt[4]{\frac{5}{6} \cdot \frac{4}{5} \cdot \frac{3}{4} \cdot \frac{2}{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The final BLEU score is then &amp;lt;math&amp;gt;0.82 \cdot 0.76 \doteq 0.62&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
BLEU is often mutliplied by 100 for readability.&lt;br /&gt;
&lt;br /&gt;
BLEU is a document-level metric. This means that counts of confirmed n-grams are collected for all sentences in the translated document and then the geometric mean of n-gram precisions is computed from the accumulated counts. For a single sentence, BLEU is often zero (since there is frequently no matching 4-gram or even trigram).&lt;br /&gt;
&lt;br /&gt;
=== Multiple Reference Translations ===&lt;br /&gt;
&lt;br /&gt;
BLEU supports multiple references. In that case, if an n-gram in the MT output is confirmed by &#039;&#039;any&#039;&#039; of the reference translations, it is counted as correct. If an n-gram occurs multiple times, it has to be seen in one of the references multiple times as well.&lt;br /&gt;
&lt;br /&gt;
The original paper is not clear about BP in this case. The usual practice is to take the reference translation which is closest in length to the MT output and calculate BP from that. (Note that even this specification is not unambiguous since there can be two closest references to the given hypothesis, the longer and the shorter one.)&lt;br /&gt;
&lt;br /&gt;
== Other Metrics ==&lt;br /&gt;
&lt;br /&gt;
* Translation Error Rate&amp;lt;ref name=&amp;quot;ter&amp;quot;&amp;gt;Matthew Snover, Bonnie Dorr, Richard Schwartz, Linnea Micciulla, John Makhoul. &#039;&#039;[https://www.cs.umd.edu/~snover/pub/amta06/ter_amta.pdf A Study of Translation Edit Rate with Targeted Human Annotation]&#039;&#039;&amp;lt;/ref&amp;gt; (TER) -- an edit-distance based metric on the level of phrases&lt;br /&gt;
&lt;br /&gt;
* METEOR&amp;lt;ref name=&amp;quot;meteor&amp;quot;&amp;gt;Alon Lavie, Michael Denkowski. &#039;&#039;[http://www.cs.cmu.edu/afs/cs.cmu.edu/project/mteval-1/Papers/MT-Journal-2009/meteor-mtj-2009.pdf The METEOR Metric for Automatic Evaluation of Machine Translation]&#039;&#039;&amp;lt;/ref&amp;gt; -- a robust metric with support for paraphrasing&lt;br /&gt;
&lt;br /&gt;
== Exercises ==&lt;br /&gt;
&lt;br /&gt;
* [https://codex3.ms.mff.cuni.cz/codex-trans/?groupId=3&amp;amp;taskId=8&amp;amp;module=groups%2Ftasks&amp;amp;page=specification Implement BLEU] &lt;br /&gt;
* [https://codex3.ms.mff.cuni.cz/codex-trans/?groupId=3&amp;amp;taskId=9&amp;amp;module=groups%2Ftasks&amp;amp;page=specification Implement PER]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bojar</name></author>
	</entry>
	<entry>
		<id>https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=MT_Evaluation_in_General&amp;diff=269</id>
		<title>MT Evaluation in General</title>
		<link rel="alternate" type="text/html" href="https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=MT_Evaluation_in_General&amp;diff=269"/>
		<updated>2015-01-28T08:06:59Z</updated>

		<summary type="html">&lt;p&gt;Bojar: new link to video&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox&lt;br /&gt;
|title = Lecture 4: General MT Evaluation&lt;br /&gt;
|image = [[File:worker.png|200px]]&lt;br /&gt;
|label1 = Lecture video:&lt;br /&gt;
|data1 = [http://example.com web &#039;&#039;&#039;TODO&#039;&#039;&#039;] &amp;lt;br/&amp;gt; [http://youtu.be/kSVb4-xI0Fw Youtube]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{#ev:youtube|kSVb4-xI0Fw|800|center}}&lt;br /&gt;
&lt;br /&gt;
== Data Splits ==&lt;br /&gt;
&lt;br /&gt;
Available training data is usually split into several parts, e.g. &#039;&#039;&#039;training&#039;&#039;&#039;, &#039;&#039;&#039;development&#039;&#039;&#039; (held-out) and &#039;&#039;&#039;(dev-)test&#039;&#039;&#039;. Training data is used to estimate model parameters, development set can be used for model selection, hyperparameter tuning etc. and dev-test is used for continuous evaluation of progress (are we doing better than before?).&lt;br /&gt;
&lt;br /&gt;
However, you should always keep an additional &#039;&#039;&#039;(final) test set&#039;&#039;&#039; which is used only very rarely. Evaluating your system on the final test set can then be used as a rough estimate of its true performance because you do not use it in the development process at all, and therefore do not bias your system towards it.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;golden rule&amp;quot; of (MT) evaluation: &#039;&#039;&#039;Evaluate on unseen data!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Approaches to Evaluation ==&lt;br /&gt;
&lt;br /&gt;
Let us first introduce the example that we will use throughout the section:&lt;br /&gt;
&lt;br /&gt;
=== Example Sentence + Translations ===&lt;br /&gt;
&lt;br /&gt;
Original German sentence:&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;Arbeiter sturzte von Leiter: schwer verletzt&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
English reference translation:&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;Worker falls from ladder: seriously injured&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! Translation Candidate&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;A&#039;&#039;&#039; &#039;&#039;Workers rushed from director: Seriously injured&#039;&#039;&lt;br /&gt;
| plural (workers), bad choice of verb (rushed), &#039;&#039;Leiter&#039;&#039; mistranslated as &#039;&#039;director&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;B&#039;&#039;&#039; &#039;&#039;Workers fell from ladder: hurt&#039;&#039;&lt;br /&gt;
| plural (workers), intensifier missing &lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;C&#039;&#039;&#039; &#039;&#039;Worker rushed from ladder: schwer verletzt&#039;&#039;&lt;br /&gt;
| bad choice of verb (rushed), tail is left untranslated&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;D&#039;&#039;&#039; &#039;&#039;Worker fell from leader: heavily injures&#039;&#039;&lt;br /&gt;
| &#039;&#039;Leiter&#039;&#039; translated as &#039;&#039;leader&#039;&#039; (not a typo, a bad lexical choice), poor morphological choices&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Absolute Ranking ===&lt;br /&gt;
&lt;br /&gt;
We put each translation into a category that best describes its quality. The following categories can be used:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| &#039;&#039;&#039;Worth publishing&#039;&#039;&#039;&lt;br /&gt;
| Translation is almost perfect, can be published as-is.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Worth editing&#039;&#039;&#039;&lt;br /&gt;
| Translation contains minor errors which can be quickly fixed by a human post-editor.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Worth reading&#039;&#039;&#039;&lt;br /&gt;
| Translation contains major errors but can be used for rough understanding of the text (&#039;&#039;gisting&#039;&#039;).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If we define our categories like this, probably all example translations fall in the &#039;&#039;worth editing&#039;&#039; bin.&lt;br /&gt;
&lt;br /&gt;
We can also separate our assessment of translation quality into different aspects (or dimensions). One division that has been used extensively for MT evaluation is:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Adequacy&#039;&#039;&#039; -- how faithfully does the translation capture the meaning of the source sentence&lt;br /&gt;
* &#039;&#039;&#039;Fluency&#039;&#039;&#039; -- is the translation a grammatical, fluent sentence in the target language? (regardless of meaning)&lt;br /&gt;
&lt;br /&gt;
In this case, e.g. candidate &#039;&#039;&#039;A&#039;&#039;&#039; could be marked as &#039;&#039;worth publishing&#039;&#039; in terms of fluency, while it is &#039;&#039;worth reading&#039;&#039; at best in terms of adequacy.&lt;br /&gt;
&lt;br /&gt;
=== Relative Ranking ===&lt;br /&gt;
&lt;br /&gt;
In this case, we avoid assigning translations into categories and instead ask the human judge(s) to rank the possible translations relative to one another. (Human [http://en.wikipedia.org/wiki/Inter-rater_reliability inter-annotator agreement] can be surprisingly low in both scenarios, though.)&lt;br /&gt;
&lt;br /&gt;
In our example, we would probably order the systems (from best to worst): &#039;&#039;&#039;B &amp;gt; D &amp;gt; C &amp;gt; A&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different annotators could come up with different rankings. Ranking can also differ according to the intended &#039;&#039;&#039;purpose&#039;&#039;&#039; of the translations -- if a human translator is supposed to post-edit the translation, major errors in adequacy (such as spurious/missing negation) might be easy to fix and therefore such translations could be ranked higher than factually correct translations with lots of small errors.&lt;br /&gt;
&lt;br /&gt;
== Dimensions of Translation Quality ==&lt;br /&gt;
&lt;br /&gt;
Multidimensional Quality Metrics (MQM &amp;lt;ref name=&amp;quot;mqm&amp;quot;&amp;gt;Arle Richard Lommel, Aljoscha Burchardt, Hans Uszkoreit. &#039;&#039;[http://www.mt-archive.info/10/Aslib-2013-Lommel.pdf Multidimensional Quality Metrics: A Flexible System for Assessing Translation Quality]&#039;&#039;&amp;lt;/ref&amp;gt;) provides probably the greatest level of detail for various aspects (or dimensions) of translation quality:&lt;br /&gt;
&lt;br /&gt;
[[File:mqm.png|800px]]&lt;br /&gt;
&lt;br /&gt;
== Space of Possible Translations ==&lt;br /&gt;
&lt;br /&gt;
An inherent issue with MT evaluation is the fact that there is usually more than one correct translation. In fact, several experiments&amp;lt;ref name=&amp;quot;deprefset&amp;quot;&amp;gt;Ondřej Bojar, Matouš Machaček, Aleš Tamchyna, Daniel Zeman. &#039;&#039;[https://ufal.mff.cuni.cz/~tamchyna/papers/2013-tsd.pdf Scratching the Surface of Possible Translations]&#039;&#039;&amp;lt;/ref&amp;gt;&amp;lt;ref name=&amp;quot;hyter&amp;quot;&amp;gt;Markus Dreyer, Daniel Marcu. &#039;&#039;[http://www.aclweb.org/anthology/N12-1017 HyTER: Meaning-Equivalent Semantics for Translation Evaluation]&#039;&#039;&amp;lt;/ref&amp;gt; show that there can be as many as hundreds of thousands or even millions of correct translations per a single sentence.&lt;br /&gt;
&lt;br /&gt;
Such a high number of possible translations is mainly caused by the flexibility of lexical choice and word order. (In our example, the German word &amp;quot;&#039;&#039;Arbeiter&#039;&#039;&amp;quot; can be translated into English as &amp;quot;&#039;&#039;worker&#039;&#039;&amp;quot; or &amp;quot;&#039;&#039;employee&#039;&#039;&amp;quot;.) Every such decision multiplies the number of translations, which thus grows exponentially.&lt;br /&gt;
&lt;br /&gt;
Despite this fact, when we train or evaluate translation systems, we often rely on just a single reference translation.&lt;br /&gt;
&lt;br /&gt;
== Translation Evaluation Campaigns ==&lt;br /&gt;
&lt;br /&gt;
There are several academic workshops where the quality of various translation systems is compared. Such &amp;quot;competitions&amp;quot; require manual evaluation. Their methodology evolves to make the results as fair and statistically sound as possible. The most prominent ones include:&lt;br /&gt;
&lt;br /&gt;
[http://www.statmt.org/wmt14/ Workshop on Statistical Machine Translation (WMT)]&lt;br /&gt;
&lt;br /&gt;
[http://workshop2014.iwslt.org/ International Workshop on Spoken Language Translation (IWSLT)]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bojar</name></author>
	</entry>
	<entry>
		<id>https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=MT_Talks&amp;diff=268</id>
		<title>MT Talks</title>
		<link rel="alternate" type="text/html" href="https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=MT_Talks&amp;diff=268"/>
		<updated>2015-01-27T17:35:37Z</updated>

		<summary type="html">&lt;p&gt;Bojar: /* Our Talks */ rephrased&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:banner.png]]&lt;br /&gt;
&lt;br /&gt;
MT Talks is a series of mini-lectures on machine translation.&lt;br /&gt;
&lt;br /&gt;
Our goal is to hit just the right level of detail and technicality to make the talks interesting and attractive to people who are not yet familiar with the field but mix in new observations and insights so that even old pals will have a reason to watch us.&lt;br /&gt;
&lt;br /&gt;
MT Talks and the expanded notes on this wiki will never be the ultimate resource for MT, but we would be very happy to serve as an ultimate commented &#039;&#039;directory&#039;&#039; of good pointers.&lt;br /&gt;
&lt;br /&gt;
By the way, this is indeed a Wiki, so your contributions are very welcome! Please register and feel free to add comments, corrections or links to useful resources.&lt;br /&gt;
&lt;br /&gt;
== Our Talks ==&lt;br /&gt;
&lt;br /&gt;
01 &#039;&#039;&#039;[[Intro]]&#039;&#039;&#039;: Why is MT difficult, Approaches to MT.&lt;br /&gt;
&lt;br /&gt;
02 &#039;&#039;&#039;[[MT that Deceives]]&#039;&#039;&#039;: Serious translation errors even for short and simple inputs.&lt;br /&gt;
&lt;br /&gt;
03 &#039;&#039;&#039;[[Pre-processing]]&#039;&#039;&#039;: Normalization and other technical tricks bound to help your MT system.&lt;br /&gt;
&lt;br /&gt;
04 &#039;&#039;&#039;[[MT Evaluation in General]]&#039;&#039;&#039;: Techniques of judging MT quality, dimensions of translation quality, number of possible translations.&lt;br /&gt;
&lt;br /&gt;
== CodEx ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [https://codex3.ms.mff.cuni.cz/codex-trans/ Log in to CodEx] and solve programming exercises that complement our talks.&lt;br /&gt;
* [[CodEx-Introduction|Brief description of CodEx]]: how to get an account and submit a solution.&lt;br /&gt;
&lt;br /&gt;
== Other Videolectures on MT ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.upc.edu/learning/courses/mooc/2014-2015/approaches-to-machine/approaches-to-machine Approaches to Machine Translation: Rule-Based, Statistical, Hybrid] (an online course on MT by UPC Barcelona)&lt;br /&gt;
* [https://www.coursera.org/course/nlangp Natural Language Processing at Coursera] by Michael Collins, includes lectures on word-based and phrase-based models. [http://www.cs.columbia.edu/~mcollins/notes-spring2013.html Further notes]&lt;br /&gt;
&lt;br /&gt;
== Acknowledgement ==&lt;br /&gt;
&lt;br /&gt;
The work on this project has been supported by the grant FP7-ICT-2011-7-288487 ([http://www.statmt.org/mosescore/ MosesCore]).&lt;/div&gt;</summary>
		<author><name>Bojar</name></author>
	</entry>
	<entry>
		<id>https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=MT_Talks&amp;diff=267</id>
		<title>MT Talks</title>
		<link rel="alternate" type="text/html" href="https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=MT_Talks&amp;diff=267"/>
		<updated>2015-01-27T17:34:04Z</updated>

		<summary type="html">&lt;p&gt;Bojar: /* Our Talks */ revealing 04&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:banner.png]]&lt;br /&gt;
&lt;br /&gt;
MT Talks is a series of mini-lectures on machine translation.&lt;br /&gt;
&lt;br /&gt;
Our goal is to hit just the right level of detail and technicality to make the talks interesting and attractive to people who are not yet familiar with the field but mix in new observations and insights so that even old pals will have a reason to watch us.&lt;br /&gt;
&lt;br /&gt;
MT Talks and the expanded notes on this wiki will never be the ultimate resource for MT, but we would be very happy to serve as an ultimate commented &#039;&#039;directory&#039;&#039; of good pointers.&lt;br /&gt;
&lt;br /&gt;
By the way, this is indeed a Wiki, so your contributions are very welcome! Please register and feel free to add comments, corrections or links to useful resources.&lt;br /&gt;
&lt;br /&gt;
== Our Talks ==&lt;br /&gt;
&lt;br /&gt;
01 &#039;&#039;&#039;[[Intro]]&#039;&#039;&#039;: Why is MT difficult, Approaches to MT.&lt;br /&gt;
&lt;br /&gt;
02 &#039;&#039;&#039;[[MT that Deceives]]&#039;&#039;&#039;: Serious translation errors even for short and simple inputs.&lt;br /&gt;
&lt;br /&gt;
03 &#039;&#039;&#039;[[Pre-processing]]&#039;&#039;&#039;: Normalization and other technical tricks bound to help your MT system.&lt;br /&gt;
&lt;br /&gt;
04 &#039;&#039;&#039;[[MT Evaluation in General]]&#039;&#039;&#039;: Zillion as the number of correct translations of a sentence, techniques of judging MT quality.&lt;br /&gt;
&lt;br /&gt;
== CodEx ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [https://codex3.ms.mff.cuni.cz/codex-trans/ Log in to CodEx] and solve programming exercises that complement our talks.&lt;br /&gt;
* [[CodEx-Introduction|Brief description of CodEx]]: how to get an account and submit a solution.&lt;br /&gt;
&lt;br /&gt;
== Other Videolectures on MT ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.upc.edu/learning/courses/mooc/2014-2015/approaches-to-machine/approaches-to-machine Approaches to Machine Translation: Rule-Based, Statistical, Hybrid] (an online course on MT by UPC Barcelona)&lt;br /&gt;
* [https://www.coursera.org/course/nlangp Natural Language Processing at Coursera] by Michael Collins, includes lectures on word-based and phrase-based models. [http://www.cs.columbia.edu/~mcollins/notes-spring2013.html Further notes]&lt;br /&gt;
&lt;br /&gt;
== Acknowledgement ==&lt;br /&gt;
&lt;br /&gt;
The work on this project has been supported by the grant FP7-ICT-2011-7-288487 ([http://www.statmt.org/mosescore/ MosesCore]).&lt;/div&gt;</summary>
		<author><name>Bojar</name></author>
	</entry>
	<entry>
		<id>https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=Admin_RootPage&amp;diff=266</id>
		<title>Admin RootPage</title>
		<link rel="alternate" type="text/html" href="https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=Admin_RootPage&amp;diff=266"/>
		<updated>2015-01-27T16:39:46Z</updated>

		<summary type="html">&lt;p&gt;Bojar: renamed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;0x : How to get started with CodEx MT exercises&lt;br /&gt;
&lt;br /&gt;
04 &#039;&#039;&#039;[[MT Evaluation in General]]&#039;&#039;&#039;: TODO popisek&lt;/div&gt;</summary>
		<author><name>Bojar</name></author>
	</entry>
	<entry>
		<id>https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=MT_Evaluation_in_General&amp;diff=265</id>
		<title>MT Evaluation in General</title>
		<link rel="alternate" type="text/html" href="https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=MT_Evaluation_in_General&amp;diff=265"/>
		<updated>2015-01-27T16:39:08Z</updated>

		<summary type="html">&lt;p&gt;Bojar: Bojar moved page General MT Evaluation to MT Evaluation in General without leaving a redirect&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox&lt;br /&gt;
|title = Lecture 4: General MT Evaluation&lt;br /&gt;
|image = [[File:worker.png|200px]]&lt;br /&gt;
|label1 = Lecture video:&lt;br /&gt;
|data1 = [http://example.com web &#039;&#039;&#039;TODO&#039;&#039;&#039;] &amp;lt;br/&amp;gt; [http://www.youtube.com/watch?v=_QL-BUxIIhU Youtube]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{#ev:youtube|_QL-BUxIIhU|800|center}}&lt;br /&gt;
&lt;br /&gt;
== Data Splits ==&lt;br /&gt;
&lt;br /&gt;
Available training data is usually split into several parts, e.g. &#039;&#039;&#039;training&#039;&#039;&#039;, &#039;&#039;&#039;development&#039;&#039;&#039; (held-out) and &#039;&#039;&#039;(dev-)test&#039;&#039;&#039;. Training data is used to estimate model parameters, development set can be used for model selection, hyperparameter tuning etc. and dev-test is used for continuous evaluation of progress (are we doing better than before?).&lt;br /&gt;
&lt;br /&gt;
However, you should always keep an additional &#039;&#039;&#039;(final) test set&#039;&#039;&#039; which is used only very rarely. Evaluating your system on the final test set can then be used as a rough estimate of its true performance because you do not use it in the development process at all, and therefore do not bias your system towards it.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;golden rule&amp;quot; of (MT) evaluation: &#039;&#039;&#039;Evaluate on unseen data!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Approaches to Evaluation ==&lt;br /&gt;
&lt;br /&gt;
Let us first introduce the example that we will use throughout the section:&lt;br /&gt;
&lt;br /&gt;
=== Example Sentence + Translations ===&lt;br /&gt;
&lt;br /&gt;
Original German sentence:&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;Arbeiter sturzte von Leiter: schwer verletzt&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
English reference translation:&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;Worker falls from ladder: seriously injured&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! Translation Candidate&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;A&#039;&#039;&#039; &#039;&#039;Workers rushed from director: Seriously injured&#039;&#039;&lt;br /&gt;
| plural (workers), bad choice of verb (rushed), &#039;&#039;Leiter&#039;&#039; mistranslated as &#039;&#039;director&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;B&#039;&#039;&#039; &#039;&#039;Workers fell from ladder: hurt&#039;&#039;&lt;br /&gt;
| plural (workers), intensifier missing &lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;C&#039;&#039;&#039; &#039;&#039;Worker rushed from ladder: schwer verletzt&#039;&#039;&lt;br /&gt;
| bad choice of verb (rushed), tail is left untranslated&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;D&#039;&#039;&#039; &#039;&#039;Worker fell from leader: heavily injures&#039;&#039;&lt;br /&gt;
| &#039;&#039;Leiter&#039;&#039; translated as &#039;&#039;leader&#039;&#039; (not a typo, a bad lexical choice), poor morphological choices&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Absolute Ranking ===&lt;br /&gt;
&lt;br /&gt;
We put each translation into a category that best describes its quality. The following categories can be used:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| &#039;&#039;&#039;Worth publishing&#039;&#039;&#039;&lt;br /&gt;
| Translation is almost perfect, can be published as-is.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Worth editing&#039;&#039;&#039;&lt;br /&gt;
| Translation contains minor errors which can be quickly fixed by a human post-editor.&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Worth reading&#039;&#039;&#039;&lt;br /&gt;
| Translation contains major errors but can be used for rough understanding of the text (&#039;&#039;gisting&#039;&#039;).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If we define our categories like this, probably all example translations fall in the &#039;&#039;worth editing&#039;&#039; bin.&lt;br /&gt;
&lt;br /&gt;
We can also separate our assessment of translation quality into different aspects (or dimensions). One division that has been used extensively for MT evaluation is:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Adequacy&#039;&#039;&#039; -- how faithfully does the translation capture the meaning of the source sentence&lt;br /&gt;
* &#039;&#039;&#039;Fluency&#039;&#039;&#039; -- is the translation a grammatical, fluent sentence in the target language? (regardless of meaning)&lt;br /&gt;
&lt;br /&gt;
In this case, e.g. candidate &#039;&#039;&#039;A&#039;&#039;&#039; could be marked as &#039;&#039;worth publishing&#039;&#039; in terms of fluency, while it is &#039;&#039;worth reading&#039;&#039; at best in terms of adequacy.&lt;br /&gt;
&lt;br /&gt;
=== Relative Ranking ===&lt;br /&gt;
&lt;br /&gt;
In this case, we avoid assigning translations into categories and instead ask the human judge(s) to rank the possible translations relative to one another. (Human [http://en.wikipedia.org/wiki/Inter-rater_reliability inter-annotator agreement] can be surprisingly low in both scenarios, though.)&lt;br /&gt;
&lt;br /&gt;
In our example, we would probably order the systems (from best to worst): &#039;&#039;&#039;B &amp;gt; D &amp;gt; C &amp;gt; A&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different annotators could come up with different rankings. Ranking can also differ according to the intended &#039;&#039;&#039;purpose&#039;&#039;&#039; of the translations -- if a human translator is supposed to post-edit the translation, major errors in adequacy (such as spurious/missing negation) might be easy to fix and therefore such translations could be ranked higher than factually correct translations with lots of small errors.&lt;br /&gt;
&lt;br /&gt;
== Dimensions of Translation Quality ==&lt;br /&gt;
&lt;br /&gt;
Multidimensional Quality Metrics (MQM &amp;lt;ref name=&amp;quot;mqm&amp;quot;&amp;gt;Arle Richard Lommel, Aljoscha Burchardt, Hans Uszkoreit. &#039;&#039;[http://www.mt-archive.info/10/Aslib-2013-Lommel.pdf Multidimensional Quality Metrics: A Flexible System for Assessing Translation Quality]&#039;&#039;&amp;lt;/ref&amp;gt;) provides probably the greatest level of detail for various aspects (or dimensions) of translation quality:&lt;br /&gt;
&lt;br /&gt;
[[File:mqm.png|800px]]&lt;br /&gt;
&lt;br /&gt;
== Space of Possible Translations ==&lt;br /&gt;
&lt;br /&gt;
An inherent issue with MT evaluation is the fact that there is usually more than one correct translation. In fact, several experiments&amp;lt;ref name=&amp;quot;deprefset&amp;quot;&amp;gt;Ondřej Bojar, Matouš Machaček, Aleš Tamchyna, Daniel Zeman. &#039;&#039;[https://ufal.mff.cuni.cz/~tamchyna/papers/2013-tsd.pdf Scratching the Surface of Possible Translations]&#039;&#039;&amp;lt;/ref&amp;gt;&amp;lt;ref name=&amp;quot;hyter&amp;quot;&amp;gt;Markus Dreyer, Daniel Marcu. &#039;&#039;[http://www.aclweb.org/anthology/N12-1017 HyTER: Meaning-Equivalent Semantics for Translation Evaluation]&#039;&#039;&amp;lt;/ref&amp;gt; show that there can be as many as hundreds of thousands or even millions of correct translations per a single sentence.&lt;br /&gt;
&lt;br /&gt;
Such a high number of possible translations is mainly caused by the flexibility of lexical choice and word order. (In our example, the German word &amp;quot;&#039;&#039;Arbeiter&#039;&#039;&amp;quot; can be translated into English as &amp;quot;&#039;&#039;worker&#039;&#039;&amp;quot; or &amp;quot;&#039;&#039;employee&#039;&#039;&amp;quot;.) Every such decision multiplies the number of translations, which thus grows exponentially.&lt;br /&gt;
&lt;br /&gt;
Despite this fact, when we train or evaluate translation systems, we often rely on just a single reference translation.&lt;br /&gt;
&lt;br /&gt;
== Translation Evaluation Campaigns ==&lt;br /&gt;
&lt;br /&gt;
There are several academic workshops where the quality of various translation systems is compared. Such &amp;quot;competitions&amp;quot; require manual evaluation. Their methodology evolves to make the results as fair and statistically sound as possible. The most prominent ones include:&lt;br /&gt;
&lt;br /&gt;
[http://www.statmt.org/wmt14/ Workshop on Statistical Machine Translation (WMT)]&lt;br /&gt;
&lt;br /&gt;
[http://workshop2014.iwslt.org/ International Workshop on Spoken Language Translation (IWSLT)]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bojar</name></author>
	</entry>
	<entry>
		<id>https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=Pre-processing&amp;diff=232</id>
		<title>Pre-processing</title>
		<link rel="alternate" type="text/html" href="https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=Pre-processing&amp;diff=232"/>
		<updated>2015-01-20T09:51:00Z</updated>

		<summary type="html">&lt;p&gt;Bojar: /* Script/Characters */ link to homoglyphs.net&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox&lt;br /&gt;
|title = Lecture 3: Pre-processing&lt;br /&gt;
|image = [[File:bear-with-us.png|200px]]&lt;br /&gt;
|label1 = Lecture video:&lt;br /&gt;
|data1 = [http://example.com web &#039;&#039;&#039;TODO&#039;&#039;&#039;] &amp;lt;br/&amp;gt; [http://www.youtube.com/watch?v=GDij7urWeOk Youtube]&lt;br /&gt;
|label2 = Exercises:&lt;br /&gt;
|data2 = [https://codex3.ms.mff.cuni.cz/codex-trans/?groupId=3&amp;amp;taskId=6&amp;amp;module=groups%2Ftasks&amp;amp;page=specification Lowercasing] &amp;lt;br/&amp;gt; [https://codex3.ms.mff.cuni.cz/codex-trans/?groupId=3&amp;amp;taskId=7&amp;amp;module=groups%2Ftasks&amp;amp;page=specification Deaccenting]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{#ev:youtube|GDij7urWeOk|800|center}}&lt;br /&gt;
&lt;br /&gt;
Overall, the task of MT data pre-processing is to &#039;&#039;drop any distinctions that are not important for the output&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Inspecting Text Data ==&lt;br /&gt;
&lt;br /&gt;
=== Text Encoding ===&lt;br /&gt;
&lt;br /&gt;
Two texts that look the same might not be identical. MT systems do not see the strings as humans do but instead, they work with the actual byte representation. Therefore, data pre-processing is a very important step in system development.&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.com/wiki/Unicode Unicode] includes a number of special characters which can complicate text processing for an MT system developer. The following table contains examples of some of the more devious characters:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! Code&lt;br /&gt;
! Name&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;U+200B&#039;&#039;&#039;&lt;br /&gt;
|Zero-width space&lt;br /&gt;
|An invisible space.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;U+200E&#039;&#039;&#039;&lt;br /&gt;
|Left-to-right mark&lt;br /&gt;
|An invisible character used in texts with mixed scripts (e.g. Latin and Arabic) to indicate reading direction.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;U+2028&#039;&#039;&#039;&lt;br /&gt;
|Line separator&lt;br /&gt;
|A Unicode newline which is often not interpreted by text editors (and can be invisible).&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;U+2029&#039;&#039;&#039;&lt;br /&gt;
|Paragraph separator&lt;br /&gt;
|Separates paragraphs, implies a new line (also often ignored).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[http://www.decodeunicode.org/ Decode Unicode] is a useful webpage with information on Unicode characters.&lt;br /&gt;
&lt;br /&gt;
Often, a file [http://en.wikipedia.org/wiki/Hex_dump hexdump] is the most useful diagnostic tool. E.g. the Linux command &#039;&#039;&#039;xxd&#039;&#039;&#039; provides the necessary functionality.&lt;br /&gt;
&lt;br /&gt;
=== Script/Characters ===&lt;br /&gt;
&lt;br /&gt;
Unicode often provides many ways how to write a single character. For example, the letter &amp;quot;&#039;&#039;&#039;a&#039;&#039;&#039;&amp;quot; might be written with Latin or Cyrillic script. A nice summary of Latin-like alphabets is available at [http://homoglyphs.net/ homoglyphs.net]&lt;br /&gt;
&lt;br /&gt;
Aside from seemingly identical, but differently encoded characters, problems commonly seen in data include:&lt;br /&gt;
&lt;br /&gt;
* Confusion of &#039;&#039;&#039;0&#039;&#039;&#039; (zero) and &#039;&#039;&#039;O&#039;&#039;&#039; (capital letter)&lt;br /&gt;
* Inconsistent letter case: English word &#039;&#039;&#039;I&#039;&#039;&#039; written in lowercase etc. (notorious e.g. in movie subtitles)&lt;br /&gt;
* Various systematic mis-spellings -- all of these variants of &amp;quot;I&#039;ll&amp;quot; (I will) were observed in movie subtitles: &#039;&#039;&#039;i&#039;ll Ill l&#039;ll 1&#039;ll 1&#039;11&#039;&#039;&#039;&lt;br /&gt;
* Different symbols for various punctuation (quotes, dashes, apostrophe etc.)&lt;br /&gt;
&lt;br /&gt;
=== VIM tips ===&lt;br /&gt;
&lt;br /&gt;
A good text editor is an essential pre-requisite for successful inspection of text data and the implementation of suitable pre-processing. We provide several random tips for the VIM editor:&lt;br /&gt;
&lt;br /&gt;
Set file encoding to UTF-8:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;:set encoding=utf8&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Show the code of character under cursor:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;ga&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Set or remove BOM (byte-order mark) for current file:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;:set bomb&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;:set nobomb&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Spot Five Differences ===&lt;br /&gt;
&lt;br /&gt;
A text file with the Russian word &#039;&#039;&amp;quot;чай&amp;quot;&#039;&#039; (tea) can be written in seemingly identical ways which however differ significantly on byte level.&lt;br /&gt;
&lt;br /&gt;
First is the very file beginning, which may and may not include the Unicode byte-order-mark symbol (BOM), which is 3 bytes long.&lt;br /&gt;
&lt;br /&gt;
The second and third difference is the presence of two Unicode non-printing characters, namely zero-width space and left-to-right direction mark.&lt;br /&gt;
&lt;br /&gt;
The fourth difference is the code for the letter &#039;&#039;&amp;quot;a&amp;quot;&#039;&#039; which can be written either in Latin or in Cyrillic script (looks identical).&lt;br /&gt;
&lt;br /&gt;
The fifth, final difference is the representation of the last letter &#039;&#039;&amp;quot;й&amp;quot;&#039;&#039;. It can be written either as one letter or as &#039;&#039;&amp;quot;и&amp;quot;&#039;&#039; followed by a wedge (the diacritics).&lt;br /&gt;
&lt;br /&gt;
== Tokenization ==&lt;br /&gt;
&lt;br /&gt;
The most suitable tokenization can be task-dependent. For example, in parsing, we would like to keep adjectives such as &amp;quot;red-haired&amp;quot; as one word, while for phrase-based MT, it is useful to split such words.&lt;br /&gt;
&lt;br /&gt;
A basic but quite robust approach is to split whenever the [http://www.regular-expressions.info/unicode.html Unicode character category] changes. Imagine reading the input character by character. When we observe that so far, there have been letters (category &#039;&#039;&#039;L&#039;&#039;&#039;) and suddenly, there is punctuation (category &#039;&#039;&#039;P&#039;&#039;&#039;), we insert a space. During the same process, it is useful to convert all whitespace (tabulators, spaces, non-breaking spaces and sequences of such) to a single space character.&lt;br /&gt;
&lt;br /&gt;
However, in many situations, a more sophisticated, linguistically motivated tokenization scheme is useful. E.g. for words such as &amp;quot;don&#039;t&amp;quot;, &amp;quot;could&#039;t&amp;quot;, &amp;quot;shouldn&#039;t&amp;quot;, we can obtain a nice generalization by splitting off &amp;quot;n&#039;t&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;don&#039;t -&amp;gt; do n&#039;t&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;shouldn&#039;t -&amp;gt; should n&#039;t&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;couldn&#039;t -&amp;gt; could n&#039;t&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It is essential for data tokenization to be &#039;&#039;&#039;consistent&#039;&#039;&#039;. All of our training data should conform to the same pre-processing scheme and an identical pipeline should be applied at test time (when our system runs and we translate new data).&lt;br /&gt;
&lt;br /&gt;
== Exercises ==&lt;br /&gt;
&lt;br /&gt;
This is the first lecture accompanied by programming exercises. Before starting, you should follow the [[CodEx-Introduction|instructions]] on how to use the CodEx submission system.&lt;br /&gt;
&lt;br /&gt;
Follow the links to see the description of each task and a submission interface with automatic evaluation of your solutions.&lt;br /&gt;
&lt;br /&gt;
* [https://codex3.ms.mff.cuni.cz/codex-trans/?groupId=3&amp;amp;taskId=6&amp;amp;module=groups%2Ftasks&amp;amp;page=specification Lowercasing]&lt;br /&gt;
* [https://codex3.ms.mff.cuni.cz/codex-trans/?groupId=3&amp;amp;taskId=7&amp;amp;module=groups%2Ftasks&amp;amp;page=specification Deaccenting]&lt;/div&gt;</summary>
		<author><name>Bojar</name></author>
	</entry>
	<entry>
		<id>https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=CodEx-Introduction&amp;diff=231</id>
		<title>CodEx-Introduction</title>
		<link rel="alternate" type="text/html" href="https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=CodEx-Introduction&amp;diff=231"/>
		<updated>2015-01-19T09:09:31Z</updated>

		<summary type="html">&lt;p&gt;Bojar: /* How to get a CodEx account */ updated the mailto form&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;When reading this page, you&#039;ve probably already gone a long way in learning about machine translation. Nice work!&lt;br /&gt;
&lt;br /&gt;
Our MT Talks are occasionally complemented with programming exercises. We invite you (and strongly recommend) to go beyond watching our videos and try solving some or all of these exercises. Pick a programming language from our choice, write the short program and submit it to our system for evaluation -- a set of fully automatic tests.&lt;br /&gt;
&lt;br /&gt;
The exercises are implemented in The Code Examiner (&#039;&#039;&#039;CodEx&#039;&#039;&#039;, https://codex3.ms.mff.cuni.cz/codex-trans/). This page briefly describes how to use CodEx in general:&lt;br /&gt;
&lt;br /&gt;
* How to get a CodEx account&lt;br /&gt;
* How to login to CodEx&lt;br /&gt;
* How to pick a task to solve&lt;br /&gt;
* How to submit a solution for evaluation&lt;br /&gt;
&lt;br /&gt;
The individual exercises are described both in the CodEx system, as well as on the corresponding MT talk page here.&lt;br /&gt;
&lt;br /&gt;
== How to get a CodEx account ==&lt;br /&gt;
&lt;br /&gt;
Before venturing your journey though all the tasks, you need to get an account. There are two options to obtain an account in CodEx&lt;br /&gt;
&lt;br /&gt;
=== For CUNI students ===&lt;br /&gt;
&lt;br /&gt;
[[File:codex-registration.png|thumb|200px|&#039;&#039;&#039;Codex Registration&#039;&#039;&#039; CUNI students]]&lt;br /&gt;
&lt;br /&gt;
Please access the SIS registration page: https://codex3.ms.mff.cuni.cz/codex-trans/?module=sisregistration. You will be asked to verify your account, then click &#039;&#039;&#039;verify&#039;&#039;&#039;. If everything is fine, you could proceed to create your own account by following the instruction.&lt;br /&gt;
&lt;br /&gt;
=== For non-CUNI students ===&lt;br /&gt;
&lt;br /&gt;
Please send an email to [mailto:mttalks@ufal.mff.cuni.cz?Subject=Request%20for%20MT%20Talks%20CodEx%20account&amp;amp;body=Hello!%0D%0A%0D%0APlease%20create%20a%20CodEx%20account%20for%20me.%0D%0A%0D%0AMy%20name:%09%0D%0AInstitution:%09%0D%0A%0D%0A%20Thank%20you. mttalks@ufal.mff.cuni.cz] mentioning your name and institution to request an account. He will create the account for you and add it to &#039;&#039;&#039;MT talks&#039;&#039;&#039; CodEx group right away.&lt;br /&gt;
&lt;br /&gt;
== How to login and join a group ==&lt;br /&gt;
&lt;br /&gt;
[[File:codex-welcome-page.png|thumb|200px|&#039;&#039;&#039;Codex Welcome&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Once you have your login alias/password, come back to the login page: https://codex3.ms.mff.cuni.cz/codex-trans. After logging in, you are directed to the welcome page which displays all documentation and news related to your account.&lt;br /&gt;
&lt;br /&gt;
In the left hand column, there is an internal link &#039;&#039;&#039;group&#039;&#039;&#039;. It directs to the list of all groups that you could join. When you join a group, you are responsible to do all the exercises of the group.&lt;br /&gt;
&lt;br /&gt;
[[File:codex-group.png|thumb|200px|&#039;&#039;&#039;List of groups&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
For MT talks exercises, please join the group &#039;&#039;&#039;MT talks&#039;&#039;&#039; if you have not done it yet (shown in picture: list of groups).&lt;br /&gt;
&lt;br /&gt;
== How to pick an exercise, solve it and submit your solution ==&lt;br /&gt;
&lt;br /&gt;
After joining a group, you are able to see all the exercises assigned to that group. &lt;br /&gt;
In the left-handed sidebar, under &#039;&#039;&#039;group -&amp;gt; task&#039;&#039;&#039;, there are three options: &#039;&#039;specification, new submit, submits&#039;&#039;. They mean &#039;&#039;read the specification, submit a new solution&#039;&#039; and &#039;&#039;manage old submissions&#039;&#039;, respectively.&lt;br /&gt;
&lt;br /&gt;
[[File:codex-submit.png|thumb|200px|&#039;&#039;&#039;Submit a new solution&#039;&#039;&#039;]]&lt;br /&gt;
[[File:codex-eval.png|thumb|200px|&#039;&#039;&#039;Manage your submissions&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
For every exercise, please read the specification carefully. You are asked to write a complete program (not just a function). You can pick any of these programming languages: &#039;&#039;Pascal, C, C++, C#, Haskell, Python and Java&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
Your solution has to fit in one single file and process standard input to standard output. &lt;br /&gt;
&lt;br /&gt;
To submit a solution, there are two ways:&lt;br /&gt;
* Upload from text area: You write your solution into the text box directly on the web page, select the extension according to your programming language, then submit. &lt;br /&gt;
* Upload from file: Simply write your solution into a file with an appropriate extension, upload and submit it.&lt;br /&gt;
&lt;br /&gt;
In the evaluation process, your program is run several times with several inputs to validate the correctness. There are also built-in time and memory limits, which any sensible solution should easily meet. You will pass the exercise if your program passes a given number of these tests, we generally require to pass all the tests.&lt;br /&gt;
&lt;br /&gt;
In the left-handed sidebar, under &#039;&#039;&#039;group&#039;&#039;&#039;, there are links to page &#039;&#039;&#039;results&#039;&#039;&#039; and &#039;&#039;&#039;bonus points&#039;&#039;&#039; where you can keep track of your results throughout the course.&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
&lt;br /&gt;
Exercise &#039;&#039;&#039;Hello World!&#039;&#039;&#039;: Your task is to write a program which reads names of people and says &#039;Hello&#039; to each of them. Each input line should be turned into a greeting.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Input&#039;&#039;&#039;: &amp;lt;&amp;lt; standard input &amp;gt;&amp;gt; &amp;lt; sample.in&lt;br /&gt;
&lt;br /&gt;
    John&lt;br /&gt;
    Marry&lt;br /&gt;
    Marry and Kate&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ouput&#039;&#039;&#039;: &amp;lt;&amp;lt;standard output &amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Hello John!&lt;br /&gt;
    Hello Marry!&lt;br /&gt;
    Hello Marry and Kate!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Sample solution&#039;&#039;&#039;: Read the input file line-by-line, trim the string, concatenate the line with &amp;quot;Hello &amp;quot; and &amp;quot;!&amp;quot; then print it.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Python&#039;&#039;&#039;&lt;br /&gt;
    #!/usr/bin/env python&lt;br /&gt;
    import fileinput&lt;br /&gt;
    if __name__ == &#039;__main__&#039;:&lt;br /&gt;
        for line in fileinput.input():&lt;br /&gt;
            print &amp;quot;Hello &amp;quot; + line.strip() + &amp;quot;!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To test it manually, run: ./helloworld.py sample.in&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Java&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    import java.io.BufferedReader;&lt;br /&gt;
    import java.io.InputStreamReader;&lt;br /&gt;
    import java.io.IOException;&lt;br /&gt;
    public class CodEx{&lt;br /&gt;
        public static void main(String[] args) {&lt;br /&gt;
            BufferedReader br = null;&lt;br /&gt;
            try {&lt;br /&gt;
                br = new BufferedReader(new InputStreamReader(System.in));&lt;br /&gt;
                String line;&lt;br /&gt;
                while ((line = br.readLine()) != null) {&lt;br /&gt;
                    System.out.println(&amp;quot;Hello &amp;quot; + line + &amp;quot;!&amp;quot;);&lt;br /&gt;
                }&lt;br /&gt;
            } catch (IOException e) {&lt;br /&gt;
                e.printStackTrace();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
To test it manually, run: javac CodEx.java; java CodEx &amp;lt; sample.in&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you choose Java to be your programming language, your program must not declare any package, the main class must be &amp;quot;CodEx&amp;quot;. For CodEx limitiations for other languages, please read the CodEx manual.&lt;/div&gt;</summary>
		<author><name>Bojar</name></author>
	</entry>
	<entry>
		<id>https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=Pre-processing&amp;diff=227</id>
		<title>Pre-processing</title>
		<link rel="alternate" type="text/html" href="https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=Pre-processing&amp;diff=227"/>
		<updated>2015-01-14T14:07:15Z</updated>

		<summary type="html">&lt;p&gt;Bojar: &amp;#039;MT&amp;#039; data preprocessing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox&lt;br /&gt;
|title = Lecture 3: Pre-processing&lt;br /&gt;
|image = [[File:bear-with-us.png|200px]]&lt;br /&gt;
|label1 = Lecture video:&lt;br /&gt;
|data1 = [http://example.com web &#039;&#039;&#039;TODO&#039;&#039;&#039;] &amp;lt;br/&amp;gt; [http://www.youtube.com/watch?v=GDij7urWeOk Youtube]&lt;br /&gt;
|label2 = Exercises:&lt;br /&gt;
|data2 = [https://codex3.ms.mff.cuni.cz/codex-trans/?exerciseId=1&amp;amp;module=exercises&amp;amp;page=specification Lowercasing] &amp;lt;br/&amp;gt; [https://codex3.ms.mff.cuni.cz/codex-trans/?exerciseId=2&amp;amp;module=exercises&amp;amp;page=specification Deaccenting]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{#ev:youtube|GDij7urWeOk|800|center}}&lt;br /&gt;
&lt;br /&gt;
Overall, the task of MT data pre-processing is to &#039;&#039;drop any distinctions that are not important for the output&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Inspecting Text Data ==&lt;br /&gt;
&lt;br /&gt;
=== Text Encoding ===&lt;br /&gt;
&lt;br /&gt;
Two texts that look the same might not be identical. MT systems do not see the strings as humans do but instead, they work with the actual byte representation. Therefore, data pre-processing is a very important step in system development.&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.com/wiki/Unicode Unicode] includes a number of special characters which can complicate text processing for an MT system developer. The following table contains examples of some of the more devious characters:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! Code&lt;br /&gt;
! Name&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;U+200B&#039;&#039;&#039;&lt;br /&gt;
|Zero-width space&lt;br /&gt;
|An invisible space.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;U+200E&#039;&#039;&#039;&lt;br /&gt;
|Left-to-right mark&lt;br /&gt;
|An invisible character used in texts with mixed scripts (e.g. Latin and Arabic) to indicate reading direction.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;U+2028&#039;&#039;&#039;&lt;br /&gt;
|Line separator&lt;br /&gt;
|A Unicode newline which is often not interpreted by text editors (and can be invisible).&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;U+2029&#039;&#039;&#039;&lt;br /&gt;
|Paragraph separator&lt;br /&gt;
|Separates paragraphs, implies a new line (also often ignored).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[http://www.decodeunicode.org/ Decode Unicode] is a useful webpage with information on Unicode characters.&lt;br /&gt;
&lt;br /&gt;
Often, a file [http://en.wikipedia.org/wiki/Hex_dump hexdump] is the most useful diagnostic tool. E.g. the Linux command &#039;&#039;&#039;xxd&#039;&#039;&#039; provides the necessary functionality.&lt;br /&gt;
&lt;br /&gt;
=== Script/Characters ===&lt;br /&gt;
&lt;br /&gt;
Unicode often provides many ways how to write a single character. For example, the letter &amp;quot;&#039;&#039;&#039;a&#039;&#039;&#039;&amp;quot; might be written with Latin or Cyrillic script.&lt;br /&gt;
&lt;br /&gt;
Aside from seemingly identical, but differently encoded characters, problems commonly seen in data include:&lt;br /&gt;
&lt;br /&gt;
* Confusion of &#039;&#039;&#039;0&#039;&#039;&#039; (zero) and &#039;&#039;&#039;O&#039;&#039;&#039; (capital letter)&lt;br /&gt;
* Inconsistent letter case: English word &#039;&#039;&#039;I&#039;&#039;&#039; written in lowercase etc. (notorious e.g. in movie subtitles)&lt;br /&gt;
* Various systematic mis-spellings -- all of these variants of &amp;quot;I&#039;ll&amp;quot; (I will) were observed in movie subtitles: &#039;&#039;&#039;i&#039;ll Ill l&#039;ll 1&#039;ll 1&#039;11&#039;&#039;&#039;&lt;br /&gt;
* Different symbols for various punctuation (quotes, dashes, apostrophe etc.) &lt;br /&gt;
&lt;br /&gt;
=== VIM tips ===&lt;br /&gt;
&lt;br /&gt;
A good text editor is an essential pre-requisite for successful inspection of text data and the implementation of suitable pre-processing. We provide several random tips for the VIM editor:&lt;br /&gt;
&lt;br /&gt;
Set file encoding to UTF-8:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;:set encoding=utf8&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Show the code of character under cursor:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;ga&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Set or remove BOM (byte-order mark) for current file:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;:set bomb&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;:set nobomb&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Spot Five Differences ===&lt;br /&gt;
&lt;br /&gt;
A text file with the Russian word &#039;&#039;&amp;quot;чай&amp;quot;&#039;&#039; (tea) can be written in seemingly identical ways which however differ significantly on byte level.&lt;br /&gt;
&lt;br /&gt;
First is the very file beginning, which may and may not include the Unicode byte-order-mark symbol (BOM), which is 3 bytes long.&lt;br /&gt;
&lt;br /&gt;
The second and third difference is the presence of two Unicode non-printing characters, namely zero-width space and left-to-right direction mark.&lt;br /&gt;
&lt;br /&gt;
The fourth difference is the code for the letter &#039;&#039;&amp;quot;a&amp;quot;&#039;&#039; which can be written either in Latin or in Cyrillic script (looks identical).&lt;br /&gt;
&lt;br /&gt;
The fifth, final difference is the representation of the last letter &#039;&#039;&amp;quot;й&amp;quot;&#039;&#039;. It can be written either as one letter or as &#039;&#039;&amp;quot;и&amp;quot;&#039;&#039; followed by a wedge (the diacritics).&lt;br /&gt;
&lt;br /&gt;
== Tokenization ==&lt;br /&gt;
&lt;br /&gt;
The most suitable tokenization can be task-dependent. For example, in parsing, we would like to keep adjectives such as &amp;quot;red-haired&amp;quot; as one word, while for phrase-based MT, it is useful to split such words.&lt;br /&gt;
&lt;br /&gt;
A basic but quite robust approach is to split whenever the [http://www.regular-expressions.info/unicode.html Unicode character category] changes. Imagine reading the input character by character. When we observe that so far, there have been letters (category &#039;&#039;&#039;L&#039;&#039;&#039;) and suddenly, there is punctuation (category &#039;&#039;&#039;P&#039;&#039;&#039;), we insert a space. During the same process, it is useful to convert all whitespace (tabulators, spaces, non-breaking spaces and sequences of such) to a single space character.&lt;br /&gt;
&lt;br /&gt;
However, in many situations, a more sophisticated, linguistically motivated tokenization scheme is useful. E.g. for words such as &amp;quot;don&#039;t&amp;quot;, &amp;quot;could&#039;t&amp;quot;, &amp;quot;shouldn&#039;t&amp;quot;, we can obtain a nice generalization by splitting off &amp;quot;n&#039;t&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;don&#039;t -&amp;gt; do n&#039;t&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;shouldn&#039;t -&amp;gt; should n&#039;t&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;couldn&#039;t -&amp;gt; could n&#039;t&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It is essential for data tokenization to be &#039;&#039;&#039;consistent&#039;&#039;&#039;. All of our training data should conform to the same pre-processing scheme and an identical pipeline should be applied at test time (when our system runs and we translate new data).&lt;/div&gt;</summary>
		<author><name>Bojar</name></author>
	</entry>
	<entry>
		<id>https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=Admin_RootPage&amp;diff=219</id>
		<title>Admin RootPage</title>
		<link rel="alternate" type="text/html" href="https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=Admin_RootPage&amp;diff=219"/>
		<updated>2015-01-13T09:57:49Z</updated>

		<summary type="html">&lt;p&gt;Bojar: links to codex&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;0x : How to get started with CodEx MT exercises&lt;br /&gt;
&lt;br /&gt;
03 &#039;&#039;&#039;[[Pre-processing]]&#039;&#039;&#039;: Normalization and other technical tricks bound to help your MT system.&lt;br /&gt;
&lt;br /&gt;
== CodEx ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 * [https://codex3.ms.mff.cuni.cz/codex-trans/ Log in to CodEx] and solve programming exercises that complement our talks.&lt;br /&gt;
 * [[CodEx-Introduction|Brief description of CodEx]]: how to get an account and submit a solution.&lt;/div&gt;</summary>
		<author><name>Bojar</name></author>
	</entry>
	<entry>
		<id>https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=CodEx-Introduction&amp;diff=218</id>
		<title>CodEx-Introduction</title>
		<link rel="alternate" type="text/html" href="https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=CodEx-Introduction&amp;diff=218"/>
		<updated>2015-01-13T09:50:49Z</updated>

		<summary type="html">&lt;p&gt;Bojar: /* How to pick an exercise, solve it and submit your solution */ various small changes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;When reading this page, you&#039;ve probably already gone a long way in learning about machine translation. Nice work!&lt;br /&gt;
&lt;br /&gt;
Our MT Talks are occasionally complemented with programming exercises. We invite you (and strongly recommend) to go beyond watching our videos and try solving some or all of these exercises. Pick a programming language from our choice, write the short program and submit it to our system for evaluation -- a set of fully automatic tests.&lt;br /&gt;
&lt;br /&gt;
The exercises are implemented in The Code Examiner (&#039;&#039;&#039;CodEx&#039;&#039;&#039;, https://codex3.ms.mff.cuni.cz/codex-trans/). This page briefly describes how to use CodEx in general:&lt;br /&gt;
&lt;br /&gt;
* How to get a CodEx account&lt;br /&gt;
* How to login to CodEx&lt;br /&gt;
* How to pick a task to solve&lt;br /&gt;
* How to submit a solution for evaluation&lt;br /&gt;
&lt;br /&gt;
The individual exercises are described both in the CodEx system, as well as on the corresponding MT talk page here.&lt;br /&gt;
&lt;br /&gt;
== How to get a CodEx account ==&lt;br /&gt;
&lt;br /&gt;
Before venturing your journey though all the tasks, you need to get an account. There are two options to obtain an account in CodEx&lt;br /&gt;
&lt;br /&gt;
=== For CUNI students ===&lt;br /&gt;
&lt;br /&gt;
[[File:codex-registration.png|thumb|200px|&#039;&#039;&#039;Codex Registration&#039;&#039;&#039; CUNI students]]&lt;br /&gt;
&lt;br /&gt;
Please access the SIS registration page: https://codex3.ms.mff.cuni.cz/codex-trans/?module=sisregistration. You will be asked to verify your account, then click &#039;&#039;&#039;verify&#039;&#039;&#039;. If everything is fine, you could proceed to create your own account by following the instruction.&lt;br /&gt;
&lt;br /&gt;
=== For non-CUNI students ===&lt;br /&gt;
&lt;br /&gt;
Please send an email to [mailto:mttalks@ufal.mff.cuni.cz?Subject=Request%20for%20CodEx%20account!%20MT%20talks&amp;amp;body=Hello!%0D%0A%0D%0APlease%20create%20a%20CodEx%20account%20for%20me.%20Thank%20you. Admin] to request an account. He will create the account for you. Your account is added to &#039;&#039;&#039;MT talks&#039;&#039;&#039; group by default.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to login and join a group ==&lt;br /&gt;
&lt;br /&gt;
[[File:codex-welcome-page.png|thumb|200px|&#039;&#039;&#039;Codex Welcome&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Once you have your login alias/password, come back to the login page: https://codex3.ms.mff.cuni.cz/codex-trans. After logging in, you are directed to the welcome page which displays all documentation and news related to your account.&lt;br /&gt;
&lt;br /&gt;
In the left hand column, there is an internal link &#039;&#039;&#039;group&#039;&#039;&#039;. It directs to the list of all groups that you could join. When you join a group, you are responsible to do all the exercises of the group.&lt;br /&gt;
&lt;br /&gt;
[[File:codex-group.png|thumb|200px|&#039;&#039;&#039;List of groups&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
For MT talks exercises, please join the group &#039;&#039;&#039;MT talks&#039;&#039;&#039; if you have not done it yet (shown in picture: list of groups).&lt;br /&gt;
&lt;br /&gt;
== How to pick an exercise, solve it and submit your solution ==&lt;br /&gt;
&lt;br /&gt;
After joining a group, you are able to see all the exercises assigned to that group. &lt;br /&gt;
In the left-handed sidebar, under &#039;&#039;&#039;group -&amp;gt; task&#039;&#039;&#039;, there are three options: &#039;&#039;specification, new submit, submits&#039;&#039;. They mean &#039;&#039;read the specification, submit a new solution&#039;&#039; and &#039;&#039;manage old submissions&#039;&#039;, respectively.&lt;br /&gt;
&lt;br /&gt;
[[File:codex-submit.png|thumb|200px|&#039;&#039;&#039;Submit a new solution&#039;&#039;&#039;]]&lt;br /&gt;
[[File:codex-eval.png|thumb|200px|&#039;&#039;&#039;Manage your submissions&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
For every exercise, please read the specification carefully. You are asked to write a complete program (not just a function). You can pick any of these programming languages: &#039;&#039;Pascal, C, C++, C#, Haskell, Python and Java&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
Your solution has to fit in one single file and process standard input to standard output. &lt;br /&gt;
&lt;br /&gt;
To submit a solution, there are two ways:&lt;br /&gt;
* Upload from text area: You write your solution into the text box directly on the web page, select the extension according to your programming language, then submit. &lt;br /&gt;
* Upload from file: Simply write your solution into a file with an appropriate extension, upload and submit it.&lt;br /&gt;
&lt;br /&gt;
In the evaluation process, your program is run several times with several inputs to validate the correctness. There are also built-in time and memory limits, which any sensible solution should easily meet. You will pass the exercise if your program passes a given number of these tests, we generally require to pass all the tests.&lt;br /&gt;
&lt;br /&gt;
In the left-handed sidebar, under &#039;&#039;&#039;group&#039;&#039;&#039;, there are links to page &#039;&#039;&#039;results&#039;&#039;&#039; and &#039;&#039;&#039;bonus points&#039;&#039;&#039; where you can keep track of your results throughout the course.&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
&lt;br /&gt;
Exercise &#039;&#039;&#039;Hello World!&#039;&#039;&#039;: Your task is to write a program which reads names of people and says &#039;Hello&#039; to each of them. Each input line should be turned into a greeting.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Input&#039;&#039;&#039;: &amp;lt;&amp;lt; standard input &amp;gt;&amp;gt; &amp;lt; sample.in&lt;br /&gt;
&lt;br /&gt;
    John&lt;br /&gt;
    Marry&lt;br /&gt;
    Marry and Kate&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ouput&#039;&#039;&#039;: &amp;lt;&amp;lt;standard output &amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Hello John!&lt;br /&gt;
    Hello Marry!&lt;br /&gt;
    Hello Marry and Kate!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Sample solution&#039;&#039;&#039;: Read the input file line-by-line, trim the string, concatenate the line with &amp;quot;Hello &amp;quot; and &amp;quot;!&amp;quot; then print it.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Python&#039;&#039;&#039;&lt;br /&gt;
    #!/usr/bin/env python&lt;br /&gt;
    import fileinput&lt;br /&gt;
    if __name__ == &#039;__main__&#039;:&lt;br /&gt;
        for line in fileinput.input():&lt;br /&gt;
            print &amp;quot;Hello &amp;quot; + line.strip() + &amp;quot;!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To test it manually, run: ./helloworld.py sample.in&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Java&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    import java.io.BufferedReader;&lt;br /&gt;
    import java.io.InputStreamReader;&lt;br /&gt;
    import java.io.IOException;&lt;br /&gt;
    public class CodEx{&lt;br /&gt;
        public static void main(String[] args) {&lt;br /&gt;
            BufferedReader br = null;&lt;br /&gt;
            try {&lt;br /&gt;
                br = new BufferedReader(new InputStreamReader(System.in));&lt;br /&gt;
                String line;&lt;br /&gt;
                while ((line = br.readLine()) != null) {&lt;br /&gt;
                    System.out.println(&amp;quot;Hello &amp;quot; + line + &amp;quot;!&amp;quot;);&lt;br /&gt;
                }&lt;br /&gt;
            } catch (IOException e) {&lt;br /&gt;
                e.printStackTrace();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
To test it manually, run: javac CodEx.java; java CodEx &amp;lt; sample.in&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you choose Java to be your programming language, your program must not declare any package, the main class must be &amp;quot;CodEx&amp;quot;. For CodEx limitiations for other languages, please read the CodEx manual.&lt;/div&gt;</summary>
		<author><name>Bojar</name></author>
	</entry>
	<entry>
		<id>https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=CodEx-Introduction&amp;diff=217</id>
		<title>CodEx-Introduction</title>
		<link rel="alternate" type="text/html" href="https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=CodEx-Introduction&amp;diff=217"/>
		<updated>2015-01-13T09:42:52Z</updated>

		<summary type="html">&lt;p&gt;Bojar: /* How to login and join a group */ polishing English&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;When reading this page, you&#039;ve probably already gone a long way in learning about machine translation. Nice work!&lt;br /&gt;
&lt;br /&gt;
Our MT Talks are occasionally complemented with programming exercises. We invite you (and strongly recommend) to go beyond watching our videos and try solving some or all of these exercises. Pick a programming language from our choice, write the short program and submit it to our system for evaluation -- a set of fully automatic tests.&lt;br /&gt;
&lt;br /&gt;
The exercises are implemented in The Code Examiner (&#039;&#039;&#039;CodEx&#039;&#039;&#039;, https://codex3.ms.mff.cuni.cz/codex-trans/). This page briefly describes how to use CodEx in general:&lt;br /&gt;
&lt;br /&gt;
* How to get a CodEx account&lt;br /&gt;
* How to login to CodEx&lt;br /&gt;
* How to pick a task to solve&lt;br /&gt;
* How to submit a solution for evaluation&lt;br /&gt;
&lt;br /&gt;
The individual exercises are described both in the CodEx system, as well as on the corresponding MT talk page here.&lt;br /&gt;
&lt;br /&gt;
== How to get a CodEx account ==&lt;br /&gt;
&lt;br /&gt;
Before venturing your journey though all the tasks, you need to get an account. There are two options to obtain an account in CodEx&lt;br /&gt;
&lt;br /&gt;
=== For CUNI students ===&lt;br /&gt;
&lt;br /&gt;
[[File:codex-registration.png|thumb|200px|&#039;&#039;&#039;Codex Registration&#039;&#039;&#039; CUNI students]]&lt;br /&gt;
&lt;br /&gt;
Please access the SIS registration page: https://codex3.ms.mff.cuni.cz/codex-trans/?module=sisregistration. You will be asked to verify your account, then click &#039;&#039;&#039;verify&#039;&#039;&#039;. If everything is fine, you could proceed to create your own account by following the instruction.&lt;br /&gt;
&lt;br /&gt;
=== For non-CUNI students ===&lt;br /&gt;
&lt;br /&gt;
Please send an email to [mailto:mttalks@ufal.mff.cuni.cz?Subject=Request%20for%20CodEx%20account!%20MT%20talks&amp;amp;body=Hello!%0D%0A%0D%0APlease%20create%20a%20CodEx%20account%20for%20me.%20Thank%20you. Admin] to request an account. He will create the account for you. Your account is added to &#039;&#039;&#039;MT talks&#039;&#039;&#039; group by default.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to login and join a group ==&lt;br /&gt;
&lt;br /&gt;
[[File:codex-welcome-page.png|thumb|200px|&#039;&#039;&#039;Codex Welcome&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Once you have your login alias/password, come back to the login page: https://codex3.ms.mff.cuni.cz/codex-trans. After logging in, you are directed to the welcome page which displays all documentation and news related to your account.&lt;br /&gt;
&lt;br /&gt;
In the left hand column, there is an internal link &#039;&#039;&#039;group&#039;&#039;&#039;. It directs to the list of all groups that you could join. When you join a group, you are responsible to do all the exercises of the group.&lt;br /&gt;
&lt;br /&gt;
[[File:codex-group.png|thumb|200px|&#039;&#039;&#039;List of groups&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
For MT talks exercises, please join the group &#039;&#039;&#039;MT talks&#039;&#039;&#039; if you have not done it yet (shown in picture: list of groups).&lt;br /&gt;
&lt;br /&gt;
== How to pick an exercise, solve it and submit your solution ==&lt;br /&gt;
&lt;br /&gt;
After joining a group, you are able to see all the exercises assigned to that group. &lt;br /&gt;
On the left-handed sidebar, under &#039;&#039;&#039;group -&amp;gt; task&#039;&#039;&#039;, you will see three options: &#039;&#039;specification, new submit, submits&#039;&#039;. They mean &#039;&#039;read the specification, submit a new solution&#039;&#039; and &#039;&#039;manage old submissions&#039;&#039; respectively.&lt;br /&gt;
&lt;br /&gt;
[[File:codex-submit.png|thumb|200px|&#039;&#039;&#039;Submit a new solution&#039;&#039;&#039;]]&lt;br /&gt;
[[File:codex-eval.png|thumb|200px|&#039;&#039;&#039;Manage your submissions&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
For every exercise, please read the specification carefully. You are asked to write a complete program (not just a function). The list of programming languages is: &#039;&#039;Pascal, C, C++, C#, Haskell, Python and Java&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
You solution has to fit in one single file with standard input/output. &lt;br /&gt;
&lt;br /&gt;
To submit a solution, there are two ways:&lt;br /&gt;
* Upload from text area: You write your solution into the text box, select the extension according to your programming language, then submit. &lt;br /&gt;
* Upload from file: Simply write your solution into a file with an appropriate extension and submit&lt;br /&gt;
&lt;br /&gt;
In the evaluation process, your program is run several times with several input to validate the correctness. You will pass if your program passes a &#039;&#039;threshold&#039;&#039; number of times. &lt;br /&gt;
&lt;br /&gt;
On the left-handed sidebar, under &#039;&#039;&#039;group&#039;&#039;&#039;, there are links to page &#039;&#039;&#039;results&#039;&#039;&#039; and &#039;&#039;&#039;bonus points&#039;&#039;&#039; where you can keep track of your results throughout the course.&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
&lt;br /&gt;
Exercise &#039;&#039;&#039;Hello World!&#039;&#039;&#039;: Your task is to write a program which read the name of a person and say &#039;Hello&#039; to him/her.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Input&#039;&#039;&#039;: &amp;lt;&amp;lt; standard input &amp;gt;&amp;gt; &amp;lt; sample.in&lt;br /&gt;
&lt;br /&gt;
    John&lt;br /&gt;
    Marry&lt;br /&gt;
    Marry and Kate&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ouput&#039;&#039;&#039;: &amp;lt;&amp;lt;standard output &amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Hello John!&lt;br /&gt;
    Hello Marry!&lt;br /&gt;
    Hello Marry and Kate!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Sample solution&#039;&#039;&#039;: Read the input file line-by-line, trim the string, concatenate the line with &amp;quot;Hello &amp;quot; and &amp;quot;!&amp;quot; then print it.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Python&#039;&#039;&#039;&lt;br /&gt;
    #!/usr/bin/env python&lt;br /&gt;
    import fileinput&lt;br /&gt;
    if __name__ == &#039;__main__&#039;:&lt;br /&gt;
        for line in fileinput.input():&lt;br /&gt;
            print &amp;quot;Hello &amp;quot; + line.strip() + &amp;quot;!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Run: ./helloworld.py sample.in&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Java&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    import java.io.BufferedReader;&lt;br /&gt;
    import java.io.InputStreamReader;&lt;br /&gt;
    import java.io.IOException;&lt;br /&gt;
    public class CodEx{&lt;br /&gt;
        public static void main(String[] args) {&lt;br /&gt;
            BufferedReader br = null;&lt;br /&gt;
            try {&lt;br /&gt;
                br = new BufferedReader(new InputStreamReader(System.in));&lt;br /&gt;
                String line;&lt;br /&gt;
                while ((line = br.readLine()) != null) {&lt;br /&gt;
                    System.out.println(&amp;quot;Hello &amp;quot; + line + &amp;quot;!&amp;quot;);&lt;br /&gt;
                }&lt;br /&gt;
            } catch (IOException e) {&lt;br /&gt;
                e.printStackTrace();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Run: javac CodEx.java; java CodEx &amp;lt; sample.in&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes&#039;&#039;&#039;: If you choose Java to be your programming language, your program must not declare any package, the main class must be &amp;quot;CodEx&amp;quot;. For other languages, please read the CodEx manual.&lt;/div&gt;</summary>
		<author><name>Bojar</name></author>
	</entry>
	<entry>
		<id>https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=CodEx-Introduction&amp;diff=216</id>
		<title>CodEx-Introduction</title>
		<link rel="alternate" type="text/html" href="https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=CodEx-Introduction&amp;diff=216"/>
		<updated>2015-01-13T09:40:21Z</updated>

		<summary type="html">&lt;p&gt;Bojar: typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;When reading this page, you&#039;ve probably already gone a long way in learning about machine translation. Nice work!&lt;br /&gt;
&lt;br /&gt;
Our MT Talks are occasionally complemented with programming exercises. We invite you (and strongly recommend) to go beyond watching our videos and try solving some or all of these exercises. Pick a programming language from our choice, write the short program and submit it to our system for evaluation -- a set of fully automatic tests.&lt;br /&gt;
&lt;br /&gt;
The exercises are implemented in The Code Examiner (&#039;&#039;&#039;CodEx&#039;&#039;&#039;, https://codex3.ms.mff.cuni.cz/codex-trans/). This page briefly describes how to use CodEx in general:&lt;br /&gt;
&lt;br /&gt;
* How to get a CodEx account&lt;br /&gt;
* How to login to CodEx&lt;br /&gt;
* How to pick a task to solve&lt;br /&gt;
* How to submit a solution for evaluation&lt;br /&gt;
&lt;br /&gt;
The individual exercises are described both in the CodEx system, as well as on the corresponding MT talk page here.&lt;br /&gt;
&lt;br /&gt;
== How to get a CodEx account ==&lt;br /&gt;
&lt;br /&gt;
Before venturing your journey though all the tasks, you need to get an account. There are two options to obtain an account in CodEx&lt;br /&gt;
&lt;br /&gt;
=== For CUNI students ===&lt;br /&gt;
&lt;br /&gt;
[[File:codex-registration.png|thumb|200px|&#039;&#039;&#039;Codex Registration&#039;&#039;&#039; CUNI students]]&lt;br /&gt;
&lt;br /&gt;
Please access the SIS registration page: https://codex3.ms.mff.cuni.cz/codex-trans/?module=sisregistration. You will be asked to verify your account, then click &#039;&#039;&#039;verify&#039;&#039;&#039;. If everything is fine, you could proceed to create your own account by following the instruction.&lt;br /&gt;
&lt;br /&gt;
=== For non-CUNI students ===&lt;br /&gt;
&lt;br /&gt;
Please send an email to [mailto:mttalks@ufal.mff.cuni.cz?Subject=Request%20for%20CodEx%20account!%20MT%20talks&amp;amp;body=Hello!%0D%0A%0D%0APlease%20create%20a%20CodEx%20account%20for%20me.%20Thank%20you. Admin] to request an account. He will create the account for you. Your account is added to &#039;&#039;&#039;MT talks&#039;&#039;&#039; group by default.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to login and join a group ==&lt;br /&gt;
&lt;br /&gt;
[[File:codex-welcome-page.png|thumb|200px|&#039;&#039;&#039;Codex Welcome&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Once you have your login alias/password, come back to the login page: https://codex3.ms.mff.cuni.cz/codex-trans. After logging in, you are directed to the welcome page which displays all documentations and news that relates to your account.&lt;br /&gt;
&lt;br /&gt;
On the left hand column, there is an internal link &#039;&#039;&#039;group&#039;&#039;&#039;. It directs to the list of all groups that you could join. When you join a group, you are responsible to do all the exercises which are assigned to that group.&lt;br /&gt;
&lt;br /&gt;
[[File:codex-group.png|thumb|200px|&#039;&#039;&#039;List of groups&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
For the sake of MT talks, please join the group &#039;&#039;&#039;MT talks&#039;&#039;&#039; if you have not done it.(shown in pictures: list of groups)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to pick an exercise, solve it and submit your solution ==&lt;br /&gt;
&lt;br /&gt;
After joining a group, you are able to see all the exercises assigned to that group. &lt;br /&gt;
On the left-handed sidebar, under &#039;&#039;&#039;group -&amp;gt; task&#039;&#039;&#039;, you will see three options: &#039;&#039;specification, new submit, submits&#039;&#039;. They mean &#039;&#039;read the specification, submit a new solution&#039;&#039; and &#039;&#039;manage old submissions&#039;&#039; respectively.&lt;br /&gt;
&lt;br /&gt;
[[File:codex-submit.png|thumb|200px|&#039;&#039;&#039;Submit a new solution&#039;&#039;&#039;]]&lt;br /&gt;
[[File:codex-eval.png|thumb|200px|&#039;&#039;&#039;Manage your submissions&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
For every exercise, please read the specification carefully. You are asked to write a complete program (not just a function). The list of programming languages is: &#039;&#039;Pascal, C, C++, C#, Haskell, Python and Java&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
You solution has to fit in one single file with standard input/output. &lt;br /&gt;
&lt;br /&gt;
To submit a solution, there are two ways:&lt;br /&gt;
* Upload from text area: You write your solution into the text box, select the extension according to your programming language, then submit. &lt;br /&gt;
* Upload from file: Simply write your solution into a file with an appropriate extension and submit&lt;br /&gt;
&lt;br /&gt;
In the evaluation process, your program is run several times with several input to validate the correctness. You will pass if your program passes a &#039;&#039;threshold&#039;&#039; number of times. &lt;br /&gt;
&lt;br /&gt;
On the left-handed sidebar, under &#039;&#039;&#039;group&#039;&#039;&#039;, there are links to page &#039;&#039;&#039;results&#039;&#039;&#039; and &#039;&#039;&#039;bonus points&#039;&#039;&#039; where you can keep track of your results throughout the course.&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
&lt;br /&gt;
Exercise &#039;&#039;&#039;Hello World!&#039;&#039;&#039;: Your task is to write a program which read the name of a person and say &#039;Hello&#039; to him/her.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Input&#039;&#039;&#039;: &amp;lt;&amp;lt; standard input &amp;gt;&amp;gt; &amp;lt; sample.in&lt;br /&gt;
&lt;br /&gt;
    John&lt;br /&gt;
    Marry&lt;br /&gt;
    Marry and Kate&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ouput&#039;&#039;&#039;: &amp;lt;&amp;lt;standard output &amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Hello John!&lt;br /&gt;
    Hello Marry!&lt;br /&gt;
    Hello Marry and Kate!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Sample solution&#039;&#039;&#039;: Read the input file line-by-line, trim the string, concatenate the line with &amp;quot;Hello &amp;quot; and &amp;quot;!&amp;quot; then print it.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Python&#039;&#039;&#039;&lt;br /&gt;
    #!/usr/bin/env python&lt;br /&gt;
    import fileinput&lt;br /&gt;
    if __name__ == &#039;__main__&#039;:&lt;br /&gt;
        for line in fileinput.input():&lt;br /&gt;
            print &amp;quot;Hello &amp;quot; + line.strip() + &amp;quot;!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Run: ./helloworld.py sample.in&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Java&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    import java.io.BufferedReader;&lt;br /&gt;
    import java.io.InputStreamReader;&lt;br /&gt;
    import java.io.IOException;&lt;br /&gt;
    public class CodEx{&lt;br /&gt;
        public static void main(String[] args) {&lt;br /&gt;
            BufferedReader br = null;&lt;br /&gt;
            try {&lt;br /&gt;
                br = new BufferedReader(new InputStreamReader(System.in));&lt;br /&gt;
                String line;&lt;br /&gt;
                while ((line = br.readLine()) != null) {&lt;br /&gt;
                    System.out.println(&amp;quot;Hello &amp;quot; + line + &amp;quot;!&amp;quot;);&lt;br /&gt;
                }&lt;br /&gt;
            } catch (IOException e) {&lt;br /&gt;
                e.printStackTrace();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Run: javac CodEx.java; java CodEx &amp;lt; sample.in&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes&#039;&#039;&#039;: If you choose Java to be your programming language, your program must not declare any package, the main class must be &amp;quot;CodEx&amp;quot;. For other languages, please read the CodEx manual.&lt;/div&gt;</summary>
		<author><name>Bojar</name></author>
	</entry>
	<entry>
		<id>https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=CodEx-Introduction&amp;diff=215</id>
		<title>CodEx-Introduction</title>
		<link rel="alternate" type="text/html" href="https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=CodEx-Introduction&amp;diff=215"/>
		<updated>2015-01-13T09:39:34Z</updated>

		<summary type="html">&lt;p&gt;Bojar: polishing intro paragraph&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;When reading this page, you&#039;ve probably already gone a long way in learning about machine translation. Nice work!&lt;br /&gt;
&lt;br /&gt;
Our MT Talks are occasionally complemented with programming exercises. We invite you (and strongly recommend) to go beyond watching our videos and try solving some or all of these exercises. Pick a programming language from our choice, write the short program and submit it to our system for evaluation -- a set of fully automatic tests.&lt;br /&gt;
&lt;br /&gt;
The exercises are implemented in The Code Examiner (&#039;&#039;&#039;CodEx&#039;&#039;&#039;, https://codex3.ms.mff.cuni.cz/codex-trans/). This page briefly describes how to use CodEx in general:&lt;br /&gt;
&lt;br /&gt;
* How to get a CodEx account&lt;br /&gt;
* How to login to CodEx&lt;br /&gt;
* How to pick a task to solve&lt;br /&gt;
* How to submit a solution for evaluation&lt;br /&gt;
&lt;br /&gt;
The individual excercises are described both in the CodEx system, as well as on the corresponding MT talk page here.&lt;br /&gt;
&lt;br /&gt;
== How to get a CodEx account ==&lt;br /&gt;
&lt;br /&gt;
Before venturing your journey though all the tasks, you need to get an account. There are two options to obtain an account in CodEx&lt;br /&gt;
&lt;br /&gt;
=== For CUNI students ===&lt;br /&gt;
&lt;br /&gt;
[[File:codex-registration.png|thumb|200px|&#039;&#039;&#039;Codex Registration&#039;&#039;&#039; CUNI students]]&lt;br /&gt;
&lt;br /&gt;
Please access the SIS registration page: https://codex3.ms.mff.cuni.cz/codex-trans/?module=sisregistration. You will be asked to verify your account, then click &#039;&#039;&#039;verify&#039;&#039;&#039;. If everything is fine, you could proceed to create your own account by following the instruction.&lt;br /&gt;
&lt;br /&gt;
=== For non-CUNI students ===&lt;br /&gt;
&lt;br /&gt;
Please send an email to [mailto:mttalks@ufal.mff.cuni.cz?Subject=Request%20for%20CodEx%20account!%20MT%20talks&amp;amp;body=Hello!%0D%0A%0D%0APlease%20create%20a%20CodEx%20account%20for%20me.%20Thank%20you. Admin] to request an account. He will create the account for you. Your account is added to &#039;&#039;&#039;MT talks&#039;&#039;&#039; group by default.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to login and join a group ==&lt;br /&gt;
&lt;br /&gt;
[[File:codex-welcome-page.png|thumb|200px|&#039;&#039;&#039;Codex Welcome&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
Once you have your login alias/password, come back to the login page: https://codex3.ms.mff.cuni.cz/codex-trans. After logging in, you are directed to the welcome page which displays all documentations and news that relates to your account.&lt;br /&gt;
&lt;br /&gt;
On the left hand column, there is an internal link &#039;&#039;&#039;group&#039;&#039;&#039;. It directs to the list of all groups that you could join. When you join a group, you are responsible to do all the exercises which are assigned to that group.&lt;br /&gt;
&lt;br /&gt;
[[File:codex-group.png|thumb|200px|&#039;&#039;&#039;List of groups&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
For the sake of MT talks, please join the group &#039;&#039;&#039;MT talks&#039;&#039;&#039; if you have not done it.(shown in pictures: list of groups)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to pick an exercise, solve it and submit your solution ==&lt;br /&gt;
&lt;br /&gt;
After joining a group, you are able to see all the exercises assigned to that group. &lt;br /&gt;
On the left-handed sidebar, under &#039;&#039;&#039;group -&amp;gt; task&#039;&#039;&#039;, you will see three options: &#039;&#039;specification, new submit, submits&#039;&#039;. They mean &#039;&#039;read the specification, submit a new solution&#039;&#039; and &#039;&#039;manage old submissions&#039;&#039; respectively.&lt;br /&gt;
&lt;br /&gt;
[[File:codex-submit.png|thumb|200px|&#039;&#039;&#039;Submit a new solution&#039;&#039;&#039;]]&lt;br /&gt;
[[File:codex-eval.png|thumb|200px|&#039;&#039;&#039;Manage your submissions&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
For every exercise, please read the specification carefully. You are asked to write a complete program (not just a function). The list of programming languages is: &#039;&#039;Pascal, C, C++, C#, Haskell, Python and Java&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
You solution has to fit in one single file with standard input/output. &lt;br /&gt;
&lt;br /&gt;
To submit a solution, there are two ways:&lt;br /&gt;
* Upload from text area: You write your solution into the text box, select the extension according to your programming language, then submit. &lt;br /&gt;
* Upload from file: Simply write your solution into a file with an appropriate extension and submit&lt;br /&gt;
&lt;br /&gt;
In the evaluation process, your program is run several times with several input to validate the correctness. You will pass if your program passes a &#039;&#039;threshold&#039;&#039; number of times. &lt;br /&gt;
&lt;br /&gt;
On the left-handed sidebar, under &#039;&#039;&#039;group&#039;&#039;&#039;, there are links to page &#039;&#039;&#039;results&#039;&#039;&#039; and &#039;&#039;&#039;bonus points&#039;&#039;&#039; where you can keep track of your results throughout the course.&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
&lt;br /&gt;
Exercise &#039;&#039;&#039;Hello World!&#039;&#039;&#039;: Your task is to write a program which read the name of a person and say &#039;Hello&#039; to him/her.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Input&#039;&#039;&#039;: &amp;lt;&amp;lt; standard input &amp;gt;&amp;gt; &amp;lt; sample.in&lt;br /&gt;
&lt;br /&gt;
    John&lt;br /&gt;
    Marry&lt;br /&gt;
    Marry and Kate&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ouput&#039;&#039;&#039;: &amp;lt;&amp;lt;standard output &amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Hello John!&lt;br /&gt;
    Hello Marry!&lt;br /&gt;
    Hello Marry and Kate!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Sample solution&#039;&#039;&#039;: Read the input file line-by-line, trim the string, concatenate the line with &amp;quot;Hello &amp;quot; and &amp;quot;!&amp;quot; then print it.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Python&#039;&#039;&#039;&lt;br /&gt;
    #!/usr/bin/env python&lt;br /&gt;
    import fileinput&lt;br /&gt;
    if __name__ == &#039;__main__&#039;:&lt;br /&gt;
        for line in fileinput.input():&lt;br /&gt;
            print &amp;quot;Hello &amp;quot; + line.strip() + &amp;quot;!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Run: ./helloworld.py sample.in&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Java&#039;&#039;&#039;&lt;br /&gt;
    &lt;br /&gt;
    import java.io.BufferedReader;&lt;br /&gt;
    import java.io.InputStreamReader;&lt;br /&gt;
    import java.io.IOException;&lt;br /&gt;
    public class CodEx{&lt;br /&gt;
        public static void main(String[] args) {&lt;br /&gt;
            BufferedReader br = null;&lt;br /&gt;
            try {&lt;br /&gt;
                br = new BufferedReader(new InputStreamReader(System.in));&lt;br /&gt;
                String line;&lt;br /&gt;
                while ((line = br.readLine()) != null) {&lt;br /&gt;
                    System.out.println(&amp;quot;Hello &amp;quot; + line + &amp;quot;!&amp;quot;);&lt;br /&gt;
                }&lt;br /&gt;
            } catch (IOException e) {&lt;br /&gt;
                e.printStackTrace();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Run: javac CodEx.java; java CodEx &amp;lt; sample.in&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes&#039;&#039;&#039;: If you choose Java to be your programming language, your program must not declare any package, the main class must be &amp;quot;CodEx&amp;quot;. For other languages, please read the CodEx manual.&lt;/div&gt;</summary>
		<author><name>Bojar</name></author>
	</entry>
	<entry>
		<id>https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=Pre-processing&amp;diff=214</id>
		<title>Pre-processing</title>
		<link rel="alternate" type="text/html" href="https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=Pre-processing&amp;diff=214"/>
		<updated>2015-01-13T09:26:19Z</updated>

		<summary type="html">&lt;p&gt;Bojar: /* VIM tips */ set nomomb added&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox&lt;br /&gt;
|title = Lecture 3: Pre-processing&lt;br /&gt;
|image = [[File:bear-with-us.png|200px]]&lt;br /&gt;
|label1 = Lecture video:&lt;br /&gt;
|data1 = [http://example.com web &#039;&#039;&#039;TODO&#039;&#039;&#039;] &amp;lt;br/&amp;gt; [http://www.youtube.com/watch?v=ucSv4S4sCjs Youtube]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{#ev:youtube|ucSv4S4sCjs|800|center}}&lt;br /&gt;
&lt;br /&gt;
Overall, the task of data pre-processing is to &#039;&#039;drop any distinctions that are not important for the output&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Inspecting Text Data ==&lt;br /&gt;
&lt;br /&gt;
=== Text Encoding ===&lt;br /&gt;
&lt;br /&gt;
Two texts that look the same might not be identical. MT systems do not see the strings as humans do but instead, they work with the actual byte representation. Therefore, data pre-processing is a very important step in system development.&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.com/wiki/Unicode Unicode] includes a number of special characters which can complicate text processing for an MT system developer. The following table contains examples of some of the more devious characters:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! Code&lt;br /&gt;
! Name&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;U+200B&#039;&#039;&#039;&lt;br /&gt;
|Zero-width space&lt;br /&gt;
|An invisible space.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;U+200E&#039;&#039;&#039;&lt;br /&gt;
|Left-to-right mark&lt;br /&gt;
|An invisible character used in texts with mixed scripts (e.g. Latin and Arabic) to indicate reading direction.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;U+2028&#039;&#039;&#039;&lt;br /&gt;
|Line separator&lt;br /&gt;
|A Unicode newline which is often not interpreted by text editors (and can be invisible).&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;U+2029&#039;&#039;&#039;&lt;br /&gt;
|Paragraph separator&lt;br /&gt;
|Separates paragraphs, implies a new line (also often ignored).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[http://www.decodeunicode.org/ Decode Unicode] is a useful webpage with information on Unicode characters.&lt;br /&gt;
&lt;br /&gt;
Often, a file [http://en.wikipedia.org/wiki/Hex_dump hexdump] is the most useful diagnostic tool. E.g. the Linux command &#039;&#039;&#039;xxd&#039;&#039;&#039; provides the necessary functionality.&lt;br /&gt;
&lt;br /&gt;
=== Script/Characters ===&lt;br /&gt;
&lt;br /&gt;
Unicode often provides many ways how to write a single character. For example, the letter &amp;quot;&#039;&#039;&#039;a&#039;&#039;&#039;&amp;quot; might be written with Latin or Cyrillic script.&lt;br /&gt;
&lt;br /&gt;
Aside from seemingly identical, but differently encoded characters, problems commonly seen in data include:&lt;br /&gt;
&lt;br /&gt;
* Confusion of &#039;&#039;&#039;0&#039;&#039;&#039; (zero) and &#039;&#039;&#039;O&#039;&#039;&#039; (capital letter)&lt;br /&gt;
* Inconsistent letter case: English word &#039;&#039;&#039;I&#039;&#039;&#039; written in lowercase etc. (notorious e.g. in movie subtitles)&lt;br /&gt;
* Various systematic mis-spellings -- all of these variants of &amp;quot;I&#039;ll&amp;quot; (I will) were observed in movie subtitles: &#039;&#039;&#039;i&#039;ll Ill l&#039;ll 1&#039;ll 1&#039;11&#039;&#039;&#039;&lt;br /&gt;
* Different symbols for various punctuation (quotes, dashes, apostrophe etc.) &lt;br /&gt;
&lt;br /&gt;
=== VIM tips ===&lt;br /&gt;
&lt;br /&gt;
A good text editor is an essential pre-requisite for successful inspection of text data and the implementation of suitable pre-processing. We provide several random tips for the VIM editor:&lt;br /&gt;
&lt;br /&gt;
Set file encoding to UTF-8:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;:set encoding=utf8&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Show the code of character under cursor:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;ga&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Set or remove BOM (byte-order mark) for current file:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;:set bomb&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;:set nobomb&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Tokenization ==&lt;br /&gt;
&lt;br /&gt;
The most suitable tokenization can be task-dependent. For example, in parsing, we would like to keep adjectives such as &amp;quot;red-haired&amp;quot; as one word, while for phrase-based MT, it is useful to split such words.&lt;br /&gt;
&lt;br /&gt;
A basic but quite robust approach is to split whenever the [http://www.regular-expressions.info/unicode.html Unicode character category] changes. Imagine reading the input character by character. When we observe that so far, there have been letters (category &#039;&#039;&#039;L&#039;&#039;&#039;) and suddenly, there is punctuation (category &#039;&#039;&#039;P&#039;&#039;&#039;), we insert a space. During the same process, it is useful to convert all whitespace (tabulators, spaces, non-breaking spaces and sequences of such) to a single space character.&lt;br /&gt;
&lt;br /&gt;
However, in many situations, a more sophisticated, linguistically motivated tokenization scheme is useful. E.g. for words such as &amp;quot;don&#039;t&amp;quot;, &amp;quot;could&#039;t&amp;quot;, &amp;quot;shouldn&#039;t&amp;quot;, we can obtain a nice generalization by splitting off &amp;quot;n&#039;t&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;don&#039;t -&amp;gt; do n&#039;t&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;shouldn&#039;t -&amp;gt; should n&#039;t&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;couldn&#039;t -&amp;gt; could n&#039;t&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It is essential for data tokenization to be &#039;&#039;&#039;consistent&#039;&#039;&#039;. All of our training data should conform to the same pre-processing scheme and an identical pipeline should be applied at test time (when our system runs and we translate new data).&lt;/div&gt;</summary>
		<author><name>Bojar</name></author>
	</entry>
	<entry>
		<id>https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=MT_Talks&amp;diff=146</id>
		<title>MT Talks</title>
		<link rel="alternate" type="text/html" href="https://mttalks.ufal.ms.mff.cuni.cz/index.php?title=MT_Talks&amp;diff=146"/>
		<updated>2014-12-16T22:38:10Z</updated>

		<summary type="html">&lt;p&gt;Bojar: links to other videolectures&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:banner.png]]&lt;br /&gt;
&lt;br /&gt;
MT Talks is a series of mini-lectures on machine translation.&lt;br /&gt;
&lt;br /&gt;
Our goal is to hit just the right level of detail and technicality to make the talks interesting and attractive to people who are not yet familiar with the field but mix in new observations and insights so that even old pals will have a reason to watch us.&lt;br /&gt;
&lt;br /&gt;
MT Talks and the expanded notes on this wiki will never be the ultimate resource for MT, but we would be very happy to serve as an ultimate commented &#039;&#039;directory&#039;&#039; of good pointers.&lt;br /&gt;
&lt;br /&gt;
By the way, this is indeed a Wiki, so your contributions are very welcome! Please register and feel free to add comments, corrections or links to useful resources.&lt;br /&gt;
&lt;br /&gt;
== Our Talks ==&lt;br /&gt;
&lt;br /&gt;
01 &#039;&#039;&#039;[[Intro]]&#039;&#039;&#039;: Why is MT difficult, Approaches to MT.&lt;br /&gt;
&lt;br /&gt;
== Other Videolectures on MT ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.upc.edu/learning/courses/mooc/2014-2015/approaches-to-machine/approaches-to-machine Approaches to Machine Translation: Rule-Based, Statistical, Hybrid] (an online course on MT by UPC Barcelona)&lt;br /&gt;
* [https://www.coursera.org/course/nlangp Natural Language Processing at Coursera] by Michael Collins, includes lectures on word-based and phrase-based models. [http://www.cs.columbia.edu/~mcollins/notes-spring2013.html Further notes]&lt;br /&gt;
&lt;br /&gt;
== Acknowledgement ==&lt;br /&gt;
&lt;br /&gt;
The work on this project has been supported by the grant FP7-ICT-2011-7-288487 ([http://www.statmt.org/mosescore/ MosesCore]).&lt;/div&gt;</summary>
		<author><name>Bojar</name></author>
	</entry>
</feed>