GRAPHiC: Utilizing Graph Structures and Class Weights in Code Comment Classification with Pretrained BERT Models

Source code comments are an essential part of the software development process, and the classification of these comments into relevant categories is crucial for code mainte-nance. For this problem, we present GRAPHiC, a set of classifiers designed for multi-label classification of source code comments in Java, Python, and Pharo. As part of GRAPHiC, we train three separate classifiers on the NLBSE Code Comment Classification dataset, using GraphCodeBERT and incorporate class weights to address dataset imbalance. The classifiers achieve an average F1 score of 0.71, outperforming the SetFit baseline score of 0.63 by 12%. This paper highlights the effectiveness of GraphCodeBERT for code comment classification and explores areas for further research. The models and training code are publicly available to facilitate replication and further experimentation.

Authors

Institutions

Publication Details

Published
2025-04-27
DOI
https://doi.org/10.1109/nlbse66842.2025.00014
Citations
1
Primary Topic
Natural Language Processing Techniques
Type
article
Field-Weighted Citation Impact
2.48
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

GRAPHiC: Utilizing Graph Structures and Class Weights in Code Comment Classification with Pretrained BERT Models

Shahela Saif, Aftab Afzal, Muhammad Tariq, Muhammad Athar et al.
1 citations
Natural Language Processing Techniques
2.48
article

GRAPHiC: Utilizing Graph Structures and Class Weights in Code Comment Classification with Pretrained BERT Models

Shahela Saif, Aftab Afzal, Muhammad Tariq, Muhammad Athar, Pir Sami Ullah Shah
article en
1 citations

Abstract

Source code comments are an essential part of the software development process, and the classification of these comments into relevant categories is crucial for code mainte-nance. For this problem, we present GRAPHiC, a set of classifiers designed for multi-label classification of source code comments in Java, Python, and Pharo. As part of GRAPHiC, we train three separate classifiers on the NLBSE Code Comment Classification dataset, using GraphCodeBERT and incorporate class weights to address dataset imbalance. The classifiers achieve an average F1 score of 0.71, outperforming the SetFit baseline score of 0.63 by 12%. This paper highlights the effectiveness of GraphCodeBERT for code comment classification and explores areas for further research. The models and training code are publicly available to facilitate replication and further experimentation.

National University of Computer and Emerging Sciences (PK)
Openalex Percentile: Top 10%
Natural Language Processing Techniques
2.48
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.