User:Gang Chen/GSoC 2013 Progress
Contents
GSOC 2013[edit]
I was working with Apertium for the GSoC 2013 (2013.06-2013.09), on the project "Sliding Window Part of Speech Tagger for Apertium".
my proposal is here: Proposal
SVN repo[edit]
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
3. es-ca language pair(for experiment) https://svn.code.sf.net/p/apertium/svn/branches/apertium-swpost/apertium-es-ca
Usage[edit]
Command line[edit]
HMM tagger usage: apertium-tagger -t 8 es.dic es.crp apertium-en-es.es.tsx es-en.prob.new apertium-tagger -g es-en.prob.new LSW tagger usage: apertium-tagger -w -t 8 es.dic es.crp apertium-en-es.es.tsx es-en.prob.new apertium-tagger -w -g es-en.prob.new
Tagging Experiments[edit]
1. run the whole training and evaluation pipeline[edit]
To execute a whole training and evaluation procedure, please refer to these 2 scripts:
apertium-en-es/es_step1_preprocess.sh
apertium-en-es/es_step2_train_tag_eval.sh
2. evaluation scripts[edit]
In the apertium-swpost/apertium-xx-yy (e.g. apertium-en-es) package, we have 2 tiny scripts, that do the evaluation, and are called by es_step2_train_tag_eval.sh:
apertium-en-es/es-tagger-data/extract_word_pos.py
apertium-en-es/es-tagger-data/eval.py
3. Experimetal Results[edit]
3.1 Language Pairs[edit]
language | svn | training | test-set |
---|---|---|---|
es | apertium-swpost/apertium-en-es | Europarl Spanish | 1000+ lines, hand-tagged |
ca | apertium-swpost/apertium-es-ca | Catalan Wikipedia | 1000+ lines, hand-tagged |
en | apertium-swpost/apertium-en-es | Europarl Spanish | 1000+ lines, 80% automatically mapped from the TnT tagger, 20% by hand-tagging |
3.2 System Precision[edit]
4. Rules and CG[edit]
4.1 With or without Rules[edit]
4.2 With or without CG[edit]
- cgTrain means using CG for processing the training corpus (to reduce ambiguity).
- cgTag means using CG before the PoS tagger.
4.2.1 Spanish[edit]
4.2.2 Catalan[edit]
4.2.3 English[edit]
Week Plan and Progress[edit]
week | date | plans | progress |
---|---|---|---|
Week -2 | 06.01-06.08 | Community Bonding | (1) Evaluation scripts (1st version) working for Recall precision and F1-score. (2) SW tagger (1st version) working. |
Week -1 | 06.09-06.16 | Community Bonding | (1) LSW tagger (1st version) working, without rules. |
Week 01 | 06.17-06.23 | Implement the unsupervised version of the algorithm. | (1) LSW tagger working, without rules. (2) Check for and fix bugs. |
Week 02 | 06.24-06.30 | Implement the unsupervised version of the algorithm. | (1) LSW tagger working, with rules. (2) Update evaluation scripts for unknown words. |
Week 03 | 07.01-07.07 | Store the probability data in a clever way, allowing reading and edition using linguistic knowledge. Test using linguistic edition. | (1) Reconstruct tagger-data using inheritance. (2) Experiment on "How the iteration number affects the tagger performance?"(Conclusion: usually less than 8.) (3) Extract large corpus from Wikipedia for Spanish and Catalan for text amount experiments. |
Week 04 | 07.08-07.14 | Make tests, check for bugs, and documentation. | (1) Refine LSW tagger code for efficiency. (2) Experiment on "How the text amount affects the tagger performance?" (Conclusion: usually 1000+ lines will be OK) (3) Make stability tests. |
Deliverable #1 | A SWPoST that works with probabilities. | ||
Week 05 | 07.15-07.21 | Implement FORBID restrictions, using LSW. Using the same options and TSX file as the HMM tagger. | (1) Refine LSW tagger code for efficiency. (2) Implement LSW tagger with different window sizes for Catalan and Spanish and experiment them with different amounts of text. (Conclusion: window -1,+1 works best of all). |
Week 06 | 07.22-07.28 | Implement FORBID restrictions, using LSW. Using the same options and TSX file as the HMM tagger. | (1) Study the TnT tagger for preparing English tagged text. (2) Map tags between TnT tagger and LSW tagger. 6000 ambigous words were automatically mapped out of the total 8000. |
Week 07 | 07.29-08.04 | Implement ENFORCE restrictions, using LSW. Using the same options and TSX file as the HMM tagger. | (1) Hand-tag the 2000 ambiguous words that were not mapped automatically. |
Week 08 | 08.05-08.11 | Make tests, check for bugs, and documentation. | (1) Experiment different window settings and text amounts on English. (Conclusion: performance all increase, unlike Spanish and Catalan, which decrease under some settings.) (2) Experiment to randomize training text for Spanish. (Conclusion: behave very alike.) (3) Further study window -1,+1,+2. (very little improvement at the cost of increasing many parameters and memory usage.) |
Deliverable #2 | A SWPoST that works with FORBID and ENFORCE restrictions. | ||
Week 09 | 08.12-08.18 | Implement the minimized FST version. | (1) Experiment HMM and LSw tagger without rules (2) Learn about CG. |
Week 10 | 08.19-08.25 | Refine code. Optionally, implement the supervised version of the algorithm. | (1) Experiment HMM and LSw tagger without rules (2) Experiment HMM and LSW tagger with CG. |
Week 11 | 08.26-09.01 | Make tests, check the code and documentation. Optionally, Study further possible improvements. | (1) re-ran the experiments to check code and data. (2) Write the report, 1st version. |
Week 12 | 09.02-09.08 | Make tests, check the code and documentation. | Documentation |
Deliverable #3 | A full implementation of the SWPoST in Apertium. |
General Progress[edit]
2013-09-23: Making test, checking for bugs, documentation.
2013-08-27: Experiment using CG with LSW tagger.
2013-08-20: Experiment HMM and LSW tagger without rules.
2013-08-09: Experiment different window settings and text amounts on English.
2013-08-01: Hand-tag the English words that were not automatically mapped from the TnT tagger.
2013-07-26: Map tags between TnT tagger and LSW tagger.
2013-07-17: Refine LSW tagger code for efficiency.
2013-07-06: Reconstruct tagger data using inheritance. Delete the intermedia SW tagger implementation.
2013-06-28: LSW tagger working, with rules.
2013-06-20: LSW tagger working, without rules.
2013-06-11: SW tagger working. Evaluation scripts working.
2013-05-30: Start.
Detailed progress[edit]
2013-09-23
1. Makint tests, checking for bugs, documentation.
2. Finished the report, 2nd, 3rd vertion.
2013-09-03
1. Finished the report, 1st version
2013-08-27
1. Finished experimenting HMM and LSW tagger without using rules.
2. Managed to use CG together with LSW tagger.
2013-08-09
1. Finished hand-tagging the English test set.
2. Experiment different window settings, and text amount on English.
3. Experiment to randomize training text for Spanish.
4. Further experiment the -1,+1,+2 window.
2013-08-01
1. Check the algorithm and analyse cases
2. Hand-tag the rest 20% ambiguous words that were not mapped automatically.
2013-07-26
1. Study the usage of the TnT tagger.
2. Study the relationship between tagset of the TnT tagger and that of the Apertium tagger.
3. Develop algorithms to do automatic mapping between the two tagsets, 80% of the ambiguous words are successfully mapped.
2013-07-15
1. Follow the training and tagging procedure step by step, using a small corpus of several sentences, so that parameters can be calculated by hand.
2. No significant bugs found during the training and tagging procedure.
2013-07-10
1. Managed to get the HMM-supervised running.
2. Do experiments with window +1+2, -1+1+2. The results show that the RIGHT contexts are more important than the left contexts.
2013-07-06
1. Reconstruct 'tagger_data' class, using INHERITANCE for HMM and LSW respectively.
2. Make relevant changes to the surroundings, including tagger, tsx_reader, hmm, lswpost, filter-ambiguity-class, apply-new-rules, read-words, etc.
3. DELETE the swpost tagger, which serves as an intermedia implementaion, replaced by the final lsw tagger, which works fine and could support rules.
2013-07-03
1. update evaluation scripts, putting the unknown words into consideration. Now the evaluation script can report Recall, Precision, and F1-Score.
2. experiment with different amounts of text for training the LSW tagger.
3. experiment with different window sizes for training the LSW tagger.
4. experiments show strange results.
5. checking implementation, in case of potential bugs.
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.