Method, device and equipment for automatically generating code annotation

By slicing, chunking and inputting unlabeled codes in the code repository into a large language model to generate comments, the problem of low annotation generation quality in the existing technology is solved, and the rapid generation and adaptability of high-quality annotations are achieved.

CN119690508APending Publication Date: 2025-03-25ALIBABA (CHINA) CO LTD
0 Cites 0 Cited by

Patent Information

Application Number
CN202411849920.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

It is difficult for the existing technology to generate high-quality annotations for the code warehouse. The annotation generation tool requires users to manually set up more configurations, and the generated annotations are mechanized, which lacks an in-depth description of the logic of the R&D scenario.

Method used

By obtaining the unlabeled code in the initial file, slice it and chunking it into a group to be labeled, input it into a pre-trained large language model to generate an annotated labeled group, and generate the target file through source code comparison.

Benefits of technology

It realizes the rapid generation of high-quality annotations for the code repository, reducing the time and effort of users to manually write annotations, and the generated annotations are more meaningful and detailed, adapting to different programming languages ​​and styles.

✦ Generated by Eureka AI based on patent content.
Patent Text Reader

Abstract

The embodiment of the invention discloses a method, device and equipment for automatically generating code annotations. In the embodiment of the invention, an initial file is obtained, and the initial file comprises a plurality of unlabeled codes; at least one to-be-labeled group in the initial file is determined, and the to-be-labeled group comprises a set number of unlabeled codes; inputting the at least one group to be labeled into a pre-trained large language model to generate at least one labeled group with annotations; performing source code comparison on the at least one annotated group with the annotation and the at least one group to be annotated, and determining at least one comparison result; according to the at least one comparison result, a target file is generated, and the target file comprises a plurality of marked codes. Through the method, high-quality annotations can be quickly generated for the code warehouse.
Need to check novelty before this filing date? Find Prior Art