1 Introduction
1Code-mixing is the alternation between two or more languages that can occur between sentences (inter-sentential), within the same utterance (intrasentential), or even inside a single token (mixing of morphemes). This phenomenon has been widely studied from the linguistic, psycholinguistic, and sociolinguistic point of view (Gardner-Chloros, 1995; Grosjean, 1995; Ho, 2007) but there is no consensus on the terminology to be adopted. In this paper code-mixing is used as an umbrella term to indicate a manifestation of language contact subsuming other expressions such as code-switching, languaging, borrowing, language crossing (Muysken, 2000).
2Code-mixing characterizes communication of post-colonial, migrant and multilingual communities (Papalexakis et al., 2014; Frey et al., 2016) and it emerges in different types of documents, for example parliamentary debates, interviews and social media posts (Carpuat, 2014; Das and Gamb¨ack, 2015; Piergallini et al., 2016). Travel writings (e.g. guidebooks, travelogues, diaries, blogs, travel articles in magazines) are affected as well by this phenomenon that has been studied in particular by analyzing small corpora of contemporary tourism discourse through manual inspection (Dann, 1996). Even if code-mixing occurs in less than 1% of the cases (Cappelli, 2013), it has several important functions in the travel domain: it gives a “linguistic sense of place” (Cortese and Hymes, 2001), it adds authenticity to a narration, it provides translation of cultural-specific words and it is a mean to define social identity (“us” tourists versus “they” locals) (Jaworski et al., 2003).
3In this work, we investigate the phenomenon of code-mixing in travel writings, but differently from previous works we shift the focus of analysis from contemporary to historical data and from manual to automatic information extraction. As for the first point, we present a corpus of more than 3.5 millions words of English travel writings published between the end of the XIX Century and the beginning of the XX Century, which we have retrieved from freely available sources and we release in a cleaned format. As for automatic information extraction, we retrain two state-of-the-art tools to identify English-Italian code-mixing and evaluate them on a sample of our dataset. We further launch the best system on the whole dataset and then we perform a semi-automatic refinement of the automatic annotation. The corpus, the training and test data and the outcome of the extraction are available online1.
2 Related Work
4Automatic language identification of monolingual documents has a long tradition in Natural Language Processing (Hughes et al., 2006; Lui and Baldwin, 2012). More recently a new hot topic of research has emerged, that is the detection of language at word level in code-mixing texts. Dedicated workshops and evaluation exercises have been organized on this task dealing with different pairs of languages and with social media data (Choudhury et al., 2014; Solorio et al., 2014; Molina et al., 2016). The most common approach of the proposed systems is based on Conditional Random Fields (CRFs) but there are also implementations of Logistic Regression and deep learning algorithms.
5To the best our knowledge, there is no previous work on the automatic identification of codemixing in travel writing. Cappelli (2013) and Gandin (2014) have studied the phenomenon, but they have mainly used standard corpus linguistics tools, i.e. WordSmith (Scott, 2008), to analyse language contact in English guidebooks, travel blogs written by expatriates and travel articles from 2002-2012.
3 Corpus Description
6Differently from the works cited in the previous Section, we focus on historical texts. To this end, we collect from Project Gutenberg2 a corpus of travel writings about Italy written by English native authors and published between the country unification and the beginning of the 30’s. We choose this period because in the second half of the XIX Century the tradition of the Grand Tour declined and leisure-oriented travels emerged. This radical transformation was enabled by technological, economic and sociological, factors, such as the development of steampowered ships and of the railway network, the growth of Anglo-American economy and a greater emancipation of women with more female travelers (Schriber, 1995). Moreover, after unification, new routes to Southern Italy and the islands were opened, so that travelers’ attention was no longer limited to the classic destinations in the North and Central Italy, such as Venice, Florence and Rome (Ouditt and Polezzi, 2012).
7The corpus is made by 57 texts3, divided into travel narratives (reports, diaries, collections of letters) and guidebooks, for a total of 3,630,781 tokens. We distinguish between these two types of text, following a standard classification of documents in the travel domain. However, the distinction was not so clear-cut in the period we take into account as it is now, since reports on personal travel experiences were often mixed with practical recommendations and long disquisitions on art and history. Therefore, we adopt as a rule of thumb the distinction suggested in (Santulli, 2007): travel narratives are those told in the first person, while guidebooks are written in impersonal form.
8The authors of the selected texts belong to different nationalities (UK, US, Ireland, Australia) and are both male and female. Some books dwell on specific cities or regions, others cover different parts of Italy or even several countries: in the latter case we extracted only the chapters related to Italy. Although we made an effort to have a diverse, well-balanced corpus in terms of content, author’s gender and nationality, this was only partially possible because of the limited availability of online travel books whose text is freely available and cleaned from OCR errors. The distribution of tokens according to the year of publication and type of text is shown in Fig. 1. Details about authors are given in a spreadsheet provided together with the corpus.
4 Code-Mixing Detection
9In this Section we describe the experiments on code-mixing, comparing the performance of two available systems in different configurations. We also detail the post-processing step introduced to refine the output of the best performing system.
Figure 1: Distribution of tokens per year of publication and sub-genre.
4.1 Experimental Setting
10In order to automatically extract Italian words, expressions and sentences from the corpus described in Section 3, we train and test two systems whose source code is available on the web. The first one (henceforth, langid) is based on character n-grams (n = 1 to 5) and adopts a weakly supervised approach, i.e. training data are monolingual texts of few thousand tokens (King and Abney, 2013). This system includes four classification algorithms: Conditional Random Field (CRF), Hidden Markov Model (HMM) and Maximum Entropy Model with and without generalized expectation criteria (MaxEnt-GE and MaxEnt). langid has been successfully evaluated on documents containing English texts mixed with 30 different minority languages such as Zulu and Chippewa4.
- 5 For Italian: “Le Avventure di Pinocchio” by C. Collodi, “Una donna” by S. Aleramo, “Il Valdarno da (...)
11For our experiments, we retrain langid using a collection of about 300,000 tokens taken from monolingual Italian and English books, of different genres, published in the same period of our corpus5.
12The second system (henceforth, CodeSwitching), has been developed to detect languages in texts mixing Latin and Middle English (Schulz and Keller, 2016). It implements a CRF classifier with features generated from TreeTagger models and word lists of both languages6. Differently from langid that classifies words as belonging to one language rather than the other, this latter system performs a fine-grained annotation by distinguishing five classes (see below). Since this system is fully supervised, we create a training set by manually annotating 3,900 tokens from 4 samples extracted from our corpus, a size in line with the training data used in the original paper. The training data were annotated with 5 different classes: Italian tokens (i), English tokens (e), punctuation (p), named entities (NEs) (n), and ambiguous tokens that belong to the dictionary of both languages (a).
13Both langid and CodeSwitching were evaluated on the same test set, i.e. two samples of texts (one from a travel narrative and one from a guidebook) of 1,623 tokens. The test set was annotated by assigning to each token a label for English or Italian, as required by langid, and also marking punctuation, NEs and ambiguous tokens, following CodeSwitching scheme. Since the performance of langid is sensitive to the length of the input file, we split the test set in batches of 40 sentences, replicating the experimental setting presented in (Schulz and Keller, 2016).
4.2 Evaluation
14Table 1 presents the performances of langid on the test set: contrary to the results achieved by King and Abney (2013), HMM – not CRF – proved to be the best approach. This is likely due to the greater sparseness of the code-mixing phenomenon in our dataset with respect to what was registered in the original corpus, where languages different from English cover the 56% of the over-all number of tokens.
15Table 2 reports Precision, Recall and F-measure of the retrained CodeSwitching system. Even if the overall performance is slightly better than the one obtained with HMM in langid, the scores for the detection of Italian tokens (i) are lower (0.82 versus 0.90 in terms of F-measure). Punctuation (p) and ambiguous tokens (a) are generally detected with a good performance, while NEs (e) represent the most challenging class. Given that we are mainly interested in recognising English and Italian terms, and that on this task langid performs better, we run this tool on the whole corpus.
Table 1: Results of the evaluation on the retrained langid system in terms of precision (P), recall (R), and F-Measure (F)
|
CRF
|
HMM
|
MaxEnt
|
MaxEnt-GE
|
P
|
1
|
0.89
|
0.59
|
0.82
|
R
|
0.51
|
0.92
|
0.90
|
0.47
|
F
|
0.67
|
0.90
|
0.71
|
0.60
|
Table 2: Results of the evaluation on the retrained CodeSwitching system in terms of precision (P), recall (R), and F-Measure (F) for each class and the macro-average of all classes
|
i
|
e
|
a
|
n
|
p
|
ALL
|
P
|
0.83
|
0.98
|
0.98
|
0.85
|
0.98
|
0.92
|
R
|
0.80
|
0.99
|
0.90
|
0.85
|
0.96
|
0.90
|
F
|
0.82
|
0.99
|
0.94
|
0.85
|
0.97
|
0.91
|
4.3 Post-processing
16In order to refine the output of langid (see Figure 2), we perform three post-processing steps. First of all, we check whether tokens tagged as Italian are included in Morph-it, an Italian lexicon of inflected forms (Zanchetta and Baroni, 2005): in this way we are able to detect false positives. Then, we run the Polyglot Python module on the corpus to find out if the processed documents contain other languages beside English and Italian7. Indeed 27 books result to have a high probability of including text written also in Latin, French, Germany or Greek. These books are likely to be problematic given that langid recognizes only English and Italian. Information obtained in these two steps are then used to manually check the outcome of langid extraction and correct it semi-automatically. Furthermore, we employ the USAS Italian semantic tagger (Piao et al., 2015) to obtain a categorization of the terms tagged as Italian. Based on the 21 semantic classes recognised by USAS, we are able to understand in which cases and why writers used to switch their narration from English to Italian.
5 Discussion
17The classification performed with the USAS tagger shows that Italian is adopted to express concepts covered by 20 semantic classes, both in guidebooks and in travel narratives. Only one USAS class, the one related to “Science and technology”, is not found in the corpus. Table 5 shows frequency and examples for each detected class. As in contemporary travel writings (Francesconi, 2007), food is well represented: traditional dishes, drinks and products (e.g. polenta, Chianti, mortadella) appear together with fruits, vegetables (e.g. mandarini, finocchio) and also eating establishments (e.g. osteria, trattoria, locanda). The attention for Italian art and architecture manifests itself through the use of many specialized terms (cassettoni, gotico, giallo antico). The semantic areas of emotions and psychological processes are not recorded in previous work on contemporary texts but are frequent especially in travel reports (e.g. addolorata, trionfo, simpatico). As for NEs, city names reveal an increasing interest for towns in Central regions (for example, Perugia has a high frequency of occurrence in both genres). Moreover, following Italy unification, travellers discovered several locations in the South (e.g. Ragusa, Catanzaro). Among the most mentioned people, there are representatives of past Italian politics (e.g. Lorenzo and Cosimo de Medici), artists (e.g. Giotto, Dante) and religious figures (e.g. Madonna, San Michele).
Figure 2: Examples of langid output.
18In many cases, the use of Italian is not limited to single words or multi-token expressions (e.g. appartamento signorile) but longer utterances are reported. Texts of both genres contain proverbs (e.g. chi tardi arriva mal alloggia) and citations, not only from the canon of Italian literature, such as Leopardi’s poems, but also from the popular tradition, such as Tuscan songs (O rosa O rosa O rosa gentillina). The main difference between travel narratives and guidebooks is the greater presence in the former of dialogues or expressions heard by the author during his/her stay in Italy (voi siete un cattivo; e voi siete bella).
19Table 3: Italian word frequency for each semantic class
GUIDEBOOKS
|
TRAVEL NARRATIVES
|
SEMANTIC CLASS
|
#
|
EXAMPLES
|
SEMANTIC CLASS
|
#
|
EXAMPLES
|
names & grammar
|
29,927
|
Pisa
|
names & grammar
|
28,694
|
Donatello
|
architecture
|
3,070
|
villa
|
social elements
|
3,134
|
popolo
|
movement
|
2,294
|
automobile
|
architecture
|
3,065
|
palazzo
|
social elements
|
1,590
|
trinita
|
environment
|
1,311
|
lago
|
materials & objects
|
717
|
fontana
|
movement
|
1,207
|
vetturino
|
environment
|
713
|
campagna
|
materials & objects
|
965
|
rosso
|
general/abstract terms
|
580
|
essere
|
general/abstract terms
|
943
|
fare
|
measurement
|
340
|
alto
|
food & farming
|
665
|
trattoria
|
arts & crafts
|
231
|
stucco
|
life
|
479
|
fiore
|
time
|
225
|
nuovo
|
measurement
|
464
|
grande
|
life
|
222
|
agnello
|
time
|
379
|
primavera
|
body
|
211
|
cintola
|
body
|
350
|
braccio
|
public domain
|
205
|
podesta
|
psyche
|
330
|
vedere
|
psyche
|
198
|
volere
|
entertainment
|
319
|
marionetta
|
food & farming
|
162
|
maccaroni
|
money & commerce
|
269
|
dazio
|
entertainment
|
141
|
giuoco
|
communication
|
268
|
dire
|
emotion
|
137
|
amore
|
public domain
|
260
|
carabiniere
|
communication
|
131
|
motto
|
arts & crafts
|
206
|
arte
|
money & commerce
|
127
|
soldo
|
emotion
|
176
|
evviva
|
education
|
22
|
universita
|
education
|
135
|
maestro
|
6 Conclusions and Future Work
20In this work, we presented the first automated analysis of code-mixing in historical travel writings. In particular, we focus on English documents about Italy, and we compare guidebooks and travel narratives, analysing the semantic categories mostly related to code-mixing.
21In the future, we plan to investigate how code-mixing phenomena relate to content types in travel writings (Sprugnoli et al., 2017). Besides, we are planning to implement an algorithm to automatically link code-mixing quotations to their original source text. Finally, we would like to extend our experiments to recognise code-mixing in multiple languages, and compare the semantic domains specific to each language.