Supporting the translation from natural language (NL) query to visualization (NL2VIS) can simplify the creation of data visualizations because if successful, anyone can generate visualizations by their natural language from the tabular data.
We present ncNet, a Transformer-based model for supporting NL2VIS, with several novel visualization-aware optimizations, including using attention-forcing to optimize the learning process, and visualization-aware rendering to produce better visualization results.
Please refer to our paper at IEEE VIS 2021 for more details.
Python3.6+
PyTorch 1.7
torchtext 0.8
ipyvega
Install Python dependency via pip install -r requirements.txt
when the environment of Python and Pytorch is setup.
-
[Must] Download the Spider data here and unzip under
./dataset/
directory -
[Optional] Only if you change the
train/dev/test.csv
under the./dataset/
folder, you need to runprocess_dataset.py
under thepreprocessing
foler.
Open the ncNet.ipynb
to try the running example.
Run train.py
to train ncNet.
Run test.py
to eval ncNet.
@inproceedings{ncnet,
author = {Yuyu Luo and Nan Tang and Guoliang Li and Jiawei Tang and Chengliang Chai and Xuedi Qin},
title = {Natural Language to Visualization by Neural Machine Translation},
booktitle = {{IEEE Visualization Conference (VIS)}},
year = {2021},
}
The project is available under the MIT License.
If you have any questions, feel free contact Yuyu Luo (luoyy18 [AT] mails.tsinghua.edu.cn).