CorpusCompass: A Tool for Data Extraction and Dataset Generation in Corpus Linguistics
Authors: Muhadj Adnan, Nicolo' Brandizzi (University of Bayreuth, Sapienza Università di Roma, 2023)
Topic: Lexical and Semantic Resources and Analysis

Abstract
As the need for effective tools in Corpus Linguistics continues to grow, particularly for under-resourced languages and nonstandard annotation tasks, specialized software has become essential for processing and analyzing large and complex datasets. This paper introduces CorpusCompass, a new open-source tool for data extraction and dataset creation, which offers a number of functionalities for researchers interested in analyzing corpora. The tool can derive structured datasets from text annotated with custom annotation schemes, while also checking for errors and consistency. By defining custom variables of interest and annotation rules, researchers can tailor the tool to their specific needs, making it particularly valuable for unique linguistic research domains. When used in conjunction with statistical analysis or visualization tools, CorpusCompass helps researchers to gain insights into the factors that are affecting language use. In this paper, we introduce the tool and give a real-world example in the field of language variation.

Introduction
In recent years, there has been a growing interest in studying language variation in under-resourced languages. Mair [1] identifies a lack of resources for spoken data in corpus linguistics and emphasizes the need for more computational tools for different languages and varieties. The process of creating and analyzing a spoken language corpus is complex, posing a range of challenges for researchers in the field of Corpus Linguistics. In this context, we identify six main steps for this process, each presenting its own set of practical and technical challenges, see Figure 1. Step (i) entails sourcing and recording data, along with the associated metadata, which provides essential contextual information about the recordings. Following this, step (ii) involves transcribing the spoken data to convert it into a text-based format, allowing for more straightforward analysis. The third step (iii) involves annotating the data with linguistic features, such as phonological or morphological information. Subsequently, step (iv) requires data preprocessing to clean and organize the data, preparing it for the fifth step, (v), which is data analysis. This stage allows researchers to derive insights from the corpus by examining patterns and connections within the data. Lastly, the final step, (vi), involves publishing and sharing the corpus with the wider research community, promoting collaboration and further research based on the spoken language data. Annotating can be a time-consuming and error-prone process, especially when working with large corpora. Errors in a manually annotated corpus can potentially affect the evaluation. Additionally, poor quality annotation in the corpus can lead to misleading results in a linguistic analysis. This is where CorpusCompass comes into play. In this paper, we provide a detailed overview of CorpusCompass, including its design, implementation, and functionalities. The tool is based on Jupyter Notebook and is designed to help Corpus Linguistics researchers focusing on language variation to create a structured dataset from their previously annotated corpus/corpora and a list of variables of interest (see Section 3.1). The tool is coded in Python and can be run in an interactive manner using Google Colab. Once run, it generates a structured dataset, i.e., a systematically organized collection of data, that includes linguistic variables and potentially relevant metadata (see Section 3.2). On the one hand, the dataset enables corpus exploration, assisting in discovering patterns that can inform the creation of new hypotheses or the dismissal of initial assumptions (see Al-Wer et al. [2], pp. 37-38). On the other hand, it facilitates performing statistical analyses using established methods through platforms like Rbrul [3], SPSS [4], and R [5]. To exemplify the practical application of CorpusCompass within a research context, Section 4 explores a case study on inter-generational linguistic variation among Iraqi speakers living in Germany, and highlights various potential uses of the tool. For linguists without any or limited programming skills, CorpusCompass has the potential of saving time (by automating repetitive tasks) and improving the accuracy of their research. It is intended to bridge the gap between researchers and advanced statistical analysis by facilitating the connection between them, as well as addressing research questions that require the use of manually annotated data. Moreover, CorpusCompass was developed by researchers in Linguistics and Computer Science to advance Corpus Linguistics tools and promote interdisciplinary collaboration.

Conclusion
Creating and analyzing a corpus is a complex task that requires a range of technical and practical skills. In this paper, we have explored the challenges involved in these steps and introduced CorpusCompass as an innovative solution. The tool’s aim is to simplify data extraction and dataset generation, facilitating the identification of significant features and syntactic errors in the annotations. This contributes to advancing the overall replicability of studies within the field of Corpus Linguistics. As CorpusCompass is implemented as a Jupyter Notebook, it also serves as an accessible introduction to programming for researchers who wish to expand their skill set and gain more control over their analytical processes. Additionally, we have presented a real-world example of how CorpusCompass can be applied in the field of language variation by using a subset of our corpus of Arabic varieties spoken by migrants in Germany, representing an under-resourced language. The example shows how the generated dataset can be used in conjunction with existing analysis tools to answer unique research questions. With CorpusCompass, we aim to contribute to the development of tools for spoken language corpora. The existence of this tool and its accessibility to researchers without a background in programming will lead to more quantitative studies that analyze such corpora. The tool exemplifies interdisciplinary collaboration and emphasizes the importance of linguistics researchers working with experts from computer science and engineering. This collaboration results in the development of flexible corpus tools applicable to a wide range of research studies. Sharing is Caring: It is essential to highlight that structured datasets are crucial for sharing data in linguistic research, particularly in connection to research data management practices and platforms such as Figshare [24]. Organized data facilitates sharing and reusability among researchers, enabling more extensive collaborations and the creation of larger datasets. Furthermore, structured datasets allow researchers to replicate and verify research findings, promoting transparency and accountability in the scientific community. Therefore, creating a structured dataset is not only essential for internal analysis but also for the advancement of the field and the dissemination of knowledge.