一句话:提出 NB2P,自动从计算笔记本中提取可部署的数据科学流水线,性能优于 LLM 基线且开销低。
计算笔记本中单元格的执行顺序任意,数据操作混杂,导致难以提取内聚的数据科学流水线并迁移到生产系统。NB2P 系统在语法树层面分析笔记本以恢复执行顺序,并依据语义将数据操作分组为流水线阶段。为捕获数据流与细粒度层次信息,它采用基于树的学得编码-解码算法,最终组装阶段构建可部署的流水线。作者在 Kaggle 大规模笔记本语料上训练 NB2P,并与使用最先进大语言模型及其他方法的基线对比。实验表明,NB2P 持续优于基线且开销较低。
Computational notebooks empower data scientists to explore data, perform analytics, and share findings through data pipelines. Extracting these pipelines facilitates understanding and migrating them to production systems. However, notebook cells executed in arbitrary order complicate data flow between stages. Moreover, data operations may not be cleanly separated, hindering the extraction of cohesive pipeline components. In this paper, we propose NB2P, a novel system that automatically extracts data science pipelines from notebooks. Given a notebook, NB2P performs analysis at the syntax tree level to recover the execution order, then groups the data operations into pipeline stages based on semantics. It uses a tree-based, learned encoding-decoding algorithm that captures the data flow and fine-grained hierarchical information in the notebook. Finally, NB2P assembles the stages and constructs the final pipeline that can be deployed into production systems. We train NB2P on a large notebook corpus from Kaggle and compare it against baselines that use state-of-the-art large language models and other approaches. The experimental results show that NB2P consistently outperforms the baselines while incurring low overhead.
@inproceedings{paperbot11678,
title = {NB2P: Generating Data Science Pipelines from Computational Notebooks},
author = {Haotian Gao and Quang Trung Ta and Tien Tuan Anh Dinh and Nhut-Minh Ho and Zhiyong Huang and Beng Chin Ooi},
booktitle = {ICSE},
year = {2026},
doi = {10.1145/3744916.3773200}
}