Abstract
Jupyter notebook allows data scientists to write machine learning code together with its documentation in cells. In this paper, we propose a new task of code documentation generation (CDG) for computational notebooks. In contrast to the previous CDG tasks which focus on generating documentation for single code snippets, in a computational notebook, one documentation in a markdown cell often corresponds to multiple code cells, and these code cells have an inherent structure. We proposed a new model (HAConvGNN) that uses a hierarchical attention mechanism to consider the relevant code cells and the relevant code tokens information when generating the documentation. Tested on a new corpus constructed from well-documented Kaggle notebooks, we show that our model outperforms other baseline models.- Anthology ID:
- 2021.findings-emnlp.381
- Volume:
- Findings of the Association for Computational Linguistics: EMNLP 2021
- Month:
- November
- Year:
- 2021
- Address:
- Punta Cana, Dominican Republic
- Venue:
- Findings
- SIG:
- SIGDAT
- Publisher:
- Association for Computational Linguistics
- Note:
- Pages:
- 4473–4485
- Language:
- URL:
- https://aclanthology.org/2021.findings-emnlp.381
- DOI:
- 10.18653/v1/2021.findings-emnlp.381
- Cite (ACL):
- Xuye Liu, Dakuo Wang, April Wang, Yufang Hou, and Lingfei Wu. 2021. HAConvGNN: Hierarchical Attention Based Convolutional Graph Neural Network for Code Documentation Generation in Jupyter Notebooks. In Findings of the Association for Computational Linguistics: EMNLP 2021, pages 4473–4485, Punta Cana, Dominican Republic. Association for Computational Linguistics.
- Cite (Informal):
- HAConvGNN: Hierarchical Attention Based Convolutional Graph Neural Network for Code Documentation Generation in Jupyter Notebooks (Liu et al., Findings 2021)
- PDF:
- https://preview.aclanthology.org/paclic-22-ingestion/2021.findings-emnlp.381.pdf
- Code
- dakuo/haconvgnn + additional community code
- Data
- notebookcdg