Component attribute form generation method and electronic equipment
Through natural language descriptions, the knowledge graph is used to convert it into a vector sequence and use the knowledge graph, combining the component attribute prediction model and the component type classification model to generate component attribute forms, solving the problem of traditional manual form defining and difficult to meet complex business scenarios, and achieving efficient and accurate form generation.
Patent Information
- Application Number
- CN202510218297.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-26
- Publication Date
- 2025-05-30
AI Technical Summary
In traditional software development, the generation of component attribute forms relies on manual definition, which makes them time-consuming, labor-intensive, error-prone, and difficult to meet complex business scenarios and real-time requirements.
By obtaining natural language descriptions, converting them into vector sequences, using knowledge graphs to fuse association information, processing the target feature vectors, and generating component attribute forms through component attribute prediction model and component type classification model.
It improves the intelligence and generation accuracy of form generation, and can adjust and optimize the generation strategy in real time according to user needs and scenario changes, reducing development costs and improving efficiency.
Smart Images

Figure CN120066476A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of form generation, and particularly to a method for generating a component attribute form and an electronic device. Background Art
[0002] In traditional software development, the generation of component attribute forms mainly relies on manual definition. Developers need to determine the attributes, types of each component in the form and the logical relationships between them according to business requirements, and then implement the creation and configuration of the form through code. Although this method can meet the requirements of some simple scenarios, it exposes obvious drawbacks when facing complex business scenarios. Manually defining forms is not only time-consuming and laborious, but also error-prone. Developers need to spend a lot of time and effort writing and debugging code to ensure the correct function and logic of the form. Once the business requirements change and the form needs to be modified, developers need to review and modify a large amount of code again, which not only increases the development cost, but also easily introduces new errors. In addition, it is difficult to meet the requirements of real-time and accuracy by manually defining forms. In a rapidly iterative project, this method often cannot respond to changes in business requirements in a timely manner. Summary of the Invention
[0003] The main purpose of the embodiments of this application is to propose a method for generating a component attribute form and an electronic device. It aims to generate a component attribute form based on natural language descriptions, which can improve the intelligence level of form generation, and also improve the generation accuracy, ensuring that the generation strategy can be adjusted and optimized in real time according to user needs and scenario changes.
[0004] To achieve the above object, the first aspect of the embodiments of this application proposes a method for generating a component attribute form, and the method includes:
[0005] Obtain a natural language description of form requirements, and convert the text information corresponding to the natural language description into a continuous vector sequence, where each word is converted into a corresponding word vector;
[0006] Search for associated information related to each of the word vectors in a knowledge graph, and fuse the associated information into the corresponding word vector to obtain a first feature vector;
[0007] Process the first feature vector to obtain a target feature vector, where the target feature vector contains a comprehensive and detailed feature representation corresponding to the natural language description;
[0008] Obtain the component attribute information by processing the target feature vector through a component attribute prediction model, and obtain the component type by processing the target feature vector through a component type classification model;
[0009] Match and combine the component type with the corresponding component attribute information to generate a component attribute form.
[0010] In one embodiment of the present application, the processing of the first feature vector to obtain the target feature vector includes:
[0011] Process the first feature vector through a Transformer module to obtain a second feature vector;
[0012] Mine the context information of the second feature vector and fuse the context information with the second feature vector to obtain a third feature vector;
[0013] Perform global feature extraction and enhancement processing and local feature extraction and refinement processing on the third feature vector respectively, and then perform feature fusion to obtain the target feature vector.
[0014] In one embodiment of the present application, after obtaining the second feature vector, the method further includes:
[0015] Process the second feature vector through a multi-head attention module to capture the semantic information of the text information from multiple perspectives and obtain an optimized second feature vector.
[0016] In one embodiment of the present application, after obtaining the third feature vector, the method further includes:
[0017] Process the third feature vector through a Transformer module to obtain a fourth feature vector;
[0018] Perform global feature extraction and enhancement processing and local feature extraction and refinement processing on the fourth feature vector respectively, and then perform feature fusion to obtain the target feature vector.
[0019] In one embodiment of the present application, the component attribute prediction model includes a plurality of fully connected layers and ReLU activation layers connected in sequence. The obtaining of the target feature vector through the component attribute prediction model and the processing to obtain the component attribute information includes:
[0020] The component attribute prediction model maps the target feature vector to the attribute space of the component and predicts the corresponding component attribute information according to the natural language description.
[0021] In one embodiment of the present application, the obtaining of the target feature vector through the component type classification model and the processing to obtain the component type includes:
[0022] The component type classification model obtains the target feature vector and converts the target feature vector into a probability distribution, where the probability distribution includes probabilities corresponding to different component types respectively;
[0023] Select the component type with the highest probability as the component type of the predicted output.
[0024] In an embodiment of the present application, after matching and combining the component type with the corresponding component attribute information to generate a component attribute form, the method further includes:
[0025] Through a dynamic weight adjustment mechanism, balance the data relevance loss and the user experience loss, and construct a generation strategy loss function, where the data relevance loss is used to measure whether the logical relationship between fields in the generated component attribute form is correct, and the user experience loss is used to evaluate the interactivity and fluency of the generated component attribute form in the actual use process.
[0026] In an embodiment of the present application, the generation strategy loss function is:
[0027] L gen =αL data +βL user ;
[0028] In the formula, L gen represents the generation strategy loss function, L data represents the data relevance loss, where N is the number of samples, y i is the true relationship value between fields in the generated component attribute form, is the predicted relationship value between fields in the generated component attribute form, MSE represents the mean square error, which is used to quantify the difference between the predicted relationship value and the true relationship value, L user represents the user experience loss, where M is the number of user interaction samples, u j represents the feedback score of the actual user interaction, represents the predicted user experience score by the system, CE represents the cross-entropy loss, which is used to evaluate the consistency between the predicted user experience score and the feedback score of the actual user interaction, T j is the response time of the user operation, which is used to quantify the interaction fluency, w 1 and w 2 are adjustable weight coefficients, α and β are adjustable weight coefficients, where α + β = 1, R data represents the evaluation score of the current data relevance, θ represents the weight balance point, and γ represents the smoothing parameter, which is used to control the speed of weight adjustment.
[0029] In one embodiment of the present application, after matching and combining the component type with the corresponding component attribute information to generate a component attribute form, the method further includes:
[0030] Using the front-end dynamic interaction and real-time verification functions, the verification logic rules of the generated component attribute form are adjusted in real time according to user input, and the verification logic rules are continuously optimized through user feedback.
[0031] To achieve the above object, a second aspect of the embodiments of the present application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the method described in any embodiment of the present application is implemented.
[0032] In the technical solution provided in an embodiment of the present application, first, the text information corresponding to the natural language description of the form requirement is converted into a vector sequence, and each word is converted into a corresponding word vector. Then, the associated information related to each word vector is searched in the knowledge graph, and the associated information is fused into the corresponding word vector, so that the obtained first feature vector can fuse the prior knowledge in the knowledge graph, making the features more comprehensive and accurate, and providing more powerful support for subsequent processing. Then, the first feature vector is further processed to obtain a target feature vector containing a comprehensive and fine feature representation corresponding to the natural language description, so that the obtained target feature vector contains both high-level feature representations related to the global context and corresponding fine-grained information, which can provide important support for the accuracy and rationality of the subsequent generated form fields and components. Finally, the target feature vector is respectively input into the component attribute prediction model and the component type classification model to obtain the component attribute information and the component type accordingly, and then the component type is matched and combined with the corresponding component attribute information to generate a component attribute form, so as to realize the efficient and accurate generation of the component attribute form from the natural language description corresponding to the form requirement, improve the intelligence level and generation accuracy of form generation. Description of the Drawings
[0033] Figure 1 is a flowchart of a method for generating a component attribute form provided in an embodiment of the present application;
[0034] Figure 2 is a schematic diagram of a neural network architecture provided in an embodiment of the present application;
[0035] Figure 3 is a first-step flowchart for processing the first feature vector to obtain a target feature vector provided in an embodiment of the present application;
[0036] Figure 4It is the flowchart of the second step for processing the first feature vector to obtain the target feature vector provided by an embodiment of the present application;
[0037] Figure 5 It is the flowchart of the third step for processing the first feature vector to obtain the target feature vector provided by an embodiment of the present application;
[0038] Figure 6 It is the flowchart of the steps for obtaining the target feature vector through the component attribute prediction model and processing to obtain the component attribute information, and obtaining the target feature vector through the component type classification model and processing to obtain the component type provided by the embodiments of the present application;
[0039] Figure 7 It is the schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0040] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application.
[0041] It should be noted that although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order from the module division in the device or the order in the flowchart. Terms such as "first" and "second" in the specification, claims and the above drawings are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence.
[0042] 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 application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application, and are not intended to limit the present application.
[0043] Term explanation:
[0044] AI: Artificial Intelligence (AI for short), is a new technology science that focuses on researching and developing theories, methods, technologies, and application systems for simulating, extending, and expanding human intelligence. It enables machines to learn, think, and make decisions like humans, and thus can autonomously perform various tasks. AI technologies include sub - fields such as Machine Learning, Deep Learning, Natural Language Processing (NLP), and Computer Vision, and can exhibit intelligent behaviors similar to humans in complex tasks.
[0045] Description Generation: Description Generation is an important task in the cross - field of deep learning and natural language processing, which is a technology for generating corresponding structured data based on natural language input. By parsing user descriptions, it converts unstructured text into a form that can be understood by computers, thus supporting automated task processing and system configuration. Component Property Form: A component property form is a structured data form that defines the properties of software or hardware components. It is an interface used to set and manage component properties, and visually displays various properties of components and their configurable items. It usually presents in the form of a form, containing various controls such as text boxes, drop - down menus, buttons, and tables, which facilitates users to quickly adjust the behaviors, styles, and functional parameters of components, and is widely used in front - end development and low - code platforms to help developers or users intuitively and efficiently complete the configuration of components.
[0046] In today's software development field, the generation of component property forms is a fundamental and important task, widely used in scenarios such as front - end development and low - code platforms, helping developers or users intuitively and efficiently complete the configuration of components.
[0047] In traditional software development, the generation of component property forms mainly relies on manual definition. Developers need to determine the properties, types, and logical relationships between each component in the form one by one according to business requirements, and then implement the creation and configuration of the form through code. Although this method can meet the needs of some simple scenarios, it exposes obvious drawbacks when facing complex business scenarios. Manually defining forms is not only time - consuming and laborious, but also error - prone. Developers need to spend a lot of time and effort writing and debugging code to ensure the correct function and logic of the form. Once the business requirements change and the form needs to be modified, developers need to re - review and modify a large amount of code, which not only increases the development cost, but also easily introduces new errors. In addition, manually defining forms is difficult to meet the requirements of real - time and accuracy. In fast - iterating projects, this method often cannot respond to changes in business requirements in a timely manner.
[0048] To improve the efficiency of form generation, some automated generation tools have emerged. These tools are usually based on fixed templates and can automatically generate the attributes and structures of some form components according to preset rules and templates. Compared with the manual definition method, these tools improve the efficiency and accuracy of form generation to a certain extent. However, although they can deduce some attributes according to the template, they cannot fully utilize the natural language description information and are difficult to achieve dynamic and efficient generation. When facing complex and changing business requirements, fixed templates are difficult to dynamically adapt to the requirement descriptions of different projects. Developers often need to make a large number of customizations and modifications to the templates to meet the actual needs, which not only increases the development difficulty and cost but also reduces the flexibility and efficiency of form generation. In addition, existing automated generation tools perform poorly in dealing with complex data relationships and diverse scenarios. When the form involves complex logical relationships, data verification rules, and dynamic interactions between multiple components, these tools often cannot accurately generate forms that meet the requirements.
[0049] Based on this, the embodiments of the present application propose a method for generating a component attribute form, aiming to generate a component attribute form based on natural language descriptions, which can improve the intelligence level of form generation and also improve the generation accuracy, ensuring that the generation strategy can be adjusted and optimized in real time according to user needs and scenario changes.
[0050] Referring to Figure 1 , Figure 1 is a flowchart of the method for generating a component attribute form provided by an embodiment of the present application, including but not limited to steps S110 to S150.
[0051] Step S110, obtain the natural language description of the form requirements and convert the text information corresponding to the natural language description into a continuous vector sequence, where each word is converted into a corresponding word vector.
[0052] In the embodiments of the present application, referring to Figure 2 , Figure 2 is a schematic diagram of the neural network architecture provided by an embodiment of the present application. As Figure 2 shown, the neural network architecture includes an AI description layer, a word embedding layer, a knowledge-guided feature adjustment module, and a feature processing module connected in sequence. The AI description layer is used to obtain the natural language description of the form requirements input by the user, including the detailed description of the form requirements. Then, the text information corresponding to the natural language description is input into the word embedding layer, and the word embedding layer is used to convert the discrete text information into a continuous vector sequence, enabling the neural network to better process and understand the semantic information of the text. In this layer, each word will be converted into a low-dimensional vector representation, that is, a word vector.
[0053] Step S120: Search for associated information related to each word vector in the knowledge graph, and fuse the associated information into the corresponding word vector to obtain the first feature vector.
[0054] In the embodiment of the present application, after converting each word in the text information into the corresponding word vector, it is input into the knowledge-guided feature adjustment module. This module introduces the knowledge graph technology, and the knowledge graph contains rich semantic knowledge and entity relationship information. In this module, for the entities and concepts involved in the word vector, the knowledge-guided feature adjustment module will search for the associated information related to each word vector in the knowledge graph. For example, if the word vector contains the concept of "employee", the knowledge graph can provide various attribute information about employees, such as the positions and salary structures of employees. The knowledge-guided feature adjustment module can also fuse the information in the knowledge graph into the word vector in a suitable way. For example, the weighted summation method can be used. According to the relevance of the entity to the current task, different weights are assigned to the associated information features found in the knowledge graph and the word vector, and then the summation operation is performed to fuse the associated information into the corresponding word vector to obtain the first feature vector. In this way, the first feature vector not only contains the semantic information of the text itself, but also fuses the prior knowledge in the knowledge graph, making the features more comprehensive and accurate, and providing more powerful support for subsequent processing. This process can significantly improve the model's ability to understand natural language descriptions, especially when dealing with complex and ambiguous descriptions, it can use the information in the knowledge graph for more accurate parsing.
[0055] Step S130: Process the first feature vector to obtain the target feature vector, where the target feature vector contains a comprehensive and detailed feature representation corresponding to the natural language description.
[0056] In the embodiment of the present application, after obtaining the first feature vector, the first feature vector can be further input into the feature processing module to process the first feature vector to obtain the target feature vector containing a comprehensive and detailed feature representation corresponding to the natural language description.
[0057] Refer to Figure 3 , Figure 3 is the first step flowchart for processing the first feature vector to obtain the target feature vector provided by an embodiment of the present application, including but not limited to steps S310 to S330.
[0058] Step S310: Process the first feature vector through the Transformer module to obtain the second feature vector;
[0059] Step S320: Mine the context information of the second feature vector, and fuse the context information with the second feature vector to obtain the third feature vector;
[0060] Step S330: After performing global feature extraction and enhancement processing and local feature extraction and refinement processing on the third feature vector respectively, perform feature fusion to obtain a target feature vector.
[0061] In the embodiments of the present application, the aforementioned feature processing module may include a Transformer module, a context-aware semantic enhancement module, and a branch processing module connected in sequence. That is, after obtaining the first feature vector, the first feature vector is first processed by the Transformer module. Among them, the Transformer module is one of the core components of this network, and it can effectively process sequence data and capture long-range dependencies in the text. Among them, the Transformer module consists of an encoder and a decoder stack, and processes the input features through a unique attention mechanism. The structure of the Transformer module mainly includes an encoder stack and a decoder stack. Among them, the encoder stack consists of multiple encoder layers, and each encoder layer contains a self-attention (multi-head attention) mechanism and a feed-forward neural network, and there are residual connections between layers. The encoder is responsible for reading and encoding the information of the input text. The decoder stack also consists of multiple decoder layers. In addition to containing a self-attention mechanism and a feed-forward neural network, each decoder layer also adds an encoder-decoder attention module to combine the output information of the encoder. The decoder is responsible for generating the output text. In this module, the input text will first be processed by a tokenizer, splitting the sentence into words or subwords. The result of tokenization depends on the tokenizer used, such as BPE (Byte Pair Encoding) or WordPiece, etc. Then, each token is mapped to a vector of a fixed size, which is usually called a word embedding, representing the semantic information of the token. In this way, the input text is represented as a sequence vector, that is, a sequence of vectors. Since the word embedding only represents the meaning of each word, but in actual applications, the position of the word in the sentence also affects its meaning, the Transformer module introduces position encoding information. The position encoding is also mapped into an n-dimensional word embedding, which is added to the word embedding to form a new sequence of word embeddings to identify the position of each word in the sentence. In the encoder and decoder, the self-attention (multi-head attention) mechanism is used to learn the dependencies between words within the sentence, helping the model understand the internal structure of the sentence. Through the self-attention (multi-head attention) mechanism, the Transformer module can simultaneously focus on multiple words in the input sequence, improving the processing efficiency. The Transformer module can efficiently process the first feature vector through its unique encoder-decoder structure and attention mechanism, and output an optimized second feature vector.
[0062] Next, the second feature vector is input into the context-aware semantic enhancement module, which plays a connecting role in the entire network architecture. In the AI description layer, context information is crucial for accurately understanding and generating forms because the same word or concept may have different meanings in different contexts. Therefore, the context-aware semantic enhancement module aims to deeply mine the context information in the feature vector to enhance the semantic understanding of the natural language description obtained in the AI description layer. The context-aware semantic enhancement module includes a context modeling sub-module, an attention mechanism, and a semantic fusion layer. Specifically, in the context-aware semantic enhancement module, first, the input feature vector is processed by the context modeling sub-module. The context modeling sub-module uses the advantages of long short-term memory networks (LSTMs) and gated recurrent units (GRUs) to model the feature sequence, which can effectively capture the long-term dependencies in the sequence, thereby better understanding the context information of the text information corresponding to the natural language description. Then, the attention mechanism is used to further process the feature vector after passing through the context modeling sub-module. According to the context information, the degree of attention to different features is dynamically adjusted. By calculating the correlation score between each feature position and the context information, the attention weights are obtained, and then weighted, enabling the model to pay more attention to the features closely related to the current context, thus enhancing the semantic expression ability. After that, the semantic fusion layer is used to fuse and optimize these features. It can adopt a combination of a fully connected layer and an activation function to perform a non-linear transformation on the features, deeply fuse the context information with the original features, and generate a third feature vector, which includes a richer and more accurate semantic representation. This process can not only strengthen the key semantic information related to form generation but also suppress irrelevant or interfering information, thereby improving the quality and usability of the features. Finally, the context-aware semantic enhancement module outputs the optimized third feature vector. The third feature vector not only contains the basic semantic information of the natural language description but also fully considers the influence of the context, providing a more accurate and targeted feature representation for subsequent component attribute prediction and component type classification, helping to improve the accuracy and adaptability of form generation and better meet the complex and changing business requirements.
[0063] Then, the third feature vector is input into the branch processing module. The branch processing module includes two branches. The first branch sequentially passes through a fully connected layer, a ReLU activation layer, a fully connected layer, and a normalization layer to extract and enhance the global features. Among them, through the operations of two fully connected layers, the non-linear relationship between features can be effectively captured. The ReLU activation layer is used to introduce non-linear characteristics, and the normalization layer is used to standardize the output features, reduce the risk of gradient disappearance, and improve the convergence speed and generalization ability of the model. This branch can finally generate a high-level feature representation with global context association. The second branch sequentially passes through three fully connected layers and a ReLU activation layer to extract and refine the local features. Among them, through continuous fully connected layer operations, the characteristics of specific fields or components are gradually focused on, and the ReLU activation layer can enhance the non-linear modeling ability of local details. This design can capture the fine-grained information in the input features and provide important support for the accuracy and rationality of the generated form fields and components. Finally, the features of the two branches are fused through a concatenation operation to obtain the target feature vector. The target feature vector can provide a comprehensive and detailed feature representation for the subsequent module and further improve the performance of component attribute prediction and component type classification.
[0064] Refer to Figure 4 , Figure 4 which is a second step flowchart for processing the first feature vector to obtain the target feature vector provided by an embodiment of the present application, including but not limited to steps S410 to S440.
[0065] Step S410: Process the first feature vector through a Transformer module to obtain a second feature vector;
[0066] Step S420: Process the second feature vector through a multi-head attention module to capture the semantic information of the text information from multiple perspectives and obtain an optimized second feature vector;
[0067] Step S430: Mine the context information of the optimized second feature vector and fuse the context information with the second feature vector to obtain a third feature vector;
[0068] Step S440: Perform global feature extraction and enhancement processing and local feature extraction and refinement processing on the third feature vector respectively, and then perform feature fusion to obtain the target feature vector.
[0069] In the embodiments of the present application, the aforementioned feature processing module may include a Transformer module, a multi-head attention module, a context-aware semantic enhancement module, and a branch processing module connected in sequence. That is, after the first feature vector is processed by the Transformer module to obtain a second feature vector, the second feature vector is further processed by the multi-head attention module to capture the semantic information of the text information from multiple perspectives, and an optimized second feature vector is obtained. Specifically, the multi-head attention module allows the model to calculate attention in parallel in different representation subspaces, thereby better capturing the semantic information in the text. Specifically, the input feature vector is linearly projected into three different vector spaces to obtain query (Query), key (Key), and value (Value) vectors respectively. Then, for each head, the attention score is calculated:
[0070]
[0071] where Q, K, and V are the query, key, and value vectors respectively, and d k is the dimension of the key vector, which is used to scale the inner product result to prevent the problem of gradient disappearance caused by too large numerical values. The multi-head attention module calculates multiple sets of single-head attention in parallel through multiple sets of different linear transformations, combines them together, and projects them through a linear layer to obtain the output of the multi-head attention module. Its calculation formula is as follows:
[0072] MultiHead(Q,K,V)=Concat(head 1 ,head 2 ,…,head h )W o ;
[0073] In the formula, head i =Attention(QW i Q ,KW i K ,VW i V ), W i Q represents the linear transformation weight matrix of the query, W i K represents the linear transformation weight matrix of the key, W i V represents the linear transformation weight matrix of the value, W o represents the linear transformation weight matrix of the output, and h represents the number of multi-head attentions.
[0074] The multi-head attention module can capture the semantic information of the text from multiple perspectives through parallel computing of different heads, enabling the model to understand the input more deeply and comprehensively. The processed feature vector contains richer semantic and structural information, providing a more powerful feature representation for subsequent processing. Then, it enters the context-aware semantic enhancement module and the branch processing module for processing to obtain the target feature vector.
[0075] Referring to Figure 5 , Figure 5 is a flowchart of the third step for processing the first feature vector to obtain the target feature vector provided by an embodiment of the present application, including but not limited to steps S510 to S550.
[0076] Step S510: Process the first feature vector through a Transformer module to obtain a second feature vector;
[0077] Step S520: Process the second feature vector through a multi-head attention module to capture the semantic information of the text from multiple perspectives and obtain an optimized second feature vector;
[0078] Step S530: Mine the context information of the optimized second feature vector and fuse the context information with the second feature vector to obtain a third feature vector;
[0079] Step S540: Process the third feature vector through a Transformer module to obtain a fourth feature vector;
[0080] Step S550: Perform global feature extraction and enhancement processing and local feature extraction and refinement processing on the fourth feature vector respectively, and then perform feature fusion to obtain the target feature vector.
[0081] In the embodiment of the present application, the foregoing feature processing module may include a Transformer module, a multi-head attention module, a context-aware semantic enhancement module, a Transformer module, and a branch processing module connected in sequence. That is, after the first feature vector is processed by the Transformer module to obtain a second feature vector, the second feature vector is further processed by the multi-head attention module to capture the semantic information of the text information from multiple perspectives and obtain an optimized second feature vector. Then, the optimized second feature vector is input into the context-aware semantic enhancement module for processing to obtain a third feature vector. The third feature vector after being processed by the context-aware semantic enhancement module is again deeply processed by the Transformer module to obtain a third feature vector. It can utilize its powerful sequence processing ability to capture more complex relationships and patterns between features, further optimize and adjust the third feature vector, so that the model can better understand and process the text information corresponding to the input natural language description. Then, the fourth feature vector is respectively subjected to global feature extraction and enhancement processing and local feature extraction and refinement processing, and then feature fusion is performed to obtain a target feature vector.
[0082] Step S140, obtaining a target feature vector through a component attribute prediction model and processing it to obtain component attribute information, and obtaining a target feature vector through a component type classification model and processing it to obtain a component type.
[0083] In the embodiment of the present application, after processing the natural language description of the form requirement by the neural network architecture proposed in the embodiment of the present application to obtain a target feature vector, the target feature vector is respectively input into a component attribute prediction model and a component type classification model for processing to correspondingly predict component attribute information and a component type.
[0084] Referring to Figure 6 , Figure 6 FIG. is a flowchart of steps for obtaining a target feature vector through a component attribute prediction model and processing it to obtain component attribute information, and obtaining a target feature vector through a component type classification model and processing it to obtain a component type provided by the embodiment of the present application, including but not limited to steps S610 to S630.
[0085] Step S610, the component attribute prediction model maps the target feature vector to the attribute space of the component and predicts the corresponding component attribute information according to the natural language description;
[0086] Step S620, the component type classification model obtains the target feature vector and converts the target feature vector into a probability distribution, where the probability distribution includes probabilities corresponding to different component types;
[0087] Step S630: Select the component type with the highest probability as the predicted output component type.
[0088] In the embodiments of the present application, the target feature vectors are respectively processed by the component attribute prediction model and the component type classification model. Among them, the component attribute prediction model includes a plurality of fully connected layers and ReLU activation layers connected in sequence. The component attribute prediction model maps the input target feature vectors to the attribute space of form components through a series of fully connected layers and ReLU activation layers. The component attribute prediction model can predict the specific attributes of each form component according to the natural language description, such as the name of the text box, whether it is required, and the maximum length. The component type classification model maps the input target feature vectors to a vector space with a dimension equal to the number of component types through a fully connected layer, and then converts the target feature vectors into a probability distribution, where the probability distribution includes the probabilities corresponding to different component types. Specifically, the Softmax activation function can be used to convert this vector space into a probability distribution. Among them, the value of each dimension represents the probability of belonging to the corresponding component type, and the predicted component type is determined by selecting the category with the highest probability, such as text input box, table, file upload box, button group, time selector, label group, cascading selector, checkbox, etc.
[0089] Step S150: Match and combine the component type with the corresponding component attribute information to generate a component attribute form.
[0090] In the embodiments of the present application, after processing the target feature vectors through the component attribute prediction model to obtain component attribute information, and processing the target feature vectors through the component type classification model to obtain the component type, the predicted component type can be further matched and combined with the corresponding component attribute information to obtain a component attribute form that conforms to the natural language description input by the user.
[0091] In the embodiments of the present application, through the design of the neural network architecture, the natural language description information can be fully utilized, combined with the prior knowledge of the knowledge graph, and through the collaborative work of multiple modules, the efficient and accurate generation of the component attribute form from the natural language description can be realized, providing an efficient and intelligent component attribute form generation solution for users.
[0092] In the embodiments of the present application, after matching and combining the component type with the corresponding component attribute information to generate the component attribute form, a dynamic weight adjustment mechanism is also used to balance the data relevance loss and the user experience loss, and a generation strategy loss function is constructed to optimize the accuracy and adaptability of the component attribute form generation. Among them, the generation strategy loss function consists of the data relevance loss L data and the user experience loss L user in two parts. The data relevance loss L dataIt is used to measure whether the logical relationship between fields in the generated component property form is correct, which can be defined by analyzing the dependencies between fields:
[0093]
[0094] Among them, N is the number of samples, and y i is the true relationship value between fields in the generated component property form, is the predicted relationship value between fields in the generated component property form, and MSE represents the mean square error, which is used to quantify the difference between the predicted relationship value and the true relationship value.
[0095] The user experience loss is used to evaluate the interactivity and fluency of the generated component property form during actual use, which can be defined by indicators such as user feedback and form response speed:
[0096]
[0097] Among them, M is the number of user interaction samples, and u j represents the feedback score of the actual user interaction, represents the predicted user experience score, CE represents the cross-entropy loss, which is used to evaluate the consistency between the predicted user experience score and the feedback score of the actual user interaction, and T j is the response time of the user operation, which is used to quantify the interaction fluency, and w 1 and w 2 are adjustable weight coefficients, which can be configured according to task requirements.
[0098] The generation strategy loss function L gen can be defined as:
[0099] L gen =αL data +βL user ;
[0100] Among them, L gen represents the generation strategy loss function, L data represents the data correlation loss, L user represents the user experience loss, and α and β are adjustable weight coefficients.
[0101] In the embodiments of the present application, for the data correlation loss L data and the user experience loss L user , the weight coefficients α and β are introduced. If data correlation is prioritized, then α is increased and β is decreased. If user experience is prioritized, then β is increased and α is decreased. The adjustment formula for the adjustable weight coefficients is defined as:
[0102]
[0103] where α + β = 1, R data represents the evaluation score of the current data relevance, θ represents the weight balance point, and γ represents the smoothing parameter for controlling the speed of weight adjustment.
[0104] In the embodiments of the present application, by constructing a generation strategy loss function, not only the data relevance and user experience are comprehensively considered, but also through a dynamic weight adjustment mechanism, flexible adaptation to multiple scenarios is achieved. This design can significantly improve the accuracy, logical consistency, and user-friendliness of the component attribute form generation, and perform more excellently. At the same time, through adversarial training, the robustness of the model can be enhanced, further improving the logical consistency and adaptability of the generated form.
[0105] In the embodiments of the present application, after matching and combining the component type with the corresponding component attribute information to generate a component attribute form, the front-end dynamic interaction and real-time verification functions are also used to adjust the verification logic rules of the generated component attribute form in real time according to user input, and continuously optimize the verification logic rules through user feedback.
[0106] In the embodiments of the present application, considering that in the traditional form generation and verification process, it mostly relies on a single rule engine or hard-coded logic. This mode is not applicable to complex application scenarios and is difficult to flexibly respond to changing requirements, resulting in logical inconsistencies or errors in the data input, verification, and submission links of the form, seriously affecting the user experience and the smooth progress of the business process. In view of this, the embodiments of the present application introduce an efficient user collaborative optimization mechanism. This mechanism combines the front-end dynamic interaction and real-time verification functions, and through an intelligent data-driven and user feedback mechanism, automatically adjusts and optimizes the form verification rules, ensuring that the logical relationship between form fields always remains consistent, and providing users with a more intelligent, convenient, and accurate form usage experience.
[0107] Specifically, in the design of the front-end interface, the advantages of modern front-end technologies can be fully utilized to implement the function of dynamically adjusting the form validation logic rules according to the real-time data input by users. When a user enters information in a form, the system can act like a keen observer and monitor the data changes in each field in real time. Based on the preset validation logic rules and the data that has been entered, the system can quickly and intelligently adjust the validation requirements for subsequent fields. For example, in a job application form, if the user selects "Software Development Engineer" in the "Applied Position" field, then the system will, based on this selection, dynamically adjust the validation logic for the "Skill Requirements" field and require the user to enter skill information related to software development; if the user selects "Marketing Specialist", the validation logic rules will correspondingly focus on marketing-related capabilities and experiences. This dynamically adjusted validation logic rule, like a "navigator" customized for the user, ensures that the relationships between different fields are fully validated and can effectively avoid data inconsistencies or submission failures caused by logical errors between fields. In addition, the embodiment of this application can also provide an intuitive and user-friendly interaction interface to encourage users to actively participate in the optimization process of the form. During the use of the form, if a user finds that the validation logic rules are unreasonable or there are logical situations that require special handling, they can easily provide feedback to the system through this interaction interface. The system will collect and deeply analyze each piece of feedback, and automatically optimize and update the validation logic rules according to the user's feedback and incorporate them into the subsequent form validation process. For example, when an enterprise uses the employee reimbursement form generated by this system, some employees feedback that when the "Reimbursement Type" is "Business Trip Expenses", the validation rule for the "Business Trip Location" field is too strict, restricting the filling of some special business trip situations. After receiving the feedback, the system analyzes and adjusts, and optimizes the validation rule for the "Business Trip Location" field under the "Business Trip Expenses" reimbursement type to make it more flexible and in line with the actual business needs.
[0108] In the embodiment of this application, through the proposed user collaborative optimization mechanism, the system can continuously learn and adapt to the needs of users, improving the flexibility, accuracy, and user experience of form validation. Each piece of user feedback becomes the driving force for the system's evolution, making the form more suitable for the actual usage scenarios of users during the continuous optimization process, truly realizing the intelligence, personalization, and high efficiency of form generation and validation.
[0109] In the traditional form generation process, a large amount of manpower is often required for design, development, and testing. However, this application can quickly convert AI descriptions into form structures through an advanced form generation network (FGAN), combining deep learning and natural language processing technologies. When a user needs to quickly create a new project approval form, they only need to input the natural language descriptions of the approval process and the fields required in the form into the system, and the system can generate a form that meets the requirements within a short period, greatly reducing the form development cycle. The knowledge graph and Transformer module in this solution can efficiently process semantic information in natural language, reducing the dependence on manual repeated proofreading and adjustment. At the same time, the generation strategy loss function can continuously optimize the form generation model during training, enabling the speed and accuracy of form generation to be further improved as the number of uses increases, thus significantly enhancing the overall work efficiency in scenarios with large-scale form generation requirements.
[0110] Since this application can generate forms automatically and accurately, enterprises no longer need to invest a large amount of labor costs in form design and maintenance. When an e-commerce enterprise has a large number of different types of order forms, return forms, and customer information forms, if manual design and update are relied on, it is not only time-consuming but also prone to errors. However, this invention can achieve the accurate generation of these forms at a relatively low cost. In the long run, it saves considerable labor and time costs for the enterprise. At the same time, an efficient user collaboration and optimization mechanism can promptly discover and solve problems during form usage, reducing business process delays and losses caused by form errors. By continuously optimizing form validation rules and logical relationships, enterprises can reduce error correction costs caused by problems such as incorrect form filling and data mismatch, further reducing operating costs.
[0111] During the process of form generation in this application, through precise natural language processing and data relevance guarantee mechanisms, the accuracy of the logical relationships between form fields is ensured, which helps to improve the accuracy of data input and guarantees data quality from the source. In terms of data security, the user collaboration and optimization mechanism can perform strict data verification and rule setting at the front end. By dynamically adjusting form validation logic, it prevents malicious data input and the risk of data leakage. During the process of the system handling user feedback and data interaction, encryption technology and strict permission management can also be adopted to ensure the security of data throughout the form usage cycle.
[0112] This application can improve the efficiency and intelligence level of form generation to a certain extent. Especially in complex application scenarios, this application can quickly parse AI descriptions and generate forms that meet the requirements, reducing manual intervention, improving development efficiency, and providing a better interaction experience for users.
[0113] The embodiments of the present application also provide an electronic device, which includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the above-mentioned method is implemented. The electronic device can be any intelligent terminal including a tablet computer, an in-vehicle computer, etc.
[0114] Please refer to Figure 7 , Figure 7 which is a schematic diagram of the hardware structure of the electronic device provided by an embodiment of the present application. The electronic device includes:
[0115] A processor 701, which can be implemented in ways such as a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided by the embodiments of the present application;
[0116] A memory 702, which can be implemented in forms such as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 702 can store an operating system and other application programs. When implementing the technical solutions provided by the embodiments of this specification through software or firmware, the relevant program codes are stored in the memory 702 and are called by the processor 701 to execute the method of the embodiments of the present application;
[0117] An input / output interface 703, which is used to implement information input and output;
[0118] A communication interface 704, which is used to implement communication and interaction between this device and other devices, and can implement communication through a wired method (such as USB, network cable, etc.) or through a wireless method (such as a mobile network, WIFI, Bluetooth, etc.);
[0119] A bus 705, which transmits information between various components of the device (such as the processor 701, the memory 702, the input / output interface 703, and the communication interface 704);
[0120] Among them, the processor 701, the memory 702, the input / output interface 703, and the communication interface 704 are communicatively connected to each other inside the device through the bus 705.
[0121] The embodiments described in the embodiments of the present application are for more clearly illustrating the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by an embodiment of the present application. Those skilled in the art will know that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by an embodiment of the present application are equally applicable to similar technical problems.
[0122] Those skilled in the art can understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than those shown, or combine certain steps, or different steps.
[0123] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0124] Those of ordinary skill in the art can understand that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, and their appropriate combinations.
[0125] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not have to be used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application described here can be implemented in an order other than those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.
[0126] It should be understood that in this application, "at least one (item)" means one or more, and "a plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that there can be three relationships. For example, "A and / or B" can mean: only A exists, only B exists, and both A and B exist at the same time. Here, A and B can be singular or plural. The character " / " generally indicates an "or" relationship between the associated objects before and after. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single items or plural items. For example, at least one (item) of a, b, or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0127] In several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the above-mentioned division of units is only a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of devices or units can be in electrical, mechanical, or other forms.
[0128] The units described above as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0129] In addition, each functional unit in various embodiments of this application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
[0130] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods of various embodiments of this application. The foregoing storage medium includes: various media that can store programs, such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks, or optical discs.
[0131] The preferred embodiments of the embodiments of this application have been described above with reference to the accompanying drawings, and thus do not limit the scope of the rights of the embodiments of this application. Any modifications, equivalent replacements, and improvements made by those skilled in the art without departing from the scope and essential content of the embodiments of this application shall be within the scope of the rights of the embodiments of this application.
Claims
1. A method for generating a component attribute form, characterized in that: The method comprises: Obtain a natural language description of the form requirement, and convert text information corresponding to the natural language description into a continuous vector sequence, wherein each word is converted into a corresponding word vector; Searching for association information related to each of the word vectors in the knowledge graph, and fusing the association information into the corresponding word vector to obtain a first feature vector; Processing the first feature vector to obtain a target feature vector, wherein the target feature vector includes a comprehensive and detailed feature representation corresponding to the natural language description; The target feature vector is obtained through a component attribute prediction model and processed to obtain component attribute information, and the target feature vector is obtained through a component type classification model and processed to obtain a component type; The component type is matched and combined with the corresponding component attribute information to generate a component attribute form.
2. The method according to claim 1, characterized in that The processing of the first feature vector to obtain a target feature vector includes: Processing the first feature vector through a Transformer module to obtain a second feature vector; mining context information of the second feature vector, and fusing the context information with the second feature vector to obtain a third feature vector; The third feature vector is subjected to global feature extraction and enhancement processing and local feature extraction and refinement processing respectively, and then feature fusion is performed to obtain a target feature vector.
3. The method according to claim 2, characterized in that After obtaining the second eigenvector, the method further includes: The second feature vector is processed by a multi-head attention module to capture the semantic information of the text information from multiple angles to obtain an optimized second feature vector.
4. The method according to claim 2 or 3, characterized in that: After obtaining the third eigenvector, the method further includes: Processing the third eigenvector through a Transformer module to obtain a fourth eigenvector; The fourth feature vector is subjected to global feature extraction and enhancement processing and local feature extraction and refinement processing respectively, and then feature fusion is performed to obtain a target feature vector.
5. The method according to claim 1, characterized in that The component attribute prediction model includes a plurality of fully connected layers and ReLU activation layers connected in sequence, and obtaining the target feature vector through the component attribute prediction model and processing to obtain component attribute information includes: The component attribute prediction model maps the target feature vector to the attribute space of the component, and predicts the corresponding component attribute information according to the natural language description.
6. The method according to claim 1, characterized in that Obtaining the target feature vector through the component type classification model and processing to obtain the component type includes: The component type classification model obtains the target feature vector and converts the target feature vector into a probability distribution, wherein the probability distribution includes probabilities corresponding to different component types respectively; The component type with the highest probability is selected as the component type of the predicted output.
7. The method according to claim 1, characterized in that After matching and combining the component type with the corresponding component attribute information to generate a component attribute form, the method further includes: Through the dynamic weight adjustment mechanism, the data relevance loss and the user experience loss are balanced to construct a generation strategy loss function, wherein the data relevance loss is used to measure whether the logical relationship between the fields in the generated component attribute form is correct, and the user experience loss is used to evaluate the interactivity and fluency of the generated component attribute form in actual use.
8. The method according to claim 7, characterized in that The generation strategy loss function is: L gen =αL data +βL user ; Where, L gen represents the generation strategy loss function, L data represents the data association loss, Where N is the number of samples, y i The actual relationship value between the fields in the generated component property form. is the predicted relationship value between the fields in the generated component attribute form. MSE stands for mean square error, which is used to quantify the difference between the predicted relationship value and the true relationship value. L user Indicates user experience loss, Among them, M is the number of user interaction samples, u j Indicates the feedback score of the user's actual interaction, represents the user experience score predicted by the system, CE represents the cross quotient loss, which is used to evaluate the consistency between the predicted user experience score and the feedback score of the user's actual interaction, and T j is the response time of user operation, which is used to quantify the interaction fluency. w1 and w2 are adjustable weight coefficients. α and β are adjustable weight coefficients, where α+β=1. R data It represents the evaluation score of the current data relevance, θ represents the weight balance point, and γ represents the smoothing parameter, which is used to control the speed of weight adjustment.
9. The method according to claim 1 or 7, characterized in that: After matching and combining the component type with the corresponding component attribute information to generate a component attribute form, the method further includes: By utilizing the dynamic interaction and real-time verification functions of the front end, the verification logic rules of the generated component property form are adjusted in real time according to user input, and the verification logic rules are continuously optimized through user feedback.
10. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 9 when executing the computer program.
Citation Information
Cited By
Browser front-end component intelligent classification method, system and equipment based on element perception
CN120540743A
Method, system and device for intelligent classification of browser front-end components based on element perception
CN120540743B