UW Interactive Data Lab
IDL logo

CORAL: COde RepresentAtion Learning with Weakly-Supervised Transformers for Analyzing Data Analysis

Ge Zhang, Mike Merrill, Yang Liu, Jeffrey Heer, Tim Althoff. EPJ Data Science, 2022
Figure for CORAL: COde RepresentAtion Learning with Weakly-Supervised Transformers for Analyzing Data Analysis
An overview of the architecture of our CORAL model, which combines weak supervision and unsupervised topic modeling into a multitask objective.
Materials
Abstract
Large scale analysis of source code, and in particular scientific source code, holds the promise of better understanding the data science process, identifying analytical best practices, and providing insights to the builders of scientific toolkits. However, large corpora have remained unanalyzed in depth, as descriptive labels are absent and require expert domain knowledge to generate. We propose a novel weakly supervised transformer-based architecture for computing joint representations of code from both abstract syntax trees and surrounding natural language comments. We then evaluate the model on a new classification task for labeling computational notebook cells as stages in the data analysis process from data import to wrangling, exploration, modeling, and evaluation. We show that our model, leveraging only easily-available weak supervision, achieves a 38% increase in accuracy over expert-supplied heuristics and outperforms a suite of baselines. Our model enables us to examine a set of 118,000 Jupyter Notebooks to uncover common data analysis patterns. Focusing on notebooks with relationships to academic articles, we conduct the largest study of scientific code to date and find that notebooks which devote an higher fraction of code to the typically labor-intensive process of wrangling data in expectation exhibit decreased citation counts for corresponding papers. We also show significant differences between academic and non-academic notebooks, including that academic notebooks devote substantially more code to wrangling and exploring data, and less on modeling.
BibTeX
@article{2022-coral,
  title = {CORAL: COde RepresentAtion Learning with Weakly-Supervised Transformers for Analyzing Data Analysis},
  author = {Zhang, Ge AND Merrill, Mike AND Liu, Yang AND Heer, Jeffrey AND Althoff, Tim},
  journal = {EPJ Data Science},
  year = {2022},
  volume = {11},
  number = {14},
  url = {https://idl.uw.edu/papers/coral},
  doi = {10.1140/epjds/s13688-022-00327-9}
}