Abstract
Text documents with numerical values involved are widely used in various applications such as scientific research, economy, public health and journalism. However, it is difficult for readers to quickly interpret such data-involved texts and gain deep insights. To fill this research gap, this work aims to automatically generate charts to accurately convey the underlying data and ideas to readers, which is essentially a challenging task. The challenges originate from text ambiguities, intrinsic sparsity and uncertainty of data in text documents, and subjective sentiment differences. Specifically, we propose ChartifyText, a novel fully-automated approach that leverages Large Language Models (LLMs) to convert complex data-involved texts to expressive charts. It consists of two major modules: tabular data inference and expressive chart generation. The tabular data inference module employs systematic prompt engineering to guide the LLM (e.g., GPT-4) to infer table data, where data ranges, uncertainties, missing data values and corresponding subjective sentiments are explicitly considered. The expressive chart generation module augments standard charts with intuitive visual encodings and concise texts to accurately convey the underlying data and insights. We extensively evaluate the effectiveness of ChartifyText on real-world data-involved text documents through case studies, in-depth interviews with three visualization experts, and a carefully-designed user study with 15 participants. The results demonstrate the usefulness and effectiveness of ChartifyText in helping readers efficiently and effectively make sense of data-involved texts.
Introduction
In our increasingly data-driven world, critical information is frequently embedded within "data-involved" texts—unstructured documents like news articles, scientific reports, or policy briefs where numerical values are scattered across paragraphs. Interpreting these texts imposes a significant cognitive load; readers must identify relevant numbers, perform mental calculations, and visualize trends themselves. While traditional visualization tools require structured data (e.g., CSV files), ChartifyText leverages Large Language Models (LLMs) to automate the end-to-end process of transforming messy natural language into expressive, insight-rich charts.
The ChartifyText Framework
ChartifyText operates through a two-module pipeline powered by GPT-4. The first module, Tabular Data Inference, acts as a "data detective." It identifies the core message of the text, generates a structured schema, and populates it with data. Crucially, it handles linguistic nuances like algebraic inference (e.g., calculating a value when the text only provides a relative comparison) and assigns uncertainty scores based on how explicitly a value is stated.
Expressive Visual Encodings
The second module, Expressive Chart Generation, translates extracted tables into visualizations. To accurately reflect the complexities and ambiguities of text-based data, ChartifyText introduces four specialized visual encodings:
- Uncertainty Encoding: Uses gradient stripes to indicate data ambiguity.
- Data Range Encoding: Employs arrows and caps to represent numerical ranges (e.g., "between 5% and 10%").
- Missing Value Encoding: Uses dashed outlines for data points inferred by the LLM rather than explicitly stated.
- Sentiment Encoding: Incorporates color-coded annotations to capture the author's subjective tone.
Evaluation and Results
The researchers evaluated ChartifyText using real-world documents and a user study with 15 participants. Key findings include:
- Efficiency: Users were nearly twice as fast at extracting information using ChartifyText charts compared to reading raw text (73.6 seconds vs. 139.4 seconds).
- Accuracy: The increase in speed did not compromise accuracy; users interpreted the data as correctly as they did when reading the full text.
- Cognitive Load: NASA-TLX assessments showed a significant reduction in mental demand and frustration.
- Expert Validation: Visualization experts praised the system's transparency, noting that visualizing uncertainty and missing values builds user trust.
Discussion and Future Work
ChartifyText demonstrates that LLMs are remarkably capable of handling the "mental lift" of data extraction and inference. By explicitly visualizing the "unknown" (uncertainty and inferred values), the system maintains transparency and helps readers focus on high-level insights.
Future developments will focus on expanding the library of supported chart types (e.g., heatmaps, stacked bars) and refining semantic grouping to ensure that related but distinct metrics are appropriately categorized. Additionally, the authors suggest integrating external data sources to further validate and enrich the information extracted from text documents.
Summary updated