Contrastive grammar
From LING073
This document is in flux. Stand by while it's worked on. —Jwashin1 (talk) 15:03, 19 March 2019 (EDT)
A previous version of this document is available at Spring 2018/Contrastive grammar.
Some of the content that used to be here is now on the Lexical selection page.
Contents
What constitutes a contrastive grammar for RBMT
- Start by looking at material in the language you're translating into your language.
- For a given way of expressing the same thing (a translation, or equivalent sentence), find differences in the parse, ignoring the content of the lexical items.
- I.e., make sure the full version of the sentence in each language parses correctly (and has correct disambiguation), and then compare the parses side-by-side.
- You'll want to identify any differences in word order, tags used, etc.
- An example of a set of similar languages might be:
- "Je le mangerai":
^je/je<prn><pers><p1><sg><nom>$ ^le/le<prn><pers><p3><m><acc>$ ^mangerais/manger<v><tv><fut><p1><sg>$ - "Yo lo comeré":
^yo/yo<prn><pers><p1><sg><nom>$ ^lo/lo<prn><pers><p3><m><acc>$ ^comeré/comer<v><tv><fut><p1><sg>$
- "Je le mangerai":
- An example of a set of rather different languages might be:
- "Yiyemeyeceğim":
^yiyemeyeceğim/ye<v><tv><abil><neg><fut>+i<cop><aor><p1><sg>$ - "I won't be able to eat it":
^I/I<prn><pers><p1><sg><subj>$ ^won't/will<vaux>+not<adv>$ ^be/be<v><iv>$ ^able/able<adj>$ ^to eat/eat<v><tv><inf>$ ^it/it<prn>pers><p3><nt><obj>$
- "Yiyemeyeceğim":
- An example of a set of similar languages might be:
- In the above example of similar languages, there are no differences in tags, only in stems. Here there is nothing to contrast. In the above example of different languages, there is quite a bit that can be contrasted—but almost too much to break down into individual points.
- An example of languages with some minor differences might be:
- "Je l'ai vu":
^je/je<prn><pers><p1><sg><nom>$ ^l'ai/le<prn><pers><p3><m><acc>+avoir<vaux><pres><p1><sg>$ ^vu/voir<v><tv><prc_past>$ - "Yo lo vi":
^yo/yo<prn><pers><p1><sg><nom>$ ^lo/lo<prn><pers><p3><m><acc>$ ^vi/ver<v><tv><ifi><p1><sg>$
- "Je l'ai vu":
- Here the difference is that one language uses the auxiliary with a participle where the other language uses a simple verb form
- Note that the following does not constitute a contrastive difference
- "Je mange la glace":
^je/je<prn><pers><p1><sg><nom>$ ^mange/manger<v><tv><pres><p1><sg>$ ^la/le<det><def><f>$ ^glace/glace<n><f>$ - "Yo como el hielo":
^yo/yo<prn><pers><p1><sg><nom>$ ^como/comer<v><tv><pres><p1><sg>$ ^el/el<det><def><m>$ ^hielo/hielo<n><m>$
- "Je mange la glace":
- This is still useful to note, as it can still be implemented as a transfer rule.
The examples above using templates
- (fra) Je le mangerai → (spa) Yo lo comeré ("I'll eat it.")
- (fra) je<prn><pers><p1><sg><nom> le<prn><pers><p3><m><acc> manger<v><tv><fut><p1><sg> → (spa) yo<prn><pers><p1><sg><nom> lo<prn><pers><p3><m><acc> comer<v><tv><fut><p1><sg>
The assignment
This assignment is due at the end of the 8th week of class (this semester: Friday, March 23rd, 2018 at 23:59, i.e., by midnight)
Getting started
- Figure out who and what languages you'd like to work with on MT (source and destination languages). You can chose to work in the same or different groups, and to work with the language you're already working on or with a different language. This is an opportunity to regroup, especially if you don't enjoy the language you're working on, or you're having trouble working in your current group, etc.
- The simplest case is that the source language is the language you've been working on this semester and the destination language is English or another language you know well (are able to easily make sense of text in the language) and that has an open source transducer (e.g., in Apertium).
- You may also choose to do MT between your language and:
- a closely related or structurally extremely similar language (e.g., that mark similar things on the same parts of speech and/or that have similar word order)
- a language spoken in close proximity to your language or shares similar cultural influences, even if unrelated (harder)
- You may work in groups of 2 or 3, or in some rare cases I may allow groups of 4.
- In groups where both languages have been worked on up to this point in the course, each language should be both a source and destination of translation.
- Otherwise, the destination language should be a language you're comfortable with.
- Get additional repositories set up:
- If you are working with someone who's done another language in this class:
- Share the corpus, keyboard, and transducer repos with each other. I.e., give each other read access (not necessarily write access).
- Fork the repos of the language you're translating from. Do this through the github interface.
- Clone the forked repos locally (in your ~/ling073 directory).
- You'll want to look at the corpus repo for this assignment, and you'll want the other stuff around for later. We'll also talk more about forking, pull requests, etc. later.
- If you're working with another language that you know
- Make sure you can type in the language
- Fork the repository (on github.com) for that language from Apertium and make sure everyone in your group has write access to the fork.
- Clone the forked repo locally (in your ~/ling073 directory).
- If you are working with someone who's done another language in this class:
- Create a page on the wiki named "LanguageX and LanguageY" (either order, and just one page).
- Add the page to the category Category:Sp19_TranslationPairs.
- Put a note at the top along the lines of "Resources for machine translation between LanguageX and LanguageY", where the language names link back to your pages on them.
- Add a link on each of the language pages to this new page, making a similar note as above.
Contrastive grammar
- Create a page on the wiki named "LanguageX and LanguageY/Contrastive Grammar". Add it to the category Category:Sp19_ContrastiveGrammars. Add a link to the page under "Developed resources" on the main page.
- Identify at least five differences between the two languages.
- These can be anything where the analyses of equivalent phrases look different when the roots are ignored: i.e., differences in tags used, differences in basic word order, etc.
- Document these differences on the wiki.
- You'll want on the order of two or three examples of each grammatical difference.
- Make two sections on the Contrastive Grammar page: one called "xyz-abc tests" and one called "abc-xyz tests".
- If you're translating in one direction only, you just need "xyz-abc tests".
- Each section will have equivalent tests, but in opposite directions.
- Use the TransferMorphTest and TransferTest templates as used above and on the Transfer rules page.