Building a J apanese Typo Dataset from W ikipedia’s Revision History (2020)

Abstract: User generated texts contain many typos for which correction is necessary for NLP systems to work. Although a large number of typo–correction pairs are needed to develop a data-driven typo correction system, no such dataset is available for Japanese. In this paper, we extract over half a million Japanese typo–correction pairs from Wikipedia’s revision history. Unlike other languages, Japanese poses unique challenges: (1) Japanese texts are unsegmented so that we cannot simply apply a spelling checker, and (2) the way people inputting kanji logographs results in typos with drastically different surface forms from correct ones. We address them by combining character-based extraction rules, morphological analyzers to guess readings, and various filtering methods. We evaluate the dataset using crowdsourcing and run a baseline seq2seq model for typo correction.

## introduction for over a decade, user generated content (ugc) has been an important target of nlp technology. it is characterized by phenomena not found in standard texts, such as word lengthening (brody and diakopoulos, 2011), dialectal variations (saito et al., 2017; blodgett et al., 2016), unknown onomatopoeias (sasano et al., 2013), grammatical errors (mizumoto et al., 2011; lee et al., 2018), and mother tongue interference in non-native writing (goldin et al., 2018). typographical errors (typos) also occur often in ugc. @xcite typos prevent machines from analyzing texts properly (belinkov and bisk, 2018). typo correction systems are important because applying them before analysis would reduce analysis errors and lead to improved accuracy in various nlp tasks. neural networks are a promising choice for building a typo correction system because they have demonstrated their success in a closely related task, spelling correction (sakaguchi et al., 2017). since neural networks are known to be data-hungry, the first step to develop a neural typo correction system is to prepare a large number of typos and their corrections. however, to our best knowledge, no such dataset is available for japanese. @xcite this motivated us to build a large japanese typo dataset. typos are usually collected using data mining techniques because thorough corpus annotation is inefficient for infrequently occurring typos. previous studies on building typo datasets have exploited wikipedia because it is large, and more importantly, keeps track of all changes made to an article (max and wisniewski, 2010; zesch, 2012). in these studies, to collect typo-correction pairs, the first step is to identify words changed in revisions and the second step is to apply a spell checker to them or calculate the edit distance between them. while these methods work well on the target languages of the previous studies, namely french and english, they cannot be applied directly to languages such as japanese and chinese, where words are not delimited by white space. this is because a typo may cause a word segmentation error and can be misinterpreted as a multiple-word change, making it difficult to identify the word affected. although state-of-the-art word segmenters provide reasonable accuracy for clean texts, word segmentation on texts with typos remains a challenging problem. in addition, languages with complex writing systems such as japanese and chinese have typos not found in french and english. these languages use logographs, kanji in japanese, and they are typically entered using input methods, with which people enter phonetic symbols, kana in the case of japanese, and then select a correct logograph from a list of logographs matching the reading. typos occurring during this process can be drastically different from the correct words. in this paper, we build a japanese wikipedia typo dataset (jwtd) from japanese wikipedia's revision history. to address problems mentioned above, we treat adjacent changed words as one block and obtain the readings of kanji using a morphological analyzer. this dataset contains over half a million typo-correction sentence pairs. we evaluate jwtd by using crowdsourcing and use it to train a baseline seq2seq model for typo correction. jwtd is publicly available at http://nlp.ist.i. kyoto-u.ac.jp/en/edit.php?jwtd . to the best of our knowledge, this is the first freely available large japanese typo dataset. ## japanese typos we classify japanese typos into four categories: erroneous substitution (hereafter substitution), erroneous deletion (hereafter deletion), erroneous insertion (hereafter insertion), and erroneous kanjiconversion (hereafter kanji-conversion). @xcite an example and its correction for each category are shown in to enter kanji, you first enter hiragana syllabary, either by converting roman-letter inputs or directly using a hiragana keyboard. the hiragana sequence indicates the reading, and accordingly, the input method shows a list of candidate kanji that match the reading, allowing you to choose the correct one. errors in kanji-conversion typically occur at the last step. a typo of this category shares the reading with the correct one but in most cases, does not contain the same characters at all. for example, the typo-correction pair, "貼り付け (harituke) → 磔 (harituke)", which mean paste and crucifixion respectively, shares no character at all so that a simple edit distance-based method does not work. this is why kanji-conversion requires a special treatment. ## data construction we construct jwtd in two steps. we first extract candidates of typo-correction sentence pairs from wikipedia's revision history and then filter out pairs that do not seem to be typo corrections. ## dataset analysis we built jwtd by applying the method explained in section 3 to japanese wikipedia's revision history generated in june 2019. the number of typo-correction pairs obtained for each category is shown in the top 10 most frequent typo-correction pairs are listed in the top 5 most frequent typo-correction pairs in terms of parts-of-speech are shown in ## evaluation through crowdsourcing by using crowdsourcing, we evaluated the dataset. we randomly sampled 2,996 article pages and evaluated sentence pairs extracted from them. they ## a typo correction system using jwtd we built a baseline typo correction system using jwtd.