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.
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
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.
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.
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.