LIDA

LIDA is a powerful tool that automates data exploration and generates visualizations and infographics using large language models (LLMs) li...

Last verified:

Visit LIDA

What is LIDA?

LIDA is an open-source tool from Microsoft that automatically generates grammar-agnostic data visualizations and data-faithful infographics using large language models (LLMs) and image generation models (IGMs). It treats visualizations as code and provides a Python API plus a hybrid user interface combining direct manipulation with multilingual natural language for interactive chart, infographic, and data story generation.

The tool consists of four core modules: a SUMMARIZER that converts datasets into compact natural language summaries, a GOAL EXPLORER that enumerates visualization goals from data, a VISGENERATOR that generates, refines, executes and filters visualization code, and an INFOGRAPHER that produces stylized infographics using image generation models. LIDA supports data summarization, automated data exploration, grammar-agnostic visualizations, infographic generation, visualization explanation, self-evaluation, automatic repair, and visualization recommendations.

LIDA is grammar agnostic and works with any programming language and visualization libraries including matplotlib, seaborn, Altair, d3, R, and C++. It is compatible with multiple LLM providers such as OpenAI, Azure OpenAI Services, PaLM, Cohere, and Huggingface. The tool is designed for data enthusiasts, data scientists, analysts, and anyone who wants to explore data and create visualizations using generative AI without requiring deep coding expertise.

LIDA is free and open source on GitHub, installable via pip with the command pip install lida. It comes with an optional bundled UI and web API that can be run locally with the command lida ui --port=8080 --docs. Users need to provide their own API key for LLM providers like OpenAI or Azure OpenAI.

LIDA pricing

Pricing model: Free

LIDA is free and open source on GitHub. It can be installed via pip with the command pip install lida. The tool itself has no cost, but users must provide their own API key for LLM providers such as OpenAI or Azure OpenAI Services, which charge separately for API usage. An optional bundled UI and web API is included free with the installation, runnable with lida ui --port=8080 --docs.

LIDA pros

  • Open source and free to use
  • Grammar agnostic - works with any programming language
  • Supports multiple visualization libraries (matplotlib, seaborn, Altair, d3)
  • Compatible with multiple LLM providers (OpenAI, Azure, PaLM, Cohere, Huggingface)
  • Automatically generates data visualizations from datasets
  • Creates data-faithful stylized infographics using IGMs
  • Provides conversational natural language interface
  • Includes automated data exploration mode (EDA for free)
  • Generates compact natural language data summaries
  • Offers visualization explanation for accessibility and education
  • Supports automatic visualization repair from feedback
  • Provides visualization recommendations for additional perspectives
  • Includes self-evaluation with multi-dimensional scoring
  • Clean Python API for programmatic access
  • Hybrid UI with direct manipulation and multilingual natural language
  • Treats visualizations as code for easy editing
  • Suitable for data stories and brand/personalization use cases

LIDA cons

  • Requires code execution (sandbox environment recommended for safety)
  • May not work well for visualization grammars not in LLM training data
  • Performance bottlenecked by choice of visualization libraries
  • Performance depends on degrees of freedom accorded to the model
  • Web version currently fails with deprecated GPT model (gpt-3.5-turbo-0301)
  • Requires user-provided API key for LLM providers (not free API calls)
  • Performance improved on datasets resembling online example datasets
  • Python version 3.10 or higher required for installation

Frequently asked questions about LIDA

What are the known limitations of LIDA?

LIDA may not work well for visualization grammars that are not well represented in the LLM's training dataset. Performance is bottlenecked by the choice of visualization libraries used and degrees of freedom accorded the model in generating visualizations. LIDA currently requires code execution, and while effort is made to constrain the scope of generated code via scaffolding, a sandbox environment is recommended to ensure safe code execution.

What programming languages and visualization libraries does LIDA support?

LIDA is grammar agnostic and works with any programming language or visualization grammar represented as code. It supports Python libraries including Altair, Matplotlib, and Seaborn, as well as R, C++, and d3. It can generate visualizations in any grammar represented as code.

What are the four modules of LIDA?

LIDA comprises four modules: (1) SUMMARIZER - converts data into a rich but compact natural language summary, (2) GOAL EXPLORER - enumerates visualization goals given the data, (3) VISGENERATOR - generates, refines, executes and filters visualization code, and (4) INFOGRAPHER - yields data-faithful stylized graphics using image generation models (IGMs).

What LLM providers does LIDA work with?

LIDA works with multiple large language model providers including OpenAI, Azure OpenAI Services, PaLM, Cohere, and Huggingface. Users need to provide their own API key for the LLM provider they choose to use.

How do I install LIDA?

LIDA can be installed via pip using the command pip install lida. Python version 3.10 or higher is required (preferably use Conda). After installation, set your API key using export OPENAI_API_KEY=<your key> for OpenAI or export AZURE_OPENAI_API_KEY=<your key> for Azure OpenAI Services.

What core automated visualization capabilities does LIDA provide?

LIDA provides four core automated visualization capabilities: Data Summarization (converts datasets into compact natural language representation), Automated Data Exploration (generates meaningful visualization goals based on dataset), Grammar-Agnostic Visualizations (creates visualizations in any grammar represented as code), and Infographics Generation (creates rich, embellished stylized infographics using image generation models).

What operations on generated visualizations (VizOps) does LIDA support?

LIDA supports five VizOps operations: Visualization Explanation (detailed descriptions of visualization code for accessibility, data literacy, education, and debugging), Self-Evaluation (generating multi-dimensional evaluation scores for visualizations), Visualization Repair (automatically improve or repair visualizations based on feedback), and Visualization Recommendations (recommend additional useful visualizations given context or existing visualization).

How do I run the LIDA user interface locally?

After installing LIDA, you can run the optional bundled UI and web API using the command lida ui --port=8080 --docs. This provides a hybrid user interface combining direct manipulation and multilingual natural language for interactive chart, infographic, and data story generation.

Is LIDA open source and where can I find the code?

Yes, LIDA is now open source on GitHub as of August 14, 2023. The code is available at the Microsoft GitHub repository (microsoft/lida). The paper was accepted at the 2023 ACL Conference (System Demonstrations) and is also available on arXiv.

Who is LIDA designed for?

LIDA is designed for data enthusiasts, data scientists, analysts, and anyone who wants to explore data and create visualizations using generative AI. It enables users to explore data easier using generative AI without requiring deep coding expertise, making it suitable for accessibility, data literacy, education, and business use cases involving data stories, personalization, brand, style, and marketing.

Categories

Use cases

Browse all AI tools on NeedAnAI