User:Gang Chen/GSoC 2013 Progress
Contents
GSOC 2013
I'm working with Apertium for the GSoC 2013, on the project "Sliding Window Part of Speech Tagger for Apertium".
my proposal is here: Proposal
SVN repo
1. the tagger https://svn.code.sf.net/p/apertium/svn/branches/apertium-swpost/apertium
2. en-es language pair(for experiment) https://svn.code.sf.net/p/apertium/svn/branches/apertium-swpost/apertium-en-es
Usage
Command line
HMM tagger usage: apertium-tagger -t 8 es.dic es.crp apertium-en-es.es.tsx es-en.prob apertium-tagger -g es-en.prob.new SW tagger usage: apertium-tagger -w -t 8 es.dic es.crp apertium-en-es.es.tsx es-en.prob apertium-tagger -w -g es-en.prob.new
Tagging Experiments
1. language
es, in the language pair en-es, https://svn.code.sf.net/p/apertium/svn/branches/apertium-swpost/apertium-en-es
2. test set
The hand-tagged 1200+ lines in the en-es package.
25% of the words are ambiguous.
3. training data
Europal Spanish, 2 million lines.
4. evaluation scripts
In the en-es package, we have 2 tiny scripts: apertium-en-es/es-tagger-data/extract_word_pos.py and apertium-en-es/es-tagger-data/eval_fscore.sh
The scripts is a bit simple, because it just list words and their POS tags in two collumns for the reference and test file, and count how many lines of the two are different. But I think the trend it reveals is informative.
5. run the whole training and evaluation pipeline
To execute a whole training and evaluation prodecure, please refer to thesse 2 scripts: apertium-en-es/step1_preporcess.shand apertium-en-es/step2_train_tag_eval.sh .
6. current F1 scores
Euroal Lines HMM(order 1) LSW(-1, +1) LSW(-2, -1, +1) 1 81.94 85.08 85.07 10 83.11 85.76 85.07 30 86.05 85.96 85.09 100 87.03 86.15 85.17 300 87.78 86.52 85.12 1000 88.41 86.77 85.16 3000 88.75 86.85 85.25 10000 88.83 86.88 85.16 30000 88.83 86.86 85.24 100000 88.84 86.87 85.43 300000 88.84 86.91 85.21 1000000 88.95 86.94 85.18
General Progress
2013-06-28: LSW tagger working, with rules.
2013-06-20: LSW tagger working, without rules.
2013-06-11: SW tagger working.
2013-05-30: Start.
Detailed progress
2013-06-28
1. add find_similar_ambiguity_class for the tagging procedure. So a new ambiguity class won't crash the tagger down.
2. bugfix to the normalize factor. This makes the things right, but no improvements are gained to the quality.
3. replace the SW tagger with the LSW tagger. So the "-w" option is owned by the LSW tagger.
2013-06-23
1. implement a light sliding-window tagger. This tagger is based on the SW tagger, with "parameter reduction" described in the 2005 paper.
2. add rule support for light-sw tagger. The rules help to improve the tagging quality.
2013-06-21
1. add ZERO define. Because there are some double comparisons, we need a relatively precise threshold.
2. bug fix for the initial procedure and iteration formula.
3. check function style so the new code is consistent to the existing code.
2013-06-20
1. use heap space for 3-dimensional parameters. This makes it possible to train successfully without manually setting the 'stack' environment.
2. add retrain() function for SW tagger. The logic of the SW tagger's retrain is the same as that of the HMM tagger. It append several iterations based on the current parameters.
3. bugfix, avoid '-nan' parameters.
4. the tagger_data write only non-ZERO values. This saves a lot of disk space, reducing the parameter file from 100M to 200k.
2013-06-19
1. add print_para_matrix() for debugging in SW tagger. This funciton only prints non-ZERO parameters in the 3d matrix.
2. add support for debug, EOS, and null_flush. This makes the tagger work stable when called by other programs.
2013-06-17
1. a deep follow into the morpho_stream class, and make sense its memembers and functions.
2. refine the reading procedure of the SW tagger, so that the procedure is simpler and more stable.
2013-06-13
1. fix a bug in tagging procedure, where the initial tag score should be -1 instead of 0.
2013-06-12
1. add option "-w" for sw tagger. The option "-w" is not a drop-in replacement to the current HMM tagger, but an extension. So the default tagger for Apertium will still be the HMM tagger. If the "-w" option is specified, the the SW tagger will be used.
2. add support for judging the end of morpho_stream.
3. The first working version is OK:)
2013-06-11
1. Fix the bug of last version, mainly because of the read() method in 'TSX reader'. The read and write methods in the tsx_reader and tagger_data are re-implemented, because they are different from those for the HMM.
2. Implement the compression part of the SW tagger probabilities. These parameters are stored in a 3-d array.
3. Doing some debugging on the HMM tagger, in order to see how a tagger should work togethor with the whole pipeline.
2013-06-10
1. Implement a basic version SW tagger. But there are bugs between them.
2. The training and tagging procedures strictly follow the 2004 paper.
2013-05-30
1. Start the project.