Code generation method for low-code development platform
By analyzing the semantic similarity of user problem descriptions and module annotations on the low-code development platform, evaluating the attention and emotional intensity of the module, filtering high-probability error modules and replacing them, the accuracy of traditional low-code platforms when dealing with complex logic errors and module selection errors is solved, and the accuracy of code generation and development efficiency are improved.
Patent Information
- Application Number
- CN202411790992.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2044-12-06
AI Technical Summary
Traditional low-code platforms lack effective prompts and solutions when dealing with complex logic errors and module selection errors, resulting in poor accuracy of code generation.
By analyzing statement participles in user problem description text and module annotation fields, calculating semantic similarity, clustering word segmentation, evaluating modules for attention and affective intensity, filtering high probability error modules, and updating modules based on the degree of substitution.
It improves the accuracy of code generation, helps users more accurately identify and fix logical errors, and improves the user experience and development efficiency of low-code development platforms.
Smart Images

Figure CN119690419A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of low-code development technology, and in particular to a code generation method for a low-code development platform. Background Art
[0002] The traditional software development process usually requires a lot of coding and development work, which is less efficient when business needs change rapidly and time requirements are high. In order to build customized applications in a simpler and faster way, the existing technology uses low-code development platforms to simplify the development process through visual drag-and-drop components and module configuration, allowing users to create applications without writing a lot of code. However, since there are still logical and functional problems in the use of low-code platforms, traditional low-code platforms lack effective prompts and solutions for complex logical errors, module selection errors and other problems, which makes it difficult for users who lack programming experience to discover potential problems and fix them, and the accuracy of code generation is poor. Summary of the invention
[0003] In order to solve the technical problems that traditional low-code platforms lack effective prompts and solutions to problems and have poor accuracy in code generation, the purpose of the present invention is to provide a code generation method for a low-code development platform. The technical solutions adopted are as follows:
[0004] The present invention proposes a code generation method for a low-code development platform, the method comprising:
[0005] Obtain multiple sentences in the user problem description text on the low-code development platform, as well as multiple sentences in the comment field of each module, and obtain sentence segmentation of the corresponding sentences;
[0006] Obtain the semantic similarity between different sentences, and obtain multiple text segments of the problem description text according to the distribution of semantic similarity between different sentences in the problem description text; obtain the attention of each module and the high-similarity text segmentation according to the semantic similarity between different sentences in different text segments and the annotation fields of each module;
[0007] According to the relative distance between sentence segmentations in all highly similar text segments, all sentence segmentations are clustered to obtain multiple segmentation clusters; according to the similarity of sentence segmentations between different segmentation clusters and the annotation fields of each module, as well as the sentiment characteristics of the text segments corresponding to the sentence segmentations, the overall sentiment intensity score of each module is obtained; according to the attention and overall sentiment intensity score of each module, the error probability of each module is obtained, and the modules with high probability of error are screened out;
[0008] 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, the degree of substitution of each other module relative to each high-probability error module is obtained;
[0009] The low-code development platform is updated with modules according to the degree of substitution.
[0010] Furthermore, the method for obtaining the semantic similarity includes:
[0011] Get the word vector of the sentence segmentation, and calculate the cosine similarity between the word vectors of two sentence segmentations as the segmentation similarity;
[0012] Calculate the mean of all word segmentation similarities between different sentences as the semantic similarity between the corresponding sentences.
[0013] Furthermore, the method for obtaining the text segmentation includes:
[0014] Get the verb sentences in the problem description text;
[0015] Each other sentence between different adjacent verb sentences is judged in turn. If the semantic similarity between other sentences and the next verb sentence is greater than the semantic similarity between the corresponding other sentences and the previous verb sentence, the corresponding other sentences are used as the segmentation points of the problem description text between adjacent verb sentences to obtain the text segmentation corresponding to each verb sentence.
[0016] Furthermore, the method for obtaining the attention degree includes:
[0017] For any text segment, the mean of the semantic similarity of all sentences between the text segment and the annotation field of each module is obtained as the overall sentence similarity of the annotation field of each module relative to the text segment;
[0018] The annotation field of each module with the largest overall sentence similarity value relative to different text segments is selected, and the corresponding overall sentence similarity is used as the attention of each module.
[0019] Furthermore, the method for obtaining the highly similar text segments includes:
[0020] A preset number of annotation fields of each module with the largest overall sentence similarity values relative to different text segments are selected, and the corresponding text segments are used as high-similar text segments of each module.
[0021] Furthermore, the method for obtaining the word segmentation cluster includes:
[0022] Get the Euclidean distance between the word vectors of the sentence segmentation as the relative distance;
[0023] According to the relative distances between sentence segmentations in all highly similar text segments, DBSCAN clustering is performed on all sentence segmentations to obtain multiple segmentation clusters.
[0024] Furthermore, the method for obtaining the overall score of the emotional intensity includes:
[0025] Obtain the mean similarity of different sentence segmentations between each segmentation cluster and the annotation field of each module as the average similarity between each segmentation cluster and the annotation field of each module;
[0026] Obtain the sentiment intensity score of the text segment corresponding to each sentence segmentation in each segmentation cluster; select the sentence segmentation with the smallest sentiment intensity score in each segmentation cluster as the reference sentiment intensity score of each segmentation cluster;
[0027] The overall sentiment intensity score of each module is obtained based on the average similarity between different word segmentation clusters and the annotation fields of each module, as well as the reference sentiment intensity score. Both the average similarity and the reference sentiment intensity score are positively correlated with the overall sentiment intensity score.
[0028] Furthermore, the method for obtaining the error probability includes:
[0029] If the overall score of the emotional intensity of each module is less than the preset score threshold, the product of the attention of each module and the overall score of the emotional intensity is obtained, and a negative correlation mapping is performed as the error probability of each module;
[0030] If the overall emotion intensity score of each module is greater than or equal to the preset score threshold, the error probability of each module is set to 0.
[0031] Furthermore, the method for obtaining the high probability error module includes:
[0032] If the error probability of a module is greater than a preset error threshold, the corresponding module is regarded as a high-probability error module.
[0033] Furthermore, the method for obtaining the degree of substitution includes:
[0034] Obtain the mean of the semantic similarity of different sentences in the annotation field between each high-probability error module and each other module as the module similarity;
[0035] Module similarity is positively correlated with the degree of substitution, and the error probability of other modules is negatively correlated with the degree of substitution.
[0036] The present invention has the following beneficial effects:
[0037] The present invention analyzes the semantic similarity between different sentences, reveals the closeness between sentences in terms of intent and content, obtains multiple text segments of the problem description text, and helps to focus on different functional descriptions of the problem; then obtains the attention of each module and the highly similar text segmentation, and determines the description text segmentation most relevant to the module; clusters all sentence segmentations according to the relative distance between sentence segmentations in all highly similar text segments, obtains multiple segmentation clusters, and clusters related segmentations into a group, which helps to subsequently determine the segmentation type associated with the module; considering that sentiment analysis helps to reveal the positive or negative tendency of the description information, it helps to identify abnormal information, and according to different segmentation clusters and the annotation words of each module, The similarity of sentence segmentation between segments, and the emotional characteristics of the text segmentation corresponding to the sentence segmentation, obtain the overall score of the emotional intensity of each module, which helps to identify the emotional attitude towards the module; according to the attention and overall score of the emotional intensity of each module, obtain the error probability of each module, and screen out the high probability error module, more accurately evaluate the error probability of the module, and help determine the module that is most likely to contain errors; according to the similarity of the annotation field between each high probability error module and each other module, and the error probability of each other module, obtain the degree of substitution of each other module relative to each high probability error module, which helps to determine the module that can replace the high probability error module; update the module of the low-code development platform. The present invention updates the module by accurately evaluating the error probability of the module and analyzing the degree of substitution of other modules, thereby 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 drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0039] Figure 1 A flowchart of a code generation method for a low-code development platform provided by an embodiment of the present invention;
[0040] Figure 2 A flow chart of a method for obtaining attention provided by an embodiment of the present invention;
[0041] Figure 3 A flow chart of a method for obtaining an overall score of sentiment intensity provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0042] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined purpose of the invention, the following is a detailed description of the code generation method of a low-code development platform proposed by the present invention, its specific implementation method, structure, characteristics and effects, in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0043] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0044] The following is a detailed description of the specific scheme of the code generation method for a low-code development platform provided by the present invention in conjunction with the accompanying drawings.
[0045] See also 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, and the specific method includes:
[0046] Step S1: Obtain multiple sentences in the user problem description text on the low-code development platform, as well as multiple sentences in the comment field of each module, and obtain sentence segmentation of the corresponding sentences.
[0047] In an embodiment of the present invention, since the low-code platform lowers the development threshold, some users who lack programming experience find it difficult to identify and repair logical errors when they encounter logical and functional problems during the use of the low-code platform; in order to improve user experience and development efficiency, it is necessary to analyze the module content and the statements in the user problem description text, which helps to analyze the user's logical problems; first, obtain multiple sentences in the user problem description text on the low-code development platform, as well as multiple statements in the comment field of each module; wherein the sentences are divided according to punctuation.
[0048] It should be noted that, in the embodiment of the present invention, each sentence is segmented by Jieba to remove meaningless function words and prepositions to obtain the sentence segmentation of the corresponding sentence; the specific Jieba algorithm is a technical means well known to those skilled in the art and will not be elaborated here.
[0049] Step S2: Obtain the semantic similarity between different sentences, and obtain multiple text segments of the problem description text according to the distribution of semantic similarity between different sentences in the problem description text; obtain the attention of each module and the high-similar text segmentation according to the semantic similarity between different sentences in different text segments and the annotation fields of each module.
[0050] The content of a sentence often contains information at multiple levels. The semantic similarity analysis between sentences can deeply explore the internal connections of this information, better understand the characteristics of the sentence content, and obtain the semantic similarity between different sentences.
[0051] Preferably, in one embodiment of the present invention, the method for obtaining semantic similarity includes:
[0052] Get the word vector of the sentence segmentation, and calculate the cosine similarity between the word vectors of two sentence segmentations as the segmentation similarity;
[0053] Calculate the mean of all word segmentation similarities between different sentences as the semantic similarity between the corresponding sentences.
[0054] It should be noted that, in one embodiment of the present invention, the sentence segmentation is converted into word vectors through the word2vec model, and in other embodiments of the present invention, the BERT algorithm can also be used to obtain the word vector; the specific word2vec and BERT algorithms are technical means well known to those skilled in the art and will not be elaborated here.
[0055] The problem description text describes the errors and defects of the functions. By analyzing the distribution of semantic similarity between different sentences, we can understand the internal connection between the sentences in the problem description text and group the semantically similar sentences into one segment to facilitate understanding of the core information and main functional performance of each segment. According to the distribution of semantic similarity between different sentences in the problem description text, multiple text segments of the problem description text are obtained.
[0056] Preferably, in one embodiment of the present invention, the method for obtaining text segments includes:
[0057] Obtain verb sentences in the problem description text. Verb sentences describe the core information of actions, events or state changes. They are the key components of the text and indicate the functional performance of a module.
[0058] Each other sentence between different adjacent verb sentences is judged in turn. If the semantic similarity between other sentences and the next verb sentence is greater than the semantic similarity between the corresponding other sentences and the previous verb sentence, the corresponding other sentences are used as the segmentation points of the problem description text between adjacent verb sentences to obtain the text segmentation corresponding to each verb sentence.
[0059] It should be noted that adjacent verb sentences mean that there are no other verb sentences between the two verb sentences. Each other sentence is analyzed in sequence according to the sentence order until a split point appears. The previous verb sentence and all sentences before the split point are obtained as similar sentences of the previous verb sentence, and all sentences between the split point and the next verb sentence are obtained as similar sentences of the next verb sentence. All similar sentences of each verb sentence are obtained to form text segmentation.
[0060] It should be noted that, in one embodiment of the present invention, the method for obtaining verb sentences is: a pre-trained part-of-speech tagger can be used to tag sentences with parts of speech to obtain sentences with verb parts of speech; in other embodiments of the present invention, a verb vocabulary can also be constructed to analyze whether there are participles in the sentence that match the verbs in the vocabulary to obtain sentences containing verbs; the specific means are technical means well known to those skilled in the art and will not be elaborated here.
[0061] Through the similarity between different text segments and the annotation fields of each module, we can identify which text segments are closer to the annotation fields of the modules, 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 segment and the text segment, the more likely it is to describe the problem information of the corresponding module, and the more attention it needs. Based on the semantic similarity of different sentences between different text segments and the annotation fields of each module, we can obtain the attention of each module and the highly similar text segments.
[0062] Preferably, in one embodiment of the present invention, the method for obtaining the attention degree is as follows: Figure 2 , which shows a flow chart of a method for obtaining attention, including:
[0063] Step S201: For any text segment, obtain the mean of the semantic similarity of all sentences between the text segment and the annotation field 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 module's annotation field, we can capture the subtle connections and differences between sentences. By quantifying the overall sentence similarity of each module's annotation field relative to each text segment by averaging, it helps to evaluate the overall relationship between module annotations and text segmentation, and identify which module annotations are more functionally matched to text segmentation.
[0065] In one embodiment of the present invention, the formula for overall sentence similarity is expressed as:
[0066]
[0067] Among them, R i,pY represents the overall sentence similarity of the annotation field of the i-th module relative to the p-th text segment; p,t represents the tth sentence in the pth text segment; X i,q Indicates the qth statement in the comment field of the i-th module; n i Indicates the number of statements in the comment field of the i-th module; n p represents the number of sentences in the pth text segment; S(Y p,t ,X i,q ) represents the semantic similarity between the qth statement in the comment field of the ith module and the tth statement in the comment field of the ith module.
[0068] In the formula of overall sentence similarity, the greater the semantic similarity between the qth sentence in the annotation field of the ith module and the tth sentence in the annotation field of the ith module, the more similar the sentences are, the more consistent the functions expressed by the sentences are, and the greater the overall sentence similarity is.
[0069] Step S202: Select the annotation field of each module with the largest overall sentence similarity value relative to different text segments, and use the corresponding overall sentence similarity as the attention level 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 needs the most attention, and the greater the attention.
[0071] Preferably, in one embodiment of the present invention, the method for obtaining highly similar text segments includes:
[0072] A preset number of annotation fields of each module with the largest similarity values relative to the overall sentences in different text segments are selected, and the corresponding text segments are used as high-similar text segments of each module.
[0073] It should be noted that, in one embodiment of the present invention, the preset number is set to 3, and in other embodiments of the present invention, the size of the preset number can be set according to specific circumstances, which is not limited or elaborated here.
[0074] Step S3: Cluster all sentence segmentations according to the relative distances between sentence segmentations in all highly similar text segments to obtain multiple segmentation clustering clusters; obtain the overall sentiment intensity score of each module according to the similarity of sentence segmentations between different segmentation clustering clusters and the annotation fields 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 and overall sentiment intensity score of each module, and screen out modules with high probability of error.
[0075] The relative distance between sentence segmentations reflects the relationship between the segmentations. Sentence segmentations with similar descriptive features are clustered through clustering to reflect the internal structure and pattern of sentence segmentations, and to analyze similar segmentations more specifically, reducing the complexity of calculations. According to the relative distance between sentence segmentations in highly similar text segments, all sentence segmentations are clustered to obtain multiple segmentation clusters.
[0076] Preferably, in one embodiment of the present invention, the method for obtaining word segmentation clusters includes:
[0077] Get the Euclidean distance between the word vectors of the sentence segmentation as the relative distance;
[0078] According to the relative distances between sentence segmentations in all highly similar text segments, DBSCAN clustering is performed on all sentence segmentations to obtain multiple segmentation clusters.
[0079] It should be noted that in other embodiments of the present invention, the Manhattan distance between word vectors of sentence segmentations may also be obtained. The specific distance algorithm is a technical means well known to those skilled in the art and will not be described in detail here.
[0080] The DBSCAN clustering algorithm can effectively identify similar sentence segmentations and divide them into clusters while eliminating the influence of noise points. It should be noted that in the DBSCAN clustering algorithm, the size of the radius parameter determines the density of the clustering. The radius parameter is set to 0.1×W, where W represents the number of elements in the word vector obtained by converting the word2vec model; and the minimum number of samples is 5; in other embodiments of the present invention, the size of the radius parameter and the minimum number of samples can be set according to the specific situation, and no limitation or elaboration is made here. Specific DBSCAN clustering is a technical means well known to those skilled in the art and will not be described here.
[0081] The word segmentation clusters reflect the concentrated appearance of certain similar concept segmentations in the text. The similarity helps to identify the sentence segmentations in which the module annotations are most relevant, which helps to understand the function or purpose of the module; the text segmentation usually contains a detailed description of the function, performance or use, and may contain emotional color, such as positive or negative evaluation, which helps to evaluate the acceptance, satisfaction or trust of the module in the minds of users; combined with the similarity of sentence segmentation and the emotional characteristics of the text segmentation corresponding to the sentence segmentation, the performance of the module in the two dimensions of semantics and emotion can be more comprehensively evaluated. According to the similarity of sentence segmentation between different word segmentation clusters and the annotation fields of each module, and the emotional characteristics of the text segmentation corresponding to the sentence segmentation, the overall emotional intensity score of each module is obtained.
[0082] Preferably, in one embodiment of the present invention, the method for obtaining the overall score of the sentiment intensity is as follows: Figure 3, which shows a flow chart of a method for obtaining an overall score of sentiment intensity, including:
[0083] Step S301: obtaining the average similarity of different sentence segmentations between each segmentation cluster and the annotation field of each module as the average similarity between each segmentation cluster and the annotation field of each module;
[0084] By quantifying all the word segmentation similarities between the word segmentation clusters and the module's annotation fields by taking the average, the average similarity between the word segmentation clusters and the module's annotation fields can be evaluated, which helps to understand the characteristics of the sentence descriptions in the module's annotation fields.
[0085] Step S302: Obtain the sentiment intensity score of the text segment corresponding to each sentence segment in each segmentation cluster; select the sentence segment corresponding to the smallest sentiment intensity score in each segmentation cluster as the reference sentiment intensity score of each segmentation cluster.
[0086] Because the user problem description text contains not only positive demand descriptions that represent the user's expected behavior, but also negative descriptions of departmental logic or functional errors that represent abnormal or inconsistent information; therefore, it is necessary to analyze the sentiment characteristics of the text segmentation corresponding to the sentence segmentation. The larger the sentiment intensity score, the more positive description segmentations there are and the fewer abnormal or inconsistent information there are.
[0087] It should be noted that, in order to analyze the description of each sentence, in one embodiment of the present invention, VADER is used to analyze the text segments to obtain corresponding sentiment intensity scores. VADER is a technical means well known to those skilled in the art and will not be described in detail here.
[0088] Step S303: According to the average similarity between different word segmentation clusters and the annotation fields of each module, and the reference sentiment intensity score, the overall sentiment intensity score of each module is obtained, and the average similarity and the reference sentiment intensity score are both positively correlated with the overall sentiment intensity score.
[0089] Among them, the larger the average similarity, the more similar the meaning of the sentence segmentation in the segmentation cluster and the sentence in the annotation field of the module is, the more similar the emotional expression is, the larger the reference emotional intensity score is, and the larger the overall emotional intensity score is.
[0090] In one embodiment of the present invention, the formula for the overall score of sentiment intensity is expressed as:
[0091]
[0092] Among them, E i represents the overall score of the sentiment intensity of the i-th module; S i,rrepresents the average similarity between the rth word segmentation 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 lth sentence segmentation in the rth segmentation cluster; n r N represents the number of sentence segmentations in the rth segmentation cluster; i Indicates the number of word segmentation clusters; min{} represents the minimum value function.
[0093] In the formula for the overall score of sentiment intensity, It means that the sentence segmentation with the smallest sentiment intensity score among all sentence segmentations in the rth segmentation cluster is selected, indicating the possibility that the sentence segmentation contains negative descriptions. The smaller the minimum sentiment intensity score, the greater the possibility of negative descriptions in the sentence segmentation, and the more likely it is that abnormal information exists. Conversely, the larger the minimum sentiment intensity score, the smaller the possibility of negative descriptions in the sentence segmentation, and the smaller the possibility of abnormal information exists. The greater the average similarity between the rth segmentation cluster and the annotation field of the i-th module, the closer the meaning of the user problem description text is to 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 level indicates the user's perception of the importance of the module. The greater the user's attention level to the module, the more similar the user's problem description text is to the module's annotation field. The smaller the overall score of the sentiment intensity, the more negative the description of the user's problem description text is, and some logic and functions are wrong. The more similar the module, the more significant the error perception will be, and the greater the error probability. The error probability of each module is obtained based on the attention level and overall score of the sentiment intensity of each module.
[0095] Preferably, in one embodiment of the present invention, the method for obtaining the error probability includes:
[0096] Considering that the smaller the overall score of sentiment intensity is, the more negative the user's problem description is. If the attention is greater, it means that the module's annotation field has the same negative description as the user's problem, and the module has a greater error probability. When the overall score of sentiment intensity is greater, the user's problem description is more positive or neutral, and the module has less problems for the user.
[0097] If the overall emotion intensity score of each module is less than the preset score threshold, the product of the attention of each module and the overall emotion intensity score is obtained, and a negative correlation mapping is performed as the error probability of each module; if the overall emotion intensity score of each module is greater than or equal to the preset score threshold, the error probability of each module is set to 0.
[0098] In one embodiment of the present invention, the formula for error probability is expressed as:
[0099]
[0100] Among them, φ i represents the error probability of the i-th module; R i Indicates the attention of the i-th module; E i represents the overall sentiment intensity score 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 question description is positive, negative or neutral, in one 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 set according to the specific situation, which is not limited or elaborated 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 greater the impact on the operation effect of the low-code development platform. By screening high-probability error modules, the modules can be further repaired and optimized.
[0103] Preferably, in one embodiment of the present invention, the method for acquiring a high probability error module includes:
[0104] If the error probability of a module is greater than a preset error threshold, the corresponding module is regarded as a high-probability error module.
[0105] It should be noted that, in one 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 circumstances, and is not limited or elaborated herein.
[0106] Step S4: 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, the degree of substitution of each other module relative to each high-probability error module is obtained.
[0107] In the low-code development platform, some modules may have similar functions and can replace high-probability error modules to maintain the normal operation of the platform. 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 likely they are to be replaced; the smaller the error probability, the less abnormal information appears, the more positive the description, and the better the functional effect of the module. The similarity of the annotation fields and the error probability are comprehensively considered to evaluate the degree of replacement of other modules relative to the high-probability error modules. The higher the similarity, the smaller the error probability, and the higher the degree of replacement. 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, the degree of replacement of each other module relative to each high-probability error module is obtained.
[0108] Preferably, in one embodiment of the present invention, the method for obtaining the degree of substitution includes:
[0109] Obtain the mean semantic similarity of different sentences in the annotation field between each high-probability error module and each other module as the module similarity;
[0110] Module similarity is positively correlated with the degree of substitution, and the error probability of other modules is negatively correlated with the degree of substitution.
[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 meaning represented, and the higher the degree of substitutability; the smaller the error probability of other modules, the less abnormal information there is, and the more corresponding replacement is possible.
[0112] In one embodiment of the present invention, the formula for the degree of substitution is expressed as:
[0113]
[0114] in, S represents the degree of substitution of the jth other module relative to the fth high probability error module; f,j represents the module similarity between the f-th high probability error module and the j-th other module; φ j represents the error probability of the jth other module.
[0115] In the formula of substitution degree, the greater the module similarity between the f-th high probability error module and the j-th other module, the more consistent the functions implemented by the modules, φ j It means that the smaller the error probability of the jth other module is, the higher the degree of substitution is.
[0116] Step S5: Update the modules of the low-code development platform according to the degree of replacement.
[0117] The degree of substitution refers to the possibility of other modules replacing the high-probability error module. The higher the degree of substitution, 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 degree of replacement 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, other modules corresponding to the maximum degree of replacement are selected as replaceable modules; after the user selects a replaceable module to replace the high-probability error module, the system will update the low-code framework, and then automatically generate improved underlying code, which will be provided to users to implement optimized functions, thereby improving the accuracy and automation level of code generation, and further improving the intelligence and usability of the low-code development platform.
[0119] In summary, the present invention obtains the attention and high-similarity text segmentation of each module based on the similarity between different sentences; obtains multiple segmentation clusters according to the relative distance between sentence segmentations in the high-similarity text segmentation; performs similarity and sentiment feature analysis on sentence segmentations between different segmentation clusters and module annotation fields to obtain the overall sentiment intensity score of each module; then obtains the error probability of each module and screens out high-probability error modules; combines the similarity of the annotation fields between each high-probability error module and each other module to obtain the degree of substitution of each other module relative to each high-probability error module; and performs module updates on the low-code development platform. The present invention updates modules by accurately evaluating the error probability of modules and analyzing the degree of substitution of other modules, thereby improving the accuracy of code generation.
[0120] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying 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] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
Claims
1. A code generation method for a low-code development platform, characterized in that: The method comprises: Obtain multiple sentences in the user problem description text on the low-code development platform, as well as multiple sentences in the comment field of each module, and obtain sentence segmentation of the corresponding sentences; Obtain the semantic similarity between different sentences, and obtain multiple text segments of the problem description text according to the distribution of semantic similarity between different sentences in the problem description text; obtain the attention of each module and the high-similarity text segmentation according to the semantic similarity between different sentences in different text segments and the annotation fields of each module; According to the relative distance between sentence segmentations in all highly similar text segments, all sentence segmentations are clustered to obtain multiple segmentation clusters; according to the similarity of sentence segmentations between different segmentation clusters and the annotation fields of each module, as well as the sentiment characteristics of the text segments corresponding to the sentence segmentations, the overall sentiment intensity score of each module is obtained; according to the attention and overall sentiment intensity score of each module, the error probability of each module is obtained, and the modules with high probability of error are screened out; 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, the degree of substitution of each other module relative to each high-probability error module is obtained; The low-code development platform is updated with modules according to the degree of substitution.
2. According to a code generation method of a low-code development platform according to claim 1, it is characterized in that: The method for obtaining the semantic similarity comprises: Get the word vector of the sentence segmentation, and calculate the cosine similarity between the word vectors of two sentence segmentations as the segmentation similarity; Calculate the mean of all word segmentation similarities between different sentences as the semantic similarity between the corresponding sentences.
3. The code generation method of a low-code development platform according to claim 1, characterized in that: The method for obtaining the text segmentation includes: Get the verb sentences in the problem description text; Each other sentence between different adjacent verb sentences is judged in turn. If the semantic similarity between other sentences and the next verb sentence is greater than the semantic similarity between the corresponding other sentences and the previous verb sentence, the corresponding other sentences are used as the segmentation points of the problem description text between adjacent verb sentences to obtain the text segmentation corresponding to each verb sentence.
4. The code generation method of a low-code development platform according to claim 1, characterized in that: The method for obtaining the attention degree includes: For any text segment, the mean of the semantic similarity of all sentences between the text segment and the annotation field of each module is obtained as the overall sentence similarity of the annotation field of each module relative to the text segment; The annotation field of each module with the largest overall sentence similarity value relative to different text segments is selected, and the corresponding overall sentence similarity is used as the attention of each module.
5. The code generation method of a low-code development platform according to claim 4, characterized in that: The method for obtaining the highly similar text segments includes: A preset number of annotation fields of each module with the largest overall sentence similarity values relative to different text segments are selected, and the corresponding text segments are used as high-similar text segments of each module.
6. The code generation method of a low-code development platform according to claim 2 is characterized in that: The method for obtaining the word segmentation cluster includes: Get the Euclidean distance between the word vectors of the sentence segmentation as the relative distance; According to the relative distances between sentence segmentations in all highly similar text segments, DBSCAN clustering is performed on all sentence segmentations to obtain multiple segmentation clusters.
7. A code generation method for a low-code development platform according to claim 6, characterized in that: The method for obtaining the overall score of the emotional intensity includes: Obtain the mean similarity of different sentence segmentations between each segmentation cluster and the annotation field of each module as the average similarity between each segmentation cluster and the annotation field of each module; Obtain the sentiment intensity score of the text segment corresponding to each sentence segmentation in each segmentation cluster; select the sentence segmentation with the smallest sentiment intensity score in each segmentation cluster as the reference sentiment intensity score of each segmentation cluster; The overall sentiment intensity score of each module is obtained based on the average similarity between different word segmentation clusters and the annotation fields of each module, as well as the reference sentiment intensity score. Both the average similarity and the reference sentiment intensity score are positively correlated with the overall sentiment intensity score.
8. The code generation method of a low-code development platform according to claim 1, characterized in that: The method for obtaining the error probability includes: If the overall score of the emotional intensity of each module is less than the preset score threshold, the product of the attention of each module and the overall score of the emotional intensity is obtained, and a negative correlation mapping is performed as the error probability of each module; If the overall emotion intensity score of each module is greater than or equal to the preset score threshold, the error probability of each module is set to 0.
9. The code generation method of 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 a preset error threshold, the corresponding module is regarded as a high-probability error module.
10. The code generation method of a low-code development platform according to claim 1, characterized in that: The method for obtaining the degree of substitution includes: Obtain the mean of the semantic similarity of different sentences in the annotation field between each high-probability error module and each other module as the module similarity; Module similarity is positively correlated with the degree of substitution, and the error probability of other modules is negatively correlated with the degree of substitution.
Citation Information
Patent Citations
Method and system for automatically detecting consistency between annotations and codes
CN108170468A
Mobile application defect locating method based on user comment information
CN108717459A
Text sentiment analysis method and system based on natural language processing
CN116882415A
Code query method and device
CN117193764A
Task processing method, code completion method, code question and answer method and task processing model training method
CN117648079A