Patents
Literature
Patsnap Eureka AI that helps you search prior art, draft patents, and assess FTO risks, powered by patent and scientific literature data.

58 results about "Code annotation" patented technology

Annotation is a term used in computer programming to refer to documentation and comments that may be found on code logic. Annotation is typically ignored once the code is executed or compiled.

Method and system for establishing relation between software code and demand tracking

The invention discloses a method and system for establishing a software code and demand tracking relation, and relates to the computer and software engineering technology, and the method comprises the steps: translating a Chinese demand and a code annotation into English, and separating a code logic from an annotation text based on a specified rule; word embedding is carried out on the preprocessed Chinese requirements, the code logic and the annotation text to obtain embedded semantic vector representation; performing hierarchical mixed matching based on the obtained semantic vector representation so as to associate the demand with the code; and fusing the association results through configurable decision logic to determine a final matching result. According to the method provided by the embodiment of the invention, based on a multi-modal semantic alignment technology of the pre-training model, high-precision and robust tracking relation identification is realized by combining deep semantic association of the modeling demand text and the code snippets.
Owner:BEIHANG UNIV

Code and development document automatic synchronization method based on large model

The invention relates to a method for automatically synchronizing a code and a development document based on a large model, which ensures that the document and the code are always kept consistent by correlating the document and the code and adopting an AI automatic synchronization mechanism, and avoids various development problems caused by manual updating errors or neglecting updating. According to the technical scheme, the method comprises the steps that a development document link is added into a code annotation, a code address is added into a development document, and bidirectional association is formed; and after the development document is changed, an AI synchronization button is clicked, and the AI automatically analyzes the document change and generates a changed code in combination with the business logic of the code. And after the code is changed, an AI synchronization button is clicked, and the AI automatically analyzes the code change and generates a changed development document in combination with the content of the development document.
Owner:SHANGHAI CAIJIANG INTELLIGENT TECH CO LTD

Automobile fault code labeling method and device, computer equipment and storage medium

The invention relates to the technical field of data processing, and discloses an automobile fault code labeling method and device, computer equipment and a storage medium, and the automobile fault code labeling method comprises the steps: carrying out the recognition processing of fault maintenance data, generating structured data, carrying out the standardization processing of the structured data, and generating text verification data; fault code fields and state information are extracted based on the text verification data, preliminary annotation data are constructed, recognition enhancement processing is carried out according to the preliminary annotation data, and fusion annotation data are generated; carrying out maintenance part matching processing on the fusion annotation data to generate image-text annotation structure data; and performing format processing on the image-text annotation structure data to generate target automobile fault code annotation data. According to the method, the labeling capability of the complex maintenance data can be effectively improved, the manual operation burden is reduced, and the efficiency, accuracy and consistency of data labeling are greatly improved.
Owner:THINKCAR TECH CO LTD

Code abstract generation method and system based on hierarchical context awareness

ActiveCN121957613AOvercoming the lack of context problemEnhance semantic relevanceSemantic analysisBiological modelsPathPingLinguistic model
The invention discloses a code abstract generation method and system based on hierarchical context awareness, and belongs to the field of natural language processing and software engineering. The method comprises the following steps: generating hierarchical annotations for a code warehouse based on a function call graph, firstly extracting a call relationship in the graph and eliminating a ring structure, and then classifying leaf nodes and generating annotations; a topological sequence from bottom to top is adopted in the core step, the importance score of a child node is calculated for each father node, child node annotations, class function descriptions and code bodies of the child nodes are fused, and a large language model is input to generate annotations till the whole graph is covered. The method is suitable for an automatic document generation scene of a complex software project, and through a technical path combining function call graph analysis, child node importance measurement and class function description, the accuracy and semantic consistency of code annotation are improved; the method can be widely applied to the fields of software maintenance, code understanding, intelligent development tools, automatic document generation of enterprise-level code warehouses and the like.
Owner:HANGZHOU DIANZI UNIV

Code annotation generation method and system based on token-level semantic matching

The invention belongs to the technical field of software engineering, and discloses a token-level semantic matching-based code annotation generation method and system, and the method comprises the following steps: obtaining a target code and a data set, carrying out the preprocessing and dividing, and obtaining a training set as a corpus; performing word segmentation on the codes in the corpus by using a word segmentation device of a pre-trained large language model, and extracting and storing a context semantic embedding vector of each token in the codes to form a code semantic warehouse; calculating the lexical similarity between the target code and the code in the corpus, and taking the top k high examples as candidate examples; according to the method, a target code and a candidate sample are subjected to token-level semantic matching, the most similar token in another code segment is matched, the accuracy rate and the recall rate are combined to obtain an F1 score, and the sample with the highest score is reused, the context semantic feature of fine granularity is considered in the aspect of retrieval, the code annotation generation precision is improved, extra training is not needed, and the retrieval efficiency is improved. And the method has good applicability to different scenes.
Owner:HANGZHOU DIANZI UNIV

Method and system for automatic generation of source code comments based on word-level retrieval

ActiveCN116627487BFeature vectorAlgorithm
The application discloses a source code annotation automatic generation method and system based on word-level retrieval and belongs to the field of natural language processing text generation. A training set composed of code function text, code abstract syntax tree and code annotation text is used to train an encoding-decoding network; an overall feature vector of each annotation word in the code annotation text is obtained to construct a near-neighbor word database; for the code function text to be annotated and the abstract syntax tree thereof, a model-based target word probability distribution and an overall feature vector of a target word at a current time step are generated in a self-recurrent manner; K near-neighbor words with the highest similarity to the overall feature vector of the target word are searched in the near-neighbor word database to generate a target word probability distribution based on the near-neighbor words; and the two target word probability distributions are fused to take the target word with the maximum probability as an annotation word generated at the current time step. The application can greatly improve the annotation generation quality of an original model and also improve the generation probability of low-frequency words in code annotation.
Owner:ZHEJIANG UNIV

Code annotation generation method based on large language model and multi-modal comparative learning

The invention discloses a code annotation generation method based on a large language model and multi-modal comparative learning, which comprises the following steps: firstly, designing a universal prompt template to help the large language model to generate similar code segments, and introducing the thought of gradually generating a thinking chain into the prompt template to effectively improve the accuracy of a generation result; meanwhile, the realization modes and styles of the generated similar code segments and source codes are variable, and the quality is higher; secondly, aligning source codes, similar codes and annotations thereof through multi-modal comparative learning, and enhancing the understanding and matching capability of the model on semantic relationships between the codes, the similar codes and the annotations by designing intra-modal comparative learning and inter-modal comparative learning, so as to better capture deep association of the similar codes, the annotations and the source codes; and finally, designing an evaluation method based on a large language model, and more comprehensively evaluating the quality of the generated annotations from four aspects of correlation, integrity, clarity and understandability by means of the understanding ability of the large language model.
Owner:SICHUAN UNIV

Automatic code generation method and system for some / ip data type

PendingCN122308840ACode generationData class
This application discloses an automatic code generation method and system for SOME / IP data types, relating to the field of vehicle system development. The method includes: S1, data dictionary reading: obtaining the data dictionary for SOME / IP protocol communication; S2, data type classification, identification, and processing: opening the Excel file from step S1, classifying each row of data in the worksheet, and performing specific parsing processing for different types; S3, multi-round iterative dependency resolution: using a multi-round scanning strategy to resolve nested dependencies between various data types; S4, naming standardization processing: standardizing the names of each parsed data type according to preset naming rules; S5, standard code generation and output: converting all data types that have undergone naming standardization processing into type definition code conforming to C language specifications; simultaneously converting the value range, precision, unit, and Chinese description metadata in the data dictionary of the Excel file into code comments, generating a C language header file that can be included in the compilation project.
Owner:CHINA FAW CO LTD

A marking method for arbitrary code fragments and its retrieval system

The present application discloses a method for annotating arbitrary code snippets and a retrieval system thereof, which relates to the field of machine learning. The method comprises: establishing a code snippet database, activating a multidimensional feature annotation model, performing code snippet annotation, and establishing a first annotation result; calling an adaptive annotation network, utilizing the adaptive annotation network to perform contextual backtracking analysis on the code snippets in the database, and establishing a second annotation result; performing static and dynamic fusion analysis on the database, establishing joint functional similarity, and establishing a third annotation result; performing code version change annotation, and establishing a fourth annotation result; and performing code annotation retrieval management based on the four annotation results. The method solves the technical problem of low management efficiency and retrieval accuracy of code snippets due to the high complexity of code snippets in multidimensional feature annotation, and achieves the technical effect of improving the annotation accuracy and retrieval efficiency of code snippets by combining multidimensional annotation with adaptive backtracking analysis.
Owner:XIAN QIKE HOUDE INFORMATION TECHNOLOGY CO LTD

A software testing method, apparatus, device, and medium

This application discloses a software testing method, apparatus, device, and medium, relating to the field of software testing technology. The method includes: determining the software test cases to be evaluated and identifying several corresponding source code files; parsing each source code file to obtain code comments, and parsing the software test cases to obtain relevant case information, and saving this information to a preset case information list; performing a quality assessment on the code comments; if the quality assessment passes, obtaining code-related information from several source code files based on the code comments and saving this information to a preset code information list; comparing and matching the information in the preset code information list and the preset case information list using preset natural language processing technology, determining whether the coverage of the software test cases meets preset coverage conditions based on the matching results, and performing software testing operations on several source code files based on the software test cases after determining that the preset coverage conditions are met.
Owner:湖南长银五八消费金融股份有限公司

Interface management method, system and equipment and storage medium

The invention relates to the technical field of code compiling, and particularly discloses an interface management method, an interface management system, computer equipment and a computer readable storage medium. The interface management method comprises the steps that an annotation processor is injected into a project management tool, and when project source code compiling is executed, the annotation processor extracts interface metadata in a compiling file compiled by the project management tool and associates the interface metadata with code annotations of the interface metadata in the project source code; the technical problem that the accuracy and the generation timeliness of the interface management document are poor is solved, the annotation processor is introduced to generate the interface management document in the project source code compiling period, and the generation efficiency of the interface management document is improved.
Owner:BEIJING BAIJU YIXING TECH CO LTD

Code annotation generation method and device, equipment, storage medium and program product

The invention relates to the technical field of computers, and provides a code annotation generation method and device, equipment, a storage medium and a program product. The method comprises the steps of obtaining a to-be-analyzed SQL code; based on a large language model, generating an SQL code blood relationship of the to-be-analyzed SQL code; generating business knowledge based on the SQL code blood relationship; and based on the SQL code consanguinity and the business knowledge, generating a code annotation of the to-be-analyzed SQL code through the large language model. By means of the mode, it can be avoided that the generated code annotation is too technically or abstractly generated, the service logic and the service target of the code can be effectively reflected, the code annotation has better readability and understandability, and the influence on subsequent development and maintenance of software is reduced.
Owner:CHINA MOBILE GROUP ZHEJIANG +1

A source code annotation generation method and device, a storage medium and a computer device

A source code annotation generation method and device, a storage medium and a computer device are provided. When automatically annotating source code, the source code to be annotated and the bytecode of the source code to be annotated are first obtained. The bytecode can identify source codes with the same function but different implementation manners. Then, based on a preset word embedding matrix, a text word vector of the source code to be annotated and a bytecode word vector of the bytecode are determined. The text word vector can capture the semantic and syntactic information between the strings of the source code to be annotated. After the text word vector and the bytecode word vector are determined, the text word vector and the bytecode word vector are spliced to form a spliced word vector. The spliced word vector is used to generate an annotation result of the source code to be annotated. In this way, the annotation of the codes with the same function but different implementation manners is constrained, confusion and ambiguity are avoided, and the accuracy of the annotation result is improved.
Owner:SUN YAT SEN UNIV

Large model code generation method based on multi-feature improved Ptuning-V2

The invention discloses a large model code generation method based on multi-feature improved Ptuning-V2, which comprises the following steps that: aiming at a source code, multi-source features are extracted and fused from three dimensions of text, consumption and image, and the text features comprise code vectors, grammar structures and execution process features; the consumption features comprise code annotation, time and space complexity features; and the image features are used for processing a structure chart and a flow chart of the code by utilizing a visual converter. And injecting final semantic features generated after weighted fusion into a P-tuning V2 fine tuning algorithm in each layer of the base large model, so that the final semantic features, learnable prompt vectors and an input sequence jointly participate in self-attention calculation. According to the method, rich priori knowledge is provided for the prompt vector by deeply fusing the multi-dimensional characteristics of the code, the understanding ability of the model for the code structure, logic and performance is remarkably enhanced, and the accuracy, logic completeness and practicability of the generated code are effectively improved while the advantage of efficient fine tuning of parameters is kept.
Owner:NANJING HAOLIN TECH CO LTD

Source code comment generation system and source code comment generation method

A source code comment generation system: has term information in which terms used in a design document inputted to the source code comment generation system and meanings of the terms are associated with each other; divides source code into source codes in prescribed scope units; and, on the basis of a term having a meaning in a prescribed relationship with the meaning of the source code in scope units, the source code in scope units, and a prescribed language model, generates commented-upon source code that includes a comment in prescribed scope units for the source code in scope units.
Owner:HITACHI LTD

Annotation statement generation method and device, storage medium and electronic equipment

The invention discloses an annotation statement generation method and device, a storage medium and electronic equipment. The method comprises the steps that a target path and an annotation generation option are received, and the annotation generation option is used for indicating attribute information of a target annotation statement; determining file structure information based on the target path, the file structure information being used for determining annotation content of the target annotation statement; and generating a target annotation statement according to the file structure information and the annotation generation option, and inserting the target annotation statement in the target position. The technical problem that code readability is poor due to nonstandard code annotation is solved.
Owner:CHINA CONSTRUCTION BANK +1

A method and system for generating code annotations based on dual graph neural networks

This invention relates to the field of software engineering technology and discloses a method and system for generating code annotations based on a dual graph neural network. The method includes: acquiring source code and natural language annotations as source code, preprocessing the source code, and constructing training data based on the preprocessed source code and natural language annotations; constructing a code processing model, training the code processing model using the training data, and obtaining a trained code processing model. The code processing model includes a dual graph module, an encoder, an aggregator, and a decoder. The dual graph module parses the preprocessed source code to obtain an abstract syntax tree (AST), and constructs a syntactic dependency graph and a semantic dependency graph based on the AST; the encoder obtains a first encoding representation based on the syntactic dependency graph and a second encoding representation based on the semantic dependency graph; the aggregator obtains an aggregate graph representation based on the first and second encoding representations; the decoder generates natural language annotations based on the first, second, and aggregate graph representations; and inputting the code to be annotated into the trained code processing model to obtain natural language annotations. This invention can more effectively encode code structure, improve the accuracy of annotation generation, and enhance the generalization ability of the code processing model.
Owner:GUANGDONG UNIV OF TECH

A machine learning based code annotation generation and verification method

This invention discloses a machine learning-based code annotation generation and verification method, comprising the following steps: Step 1: Determine the target code unit and construct an abstract syntax tree, control flow graph, and data flow graph; Step 2: Encode the target code unit to generate candidate annotation text; Step 3: Parse the candidate annotation text to obtain a set of atomic assertions and extract a set of code facts; Step 4: Calculate the consistency score and determine the core conflict set; Step 5: Perform semantic preservation transformation to generate an equivalent view set and an equivalence evidence set, and delete invalid equivalent views; Step 6: Limit the interpretation domain and perform improved SmoothGrad attribution on the consistency score to generate contribution location results; Step 7: Generate candidate edit sequences and output corrected annotations; Step 8: Calculate the re-verification consistency score and generate annotation update records. This invention improves annotation consistency and interpretability verification capabilities.
Owner:TIBET TENGSHI SOFTWARE CO LTD

Method and system for constructing CCNoV data set and WESVM classifier to assist Web program design

PendingCN120669967AProgram documentationIntelligent editorsData setKernel method
According to the method, the debugging problem in Web program design is summarized, and particularly the complex ErrorMsg problem is solved. Based on a code annotation method and a NoValidate attribute method, the ErrorMsg problem is solved, features are designed, a CCNoV data set is constructed, and dimension reduction processing is carried out through PCA and tSNE technologies. Experimental results show that the original 15-dimensional data set is excellent in performance in the WESVM classifier, and the training and testing accuracy is up to 97% or above. However, when the data is reduced to two dimensions, the classification effect of the Gaussian Kernel method is better than that of the Learar Kernel, and the accuracy rate reaches 100%. The method disclosed by the invention not only discloses the advantages of a kernel method in processing dimension reduction data, but also shows that the CCNoV data set and the WESVM classifier constructed by the method can improve the efficiency and the accuracy of Web application program development, and support is provided for a programmer to develop the Web application program.
Owner:HANJIANG NORMAL UNIV

General-purpose document automatic generation method based on structured code annotation

This invention relates to the field of code documentation generation technology and discloses a general automatic documentation generation method based on structured code comments. The method collects structured code comments from source code files and acquires code context information in real time. In a document generation fusion mode, the structured code comments are compensated and parsed to obtain code element description indicators, thereby determining the document content update cycle. By acquiring logical path information during code execution and extracting semantic features, semantic node data is obtained, and the document generation quality status level is determined in combination with code context information. Finally, based on the content update cycle and quality status level, the dynamic document generation blind spots in the document generation process are regulated. This method achieves dynamic optimization of document generation through deep parsing of comments and integration of context and logical path information, enhancing the correlation and completeness between the document and the actual logic of the code.
Owner:国投人力资源服务有限公司

Code data annotation method, electronic equipment and storage medium

The invention provides a code data annotation method, electronic equipment and a storage medium, and relates to the technical field of code development. According to the method, a software function design specification or a user demand document, a code history problem and repair discussion and a code change context which have the highest correlation with multiple key metadata can be searched from a preset code warehouse and are input into a pre-trained code annotation model, so that a target code snippet is annotated; each first training sample of the code annotation model comprises a historical target code snippet, a corresponding historical software function design specification or a user demand document, a corresponding historical code historical problem and repair discussion, a corresponding historical code change context and a corresponding historical standard code annotation. According to the method, the reliability of annotating the target code snippets is high, manual intervention is not needed, and the efficiency is high.
Owner:VOYAH AUTOMOBILE TECH CO LTD

Code testing method, device, equipment and storage medium

The application relates to the field of testing, and discloses a code testing method, a code testing device, a code testing equipment and a storage medium. The method comprises the following steps: receiving source codes of multiple application projects, wherein the source code of each application project comprises a test mark; calculating the test coverage of each application project according to the source code of each application project and the test mark of each application project; determining a target application project with a test coverage less than a threshold based on the test coverage of each application project; traversing the source code of the target application project to obtain a target code segment without the test mark; obtaining target code annotation text corresponding to the target code segment from a preset annotation library; and generating a network model based on a preset first script, processing the target code annotation text, obtaining a first target test script corresponding to the target code segment, and executing the first target test script. The test script is generated based on the annotation corresponding to the code segment with the test coverage less than the threshold to directly perform the test, and the test efficiency is improved.
Owner:PINGAN INT SMART CITY TECH CO LTD

Public component development management method

The invention provides a public component development management method. The method comprises the following steps: establishing a code writing specification, a dynamic expansion mechanism, a code annotation specification and a version control strategy for developing a public component; establishing a development team training mechanism and a code review mechanism based on the code writing specification; designing dynamic parameters based on a dynamic expansion mechanism; optimizing the annotation document based on the code annotation specification; and managing the version of each public component in the public component library based on the version control strategy. By establishing a series of management specifications and optimization mechanisms, the development efficiency, quality and maintainability of the public component are improved, and the flexibility and expandability of the public component are enhanced. Through the implementation of the steps, it is ensured that developers can rapidly and easily integrate and call the public components, and meanwhile customized configuration and expansion can be conducted according to specific requirements of the project, so that the development efficiency is improved, the maintenance cost is reduced, and successful implementation of the project is promoted.
Owner:TUS CLOUD CONTROL (BEIJING) TECH LTD

A method, device, computer equipment and storage medium for generating code comments based on language processing

This application relates to a method, apparatus, computer device, and storage medium for generating code annotations based on language processing. The method comprises: inputting pre-interpreted code to be annotated into a pre-trained model; parsing the pre-interpreted code with the pre-trained model to obtain a pre-interpreted code fusion feature vector; and decoding the pre-interpreted code fusion feature vector using a decoder to generate code annotations. This method enables more precise analysis and understanding of the code's structure and semantics through language processing, automatically generating high-quality code annotations.
Owner:JINAN INSPUR DATA TECH CO LTD

Domestic software vulnerability detection method and device based on hybrid representation and incremental learning

The invention relates to a domestic software vulnerability detection method and device based on hybrid representation and incremental learning, and the method comprises the following steps: carrying out the data preprocessing of an application source code, obtaining a code structure and semantic original information, and generating a data flow diagram, a control flow diagram and a slice code attribute diagram; the source code, the source code annotation and the data flow diagram are input into a GraphCodeBERT model, and global semantic feature representation is obtained; inputting the slice code attribute graph into a gated graph neural network GGNN to obtain a graph feature vector; fusing the global semantic feature representation and the graph feature vector to obtain a fused feature representation; and inputting the feature representation into a full connection layer to obtain probability distribution of vulnerabilities contained in each node in the slice code attribute graph, thereby realizing vulnerability statement positioning. The method has the advantages that semantic information of source codes is comprehensively understood, vulnerability statement positioning is achieved, vulnerability over-detection accuracy is improved, and classification precision and robustness are improved through a misinformation correction strategy.
Owner:FUJIAN YIRONG INFORMATION TECH +1

Universal document automatic generation method based on structured code annotation

The invention relates to the technical field of code document generation, and discloses a universal document automatic generation method based on structured code annotation. The method comprises the following steps: acquiring a structured code annotation from a source code file, and acquiring code context information in real time; in a document generation fusion mode, performing compensation analysis on the structured code annotation to obtain a code element description index, and further determining a document content updating period; semantic node data are obtained by obtaining logic path information in a code execution process and extracting semantic features, and a quality situation level generated by a document is determined in combination with code context information; finally, according to the content updating period and the quality situation level, a dynamic document generation blind area in the document generation process is regulated and controlled. According to the method, dynamic optimization of document generation is achieved by deeply analyzing the annotation and integrating context and logic path information, and relevance and integrity of the document and actual code logic are enhanced.
Owner:国投人力资源服务有限公司

Deep learning-assisted automatic code standardization review method and system

The present invention discloses a method and system for automatic code standardization review assisted by deep learning, which relates to the field of data processing technology, including: collecting a standard code data set, performing mutation enhancement, and generating a non-standard code data set; obtaining a standard code feature set and a non-standard code feature set; building a code annotation system, annotating the standard code feature set and the non-standard code feature set, and obtaining a code sample data set; designing a deep learning network architecture and a cross-entropy loss function; using a multimodal fusion network and a cross-entropy loss function to perform adversarial training optimization on the code sample data set, and constructing a code standardization review network; automatically reviewing the code data to be tested based on the code standardization review network, and determining the code standardization review results. The present invention solves the technical problem that the existing technology is difficult to adapt to diverse code scenarios, and achieves the technical effect of improving the accuracy of code standardization review.
Owner:KAIYUAN HUACHUANG TECH (GRP) CO LTD

Method for carrying out noise label learning from code annotation data

The invention discloses a method for carrying out noise label learning from code annotation data, which comprises the following steps of: in a training process, firstly, dividing samples into a head class (a class with a relatively large number of samples) and a tail class (a class with a relatively small number of samples) by using a sample selection strategy based on division and convention; and then clean samples and noise samples are selected from the head class and the tail class. Next, a pseudo label and a new sample are generated for the tail class by means of big language model knowledge distillation, the generated pseudo label is used for correcting a noise sample in the tail class, and the generated new sample is used for relieving the problem of tail class scarcity caused by class imbalance distribution; and finally, model training is carried out on a clean subset selected from the head class, a clean subset selected from the tail class, a corrected tail class sample and a newly generated tail class sample, so that the model can better avoid fitting of noise labels in the training process, and better robustness is shown.
Owner:ZHEJIANG UNIV

Code annotation generation method and device based on fusion encoder

The invention relates to the technical field of code annotation automatic generation, in particular to a code annotation generation method and device based on a fusion encoder. The method comprises the steps of obtaining a text sequence vector of a code, a structure sequence vector of the code and an adjacent matrix of the code; obtaining a multi-level sequence vector based on the text sequence vector; obtaining a multi-view structure vector based on the structure sequence vector and the adjacent matrix; splicing the multi-level sequence vector and the multi-view structure vector to obtain a spliced vector; and decoding the splicing vector to generate a code annotation. According to the method, a fusion model of a multi-level sequence encoder and a multi-view structure encoder is adopted, and the accuracy and readability of automatic generation of code annotations are remarkably improved through multi-modal feature fusion and a self-adaptive attention mechanism.
Owner:709TH RESEARCH INSTITUTE CHINA STATE SHIPBUILDING CORP LTD

Code annotation generation method driven by mixed entropy

The invention belongs to the technical field of code annotation generation, and particularly relates to a mixed entropy driven code annotation generation method which comprises the following key steps: S1, constructing a standardized dictionary for standardizing codes and annotations; s4, constructing a program structure multi-relation graph PSRG for comprehensively capturing multi-dimensional structure information and deep semantic features of the codes; s6-S8: constructing a PSRG structure expert coding module, a retrieval annotation expert coding module and an expert vector sequence dynamic selection module, realizing effective balance between information utilization efficiency and semantic generalization ability based on a mixed entropy driving mechanism, and enhancing the representation ability and context adaptability of the generation model. According to the scheme, the adaptive capacity of the model to the long word string is improved, and the grasping of semantic details is enhanced, so that the accuracy, fluency and robustness of annotation generation are remarkably improved.
Owner:GUANGDONG UNIV OF TECH