Unlocking the Heterogeneous Landscape of Big Data NLP with DUUI (2023)

Abstract: Automatic analysis of large corpora is a complex task, especially in terms of time efficiency. This complexity is increased by the fact that flexible, extensible text analysis requires the continuous integration of ever new tools. Since there are no adequate frameworks for these purposes in the field of NLP, and especially in the context of UIMA, that are not outdated or unusable for security reasons, we present a new approach to address the latter task: Docker Unified UIMA Interface (DUUI), a scalable, flexible, lightweight, and feature-rich framework for automatic distributed analysis of text corpora that leverages Big Data experience and virtualization with Docker. We evaluate DUUI’s communication approach against a state-of-the-art approach and demonstrate its outstanding behavior in terms of time efficiency, enabling the analysis of big text data.

## introduction automatic analysis of text corpora is an important task in many research areas that use natural language processing (nlp). this includes fields as diverse as digital humanities (e.g. @xcite , economics (e.g. @xcite , or biodiversity research @xcite . all these areas are supported by the availability of increasingly large text repositories such as newspaper corpora (e.g. new york times, 2019), parliamentary corpora (e.g. @xcite @xcite or wikipedia @xcite . however, text processing of large corpora is time-consuming, resource-intensive, and thus costly. in addition, nlp routines are required as pre-processing steps to perform even more time-consuming tasks as, e.g., textual entailment @xcite , rhetorical analysis @xcite or argument mining @xcite . in any event, the application of nlp methods is gaining acceptance in almost all text-based disciplines. this increasingly leads to scenarios in which ever larger corpora have to be processed regarding ever more complex tasks while ensuring a mixed methods approach @xcite . in contrast, project participants, especially those outside the nlp field, often have limited computer skills. thus, a suitable framework for flexible, transparent, and timeoptimized pre-processing of large corpora is essential, allowing the integration of ever new analysis methods. for this purpose, software is required, which serves the following functions: it should be possible to track pipelines at the level of individual documents or sequences thereof. as shown by @xcite , this approach can induce a considerable overhead in terms of memory usage and performance to be managed by the nlp platform. in particular, the maintenance and further development of such tools requires a high level of expertise. this results in two requirements: in terms of ease of use and maintenance of the entire infrastructure, and the ease with which tools can be integrated or updated. currently, there is no framework in nlp that meets criteria a-f. moreover, the number of usable frameworks has recently decreased significantly due to log4j vulnerability @xcite , which occurred in 2021 (see, e.g., the apache framework ducc). text corpora are therefore increasingly processed with proprietary systems, which increase development effort and are ultimately not reusable. we present an approach that meets requirements a-f to overcome this trend: docker unified uima interface (duui), an efficient, horizontally and vertically scalable framework that handles big text data in a simple, modular, and reusable manner, while mitigating annotation-and implementation-related heterogeneities. similar to textimager @xcite , duui is based on uima (unstructured information management applications) @xcite . uima is used in numerous projects and remains an active area of research, notwithstanding the shortcomings noted by götz et al. (2014) -see figure 11 in the appendix. duui is available on github foot_0 and provides a lightweight framework to utilize different annotators in a distributed setup based on several implementations embedded into docker ( www.docker.com ) containers used as microservices. there are many proprietary nlp frameworks (see section 2). duui accounts for this heterogeneity: it integrates these frameworks, supports interfaces, and stores all generated annotations and analysis results in uima. uima allows for defining software modules for the analysis of unstructured data (e.g., texts). this is done with so-called analysis engines (ae). the results of an analysis are stored in a common analysis structure (cas) @xcite with reference to a defined schema description (type system descriptors). cas is the basic data structure in which data is analyzed and stored with metadata. to process data, each ae receives a cas object, performs its analyses, and passes the revised cas object to the next ae. thereby, each pre-processing step comprises one to several pipelines, which are encapsulated and managed by duui. in this paper, we describe the principles and implementation of duui. we evaluate its efficiency and show that duui meets the criteria a-f. in section 2, we present related work and introduce duui in section 3. in section 4, we present an evaluation based on benchmark studies and address issues regarding annotation frameworks. we conclude with an outlook on future work (section 5) and a conclusion (section 6). several approaches exist to improve application scalability based on uima. one of the most common approaches to scale aes, the apache hadoop cluster @xcite , is used by @xcite ; @xcite ; @xcite ; @xcite . it works well for simple pipelines that are decomposable into map reduce jobs, but has problems with more complex scenarios. scenarios regarding routines that do not entirely fit into main memory are particularly difficult to model with an apache hadoop cluster. in addition, detecting and fixing out of memory (oom) issues appears to be a recurring problem in apache hadoop @xcite . further, complex aes that combine multiple aggregations after initial information extraction are difficult to accomplish @xcite ). an alternative approach is proposed by @xcite , which follows a similar microservice-centric approach as duui. despite this similarity, duui offers a considerably simpler setup that does not require the laborious setup of an apache message broker. an alternative approach based on microservices is the computation flow orchestrator (cfo) @xcite . it uses technologies, such as docker and kubernetes foot_1 , and google's buffer interface definition language protocol. cfo organizes analyses as flows and distributes them to individual nodes addressed by an orchestrator, which generates a set of startup scripts and rest interfaces using docker in preparation. in this way one gets access to the individual endpoints and to debug information. this approach is similar to duui, but requires time-consuming learning of the scripting language, while native uima integration is not directly possible -a problem for many frameworks. further, its setup is not straightforward, as profound knowledge of docker and the underlying network bridge is required; alternatively, the makefile would have to be changed to allow the system to be compiled without docker. another approach comes from @xcite and arshi @xcite . it is based on apache storm, which also enables distributed processing of texts via microservices. gate cloud @xcite allows for dis-framework a b c d e f apache ducc + + ○ -○ -apache storm + + ○ -○ ○ hadoop cluster + ○ + -○ -cfo + + + -○ ○ textimager + + + --○ gate cloud + + ○ -○ ○ data-centric -+ + -○ + flyte + + + -+argo + + + -+ -duui + + + + + + the data-centric framework (liu et al., 2020) offers a more complete workflow, which allows for pre-processing, visualization and post-annotation. it generalizes the uima schema to map nlp data in a python environment based on forte foot_2 . this solution lacks the ability to split pre-processing across servers and is neither platform nor programming language independent. in addition, its proprietary use of uima makes reuse difficult. a similar tool is flyte foot_3 , implemented in golang and available for python, java, and scala, which distributes pre-processing to kubernetes containers. this rather complex framework shares some features with duui, but getting started and setting up are challenging. while it is positive that data formats are not predefined, it makes subsequent use in existing frameworks more time-consuming. this also holds for argo foot_4 , which also uses kubernetes to realize the mapping and running of workflows. using criteria a-f from section 1, these frameworks can be compared with each other, as shown in the problems described so far cause that the implementation of all approaches from section 2 is time-consuming and ultimately makes their maintenance impossible. most of these frameworks meets more than half of the requirements a-f from section 1 (cf. to overcome this shortcoming, duui integrates functions in a modular way, making its operation reproducible and usable by non-experts. it enables source-text reduced programming and is mainly based on docker containers, while allowing for integrating other systems (see figure 1 ). duui uses so-called composers, possibly connected to a database to enable dynamic monitoring, which consist of n drivers, each containing up to m com-ponents, each of which encapsulates an analysis engine (ae). since this cross-programminglanguage system bridges functions given their heterogeneous implementations, it is reasonable to create a unified interface for docker containers to enable cross-implementation operations. this includes two aspects, as docker allows individual containers to use different programming languages (section 1, feature c) and taggers (feature b). beyond that, processes can also be executed in the local java runtime environment (jre) as shown in figure 2 . ## evaluation we conducted several tests to show the feasibility of duui. besides the projects listed in section 2, there is only one project that is not implemented in java and enables uima processing directly in python: dkpro-cassis (klie and de castilho, 2020). as tools are increasingly developed exclusively in python, the use of a native python library is important for uima, and its performance characteristics are a key basis for comparison with implementations in non-native (e.g., non-java) programming languages. we computed benchmarks for the ger-man parliamentary corpus @xcite and the largest corpus of german parliamentary minutes, gerparcor @xcite , which contains 37 881 with spacy annotated minutes from three centuries. at first sight, the subset relation of both corpora seems odd, but their individual processing is an important indicator, as will be shown. ## future work since there are container solutions besides docker (e.g., openshift, kubernetes and podman), they are candidates for duui drivers. this would solve a problem with docker, as gpu usage is limited: an issue that has been pending for over six years. the bottleneck of single-machine multi-threaded (de-)serialization may be solved with activemq @xcite . since we implemented a new form of big data nlp, optimization becomes urgent. this concerns prioritization in clusters and parallelization of individual components within the pipeline, as long as these components do not duui cfo 20 25 30 33.31 33.03 28.21 29.18 19.55 20.39 framework computation time in minutes thread1 threads2 threads4 figure 10: runtime comparison between duui and cfo, for processing german political speeches (barbaresi, 2018) with 1, 2, 4 threads respectively. both runtimes were set up to run in a dockerized environment. as can be seen here the performance of duui and cfo is almost on par even though cfo makes already use of high performance optimizations like the usage of http/2 and dedicated docker networks. ## conclusion we introduced docker unified uima inter-face, a framework for big data nlp. its design and implementation leverage experience with tex-timager and apache ducc to create a platformindependent, scalable, and lightweight environment that combines the functionality of a number of frameworks. it enables horizontal scaling via a native docker swarm implementation. regarding platform and programming language independence based on uima, problems arise with xmi serialization with python. to address this issue, duui implements lua-based communication between components and composers, resulting in a massive improvement in performance (see our evaluation). duui is currently the most powerful system meeting the requirement of big data nlp. it implements a lua sandbox for security reasons to ensure that only permitted methods are executed on the host system. due to the sandbox and the selfsufficiency of all annotators, duui can easily be hosted in public registries without causing conflicts between annotators. its use of docker containers as standalone analysis components is a new approach to implementing uima annotators and will be published under the agplv3 license. it will support big data analysis in a variety of disciplines that use nlp for their scientific purposes.