Towards integrated, interactive, and extensible text data analytics with Leam (2021)

Abstract: From tweets to product reviews, text is ubiquitous on the web and often contains valuable information for both enterprises and consumers. However, the online text is generally noisy and incomplete, requiring users to process and analyze the data to extract insights. While there are systems effective for different stages of text analysis, users lack extensible platforms to support interactive text analysis workflows end-to-end. To facilitate integrated text analytics, we introduce LEAM, which aims at combining the strengths of spreadsheets, computational notebooks, and interactive visualizations. LEAM supports interactive analysis via GUI-based interactions and provides a declarative specification language, implemented based on a visual text algebra, to enable user-guided analysis. We evaluate LEAM through two case studies using two popular Kaggle text analytics workflows to understand the strengths and weaknesses of the system.

## introduction the growth of e-commerce has contributed to the proliferation of digital text, particularly usergenerated text (reviews, q&as, discussions), which often contain useful information for improving the services and products on the web. enterprises increasingly adopt text mining technologies to extract, analyze, and summarize information from such unstructured text data. however, online text collections are incomplete, ambiguous, and often sparse in informational content. cleaning, featurizing, modeling, visualizing, extracting information from, and identifying topics in such text collections can be daunting and time-consuming without integrated systems that take the whole text analytics pipeline into account. @xcite the characteristics of online text make interactive workflows and visualizations essential for rapid iterative analysis @xcite . therefore we focus on visual interactive text analysis (vita hereafter) and related systems. few commercial and open-source tools can support different stages of vita, e.g., spreadsheets, computational notebooks, and visualization tools @xcite . customized visual text analytics tools focus on specific use-cases like review exploration @xcite , sentiment analysis @xcite , and text summarization @xcite . none of these solutions accommodate the inherently cyclic, trialand-error-based nature of vita pipelines end-toend @xcite . designing and building vita systems can be difficult. the primary challenge is the number and diversity of the tasks that need to be supported. programmatic tools such as computational notebooks can provide extensibility and expressivity to incrementally build such support but they often lack in interactivity and do not facilitate direct data manipulation, impeding analysis. in response, we propose leam , that provides an integrated environment for vita. leam combines the advantages of spreadsheets, computational notebooks, and visualization tools by integrating a code editor with interactive views of raw (data view) and transformed data (chart view). figure 1 shows a snapshot of leam. a key component in the design of leam is the instrumentation of text analysis operations via vital, a python api. these built-in operations can also be used directly from the interactive operations menu. to evaluate leam, we conduct two case studies using two popular kaggle text analytics workflows. the *work done while authors were at megagon labs. study showed that participants preferred the integrated analysis environment and the ability to specify various workflows both interactively (via operations menu) and declaratively (via vital). however, participants asked for enhanced workflow transparency and consistency of operations. we have released the source-code of leam at https: //github.com/megagonlabs/leam . ## related work leam draws from prior work on interactive text analysis, computational notebook, and declarative specification of analysis workflows. interactive visual text analytics. prior research on visual text analytics have limitations in flexibility and extensibility due to their fixed choices of models, visualizations, and interactions @xcite . leam adopts the vision of a vita system outlined in our prior work @xcite . in this paper, we primarily focus on expressivity (e.g., declarative workflow specification), resusability (e.g., reusing operators and models), on-demand coordination (e.g., linking visualizations and data), and transparency (e.g., gui interaction logging). computational notebooks. computational notebooks such as jupyter @xcite allow programmers to interleave code with visualizations. this linear layout often introduces a physical distance between related charts, limiting an analyst's ability to derives insights by visually comparing different charts. tools like b2 @xcite and lux @xcite , provide a non-linear interface where charts are placed in a separate visualization pane. while leam shares the same principle, it additionally features a data view and enables coordination between visualization and the data-a desirable property of such interactive programming environments @xcite . ## design considerations we now outline our design considerations for creating leam. ## leam user interface the four key components of the interface are a code editor, an operations menu, a data view, and a chart view. we discuss how these components enable integrated visual text analysis (d1). ## visual text analysis using leam the text analysis operations in leam are developed based on a visual text algebra, vta @xcite . leam provides a python api called visual interactive text analysis library, vital, that enables users to write vta commands in code editor. we now briefly introduce vta and then demonstrate the corresponding specification library vital that we have developed. ## leam architecture leam is developed as a web application and is implemented using reactjs and flask framework. we depict the architecture in figure 6 . leam client is responsible for capturing user input, and for rendering the views based on results returned by the back-end. given any user interaction on the front end, the leam request processor issues a request to the backend leam controller. this controller manages the uploaded data and sessions while propagating user interactions to the session manager. client system-x contr oller vital compiler server fr ontend request pr ocessor session manager datafr ame task queue session var iables vital scr ipts visual inter actions menu oper ations data oper ations metadata view cache @xmath0.get_col() c1.pr oject().clean() c1.mutate().tf_idf() vital executor coor dination gr aph the session manager interprets the user interaction-any interactions on the operations menu is sent to a lightweight vta compiler while the vital commands on the code editor are pushed in a task queue. the vta compiler translates the user-selected operator to a vital command which is then executed by the vta executor. leam backend employs a task queue to keep track of the vital commands in code editor. leam session manager also employs a view cache to track the states of the front end views. leam employs a coordination graph to manage coordination among linked views-for any interaction on a view, all the views in its adjacency list are updated. for example, selecting a bar in the barchart in figure 5 updates the scatterplot and data view in its adjacency list. ## case studies to assess the impact of leam in performing visual text analysis and collect early feedback, we evaluated it through two case studies. ## conclusion and future work this paper presents leam, a tool that enables users to perform interactive text analysis in-situ. our declarative specification api vital provides support for a suite of operators to author diverse vita workflows on-demand and enable different modes of interactive coordination among views. preliminary evaluation of leam highlights the benefits of integrating multiple views, supporting both interactive and declarative specification of tasks, enabling reusability of operations, and ensuring transparency of interactions. while the initial results are promising, there is room for improvement in adding more transparency and providing wider operations coverage. leam can further benefit from addressing challenges related to scalability, workflow optimization, and version control that related work also explores.