Docsity

Assignment 1 for Shallow Natural Language Processing | LING 570, Assignments of Linguistics

Toggle sidebar
bg1
LING 570: Hw1
Due date: 3pm on Oct 3
For this homework, you are going to write an English tokenizer and a tool that creates a
vocabulary from the input text. All the sample files are under ~/dropbox/07-08/570/hw1.
For this assignment, you can assume that a token will not cross the line boundary; that is,
you can process the input text line-by-line.
Part I (40 points): implementing an English tokenizer, eng_tokenizer.
The command line should be: cat input_file | ./eng_tokenizer.sh > output_file
The input and output files should have the same line number, and the i-th line in
the input corresponds to the i-th line in the out file.
The tokens in the output lines should be separated by the whitespace.
Do not merge the tokens in the input text (e.g., the collocation expression such as
“pick up”, “because of”, “Hong Kong”). Other than that, create your own criteria
for tokenization and describe them in your note file.
Some examples are under hw1/examples. You won’t be able to run the shell
script until you have defined your own eng_tokenizer.pl. The output* files are not
the gold standard.
Don’t spend too much time trying to make your tokenizer perfect.
Part II (20 points): writing a tool, make_voc, that creates a vocabulary from the input
text.
The command line should be: cat input_file | ./make_voc.sh > output_file
The tool reads in each line in the input, breaks it into tokens by whitespace, and
output the frequencies of the tokens.
Each line in the output file is a (token, frequency) pair. The lines are sorted by the
frequency of the tokens in descending order. For instance, the vocabulary created
from the file examples/input_ex is shown in examples/input_ex.voc.
Run make_voc.sh on a raw file (the one that is not tokenized) and on a tokenized
file, and compare the sizes of the two vocabularies.
The submission should include:
The source code: eng_tokenizer.*, make_voc.*
The shell scripts: eng_tokenizer.sh, make_voc.sh
Any additional files (e.g., word list) used by your eng_tokenizer.
A note file: hw1.*, which provides
oa short description of your tokenization algorithm
oyour tokenization criteria (e.g., how hyphenated words are treated)
oa list of remaining problems (if any) in your tokenizer.
othe time you have spent on the homework (optional)
oany comment to the homework (optional)

Partial preview of the text

Download Assignment 1 for Shallow Natural Language Processing | LING 570 and more Assignments Linguistics in PDF only on Docsity!

LING 570: Hw Due date: 3pm on Oct 3 For this homework, you are going to write an English tokenizer and a tool that creates a vocabulary from the input text. All the sample files are under ~/dropbox/07-08/570/hw. For this assignment, you can assume that a token will not cross the line boundary; that is, you can process the input text line-by-line. Part I (40 points) : implementing an English tokenizer, eng_tokenizer.  The command line should be: cat input_file | ./eng_tokenizer.sh > output_file  The input and output files should have the same line number, and the i-th line in the input corresponds to the i-th line in the out file.  The tokens in the output lines should be separated by the whitespace.  Do not merge the tokens in the input text (e.g., the collocation expression such as “pick up”, “because of”, “Hong Kong”). Other than that, create your own criteria for tokenization and describe them in your note file.  Some examples are under hw1/examples. You won’t be able to run the shell script until you have defined your own eng_tokenizer.pl. The output* files are not the gold standard.  Don’t spend too much time trying to make your tokenizer perfect. Part II (20 points): writing a tool, make_voc , that creates a vocabulary from the input text.  The command line should be: cat input_file | ./make_voc.sh > output_file  The tool reads in each line in the input, breaks it into tokens by whitespace, and output the frequencies of the tokens.  Each line in the output file is a (token, frequency) pair. The lines are sorted by the frequency of the tokens in descending order. For instance, the vocabulary created from the file examples/input_ex is shown in examples/input_ex.voc.  Run make_voc.sh on a raw file (the one that is not tokenized) and on a tokenized file, and compare the sizes of the two vocabularies. The submission should include:  The source code: eng_tokenizer., make_voc.  The shell scripts: eng_tokenizer.sh, make_voc.sh  Any additional files (e.g., word list) used by your eng_tokenizer.  A note file: hw1.*, which provides o a short description of your tokenization algorithm o your tokenization criteria (e.g., how hyphenated words are treated) o a list of remaining problems (if any) in your tokenizer. o the time you have spent on the homework (optional) o any comment to the homework (optional)