A Method of Code Digest Generation Based on Maximum Entropy Model
A technology of maximum entropy model and code summarization, applied in the direction of code compilation, program code conversion, etc., can solve the problems of loss of consistency, inability to specify, inaccurate code summary, etc., to achieve the effect of reducing workload and good scalability
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment Construction
[0022] like figure 1 As shown, the code summary generation method based on the maximum entropy model of the present invention includes the following steps:
[0023] Step 1. According to the limited sample template, use the abstract syntax tree to parse the code and collect training samples;
[0024] Step 2. According to the training samples, a general iterative algorithm is used to construct a code element classifier;
[0025] For the classification problem, use A to represent all possible code element types, and B is a set of context information where the code element is located, then a binary function on a {0,1} domain can be defined to represent the feature:
[0026]
[0027] Among them, if (a,b)∈(A,B), and satisfy the limited conditions, then f(a,b)=1; otherwise, f(a,b)=0;
[0028] If the type a∈A of the judgment code element is regarded as an event, and the context information of the code element is regarded as the condition b∈B of the occurrence of the event, then t...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


