ComML: A Code Comments Dataset for AI/ML Systems

Code comments play a critical role in ensuring
the comprehensibility, maintainability, and collaborative devel-
opment of software systems. However, in Artificial Intelligence
and Machine Learning (AI/ML) projects, where experimentation,
rapid prototyping, and iterative model development are cen-
tral, commenting practices are often inconsistent or insufficient.
To support systematic research on this issue, we introduce
ComML, a real-world dataset for analyzing code comments in
AI/ML systems. ComML comprises 50 AI/ML repositories written
in Python, having 16,110 Python files, 3,314 classes, 111,950
functions, 146,264 code blocks, 5,662,809 lines of source code,
and 449,962 lines of comments. The dataset was constructed
by cloning repositories from GitHub and extracting structured
code blocks using Python’s Abstract Syntax Tree parser. Each
code block was automatically classified into one of nine AI/ML
workflow stages. Then we checked the frequency and quality
of the comments inside the code. Along with raw code and
comments, ComML provides computed metrics for comment
density, readability, and consistency. Our initial analysis reveals
notable documentation gaps, with the Model Evaluation Stage
missing comments in 74.09% of cases. This dataset enables
researchers to study commenting behavior across AI/ML de-
velopment phases and supports the design of automated tools
for improving comment quality and documentation practices in
machine learning software.