A code generation method for a low-code development platform
By analyzing the semantic similarity between user problem description text and module comment fields in low-code platforms, high-probability error modules are identified and replaced, solving the problem of insufficient code generation accuracy in traditional low-code platforms and improving development efficiency and the platform's intelligence level.
Patent Information
- Application Number
- CN202411790992.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2044-12-06
AI Technical Summary
Traditional low-code platforms lack effective prompts and solutions during the code generation process, resulting in poor code generation accuracy. In particular, it is difficult for users with little programming experience to identify and fix logical and functional errors.
By analyzing the semantic similarity between user question description text and module annotation fields, text segmentation and word clustering are performed to evaluate the attention and sentiment intensity of modules, filter out high-probability erroneous modules, and replace them based on the similarity between modules to achieve module updates.
It improves the accuracy of code generation by accurately assessing the error probability of modules and analyzing the degree of substitution, thereby optimizing the intelligence and usability of the low-code development platform.
Smart Images

Figure CN119690419B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of low-code development, and particularly relates to a code generation method for a low-code development platform. Background Art
[0002] The traditional software development process usually requires a large amount of coding and development work, which is inefficient for situations where business requirements change rapidly and time requirements are high; in order to build customized applications in a simpler and faster way, the prior art uses a low-code development platform to simplify the development process through visual component dragging, module configuration, etc., enabling users to create applications without writing a large amount of code; however, due to problems in logic and functions still existing during the use of the low-code platform, traditional low-code platforms lack effective prompts and solutions for complex logic errors, module selection errors, etc., resulting in difficulty for users without programming experience to discover and fix potential problems, and the accuracy of code generation is poor. Summary of the Invention
[0003] In order to solve the technical problem that traditional low-code platforms lack effective prompts and solutions for problems and the accuracy of code generation is poor, the purpose of the present invention is to provide a code generation method for a low-code development platform, and the specific technical solution adopted is as follows:
[0004] The present invention proposes a code generation method for a low-code development platform, and the method includes:
[0005] Obtain multiple statements in the user problem description text on the low-code development platform, as well as multiple statements in the comment fields of each module, and obtain the statement word segmentation of the corresponding statements;
[0006] Obtain the semantic similarity between different statements, and obtain multiple text segments of the problem description text according to the semantic similarity distribution between different statements in the problem description text; obtain the attention degree of each module and the high-similarity text segments according to the semantic similarity between different text segments and different statements in the comment fields of each module.
[0007] Cluster all statement word segmentations according to the relative distances between statement word segmentations within all high-similarity text segments to obtain multiple word segmentation clustering clusters; obtain the overall emotional intensity score of each module according to the similarity between statement word segmentations in different word segmentation clustering clusters and the comment fields of each module, and the emotional characteristics of the text segments corresponding to the statement word segmentations; obtain the error probability of each module according to the attention degree and the overall emotional intensity score of each module, and screen out high-probability error modules;
[0008] The substitution degree of each other module relative to each high-probability error module is obtained according to the similarity of the annotation fields between each high-probability error module and each other module, as well as the error probability of each other module;
[0009] The module update of the low-code development platform is performed according to the substitution degree.
[0010] Furthermore, the method for obtaining the semantic similarity includes:
[0011] Obtain the word vectors of the sentence segmentations, calculate the cosine similarity of the word vectors between two sentence segmentations as the segmentation similarity;
[0012] Calculate the mean value of all segmentation similarities between different sentences as the semantic similarity between the corresponding sentences.
[0013] Furthermore, the method for obtaining the text segmentation includes:
[0014] Obtain the verb sentences in the problem description text;
[0015] Successively judge each other sentence between different adjacent verb sentences. If the semantic similarity between an other sentence and the subsequent verb sentence is greater than the semantic similarity between the corresponding other sentence and the previous verb sentence, the corresponding other sentence is used as the segmentation point of the problem description text between the adjacent verb sentences, and the text segmentation corresponding to each verb sentence is obtained.
[0016] Furthermore, the method for obtaining the attention degree includes:
[0017] For any text segmentation, obtain the mean value of the semantic similarities of all sentences between the text segmentation and the annotation fields of each module as the overall sentence similarity of the annotation fields of each module relative to the text segmentation;
[0018] Select the one with the largest overall sentence similarity value of the annotation fields of each module relative to different text segmentations, and use the corresponding overall sentence similarity as the attention degree of each module.
[0019] Furthermore, the method for obtaining the highly similar text segmentations includes:
[0020] Select the top preset number of text segmentations with the largest overall sentence similarity values of the annotation fields of each module relative to different text segmentations, and use the corresponding text segmentations as the highly similar text segmentations of each module.
[0021] Furthermore, the method for obtaining the word segmentation clustering clusters includes:
[0022] Obtain the Euclidean distance of the word vectors between the sentence segmentations as the relative distance;
[0023] Perform DBSCAN clustering on all sentence segmentations according to the relative distances between sentence segmentations within all highly similar texts, to obtain multiple segmentation clustering clusters.
[0024] Further, the method for obtaining the overall sentiment intensity score includes:
[0025] Obtain the average value of the segmentation similarities of different sentence segmentations between each segmentation clustering cluster and the annotation fields of each module, as the average similarity between each segmentation clustering cluster and the annotation fields of each module;
[0026] Obtain the sentiment intensity score of the text segment corresponding to each sentence segmentation in each segmentation clustering cluster; select the smallest sentiment intensity score corresponding to the sentence segmentation in each segmentation clustering cluster as the reference sentiment intensity score of each segmentation clustering cluster;
[0027] According to the average similarity between different segmentation clustering clusters and the annotation fields of each module, and the reference sentiment intensity score, obtain the overall sentiment intensity score of each module. Both the average similarity and the reference sentiment intensity score are positively correlated with the overall sentiment intensity score.
[0028] Further, the method for obtaining the error probability includes:
[0029] If the overall sentiment intensity score of each module is less than the preset score threshold, obtain the product of the attention degree and the overall sentiment intensity score of each module, and perform a negative correlation mapping as the error probability of each module;
[0030] If the overall sentiment intensity score of each module is greater than or equal to the preset score threshold, set the error probability of each module to 0.
[0031] Further, the method for obtaining the high-probability error module includes:
[0032] If the error probability of a module is greater than the preset error threshold, take the corresponding module as a high-probability error module.
[0033] Further, the method for obtaining the substitution degree includes:
[0034] Obtain the average value of the semantic similarities of different sentences within the annotation fields between each high-probability error module and each other module as the module similarity;
[0035] The module similarity is positively correlated with the substitution degree, and the error probability of other modules is negatively correlated with the substitution degree.
[0036] The present invention has the following beneficial effects:
[0037] The present invention analyzes the semantic similarity between different statements, reveals the proximity in intention and content between statements, obtains multiple text segments of the problem description text, which helps to focus on different functional descriptions of the problem; furthermore, obtains the attention degree of each module and highly similar text segments, determines the text segments most relevant to the module; clusters all statement word segments according to the relative distances between the statement word segments within all highly similar text segments, obtains multiple word segment clustering clusters, and clusters related word segments into a group, which helps to subsequently determine the word segment types associated with the module; considering that sentiment analysis helps to reveal the positive or negative tendency of the description information and helps to identify abnormal information, obtains the overall sentiment intensity score of each module according to the similarity between the statement word segments in different word segment clustering clusters and the annotation fields of each module, as well as the sentiment characteristics of the text segments corresponding to the statement word segments, which helps to identify the sentiment attitude towards the module; obtains the error probability of each module according to the attention degree and the overall sentiment intensity score of each module, and screens out high-probability error modules, more accurately evaluates the error probability of the module, which helps to determine the module most likely to contain errors; obtains the substitution degree of each other module relative to each high-probability error module according to the similarity between the annotation fields of each high-probability error module and each other module, as well as the error probability of each other module, which helps to determine the module that can replace the high-probability error module; updates the modules of the low-code development platform. The present invention updates the modules by accurately evaluating the error probability of the module and analyzing the substitution degree of other modules, improving the accuracy of code generation. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0039] Figure 1 It is a flowchart of a code generation method for a low-code development platform provided by an embodiment of the present invention;
[0040] Figure 2 It is a flowchart of a method for obtaining the attention degree provided by an embodiment of the present invention;
[0041] Figure 3 It is a flowchart of a method for obtaining the overall sentiment intensity score provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0042] To further elaborate on the technical means and effects adopted by the present invention to achieve the intended invention purpose, the following, in combination with the accompanying drawings and preferred embodiments, details a code generation method for a low-code development platform proposed according to the present invention, including its specific implementation manner, structure, features and effects, as follows. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, the specific features, structures or characteristics in one or more embodiments can be combined in any suitable form.
[0043] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field to which the present invention belongs.
[0044] The following specifically describes the specific solution of a code generation method for a low-code development platform provided by the present invention in conjunction with the accompanying drawings.
[0045] Please refer to Figure 1 , which shows a flowchart of a code generation method for a low-code development platform provided by an embodiment of the present invention. The specific method includes:
[0046] Step S1: Obtain multiple statements in the user problem description text on the low-code development platform, as well as multiple statements in the comment fields of each module, and obtain the statement word segmentation of the corresponding statements.
[0047] In the embodiments of the present invention, since the low-code platform reduces the development threshold, some users lacking programming experience have difficulty in identifying and fixing logical errors when encountering logical and functional problems during the use of the low-code platform; in order to improve the user experience and development efficiency, it is necessary to analyze the statements in the module content and the user problem description text, which helps to analyze the user's logical problems; first, obtain multiple statements in the user problem description text on the low-code development platform, as well as multiple statements in the comment fields of each module; among them, the statements are divided according to punctuation marks.
[0048] It should be noted that in the embodiments of the present invention, each statement is segmented by jieba to remove meaningless function words and prepositions, and the statement word segmentation of the corresponding statements is obtained; the specific jieba algorithm is a well-known technical means for those skilled in the art and will not be elaborated here.
[0049] Step S2: Obtain the semantic similarity between different statements, and obtain multiple text segments of the problem description text according to the semantic similarity distribution between different statements in the problem description text; obtain the attention degree of each module and the highly similar text segments according to the semantic similarity between different text segments and different statements in the comment fields of each module.
[0050] The content of statements often contains information at multiple levels. The semantic similarity analysis between statements can deeply explore the internal connections of this information, better understand the characteristics manifested by the content of statements, and obtain the semantic similarity between different statements.
[0051] Preferably, in an embodiment of the present invention, the method for obtaining semantic similarity includes:
[0052] Obtain the word vectors of the segmented words of the statement, calculate the cosine similarity of the word vectors between the segmented words of two statements as the similarity of word segmentation.
[0053] Calculate the mean value of all the similarities of word segmentation between different statements as the semantic similarity between the corresponding statements.
[0054] It should be noted that, in an embodiment of the present invention, the segmented words of the statement are transformed into word vectors through the word2vec model. In other embodiments of the present invention, the BERT algorithm can also be used to obtain word vectors. The specific word2vec and BERT algorithms are well-known technical means to those skilled in the art and will not be elaborated here.
[0055] The problem description text describes the problems of function errors and defects. By analyzing the distribution of semantic similarities between different statements, the internal connections between each statement in the problem description text can be understood. The statements with similar semantics are grouped into one paragraph, which is convenient for understanding the core information and main function performance of each segment. According to the distribution of semantic similarities between different statements in the problem description text, multiple text segments of the problem description text are obtained.
[0056] Preferably, in an embodiment of the present invention, the method for obtaining text segments includes:
[0057] Obtain the verb statements in the problem description text. The verb statements describe the core information of actions, events or state changes, which are key components in the text and indicate the function performance of a certain module.
[0058] Successively judge each other statement between different adjacent verb statements. If the semantic similarity between an other statement and the subsequent verb statement is greater than the semantic similarity between the corresponding other statement and the previous verb statement, the corresponding other statement is used as the segmentation point of the problem description text between the adjacent verb statements, and the text segments corresponding to each verb statement are obtained.
[0059] It should be noted that adjacent verb sentences indicate that there are no other verb sentences between two verb sentences. Analyze each other sentence in sequence according to the sentence order until a segmentation point appears. Obtain the previous verb sentence and all sentences before the segmentation point as the similar sentences of the previous verb sentence, and obtain all sentences between the segmentation point and the subsequent verb sentence as the similar sentences of the subsequent verb sentence; obtain all similar sentences of each verb sentence to form text segments.
[0060] It should be noted that in an embodiment of the present invention, the method for obtaining verb sentences is as follows: A pre-trained part-of-speech tagger can be used to perform part-of-speech tagging on sentences to obtain sentences with verb parts-of-speech marked; in other embodiments of the present invention, a verb class thesaurus can also be constructed to analyze whether there are participles in the sentence that match the verbs in the thesaurus to obtain sentences containing verbs; the specific means are well-known technical means to those skilled in the art and will not be elaborated here.
[0061] By the similarity between different text segments and the annotation fields of each module, it can be identified which text segments are closer to the annotation fields of the module, so as to more accurately understand the text content and module functions, and then evaluate the attention of each module. The greater the similarity between the module annotation segments and the text segments, the more likely it is to describe the problem information of the corresponding module and the more attention is required. According to the semantic similarity of different sentences between different text segments and the annotation fields of each module, the attention of each module and the highly similar text segments are obtained.
[0062] Preferably, in an embodiment of the present invention, for the method of obtaining attention, please refer to Figure 2 , which shows a flowchart of a method for obtaining attention, including:
[0063] Step S201: For any text segment, obtain the average value of the semantic similarity of all sentences between the text segment and the annotation fields of each module as the overall sentence similarity of the annotation field of each module relative to the text segment.
[0064] By calculating the similarity between different sentences in each text segment and each sentence in the annotation field of the module, the subtle connections and differences between sentences can be captured. By averaging to quantify the overall sentence similarity of the annotation field of each module relative to each text segment, it helps to evaluate the overall relationship between the module annotation and the text segment and identify which module annotations are more functionally matched with the text segment.
[0065] In an embodiment of the present invention, the formula for the overall sentence similarity is expressed as:
[0066]
[0067] Wherein, R i,pRepresents the overall sentence similarity of the annotation field of the i-th module relative to the p-th text segment; Y p,t Represents the t-th sentence of the p-th text segment; X i,q Represents the q-th sentence in the annotation field of the i-th module; n i Represents the number of sentences in the annotation field of the i-th module; n p Represents the number of sentences in the p-th text segment; S(Y p,t ,X i,q ) Represents the semantic similarity between the q-th sentence in the annotation field of the i-th module and the t-th sentence in the p-th text segment.
[0068] In the formula for overall sentence similarity, the greater the semantic similarity between the q-th sentence in the annotation field of the i-th module and the t-th sentence in the p-th text segment, the more similar the sentences are, the more consistent the functions represented by the sentences are, and the greater the overall sentence similarity.
[0069] Step S202: Select the one with the largest overall sentence similarity value of the annotation field of each module relative to different text segments, and use the corresponding overall sentence similarity as the attention degree of each module.
[0070] By selecting the largest overall sentence similarity value, the module annotation field that best matches the text segment can be identified. The corresponding module may contain the most important information or the part that requires the most attention, and the greater the attention degree.
[0071] Preferably, in an embodiment of the present invention, the method for obtaining high-similar text segments includes:
[0072] Select the top preset number of text segments with the largest overall sentence similarity values of the annotation field of each module relative to different text segments, and use the corresponding text segments as the high-similar text segments of each module.
[0073] It should be noted that, in an embodiment of the present invention, the preset number is set to 3. In other embodiments of the present invention, the size of the preset number can be specifically set according to specific situations, and will not be limited and elaborated here.
[0074] Step S3: Cluster all sentence segmentations according to the relative distances between the sentence segmentations within all high-similar text segments to obtain multiple sentence segmentation clustering clusters; obtain the overall sentiment score of each module according to the similarity between the sentence segmentations of different clustering clusters and the annotation field of each module, and the sentiment characteristics of the text segments corresponding to the sentence segmentations; obtain the error probability of each module according to the attention degree and the overall sentiment score of each module, and screen out the high-probability error modules.
[0075] The relative distance between statement word segments reflects the relationship between the word segments. By clustering the word segments of statements with similar descriptive features, the internal structure and pattern of the statement word segments are reflected, and the same type of word segments are analyzed more specifically, reducing the computational complexity. According to the relative distance between the statement word segments within highly similar text segments, all statement word segments are clustered to obtain multiple word segment clustering clusters.
[0076] Preferably, in an embodiment of the present invention, the method for obtaining the word segment clustering cluster includes:
[0077] Obtain the Euclidean distance of the word vectors between the statement word segments as the relative distance;
[0078] According to the relative distance between the statement word segments within all highly similar text segments, perform DBSCAN clustering on all statement word segments to obtain multiple word segment clustering clusters.
[0079] It should be noted that in other embodiments of the present invention, the Manhattan distance of the word vectors between the statement word segments can also be obtained. The specific distance algorithm is a technical means well-known to those skilled in the art and will not be elaborated here.
[0080] The DBSCAN clustering algorithm can effectively identify similar statement word segments and divide them into clusters, while excluding the influence of noise points. It should be noted that in the DBSCAN clustering algorithm, the size of the radius parameter determines the clustering density. The radius parameter is set to 0.1×W, where W represents the number of elements in the word vector converted using the word2vec model; and the minimum number of samples is 5. In other embodiments of the present invention, the sizes of the radius parameter and the minimum number of samples can be specifically set according to specific situations, and will not be limited and elaborated here. The specific DBSCAN clustering is a technical means well-known to those skilled in the art and will not be elaborated here.
[0081] The word segment clustering cluster reflects the concentrated occurrence of certain similar concept word segments in the text. The similarity helps to identify which statement word segments in the word segment clustering clusters are most relevant to the content of the module annotation, and helps to understand the function or purpose of the module; the text segment usually contains a detailed description of the function, performance, or use, and may contain emotional colors, such as positive or negative evaluations, which helps to evaluate the acceptance, satisfaction, or trust of the module in the user's mind; combining the similarity of the statement word segments and the emotional characteristics of the text segments corresponding to the statement word segments can more comprehensively evaluate the performance of the module in both semantic and emotional dimensions. According to the similarity between different word segment clustering clusters and the statement word segments in each module's annotation field, as well as the emotional characteristics of the text segments corresponding to the statement word segments, obtain the overall emotional intensity score of each module.
[0082] Preferably, in an embodiment of the present invention, for the method of obtaining the overall emotional intensity score, please refer to Figure 3, which shows a flowchart of a method for obtaining an overall emotional intensity score, including:
[0083] Step S301: Obtain the average similarity of word segmentations of different sentences between each word segmentation clustering cluster and the annotation field of each module, as the average similarity between each word segmentation clustering cluster and the annotation field of each module;
[0084] By calculating the average value to quantify all the word segmentation similarities between the word segmentation clustering cluster and the annotation field of the module, the average similarity between the word segmentation clustering cluster and the annotation field of the module can be evaluated, which helps to understand the characteristics of the sentence descriptions within the annotation field of the module.
[0085] Step S302: Obtain the emotional intensity score of the text segment corresponding to each sentence word segmentation in each word segmentation clustering cluster; select the smallest emotional intensity score corresponding to the sentence word segmentation in each word segmentation clustering cluster as the reference emotional intensity score of each word segmentation clustering cluster.
[0086] Since in the user problem description text, there are not only descriptions of positive requirements indicating the behaviors expected by the user, but also negative descriptions of department logic or functional errors indicating abnormal or inconsistent information; therefore, it is necessary to analyze the emotional characteristics of the text segments corresponding to the sentence word segmentations. The larger the emotional intensity score, the more positive-description word segmentations there are, and the less abnormal or inconsistent information there is.
[0087] It should be noted that, in order to analyze the description of each sentence, in an embodiment of the present invention, VADER is used to analyze the text segment to obtain the corresponding emotional intensity score. Specifically, VADER is a well-known technical means for those skilled in the art and will not be elaborated here.
[0088] Step S303: Obtain the overall emotional intensity score of each module according to the average similarity between different word segmentation clustering clusters and the annotation field of each module, and the reference emotional intensity score. Both the average similarity and the reference emotional intensity score are positively correlated with the overall emotional intensity score.
[0089] Among them, the larger the average similarity, the more similar the meanings expressed by the sentence word segmentations in the word segmentation clustering cluster and the sentences in the annotation field of the module, and the more the same emotional expressions. The larger the reference emotional intensity score, the larger the overall emotional intensity score.
[0090] In an embodiment of the present invention, the formula for the overall emotional intensity score is expressed as:
[0091]
[0092] Among them, E i represents the overall emotional intensity score of the i-th module; S i,rrepresents the average similarity between the r-th word segmentation clustering cluster and the annotation field of the i-th module; E r,l represents the sentiment intensity score of the text segment corresponding to the l-th sentence word segmentation within the r-th word segmentation clustering cluster; n r represents the number of sentence word segmentations within the r-th word segmentation clustering cluster; N i represents the number of word segmentation clustering clusters; min{} represents the minimum value function.
[0093] In the formula for the overall sentiment intensity score, represents selecting the minimum sentiment intensity score of the text segments corresponding to all sentence word segmentations within the r-th word segmentation clustering cluster, indicating the possibility that the sentence word segmentation contains negative descriptions. The smaller the minimum sentiment intensity score, the greater the possibility of negative descriptions in the sentence word segmentation, and the more likely there is abnormal information. On the contrary, the larger the minimum sentiment intensity score, the smaller the possibility of negative descriptions in the sentence word segmentation, and the smaller the possibility of abnormal information; the greater the average similarity between the r-th word segmentation clustering cluster and the annotation field of the i-th module, the closer the meaning expressed by the user problem description text and the annotation field of the module, the greater the sentiment intensity score, and the greater the overall sentiment intensity score. The smaller the sentiment intensity score, the smaller the overall sentiment intensity score.
[0094] The attention degree represents the user's perception of the importance of the module. When the user's attention degree to the module is greater, it means that the user problem description text is more similar to the annotation field of the module; when the overall sentiment intensity score is smaller, there are more negative descriptions in the user problem description text, and there are errors in some logic and functions. The more similar the module is, the more significant the error perception will be, and the greater the error probability. According to the attention degree and the overall sentiment intensity score of each module, the error probability of each module is obtained.
[0095] Preferably, in an embodiment of the present invention, the method for obtaining the error probability includes:
[0096] Considering that when the overall sentiment intensity score is smaller, the user problem description is more negative. If the attention degree is greater, it means that the annotation field of the module has the same negative description as the user problem, and the error probability of the module is greater; when the overall sentiment intensity score is greater, the user problem description is more positive or neutral, and there are fewer problems with the module for the user;
[0097] If the overall sentiment intensity score of each module is less than the preset score threshold, obtain the product of the attention degree and the overall sentiment intensity score of each module, and perform a negative correlation mapping as the error probability of each module; if the overall sentiment intensity score of each module is greater than or equal to the preset score threshold, set the error probability of each module to 0.
[0098] In an embodiment of the present invention, the formula for the error probability is expressed as:
[0099]
[0100] where, φ i represents the error probability of the i-th module; R i represents the attention degree of the i-th module; E i represents the overall score of the emotional intensity of the i-th module; norm{} represents the normalization function.
[0101] It should be noted that, in order to distinguish whether the emotional tendency of the problem description is positive, negative or without a specific tendency, in an embodiment of the present invention, the size of the preset score threshold is set to 0. In other embodiments of the present invention, the size of the preset score threshold can be specifically set according to specific situations, and no limitation and elaboration are made here.
[0102] The size of the error probability reflects the stability and reliability of the module during operation. The higher the error probability, the worse the stability and reliability of the module, and the more it affects the operation effect of the low-code development platform. By screening high-probability error modules, the modules are further repaired and optimized.
[0103] Preferably, in an embodiment of the present invention, the method for obtaining high-probability error modules includes:
[0104] If the error probability of the module is greater than the preset error threshold, the corresponding module is used as a high-probability error module.
[0105] It should be noted that, in an embodiment of the present invention, the size of the preset error threshold is 0.9; in other embodiments of the present invention, the size of the preset error threshold can be specifically set according to specific situations, and no limitation and elaboration are made here.
[0106] Step S4: Obtain the substitution degree of each other module relative to each high-probability error module according to the similarity of the annotation fields between each high-probability error module and each other module, and the error probability of each other module.
[0107] In the low-code development platform, some modules may have similar functions and can replace high-probability error modules to keep the platform running normally. By analyzing the similarity of the annotation fields, the similarity of the module functions is evaluated. The greater the similarity, the more similar the functions are, and the more they can be replaced; the smaller the error probability, the fewer abnormal information appears, and the more positive the description is, and the better the function effect of the module. Combining the similarity of the annotation fields and the error probability, the substitution degree of other modules relative to high-probability error modules is evaluated. The higher the similarity and the smaller the error probability, the higher the substitution degree. Obtain the substitution degree of each other module relative to each high-probability error module according to the similarity of the annotation fields between each high-probability error module and each other module, and the error probability of each other module.
[0108] Preferably, in an embodiment of the present invention, the method for obtaining the substitution degree includes:
[0109] Obtain the average semantic similarity of different statements in the annotation fields between each high-probability error module and each other module as the module similarity.
[0110] The module similarity is positively correlated with the substitution degree, and the error probability of other modules is negatively correlated with the substitution degree.
[0111] Among them, the greater the module similarity, the greater the semantic similarity of different statements in the annotation fields between modules, the more consistent the meanings represented, and the higher the substitution degree; the smaller the error probability of other modules, the less abnormal information exists, and the more replaceable it can be.
[0112] In an embodiment of the present invention, the formula for the substitution degree is expressed as:
[0113]
[0114] Wherein, represents the substitution degree of the jth other module relative to the fth high-probability error module; S f,j represents the module similarity between the fth high-probability error module and the jth other module; φ j represents the error probability of the jth other module.
[0115] In the formula for the substitution degree, the greater the module similarity between the fth high-probability error module and the jth other module, the more consistent the functions implemented by the modules, and φ j represents that the smaller the error probability of the jth other module, the higher the substitution degree.
[0116] Step S5: Update the modules of the low-code development platform according to the substitution degree.
[0117] The substitution degree refers to the substitution possibility of other modules relative to the high-probability error module. The higher the substitution degree, the more effectively the corresponding module can replace the high-probability error module, reduce the probability of errors, and thus improve the stability of the entire system.
[0118] It should be noted that after obtaining the substitution degree of different other modules relative to the high-probability error module, the modules of the low-code development platform are updated, including: for each high-probability error module, select the other module corresponding to the maximum substitution degree value as the replaceable module; after the user selects the replaceable module to replace the high-probability error module, the system will update the low-code framework, and then automatically generate the improved underlying code and provide it to the user to implement the optimized function, improving the accuracy and automation level of code generation, and further enhancing the intelligence and usability of the low-code development platform.
[0119] In summary, the present invention, based on the similarity between different statements, obtains the attention degree of each module and the high-similarity text segments; according to the relative distance between the statement word segments within the high-similarity text segments, obtains multiple word segment clustering clusters; conducts similarity and sentiment feature analysis on the statement word segments between different word segment clustering clusters and the annotation fields of the modules to obtain the overall sentiment intensity score of each module; further obtains the error probability of each module, and screens out the high-probability error modules; combines the similarity of the annotation fields between each high-probability error module and each other module to obtain the substitution degree of each other module relative to each high-probability error module; and updates the modules of the low-code development platform. The present invention updates the modules by accurately evaluating the error probability of the modules and analyzing the substitution degree of other modules, improving the accuracy of code generation.
[0120] It should be noted that the above sequence of the embodiments of the present invention is only for description and does not represent the superiority or inferiority of the embodiments. The processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0121] Each embodiment in this specification is described in a progressive manner. The same or similar parts among the embodiments can be referred to each other, and the key point of each embodiment is to illustrate the differences from other embodiments.
Claims
1. A code generation method for a low-code development platform, characterized in that, The method includes: Obtain multiple statements in the user problem description text on the low-code development platform, as well as multiple statements in the annotation fields of each module, and obtain the statement word segmentation of the corresponding statements; Obtain the semantic similarity between different statements. According to the semantic similarity distribution between different statements in the problem description text, obtain multiple text segments of the problem description text; according to the semantic similarity between different text segments and different statements in the annotation fields of each module, obtain the attention degree of each module and the highly similar text segments; Cluster all statement word segmentations according to the relative distances between statement word segmentations within all highly similar text segments to obtain multiple word segmentation clusters; according to the similarity between word segmentation clusters and statement word segmentations in the annotation fields of each module, and the sentiment characteristics of the text segments corresponding to the statement word segmentations, obtain the overall sentiment intensity score of each module; according to the attention degree and overall sentiment intensity score of each module, obtain the error probability of each module, and filter out the high-probability error modules; According to the similarity between the annotation fields of each high-probability error module and each other module, and the error probability of each other module, obtain the substitution degree of each other module relative to each high-probability error module; Update the modules of the low-code development platform according to the substitution degree; The method for obtaining the attention degree includes: For any text segment, obtain the mean value of the semantic similarity of all statements between the text segment and the annotation fields of each module, and use it as the overall statement similarity of the annotation field of each module relative to the text segment; Select the one with the largest overall statement similarity value of the annotation field of each module relative to different text segments, and use the corresponding overall statement similarity as the attention degree of each module.
2. The code generation method of a low-code development platform according to claim 1, wherein The method for obtaining the semantic similarity includes: Obtain the word vectors of the statement word segmentations, and calculate the cosine similarity between the word vectors of two statement word segmentations as the word segmentation similarity; Calculate the mean value of all word segmentation similarities between different statements as the semantic similarity between the corresponding statements.
3. A code generation method for a low-code development platform according to claim 1, characterized in that The method for obtaining the text segments includes: Obtain the verb statements in the problem description text; Successively judge each other statement between different adjacent verb statements. If the semantic similarity between another statement and the subsequent verb statement is greater than the semantic similarity between the corresponding other statement and the previous verb statement, use the corresponding other statement as the segmentation point of the problem description text between the adjacent verb statements, and obtain the text segment corresponding to each verb statement.
4. A code generation method for a low-code development platform according to claim 1, wherein The method for obtaining the highly similar text segments includes: Select the top preset number of text segments with the largest overall statement similarity value of the annotation field of each module relative to different text segments, and use the corresponding text segments as the highly similar text segments of each module.
5. A code generation method for a low-code development platform according to claim 2, characterized in that, The method for obtaining the word segmentation clusters includes: Obtain the Euclidean distance between the word vectors of the statement word segmentations as the relative distance; Cluster all statement word segmentations according to the relative distances between statement word segmentations within all highly similar text segments by DBSCAN to obtain multiple word segmentation clusters.
6. The code generation method of a low-code development platform according to claim 5, wherein, The method for obtaining the overall sentiment intensity score includes: Obtain the average similarity of word segmentations of different sentences between each word segmentation clustering cluster and the annotation field of each module as the average similarity between each word segmentation clustering cluster and the annotation field of each module; Obtain the sentiment intensity score of the text segment corresponding to each sentence word segmentation in each word segmentation clustering cluster; select the one with the smallest sentiment intensity score among the sentence word segmentations corresponding to each word segmentation clustering cluster as the reference sentiment intensity score of each word segmentation clustering cluster; According to the average similarity between different word segmentation clustering clusters and the annotation field of each module, and the reference sentiment intensity score, obtain the overall sentiment intensity score of each module. Both the average similarity and the reference sentiment intensity score are positively correlated with the overall sentiment intensity score.
7. A code generation method for a low-code development platform according to claim 1, characterized in that, The method for obtaining the error probability includes: If the overall sentiment intensity score of each module is less than the preset score threshold, obtain the product of the attention degree and the overall sentiment intensity score of each module, and perform a negative correlation mapping as the error probability of each module; If the overall sentiment intensity score of each module is greater than or equal to the preset score threshold, set the error probability of each module to 0.
8. A code generation method for a low-code development platform according to claim 1, characterized in that, The method for obtaining the high-probability error module includes: If the error probability of a module is greater than the preset error threshold, regard the corresponding module as a high-probability error module.
9. A code generation method for a low-code development platform according to claim 1, characterized in that, The method for obtaining the substitution degree includes: Obtain the average semantic similarity of different sentences within the annotation field between each high-probability error module and each other module as the module similarity; The module similarity is positively correlated with the substitution degree, and the error probability of other modules is negatively correlated with the substitution degree.
Citation Information
Patent Citations
Mobile application defect locating method based on user comment information
CN108717459A
Code query method and device
CN117193764A