Automatic Language Identification for Persian and Dari Texts

Automatic Language Identification for Persian and Dari Texts

2015 Pacific Association for Computational Linguistics Automatic Language Identification for Persian and Dari texts Shervin Malmasi Mark Dras Centre for Language Technology Centre for Language Technology Macquarie University Macquarie University Sydney, NSW, Australia Sydney, NSW, Australia [email protected] [email protected] Abstract—We present the first empirical study of distin- II. RELATED WORK AND BACKGROUND guishing Persian and Dari texts at the sentence level, using A. Language and Variety Identification discriminative models. As Dari is a low-resourced language, we developed a corpus of 28k sentences (14k per-language) for this Work in LID dates back to the seminal work of [3]–[5] and task, and using character and word n-grams, we discriminate automatic LID methods have since been widely used in NLP. them with 96% accuracy using a classifier ensemble. Out- Although LID can be extremely accurate in distinguishing of-domain cross-corpus evaluation was conducted to test the discriminative models’ generalizability, achieving 87% accu- languages that use distinct character sets (e.g. Chinese or racy in classifying 79k sentences from the Uppsala Persian Japanese) or are very dissimilar (e.g. Spanish and Swedish), Corpus. A feature analysis revealed lexical, morphological and performance is degraded when it is used for discriminating orthographic differences between the two classes. A number of similar languages or dialects. This has led to researchers directions for future work are discussed. turning their attention to the sub-problem of discriminating Keywords-Language Identification; Dialect Identification; between closely-related languages and varieties. Persian; Farsi; Dari; This issue has been investigated in the context of confus- able languages, including Malay-Indonesian [6], Croatian- I. INTRODUCTION Slovene-Serbian [1], Bosnian-Croatian-Serbian [7], and Chi- Language Identification (LID) is the task of determining nese varieties [8]. The task of Arabic Dialect Identification the language of a given text, which may be at the document, has also attracted the attention of the Arabic NLP commu- sub-document or even sentence level. Recently, attention has nity [9]. turned to discriminating between close languages, such as This issue was also the focus of the recent “Discrimi- Malay-Indonesian and Croatian-Serbian [1], or even vari- nating Similar Language” (DSL) shared task.1 The shared eties of one language (British vs. American English). task used data from 13 different languages and varieties LID has a number of useful applications including lexi- divided into 6 sub-groups and teams needed to build systems cography, authorship profiling, machine translation and In- for distinguishing these classes. They were provided with formation Retrieval. Another example is the application of a training and development dataset comprised of 20;000 the output from these LID methods to adapt NLP tools that sentences from each language and an unlabelled test set of require annotated data, such as part-of-speech taggers, for 1;000 sentences per language was used for evaluation. Most resource-poor languages. This is discussed in Section II-B. entries used surface features and many applied hierarchical The primary aim of this work is to apply classification classifiers, taking advantage of the structure provided by the methods to Persian (also known as Farsi) and Dari (Eastern language family memberships of the 13 classes. More details Persian, spoken predominantly in Afghanistan), two close can be found in the shared task report [10]. variants that have not hitherto been investigated in LID. As Although LID has been investigated using many lan- the first such study, we attempt to establish the performance guages, to our knowledge, the present study is the first of currently used classification methods on this pair. Dari treatment of Persian and Dari within this context. Existing is a low-resourced but important language, particularly for tools such as the Open Xerox Language Identifier2 do not the U.S. due to its ongoing involvement in Afghanistan, and distinguish between the pair. this has led to increasing research interest [2]. We approach this task at the sentence-level by developing B. Applications of LID a corpus of sentences from both languages in section III and Further to determining the language of documents, LID applying classification methods. Out-of-domain cross-corpus has applications in statistical machine translation, lexicogra- evaluation is also performed to gauge the discriminative phy (e.g. inducing dialect-to-dialect lexicons) and authorship models’ generalizability to other data. We also conduct a 1Held at the Workshop on Applying NLP Tools to Similar Languages, qualitative feature analysis in section VI to highlight the Varieties and Dialects, co-located with COLING 2014. key differences between the two varieties. 2https://open.xerox.com/Services/LanguageIdentifier 53 2015 Pacific Association for Computational Linguistics profiling in the forensic linguistics domain. In an Informa- Sentence Token Count By Class tion Retrieval context it can help filter documents (e.g. news DARI FARSI articles or search results) by language and even dialect; one Mean = 31.66 (SD=13.41), N = 14,000 Mean = 33.18 (SD=12.49), N = 14,000 such example is presented by [11] where LID is used for creating language-specific Twitter collections. 50 50 LID serves as an important preprocessing method for other NLP tasks. This includes selecting appropriate models 40 40 for machine translation, sentiment analysis or other types of Tokens text analysis, e.g. Native Language Identification [12], [13]. 30 30 LID can also be used in the adaptation of NLP tools, Tokens such as part-of-speech taggers for low-resourced languages [14]. Since Dari is too different to directly apply Persian 20 20 resources, the distinguishing features identified through LID can assist in adapting existing resources. 10 10 C. Persian and Dari 0 0 The Persian language is part of the eastern branch of 500.0 400.0 300.0 200.0 100.00.0 100.0 200.0 300.0 400.0 500.0 the Indo-European language family, more specifically, the Frequency Indo-Iranian branch. Several varieties of the language exist, Figure 1. A histogram of the sentence lengths (tokens) in our corpus, including Western Persian (also known as Farsi) and East- broken down by the two linguistic variety classes. ern Persian, also called Dari, which is mainly spoken in Afghanistan. We will forgo expounding the linguistic properties of these languages here for they have been discussed at length was applied to the Persian language Voice of America 5 14;000 elsewhere. A concise overview of Persian orthography, website to extract another sentences, for a total of 28;000 morphology and syntax can be found in [15, Section 2]. sentences in our corpus. A thorough exposition of Persian, Dari and other Iranian A histogram of the sentence lengths in our corpus is languages can be found in [16]. shown in Figure 1. We see that the distributions are similar for both languages, with the exception of Dari having a III. DATA larger portion of short sentences. As Dari is a low-resourced language, no corpus for the For cross-corpus testing we use the Uppsala Persian Cor- language was readily available. However, the amount of Dari pus (UPC) developed by [15]. The UPC6 is a modified ver- language content on the web has been increasing and this sion of the Bijankhan corpus7 originally developed by [17] provides a good source of data for building corpora. with improved sentence segmentation and a more consistentPage 1 Similar to the recent work in this area, we approach this tokenization scheme. The UPC contains 2; 704; 028 tokens task at the sentence-level. Sentence length, measured by the which are annotated with part-of-speech tags, although we number of tokens, is an important factor to consider when do not use the tags here. The data was sourced from news creating the dataset. There may not be enough distinguishing articles and common texts from 4;300 topics. features if a sentence is too short, and conversely, very We apply the same sentence token count constraints as we long texts will likely have more features that facilitate have in our own data, leaving us with a subset of the corpus correct classification. This assumption is supported by recent consisting of 2:11m tokens in 78;549 sentences. A histogram evidence from related work suggesting that shorter sentences of the sentence lengths from this subset is shown in Figure are more difficult to classify [9]. Bearing this in mind, 2. The sentences here are somewhat shorter than our training we limited our dataset to sentences in the range of 5–55 data, with a mean length of 27 tokens compared to 32 in tokens in order to maintain a balance between short and the training data. This is reflected by the more positively long sentences. skewed distribution in the histogram. For this study we selected the Dari language Voice of America3 news website as the source of our data. Using Ideally this cross-corpus evaluation would also include articles from the “world” section of the site4, a total of similar amounts of Dari text, but a paucity of data resources 14;000 Dari sentences matching our length requirements limited us to testing with only a single class. were extracted from over 1;000 articles. This same procedure 3http://www.darivoa.com/ 5http://ir.voanews.com/ 4This section was chosen to avoid topic bias in the data since the other 6http://stp.lingfil.uu.se/%7Emojgan/UPC.html sections of the website may have articles more focused on local issues. 7http://ece.ut.ac.ir/dbrg/bijankhan/ 54 2015 Pacific Association for Computational Linguistics Sentence Token Count for the UPC subcorpus Table I CLASSIFICATION ACCURACY RESULTS ON OUR CORPUS USING VARIOUS 2,500.0 FEATURE SPACES UNDER 10-FOLD CROSS-VALIDATION.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    6 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us