NL4DV

The Natural Language Toolkit for Data Visualization

Georgia Institute of Technology, UNC Charlotte, and Hong Kong University of Science and Technology

Hi, Welcome to the NL4DV project!


Natural language interfaces (NLIs) have shown great promise for visual data analysis, allowing people to flexibly specify and interact with visualizations. However, developing visualization NLIs remains a challenging task, requiring low-level implementation of natural language processing (NLP) techniques as well as knowledge of visual analytic tasks and visualization design.

NL4DV is a Python toolkit that takes as input a tabular dataset and a natural language query about that dataset. In response, the toolkit returns an analytic specification modeled as a JSON object containing data attributes, analytic tasks, and a list of Vega-Lite specifications relevant to the input query. In doing so, NL4DV aids visualization developers who may not have a background in NLP, enabling them to create new visualization NLIs or incorporate natural language and example charts input within their existing systems.

NL4DV has had a rich history with four major version releases. The versioning scheme is cumulative, i.e., with appropriate configurations, installing v4 (or 4.x) will include capabilities of v3 (3.x), v2 (2.x), and v1 (1.x). Read more below:


NL4DV-Stylist - [v4, 2025]

Styling Data Visualizations Using Natural Language and Example Charts
Tenghao Ji, Arpit Narechania

Traditionally, natural language interfaces (NLIs) have focused primarily on identifying data attributes and analytic tasks from user queries, giving less attention to customizing the design of output visualizations. This limitation can hinder satisfying personal preferences, meeting branding requirements, and ensuring accessibility. Released in 2025, this version assists developers in styling data visualizations by allowing them to provide one or more example charts along with corresponding natural language (NL) instructions as design guidance, e.g., preference for horizontal legends or reusing a particular color scheme they saw recently, improving current NL to VIS authoring workflows by producing more design-informed visualizations.

This version also utilizes LiteLLM as an LLM gateway to enable developers to choose from a variety of models (and not just GPT-4, as was the restriction in v3).

Citation:

@misc{ji2025enl4dv,
    title={{NL4DV-Stylist: Styling Data Visualizations Using Natural Language and Example Charts}}, 
    author={{Ji}, Tenghao and {Narechania}, Arpit},
    year={2025},
    archivePrefix={arXiv},
    primaryClass={cs.AI},
    note={Presented as a poster at IEEE VIS 2025 (Poster Track)}
}

NL4DV-LLM - [v3, 2024]

Generating Analytic Specifications Using Large Language Models
Subham Sah*, Rishab Mitra*, Arpit Narechania*, Alex Endert, John Stasko, Wenwen Dou
(* equal contribution)

Released in 2024, this version enables developers to utilize a Large Language Model (particularly GPT-4) to translate a natural language query about a dataset into a relevant visualization. We present a comprehensive text prompt that, given a tabular dataset and an NL query about the dataset, generates an analytic specification including (detected) data attributes, (inferred) analytic tasks, and (recommended) visualizations. Unlike prior LLM-based approaches, our prompt supports conversational interaction and ambiguity detection capabilities. In our paper, we detail the iterative process of curating our prompt, present a preliminary performance evaluation using GPT-4, and discuss the strengths and limitations of LLMs at various stages of query translation. Check it out!

Citation:

@misc{sah2024nl4dvllm,
    title={{Generating Analytic Specifications for Data Visualization from Natural Language Queries using Large Language Models}}, 
    author={{Sah}, Subham and {Mitra}, Rishab and {Narechania}, Arpit and {Endert}, Alex and {Stasko}, John and {Dou}, Wenwen},
    year={2024},
    eprint={2408.13391},
    archivePrefix={arXiv},
    primaryClass={cs.HC},
    url={https://arxiv.org/abs/2408.13391}, 
    howpublished={Presented at the NLVIZ Workshop, IEEE VIS 2024}
}

NL4DV 2 - [v2, 2022]

Multi Turn Dialogs (Conversational Interaction)
Rishab Mitra*, Arpit Narechania*, Alex Endert, John Stasko
(* equal contribution)

Released in 2022, this version enables developers to utilize semantic parsing techniques to facilitate multiple conversations about a dataset (conversational interaction) and also resolve associated ambiguities, in addition to the core functionality of translating a natural language query to a visualization. Checkout the showcase to see three examples: (1) an NLI to learn aspects of the Vega-Lite grammar, (2) a mind mapping application to create free-flowing conversations, and (3) a chatbot to answer questions and resolve ambiguities. Check it out!

Citation:

@article{mitra2022conversational,
    title={{Facilitating Conversational Interaction in Natural Language Interfaces for Visualization}},
    author={{Mitra}, Rishab and {Narechania}, Arpit and {Endert}, Alex and {Stasko}, John},
    journal={{IEEE VIS (Short Papers)}},
    year={{2022}},
    publisher={IEEE},
    url={https://doi.org/10.1109/VIS54862.2022.00010}
}

NL4DV - [v1, 2020]

One-off Utterances
Arpit Narechania*, Arjun Srinivasan*, John Stasko
(* equal contribution)

Released in 2020, this version enables developers to utilize semantic parsing techniques to translate a natural language query about a tabular dataset to one or more relevant visualizations. Checkout the showcase to see four examples: (1) rendering visualizations using natural language in a Jupyter notebook, (2) developing a NLI to specify and edit Vega-Lite charts, (3) recreating data ambiguity widgets from the DataTone system, and (4) incorporating speech input to create a multimodal visualization system.

Citation:

@article{narechania2020nl4dv,
    title={{NL4DV: A Toolkit for Generating Analytic Specifications for Data Visualization from Natural Language Queries}},
    author={{Narechania}, Arpit and {Srinivasan}, Arjun and {Stasko}, John},
    journal={{IEEE Transactions on Visualization and Computer Graphics}},
    year={{2021}},
    publisher={IEEE},
    url={https://doi.org/10.1109/TVCG.2020.3030378}
}


Getting started is easy!


Documentation

Installation Instructions and API Reference

Showcase

Applications recreated and Sample Queries answered using NL4DV.