{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,9,4]],"date-time":"2026-09-04T11:17:11Z","timestamp":1788520631613,"version":"build-2803163510"},"reference-count":44,"publisher":"Oxford University Press (OUP)","issue":"3","license":[{"start":{"date-parts":[[2026,5,26]],"date-time":"2026-05-26T00:00:00Z","timestamp":1779753600000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"funder":[{"name":"King\u2019s College London, Arts & Humanities Research and Scholarship"}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":[],"published-print":{"date-parts":[[2026,9,1]]},"abstract":"<jats:title>Abstract<\/jats:title>\n                  <jats:p>There has been extensive research on the phenomenon of code switching, meaning the use of two or more languages or language varieties, within texts. Until recently, most code switching studies in the digital humanities have tagged the mixed languages manually, as automatic language identification methods have so far performed too unreliably to be useful, although research on automatic methods is growing. This paper aims to improve methods for identifying snippets of a second language in historical and literary texts by evaluating three automatic methods of increasing complexity: dictionary method, dedicated language identification packages, and fine-tuned large language models (LLMs). We evaluate the methods on the test case of manually tagged French snippets in English literary texts, and report that fine-tuned LLMs performed with the highest overall detection rates in our experiment with different models, although language pair-specific methodological questions remain. We have published our code and fine-tuned LLMs to assist research on this language pair, and these methods may be expanded to more language pairs and broader applications in the future. Finally, we report observations of French usage in the English literary texts in our corpus, dating 1814\u20131920.<\/jats:p>","DOI":"10.1093\/llc\/fqag060","type":"journal-article","created":{"date-parts":[[2026,4,23]],"date-time":"2026-04-23T11:40:21Z","timestamp":1776944421000},"page":"1433-1444","source":"Crossref","is-referenced-by-count":0,"title":["Advancing methods in automatic code switching detection for digital humanities"],"prefix":"10.1093","volume":"41","author":[{"ORCID":"https:\/\/orcid.org\/0000-0003-0264-2157","authenticated-orcid":false,"given":"Erik","family":"Ketzan","sequence":"first","affiliation":[{"name":"King\u2019s College London Department of Digital Humanities, , Strand , London, WC2R 2LS,","place":["United Kingdom"]}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Avyav Kumar","family":"Singh","sequence":"additional","affiliation":[{"name":"King\u2019s College London Department of Informatics, , Strand , London, WC2R 2LS,","place":["United Kingdom"]}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Tianyu","family":"Wang","sequence":"additional","affiliation":[{"name":"Independent Scholar"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Shenwei","family":"Xu","sequence":"additional","affiliation":[{"name":"Independent Scholar"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"286","published-online":{"date-parts":[[2026,5,26]]},"reference":[{"key":"2026090406373615200_fqag060-B1","doi-asserted-by":"publisher","first-page":"221","DOI":"10.1177\/0963947008092502","author":"Albakry","year":"2008"},{"key":"2026090406373615200_fqag060-B2","first-page":"62","author":"Amazouz","year":"2017"},{"key":"2026090406373615200_fqag060-B3","author":"Brown","year":"2020"},{"key":"2026090406373615200_fqag060-B4","doi-asserted-by":"crossref","first-page":"xii","DOI":"10.1017\/CBO9780511576331.001","volume-title":"The Cambridge Handbook of Linguistic Code-Switching, Cambridge Handbooks in Language and Linguistics","author":"Bullock","year":"2009"},{"key":"2026090406373615200_fqag060-B5","author":"\u00c7etino\u011flu","year":"2016"},{"key":"2026090406373615200_fqag060-B6","doi-asserted-by":"publisher","DOI":"10.1075\/sibil.27","volume-title":"Spanish\/English Codeswitching in a Written Corpus, Volume 27 of Studies in Bilingualism","author":"Callahan","year":"2004"},{"key":"2026090406373615200_fqag060-B7","doi-asserted-by":"publisher","first-page":"373","DOI":"10.30812\/humanitatis.v10i2.3837","article-title":"Code Switching in the Social Media Era: A Linguistic Analysis of Instagram and TikTok Users","volume":"10","author":"Daulay","year":"2024","journal-title":"Humanitatis: Journal of Language and Literature"},{"key":"2026090406373615200_fqag060-B8","doi-asserted-by":"publisher","first-page":"506","DOI":"10.1353\/cdr.1997.0016","author":"Diller","year":"1997"},{"key":"2026090406373615200_fqag060-B9","doi-asserted-by":"crossref","DOI":"10.1017\/CBO9780511609787","volume-title":"Code-Switching","author":"Gardner-Chloros","year":"2009"},{"key":"2026090406373615200_fqag060-B10","doi-asserted-by":"publisher","first-page":"182","DOI":"10.1177\/0963947015585065","author":"Gardner-Chloros","year":"2015"},{"key":"2026090406373615200_fqag060-B11","author":"GoogleAI","year":"2024"},{"key":"2026090406373615200_fqag060-B12","doi-asserted-by":"publisher","first-page":"282","DOI":"10.1177\/0963947017718996","author":"Green","year":"2017"},{"key":"2026090406373615200_fqag060-B13","doi-asserted-by":"crossref","first-page":"1938","DOI":"10.63744\/gb2n7ub8kvhj","article-title":"In a Test Bed with Kafka. Introducing a Mixed-Method Approach to Digital Stylistics","volume":"11","author":"Herrmann","year":"2018","journal-title":"Digital Humanities Quarterly"},{"key":"2026090406373615200_fqag060-B14","author":"Howard","year":"2018"},{"key":"2026090406373615200_fqag060-B15","article-title":"Models","author":"Hu","year":"2021"},{"key":"2026090406373615200_fqag060-B16","author":"Jauhiainen","year":"2018"},{"key":"2026090406373615200_fqag060-B17","author":"Joulin","year":"2016"},{"key":"2026090406373615200_fqag060-B18","author":"Kaur","year":"2024"},{"key":"2026090406373615200_fqag060-B19","article-title":"Texts","volume-title":"Proceedings of the Computational Humanities Research Conference 2022.","author":"Ketzan","year":"2022"},{"key":"2026090406373615200_fqag060-B20","first-page":"707","author":"Levenshtein","year":"1966"},{"key":"2026090406373615200_fqag060-B21","author":"Liu","year":"2024"},{"key":"2026090406373615200_fqag060-B22","doi-asserted-by":"publisher","first-page":"1808","DOI":"10.18653\/v1\/2020.coling-main.163","author":"Liu","year":"2020"},{"key":"2026090406373615200_fqag060-B23","doi-asserted-by":"publisher","first-page":"581","DOI":"10.1007\/s10579-015-9303-x","article-title":"Mandarin\u2013English Code-Switching Speech Corpus in South-East Asia: SEAME","volume":"49","author":"Lyu","year":"2015","journal-title":"Language Resources and Evaluation"},{"key":"2026090406373615200_fqag060-B24","doi-asserted-by":"publisher","first-page":"403","DOI":"10.1080\/13586840500347277","article-title":"Code-Switching in US Ethnic Literature: Multiple Perspectives Presented through Multiple Languages","volume":"12","author":"Martin","year":"2005","journal-title":"Changing English"},{"key":"2026090406373615200_fqag060-B25","article-title":"Models","author":"MetaAI","year":"2024"},{"key":"2026090406373615200_fqag060-B26","doi-asserted-by":"publisher","first-page":"264","DOI":"10.1177\/0963947015585224","author":"Montes-Alcal\u00e1","year":"2015"},{"key":"2026090406373615200_fqag060-B27","volume-title":"Distant Reading","author":"Moretti","year":"2013"},{"key":"2026090406373615200_fqag060-B28","doi-asserted-by":"publisher","first-page":"213","DOI":"10.1177\/0963947015585244","author":"Mullen","year":"2015"},{"key":"2026090406373615200_fqag060-B29","doi-asserted-by":"publisher","first-page":"9541","DOI":"10.3390\/app12199541","article-title":"Code-Switching in Automatic Speech Recognition: The Issues and Future Directions","volume":"12","author":"Mustafa","year":"2022","journal-title":"Applied Sciences"},{"key":"2026090406373615200_fqag060-B30","author":"Nguyen","year":"2013"},{"key":"2026090406373615200_fqag060-B31","doi-asserted-by":"publisher","first-page":"e0226708","DOI":"10.1371\/journal.pone.0226708","article-title":"Wattpad as a Resource for Literary Studies. Quantitative and Qualitative Examples of the Importance of Digital Social Reading and Readers\u2019 Comments in the Margins","volume":"15","author":"Pianzola","year":"2020","journal-title":"PLOS One"},{"key":"2026090406373615200_fqag060-B32","first-page":"978","volume-title":"Borrowing: Loanwords in the Speech Community and in the Grammar","author":"Poplack","year":"2018"},{"key":"2026090406373615200_fqag060-B33","first-page":"4170","author":"Samih","year":"2016"},{"key":"2026090406373615200_fqag060-B34","doi-asserted-by":"publisher","first-page":"25","DOI":"10.3828\/mlo.v0i0.364","article-title":"Creating the European Literary Text Collection (ELTeC)","volume":"1","author":"Sch\u00f6ch","year":"2021","journal-title":"Challenges and Perspectives"},{"key":"2026090406373615200_fqag060-B35","doi-asserted-by":"publisher","author":"Schulz","year":"2016","DOI":"10.18653\/v1\/W16-2105"},{"key":"2026090406373615200_fqag060-B36","doi-asserted-by":"publisher","first-page":"ecv043","DOI":"10.1093\/ijl\/ecv043","article-title":"The Corpus de R\u00e9f\u00e9rence du Fran\u00e7ais Contemporain (CRFC) as the First Genre-Diverse Mega-Corpus of French","volume":"30","author":"Siepmann","year":"2015","journal-title":"International Journal of Lexicography"},{"key":"2026090406373615200_fqag060-B37","doi-asserted-by":"publisher","first-page":"59","DOI":"10.26754\/ojs_misc\/mj.20205139","author":"S\u00e1nchez","year":"2020"},{"key":"2026090406373615200_fqag060-B38","author":"Solorio","year":"2008"},{"key":"2026090406373615200_fqag060-B39","doi-asserted-by":"publisher","DOI":"10.1057\/9781137367969","volume-title":"Multilingualism in Modernist Fiction","author":"Taylor-Batty","year":"2013"},{"key":"2026090406373615200_fqag060-B40","author":"TEI Consortium","year":"2025"},{"key":"2026090406373615200_fqag060-B41","author":"Valkana","year":"2022"},{"key":"2026090406373615200_fqag060-B42","doi-asserted-by":"publisher","author":"Vaswani","year":"2017","DOI":"10.48550\/ARXIV.1706.03762"},{"key":"2026090406373615200_fqag060-B43","first-page":"2901","author":"Volk","year":"2022"},{"key":"2026090406373615200_fqag060-B44","author":"Zhang","year":"2022"}],"container-title":["Digital Scholarship in the Humanities"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/academic.oup.com\/dsh\/article-pdf\/41\/3\/1433\/68390880\/fqag060.pdf","content-type":"application\/pdf","content-version":"vor","intended-application":"syndication"},{"URL":"https:\/\/academic.oup.com\/dsh\/article-pdf\/41\/3\/1433\/68390880\/fqag060.pdf","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2026,9,4]],"date-time":"2026-09-04T10:37:46Z","timestamp":1788518266000},"score":1,"resource":{"primary":{"URL":"https:\/\/academic.oup.com\/dsh\/article\/41\/3\/1433\/8693914"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2026,5,26]]},"references-count":44,"journal-issue":{"issue":"3","published-online":{"date-parts":[[2026,5,26]]},"published-print":{"date-parts":[[2026,9,1]]}},"URL":"https:\/\/doi.org\/10.1093\/llc\/fqag060","relation":{},"ISSN":["2055-7671","2055-768X"],"issn-type":[{"value":"2055-7671","type":"print"},{"value":"2055-768X","type":"electronic"}],"subject":[],"published-other":{"date-parts":[[2026,9]]},"published":{"date-parts":[[2026,5,26]]}}}