User:Dmin1/Final project
This page provides an overview and an evaluation of Korean Finite State Transducer I developed.
Contents
Motivation
For the final project, I decided to work on Finite State Transducer for Korean. Although there are several open-sourced POS tagger(Kkoma, HanNanum, and Komoran), none of them are purely rule-based; HanNanum and Komoran uses Hidden Markov Models(statistical method for making inferences about sequential data), and Kkoma requires the usage of a custom relational database.
Although the techniques employed in the aforementioned systems are crucial in achieving state-of-the-art performance, they have certain drawbacks. First, even after achieving extremely high performance, the probabilistic nature of such techniques make it very hard to identify what aspect of the system actually encodes the linguistic pattern. Thus, when an error occurs, it is usually impossible to correct the system manually. On the other hand, this is the development scheme for rule-based systems.
Also, apertium module for Korean has not been developed yet. Therefore, I decided to implement a transducer for Korean.
Overview
The development of this transducer largely consisted of two parts. The first challenge I encountered was to make the apertium pipeline work for Hangul(Decompose-Compose Step). This is the same problem I had while working on Jeju. While I only bypassed the problem in Jeju transducer, this issue is completely solved in this project. The second part consists of normal transducer development tasks: writing rules, adding lemmas, preparing corpora, evaluating, and repeating. Also, note that due to the large size of hangul.lexc, it is recommended that the user compiles it in a machine with at least 16gb of RAM or enable swap partition.
Decompose-Compose Step
Hangul, writing system for Korean, blocks 2 or 3 letters into a syllable-block, where each letter occupies the position of onset, nucleus, and optionally, coda. While Hangul is an alphabet, this blocking system requires that all legal combination of Hangul letters into a syllable encoded in a separate Unicode.
While developing a transducer for Jeju, this meant that I had to six thousands of Unicode letters to my lexc file. Not only did this make compiling very slow, but it did also led to restriction of morphological analysis. For instance, consider the following case:
- Vowel Ending + (Topic Marker) -> 는
- Consonant Ending + (Topic Marker) -> 은
To properly analyze this, it would be necessary to look at the last sound of the previous word. However, since this information is always encoded with extra information about the other letters that contain one syllable. Thus, it results in a massive explosion of matchings needed to capture the whole set.
However, in the new approach I matched a syllable to its decomposed letters. Although I needed still have one large separate hangul.lexc file with all such possible matchings, I only needed to compile once. More importantly, I allowed me to refer to the last letter of the decomposition, making writing matching rules much easier and natural. An important implementation detail is that in the hangul.lexc file each syllable, based on the number of letters constructing it, was given a carefully chosen weight. 1-letter syllable is given weight 0.8, 2-letter 1.4 3-letter 2.1. The weights are chosen so that larger syllables are preferred.
This was to ensure that in the compose step, only the correct composition is applied. For instance, 가나 will be flattened to ㄱㅏㄴㅏ, and there are many ways to arrange this: 간ㅏ,ㄱ ㅏ나ㅡ,ㄱㅏ나, etc. Now we see that ㄱㅏㄴㅏ has the unique minimum weight of 2.8, and is chosen in the decompose step. Since incorrect forms necessarily break up a larger composition into smaller ones, they have larger weight than the unique correct form.
Structure and Development
Finding corpora was easy. In particular, I processed Korean Wikipedia dump into a large corpus, from which I drew several random samples.
Most of the morphology was implemented in lexc and twol file. In this implementation of Korean POS analyzer, I was able to analyze most of noun morphology correctly. However, as there were multiple level of suffixes that attaches to verbs in Korean, the analysis and construction of verb alteration was not easy, as it involved multiple levels of suffixing and vowel harmony.
Evaluation
I observed that most of the errors come from either 1) lemmas not yet added or 2) failure to analyze different verb forms and alterations.
Coverage of corpora
Trained Corpora refers to the hand-assembled corpora that I used during development cycle to find out which forms were not analyzed by the transducer. Thus, coverage for them is not a good measure of the transducer's performance.(because I have changed the transducer so that their coverages improves.)
On the other hand, each test corpus is a set of 1200 words that I have fetched randomly from Korean Wikipedia.(I ran $cat corpus/wiki.txt |sort -Ru | head -n 1200 > sample.txt ) There might be some overlaps between them, but it is unlikely that they are significantly correlated to each other. They provide a more reliable estimate of the transducer's performance as a result.
Both training and test corpora can be accessed here.
Trained Corpora
- kor.phrases.COURT.txt:
- kor.phrases.GENESIS.txt:
- kor.phrases.HIROHITO.txt:
- kor.phrases.ROH.txt:
- kor.phrases.STALIN.txt:
- kor.phrases.WIKI.txt:
Test Corpora
- Sample (0): 18.65%
- Sample (1): 18.49%
- Sample (2): 18.53%
- Sample (3): 17.96%
- Sample (4): 18.20%
Precision and Recall
The hand annotated set can be found here.
Using Random 1200 words grabbed from Korean Wikipedia Dump
- Precision:
- Recall: