forked from GitHub/comp-syntax-gu-mlt
Merge pull request #1 from harisont/main
Clarification of assignment task descriptions, mostly based on student questions
This commit is contained in:
@@ -6,13 +6,13 @@ The assignments are submitted via Canvas.
|
||||
|
||||
## Chapter 1: explore the parallel UD treebank (PUD)
|
||||
|
||||
1. Go to https://universaldependencies.org/ and download Version 2.7 treebanks
|
||||
2. Look up the Parallel UD treebanks for those 19 languages that have it. They are named e.g. UD_English-PUD/
|
||||
1. Go to https://universaldependencies.org/ and download Version 2.7+ treebanks
|
||||
2. Look up the Parallel UD treebanks for those 21 languages that have it. They are named e.g. `UD_English-PUD/`
|
||||
3. Select a language to compare with English.
|
||||
4. Make statistics about the frequencies of POS tags and dependency
|
||||
labels in your language compared with English: find the top-20 tags/labels and their number of occurrences.
|
||||
What does this tell you about the language?
|
||||
(This can be done with shell or Python programming or with the gf-ud tool.)
|
||||
(This can be done with shell or Python programming or with the gf-ud tool, which is available on the eduserv server. In Python, you can for example use the [conllu library](https://github.com/EmilStenstrom/conllu))
|
||||
5. Convert the following four trees from CoNLL format to graphical
|
||||
trees by hand, on paper.
|
||||
- a short English tree (5-10 words, of your choice) and its translation.
|
||||
@@ -30,15 +30,30 @@ trees by hand, on paper.
|
||||
|
||||
## Chapter 3: UD syntax analysis
|
||||
|
||||
Take a bilingual corpus with English and your own language, and annotate with UD.
|
||||
In this lab, you will annotate a bilingual corpus with English and your own language with UD.
|
||||
The English text is given in the file `comp-syntax-corpus-english.txt` in this directory.
|
||||
|
||||
Your task is to
|
||||
1. write an English CoNLL file analysing this corpus
|
||||
2. translate the corpus to your language
|
||||
3. write a CoNLL file analysing your translation
|
||||
|
||||
The corpus is a combination of different sources, including the Parallel UD treebank (PUD).
|
||||
If you want to cheat - or just check your own answer - you can look for those sentences in the official PUD. You can also compare your analyses with those of an automatic parser, such as [UDPipe](https://lindat.mff.cuni.cz/services/udpipe/), which you can try directly from your browser. These automatic analyses must of course be taken with a grain of salt.
|
||||
|
||||
The first 12 sentences are POS-tagged, with each word having the form
|
||||
|
||||
`word:<POS>`
|
||||
|
||||
Hint: you can initialize the task by converting each word or word:<POS> to a simplified CoNLL line with a dummy head (0) and label (dep), with proper position number of course.
|
||||
|
||||
The UD annotation that you produce manually can be simplified CoNLL, with just the fields
|
||||
|
||||
`position word postag head label`
|
||||
|
||||
Make sure that each field is exactly one token, so that the whole line has exactly 5 tokens.
|
||||
|
||||
This input can be automatically expanded to full CoNLL by adding undescores for the lemma, morphology, and other missing fields, as well as tabs between the fields (if you didn't use tabs already)
|
||||
This input can be automatically expanded to full CoNLL by adding undescores for the lemma, morphology, and other missing fields, as well as tabs between the fields (if you didn't use tabs already).
|
||||
|
||||
`position word _ postag _ _ head label _ _`
|
||||
|
||||
@@ -51,63 +66,37 @@ expands to
|
||||
`7 world _ NOUN _ _ 4 nmod _ _`
|
||||
|
||||
(Unfortunately, the tabs are not visible in the md output.)
|
||||
The conversion to full CoNLL can be done using Python or `gf-ud reduced2conll`
|
||||
The conversion to full CoNLL can be done using Python or `gf-ud reduced2conll` (available on eduserv) or with [this script](https://gist.github.com/harisont/612a87d20f729aa3411041f873367fa2).
|
||||
|
||||
Once you have full CoNLL, you can use for instance the gfud tool to visualize it.
|
||||
|
||||
Your task is to
|
||||
1. write an English CoNLL file analysing this corpus
|
||||
2. translate the corpus to your language
|
||||
3. write a CoNLL file analysing your translation
|
||||
|
||||
|
||||
The corpus is a combination of different sources, including the Parallel UD treebank (PUD).
|
||||
If you want to cheat - or just check your own answer - you can look for those sentences in the official PUD.
|
||||
|
||||
The first 12 sentences are POS-tagged, with each word having the form
|
||||
|
||||
`word:<POS>`
|
||||
|
||||
Hint: you can initialize the task by converting each word or word:<POS> to a simplified CoNLL line with a dummy head (0) and label (dep), with proper position number of course.
|
||||
|
||||
Extra: If you want to see the visual trees, you can build the gfud program from
|
||||
|
||||
`https://github.com/GrammaticalFramework/gf-ud`
|
||||
|
||||
and issue the command
|
||||
|
||||
`cat my-file.conllu | ./gfud conll2pdf`
|
||||
|
||||
You will need Haskell and GF libraries to build gfud, and LaTeX to show the pdf.
|
||||
Once you have full CoNLL, you can use for instance the gf-ud tool or [the online CoNNL-U viewer](https://universaldependencies.org/conllu_viewer.html) to visualize it.
|
||||
|
||||
If you use the gf-ud tool, you will need to issue the command
|
||||
|
||||
`cat my-file.conllu | ./gf-ud conll2pdf`
|
||||
|
||||
It is possible that you won't be able to visualize the trees directly on eduserv.
|
||||
Building gf-ud and running this command on your machine requires Haskell and the GF libraries, as well as LaTeX to show the pdf output.
|
||||
|
||||
## Chapter 4: phrase structure analysis
|
||||
|
||||
1. Construct phrase structure trees for some of the sentences in the corpus used in Chapter 3, both for English and your chosen language.
|
||||
### Prerequisites: get `gf-ud` to work
|
||||
There are multiple ways to use `gf-ud`:
|
||||
- using the version that is installed on eduserv
|
||||
- installing a pre-compiled executable, available for Mac and Ubuntu machines at http://www.grammaticalframework.org/~aarne/software/
|
||||
- compiling the source code, available at https://github.com/GrammaticalFramework/gf-ud. `gf-ud` can be built:
|
||||
- with `make` provided that you have the GHC Haskell compiler and the gf-core libraries (available at https://github.com/GrammaticalFramework/gf-core) installed
|
||||
- with the Haskell Stack tool, by running `stack install`. This will install all the necessary dependency automatically.
|
||||
|
||||
2. Test the grammar
|
||||
### Tasks
|
||||
1. Construct (by hand) phrase structure trees for some of the sentences in the corpus used in Chapter 3, both for English and your chosen language.
|
||||
|
||||
https://github.com/GrammaticalFramework/gf-ud/blob/master/grammars/English.dbnf
|
||||
2. Test the grammar at
|
||||
|
||||
on last week's corpus, both for English and your own language.
|
||||
|
||||
3. Modify the grammar to suit your language and test it on some of the UD treebanks by using `gf-ud eval`.
|
||||
|
||||
|
||||
The gf-ud program can be found in executable versions (once gunzipped) in
|
||||
|
||||
http://www.grammaticalframework.org/~aarne/software/
|
||||
|
||||
The source code of gf-ud can be found in
|
||||
|
||||
https://github.com/GrammaticalFramework/gf-ud
|
||||
|
||||
It can be built with `make` if you have Haskell and also have built the gf-core libraries:
|
||||
|
||||
https://github.com/GrammaticalFramework/gf-core
|
||||
|
||||
This will not be needed if you can use one of the ready-made libraries.
|
||||
https://github.com/GrammaticalFramework/gf-ud/blob/master/grammars/English.dbnf
|
||||
|
||||
on last week's corpus, both for English and your own language.
|
||||
In practice, this means:
|
||||
- running `gf-ud`'s `dbnf` command on (possibly POS-tagged) versions of the sentences in Chapter 3's corpus.
|
||||
- comparing the CoNNL-U and parse trees obtained in this way with, respectively, your hand-drawn parse trees and the CoNNL-U trees from Chapter 3. Parse tree comparison can be qualitative, while CoNNL-U trees are to be compared quantitatively via `gf-ud eval`.
|
||||
|
||||
3. Modify the grammar to suit your language and test it on some of the UD treebanks by using `gf-ud eval`. Try to obtain a `udScore` above 0.60. You are welcome to explain the changes you make.
|
||||
|
||||
Reference in New Issue
Block a user