• Home
  • Search
  • SCC-GPT: Source Code Classification Based on Generative Pre-Trained Transformers
  • Open Access IconOpen Access
  • Cite Icon1
  • https://doi.org/10.3390/math12132128Copy DOI Icon

SCC-GPT: Source Code Classification Based on Generative Pre-Trained Transformers

Show More
  • Abstract
  • Highlights & Summary
  • PDF
  • Literature Map
  • References
  • Citations
  • Similar Papers
Abstract

Developers often rely on online resources, such as Stack Overflow (SO), to seek assistance for programming tasks. To facilitate effective search and resource discovery, manual tagging of questions and posts with the appropriate programming language is essential. However, accurate tagging is not consistently achieved, leading to the need for the automated classification of code snippets into the correct programming language as a tag. In this study, we introduce a novel approach to automated classification of code snippets from Stack Overflow (SO) posts into programming languages using generative pre-trained transformers (GPT). Our method, which does not require additional training on labeled data or dependency on pre-existing labels, classifies 224,107 code snippets into 19 programming languages. We employ the text-davinci-003 model of ChatGPT-3.5 and postprocess its responses to accurately identify the programming language. Our empirical evaluation demonstrates that our GPT-based model (SCC-GPT) significantly outperforms existing methods, achieving a median F1-score improvement that ranges from +6% to +31%. These findings underscore the effectiveness of SCC-GPT in enhancing code snippet classification, offering a cost-effective and efficient solution for developers who rely on SO for programming assistance.

Loading PDF

Similar Papers
  • Conference Article
  • Citations14

Engineering Paper] SCC: Automatic Classification of Code Snippets

  • Sep 01, 2018
  • Kamel Alreshedy +4
  • Research Article
  • Citations29

Post2Vec: Learning Distributed Representations of Stack Overflow Posts

  • Sep 01, 2022
  • IEEE Transactions on Software Engineering
  • Bowen Xu +5
  • Conference Article
  • Citations27

Python Coding Style Compliance on Stack Overflow

  • May 01, 2019
  • Nikolaos Bafatakis +6
  • Conference Article
  • Citations17

ICSD

  • Dec 03, 2018
  • Yanfang Ye +7
  • Conference Article
  • Citations10

Towards Understanding Developers’ Machine-Learning Challenges: A Multi-Language Study on Stack Overflow

  • Sep 01, 2021
  • Alaleh Hamidi +4
  • PDF
  • Research Article
  • Citations3

Knowledge reuse in software projects: Retrieving software development Q&A posts based on project task similarity.

  • Dec 17, 2020
  • PloS one
  • Glaucia Melo +3
  • Conference Article
  • Citations63

Relationship-aware code search for JavaScript frameworks

  • Nov 01, 2016
  • Xuan Li +5
  • Conference Article
  • Citations7

Characterizing Duplicate Code Snippets between Stack Overflow and Tutorials

  • May 01, 2019
  • Manziba Akanda Nishi +2
  • Conference Article

Detecting Adversarial Prompted AI-Generated Code on Stack Overflow: A Benchmark Dataset and an Enhanced Detection Approach

  • Sep 07, 2025
  • Aman Swaraj +3
  • Research Article
  • Citations1

How Do OSS Developers Reuse Architectural Solutions From Q&A Sites: An Empirical Study

  • Jul 01, 2025
  • IEEE Transactions on Software Engineering
  • Musengamana Jean De Dieu +2
  • PDF
  • Research Article
  • Citations11

Incorporating Code Structure and Quality in Deep Code Search

  • Feb 16, 2022
  • Applied Sciences
  • Hao Yu +3
  • Research Article
  • Citations86

Deep Graph Matching and Searching for Semantic Code Retrieval

  • May 10, 2021
  • ACM Transactions on Knowledge Discovery from Data
  • Xiang Ling +8
  • Conference Article
  • Citations16

Mining Stack Overflow for discovering error patterns in SQL queries

  • Sep 01, 2015
  • Csaba Nagy +1
  • Conference Article
  • Citations18

A Qualitative Investigation of Insecure Code Propagation from Online Forums

  • Sep 01, 2019
  • Wei Bai +2
  • Conference Article
  • Citations60

Mining Technology Landscape from Stack Overflow

  • Sep 08, 2016
  • Chunyang Chen +1
Cactus Communications logo

Copyright 2026 Cactus Communications. All rights reserved.