Method and device for generating form based on large model and computer program product
By using a large model-based form generation method in construction project management and using a generative large language model to automatically determine and generate forms, the problem of manual generation that is time-consuming and error-prone is solved, and more efficient and accurate form generation is achieved, improving improve the safety and efficiency of the construction process.
Patent Information
- Application Number
- CN202410674941.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-28
- Publication Date
- 2024-08-30
AI Technical Summary
In construction project management, manual generation of forms such as work orders and operation tickets takes a lot of time and can easily lead to the omission of key information due to human errors, affecting the safety and efficiency of the construction process.
Using a large model-based form generation method, the generative large language model determines the target type of the form based on user input data, and extracts and generates corresponding field data to avoid cumbersome operations and human errors in the manual generation process.
It improves the efficiency and accuracy of form generation, reduces human errors, and improves the safety and efficiency of the construction process.
Smart Images

Figure CN118569229A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, specifically to technical fields such as natural language understanding, large language models and large models, and in particular to a method, device, electronic device, storage medium and computer program product for generating forms based on a large model, which can be applied to form generation scenarios. Background Art
[0002] In construction project management, the generation of work orders and operation tickets is a key link to ensure the safety and efficiency of the construction process. At present, it is generally generated manually by project managers, technicians and other relevant personnel based on their experience and professional knowledge, which not only consumes a lot of time and labor, but also may lead to the omission of key information due to human errors. Summary of the invention
[0003] The present disclosure provides a method, device, electronic device, storage medium and computer program product for generating a form based on a large model.
[0004] According to a first aspect, a method for generating a form based on a large model is provided, comprising: determining a target category to which a target form to be generated belongs according to user input data; extracting field data corresponding to each of a plurality of fields in a target form under the target category from the user input data through a generative large language model to generate a target form.
[0005] According to a second aspect, a device for generating a form based on a large model is provided, comprising: a determination unit, configured to determine a target category to which a target form to be generated belongs based on user input data; a generation unit, configured to extract field data corresponding to each of a plurality of fields in a target form under the target category from the user input data through a generative large language model, and generate the target form.
[0006] According to a third aspect, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a method described in any implementation manner of the first aspect.
[0007] According to a fourth aspect, a non-transitory computer-readable storage medium storing computer instructions is provided, where the computer instructions are used to cause a computer to execute the method described in any implementation of the first aspect.
[0008] According to a fifth aspect, a computer program product is provided, comprising: a computer program, which implements the method described in any implementation manner of the first aspect when executed by a processor.
[0009] According to the technology disclosed in the present invention, a method and device for generating a form based on a large model are provided, which can determine the target category to which the target form to be generated belongs according to the user input data, and then generate the target form under the target category based on the user input data through a generative large language model, thereby avoiding tedious operations and human errors in the manual generation process of the form, and improving the efficiency and accuracy of form generation.
[0010] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0012] Figure 1 is an exemplary system architecture diagram in which an embodiment of the present disclosure may be applied;
[0013] Figure 2 is a flowchart of an embodiment of a method for generating a form based on a large model according to the present disclosure;
[0014] Figure 3 is a schematic diagram of an application scenario of the method for generating a form based on a large model according to this embodiment;
[0015] Figure 4 is a flowchart of another embodiment of a method for generating a form based on a large model according to the present disclosure;
[0016] Figure 5 is a structural diagram of an embodiment of a device for generating a form based on a large model according to the present disclosure;
[0017] Figure 6 It is a schematic diagram of the structure of a computer system suitable for implementing the embodiments of the present disclosure. DETAILED DESCRIPTION
[0018] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0019] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0020] Figure 1 An exemplary architecture 100 is shown to which the method and apparatus for generating a form based on a large model of the present disclosure can be applied.
[0021] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The communication connection between the terminal devices 101, 102, 103 constitutes a topological network, and the network 104 is used to provide a medium for the communication link between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0022] Terminal devices 101, 102, 103 may be hardware devices or software that support network connection for data interaction and data processing. When terminal devices 101, 102, 103 are hardware, they may be various electronic devices that support network connection, information acquisition, interaction, display, processing and other functions, including but not limited to smart phones, tablet computers, e-book readers, laptop computers and desktop computers, etc. When terminal devices 101, 102, 103 are software, they may be installed in the electronic devices listed above. They may be implemented as multiple software or software modules for providing distributed services, or they may be implemented as a single software or software module. No specific limitation is made here.
[0023] The server 105 may be a server that provides various services, for example, a background processing server that obtains user input data uploaded by the user through the terminal devices 101, 102, 103 and generates a target form according to the user input data. As an example, the server 105 may be a cloud server.
[0024] It should be noted that the server can be hardware or software. When the server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or it can be implemented as a single server. When the server is software, it can be implemented as multiple software or software modules (for example, software or software modules used to provide distributed services), or it can be implemented as a single software or software module. No specific limitation is made here.
[0025] It should also be noted that the method for generating a form based on a large model provided in the embodiments of the present disclosure can be executed by a server, can be executed by a terminal device, or can be executed by the server and the terminal device in cooperation with each other. Accordingly, the various parts (such as various units) included in the device for generating a form based on a large model can be all set in the server, can be all set in the terminal device, or can be set in the server and the terminal device respectively.
[0026] It should be understood that Figure 1 The number of terminal devices, networks and servers in the system is only illustrative. According to the implementation requirements, there may be any number of terminal devices, networks and servers. When the electronic device on which the method for generating a form based on a large model is running does not need to transmit data with other electronic devices, the system architecture may only include the electronic device (such as a terminal device or a server) on which the method for generating a form based on a large model is running.
[0027] Please refer to Figure 2 , Figure 2 A flowchart of a method for generating a form based on a large model provided in an embodiment of the present disclosure. In the process 200, the following steps are included:
[0028] Step 201, determining the target type to which the target form to be generated belongs according to the user input data.
[0029] In this embodiment, the execution subject of the method for generating a form based on the large model (for example, Figure 1 The server in the embodiment can obtain user input data remotely or locally through a wired network connection or a wireless network connection, and determine the target type to which the target form to be generated belongs based on the user input data.
[0030] The target forms to be generated can be various forms in various fields. For example, quality management forms, safety management forms, building material management forms, design change forms in the field of construction engineering management, production work orders, maintenance work orders, quality inspection forms in the manufacturing field, problem solving forms, service request forms in the field of information technology, transaction confirmation forms, risk assessment forms, single application forms in the financial industry, etc.
[0031] The user input data may be natural language data for expression in the form of text, voice, image, etc. For natural language data in the form of voice, the above-mentioned execution subject may convert it into natural language data in the form of text based on the voice-to-text technology; for natural language data in the form of image, the above-mentioned execution subject may convert it into natural language data in the form of text based on the image recognition technology.
[0032] As an example, the execution subject can determine the target category to which the target form to be generated belongs according to the user input data through a pre-trained classification model. The classification model is used to characterize the correspondence between the user input data and the target category, and can be obtained by training a neural network model such as a convolutional neural network, a recursive neural network, or a generative adversarial network in a supervised manner.
[0033] As another example, the execution entity may extract keywords from the user input data, and then determine the target category to which the target form to be generated belongs based on the correspondence between the keywords and the categories.
[0034] In some optional implementations of this embodiment, the execution subject may perform step 201 in the following manner: determining the target category according to the user input data and the first prompt data through a generative large language model.
[0035] The first prompt data is used to characterize an example form under each category in the form category set.
[0036] The execution subject or the electronic device connected to the execution subject for communication is provided with a plurality of form type sets corresponding to respective fields, and the form type set corresponding to a field includes all form types involved in the field.
[0037] The first prompt data includes at least one example form under each category in the form category set, which is used to instruct the generative large language model to determine which category in the form category set the target form to be generated belongs to based on the at least one example form under each category.
[0038] As an example, the first prompt data includes a prompt part and an example part, wherein the prompt part is, for example, "You are now an expert in the field of building construction, please determine the type of the target form to be generated according to the user input data."
[0039] The example part includes multiple fields in the example form and field data corresponding to each of the multiple fields, as well as historical input data corresponding to the example form. The historical input data corresponding to the example form is the user input data based on which the example form is generated.
[0040] The historical input data is, for example:
[0041] "On September 22, 2023, the reinforcement project of the B4 layer in the A5-3 area constructed by XX County XX Construction Labor Service Co., Ltd. was inspected. The upper part of the beam is divided into two rows, with four bars in the first row and two bars in the second row. Six bars were arranged in the first row on site, and the second row of bars was missing. It is required that the rectification be completed by September 23, 2023, and XX shall report to XX for acceptance after self-inspection."
[0042] For example, multiple fields and field data corresponding to each of the multiple fields are:
[0043] "{"Project Name":"System Default";"Inspector":"Call the person filling in the information";"Recipient":" / ";"Self-inspector":"XX";"Verifier":"XX";"Completion Date":"2023-09-23";"Subcontractor":"XX County XX Construction Labor Service Co., Ltd.";"Problem Category":"Not in accordance with the drawings";"Sub-items":"Concrete structure reinforcement engineering";"Project Location":"A5-3 District B4 Floor","Problem>Content":"The upper part of the beam is divided into two rows, with four in the first row and two in the second row. Six steel bars are arranged in the first row on site, and the second row is missing. Make corrections immediately. "}"
[0044] In this implementation, first, the execution subject determines the field according to the user input data; then, determines the first prompt data applicable to the field; finally, the user input data and the first prompt data are input into the generative large language model, and the target category to which the target form to be generated belongs is determined through the generative large language model.
[0045] In this implementation, through the generative large language model, under the guidance of the first prompt data, the target category to which the target form to be generated belongs is determined according to the user input data, thereby improving the accuracy of the determined target category.
[0046] In some optional implementations of this embodiment, before determining the target category according to the user input data and the first prompt data by using the generative large language model, the execution subject may further perform the following operations:
[0047] In the first step, in response to determining that the number of types in the form type set is greater than a preset number of types, a preset number of filtered types are determined from the form type set according to similarities between user input data and example forms under the types in the form type set.
[0048] The number of categories in the form category set is greater than the preset number of categories, indicating that the form category set includes a large number of categories. If the first prompt data is generated based on the example forms corresponding to all categories in the form category set, the amount of the first prompt data will be large, exceeding the generative large language model's tolerance for prompt data, or the large amount of data will have an adverse effect on the classification process of the generative large language model. The preset category data can be specifically set according to actual conditions and is not limited here.
[0049] In this implementation, the above-mentioned execution subject can perform the following operations through a generative large language model: first, in response to determining that the number of types in the form type set is greater than the preset number of types, determine the similarity between the user input data and the example form under the high-frequency type in the form type set, wherein the high-frequency type represents that the frequency of users generating forms under this type is higher than the preset frequency threshold; then, sort the similarities corresponding to each type in the form type set in order from large to small; finally, determine the types corresponding to the preset number of similarities in the front sort as the filtered types.
[0050] In order to ensure the accuracy of the filtered categories, the execution entity may determine the similarity between the user input data and the example forms under each category in the form category set, and determine the filtered categories based on the similarity.
[0051] In the second step, first prompt data is generated according to the sample forms under the categories in the categories after the preset number of categories are filtered.
[0052] As an example, the execution subject may generate the first prompt data by combining the prompt part and the example part corresponding to the preset number of filtered categories. The example part corresponding to the preset number of filtered categories includes a plurality of fields in the example form under each of the preset number of filtered categories and field data corresponding to each of the plurality of fields, as well as historical input data corresponding to the example form.
[0053] In this implementation, a specific implementation method for generating first prompt data is provided, which improves the efficiency and accuracy of the first prompt data based on category screening, and helps to improve the classification accuracy based on the generative large language model.
[0054] In some optional implementations of this embodiment, the execution subject may perform the second step in the following manner:
[0055] First, for a category in a preset number of filtered categories, a first preset number of iconic forms are determined from example forms under the category.
[0056] As an example, for each of the preset number of filtered categories, the following operations are performed: first, the characteristic data of the category is determined to understand the broad range and specific standards covered by the category; then, the characteristic data of each example form under the category is determined; finally, based on the characteristic data of the category and the characteristic data of each example form, and on the basis of considering diversity, the first preset number of iconic forms are determined from the example forms under the category.
[0057] Among them, diversity is used for characterization. If the category contains forms of multiple subcategories, consider selecting forms that can represent different subcategories to ensure that the selected iconic forms have a certain diversity within the category.
[0058] Then, the first prompt data is generated according to the iconic forms under the categories after the preset number of categories are filtered.
[0059] As an example, the execution subject may generate the first prompt data by combining the prompt part and the example part representing the iconic form corresponding to the preset number of filtered categories. The example part representing the iconic form corresponding to the preset number of filtered categories includes multiple fields in the iconic form under each filtered category in the preset number of filtered categories and field data corresponding to each of the multiple fields, as well as historical input data corresponding to the iconic form.
[0060] In this implementation, on the basis of screening the types in the form type set, the example forms under the types are screened to generate the first prompt data, which further improves the efficiency and accuracy of the first prompt data.
[0061] In some optional implementations of this embodiment, the execution subject may perform the process of determining the target category by using the generative large language model according to the user input data and the first prompt data in the following manner:
[0062] First, a generative large language model is used to determine a specified number of candidate categories from a set of form categories according to user input data and first prompt data.
[0063] The specified number can be set according to actual conditions. For example, the specified number is 3.
[0064] Then, according to the obtained selection instruction, a target category is determined from a specified number of candidate categories.
[0065] In this implementation, the execution subject may display a specified number of candidate categories to the user, receive a selection instruction from the user for a candidate category, and determine the candidate category indicated by the selection instruction among the specified number of candidate categories as the target category.
[0066] In this implementation, a method for determining the target category by combining a generative large language model and a user's selection instruction is provided, which improves the flexibility of the target category determination process while ensuring accuracy.
[0067] Step 202 : extracting field data corresponding to a plurality of fields in a target form under a target category from user input data by using a generative large language model, and generating a target form.
[0068] In this embodiment, the generative large language model is used to extract field data corresponding to each of the multiple fields in the target form under the target category from the user input data to generate the target form.
[0069] A big language model is a deep learning model trained on massive text data, which aims to understand and generate human language. A generative big language model is a big language model that performs generative tasks.
[0070] As an example, first, the above-mentioned execution entity determines the multiple fields included in the target form of the target type through the generative large language model; then, based on the excellent natural language understanding ability of the generative large language model, it understands the user input data, and determines the field data corresponding to each of the multiple fields included in the target form; finally, in the form template corresponding to the target form, the field data corresponding to each field is filled in to generate the target form.
[0071] In some optional implementations of this embodiment, the above-mentioned execution entity can perform the above-mentioned step 202 in the following manner: through a generative large language model, according to the user input data and the second prompt data, the field data corresponding to each of the multiple fields is extracted from the user input data to generate a target form.
[0072] The second prompt data is used to characterize multiple fields in the target form and an example form under the target category.
[0073] The second prompt data includes at least one example form under the target category, which is used to instruct the generative large language model to extract field data corresponding to multiple fields in the target form under the target category from the user input data according to the at least one example form under the target category.
[0074] As an example, the second prompt data includes a prompt part and an example part, wherein the prompt part is, for example, "You are now an expert in the field of building construction, please generate a target form according to the user input data and the following example form."
[0075] The example part includes a plurality of fields in a sample form under the target category and field data corresponding to each of the plurality of fields.
[0076] In this implementation, a target form under a target category is generated according to user input data through a generative large language model under the guidance of the second prompt data, thereby improving the accuracy of the generated target form.
[0077] In some optional implementations of this embodiment, before extracting field data corresponding to multiple fields from the user input data according to the user input data and the second prompt data through the generative large language model to generate the target form, the execution subject may further perform the following operations:
[0078] In the first step, in response to determining that the number of example forms under the target category is greater than a second preset number of examples, a second preset number of target example forms are determined from the example forms under the target category according to the similarity between the user input data and the example forms under the target category.
[0079] The number of example forms under the target category is greater than the second preset number of examples, indicating that the target category includes a large number of example forms. If the second prompt data is generated based on all the example forms under the target category, the amount of the second prompt data will be large, which exceeds the generative large language model's tolerance for prompt data. The second preset number of examples can be specifically set according to actual conditions and is not limited here. Generally, the second preset number of examples is greater than the first preset number of examples.
[0080] In this implementation, the above-mentioned execution entity can perform the following operations through a generative large language model: first, in response to determining that the number of example forms under the target category is greater than the second preset number of examples, determine the similarity between the user input data and the example forms under the target category; then, sort the similarities corresponding to the example forms under the target category in order from large to small; finally, determine the example forms corresponding to the second preset number of example similarities that are ranked first as target example forms.
[0081] In the second step, second prompt data is generated according to a second preset number of example target example forms and a plurality of fields required for generating a form under the target category.
[0082] The above-mentioned execution entity can pre-determine the correspondence between the form under the target type and the multiple fields required for the form to determine the multiple fields required for the form under the target type; and then generate the second prompt data by combining the second preset example number of target example forms and the multiple fields required to generate the form under the target type.
[0083] In this implementation, a specific implementation method for generating second prompt data is provided, which improves the efficiency and accuracy of the second prompt data based on the screening of example forms, and helps to improve the accuracy of generating a target form based on a generative large language model.
[0084] In some optional implementations of this embodiment, the above-mentioned execution entity can perform the above-mentioned second step in the following manner: generate second prompt data based on a second preset number of target example forms, historical input data corresponding to each of the multiple target example forms, and multiple fields required to generate a form under the target type.
[0085] As an example, the second prompt data includes a prompt part and an example part, wherein the prompt part is, for example, "You are now an expert in the field of building construction, please generate a target form according to the user input data and the following example form."
[0086] The example part includes a plurality of fields in the example form under the target category and field data corresponding to each of the plurality of fields, as well as historical input data corresponding to the example form.
[0087] In this implementation, based on a second preset number of target example forms, historical input data corresponding to each of the multiple target example forms, and multiple fields required to generate a form under the target type, the number of target example forms is reduced while the richness and effectiveness of the second prompt data are improved.
[0088] As an example, the second prompt data and user input data are as follows:
[0089] ---------------------------------------------------------------------
[0090] You are now an expert in the field of construction. I now need to extract specific information from a text in the field of construction. This information corresponds to the specified fields. Please create this information dictionary for me. The dictionary content is as follows: ```{"Project Name":"","Inspector":"","Recipient":"","Self-inspector":"","Verifier":"","Completion Date":"","Subcontractor":"","Problem Category":"","Sub-items":"","Project Part":"","Problem Content":"}```. Please correspond your extraction to this dictionary and output it in json format. If the corresponding information cannot be extracted, please replace it with the character " / ". You can refer to the following examples:
[0091] Example 1:
[0092] "On September 22, 2023, the reinforcement project of the B4 layer in the A5-3 area constructed by XX Service Co., Ltd. was inspected. The upper part of the beam is divided into two rows, with four bars in the first row and two bars in the second row. Six bars were arranged in the first row on site, and the second row was missing. It is required to complete the rectification by September 23, 2023, and report to XX after XX."
[0093] "{"Project Name":"System Default","Inspector":"Call the person filling in the information","Recipient":" / ","Self-inspector":"XX","Verifier":"XX","Completion Date":"2023-09-23","Subcontractor":"XX County Rong'an Construction Labor Service Co., Ltd.","Problem Category":"Not in accordance with the drawings","Sub-items":"Concrete structure reinforcement engineering","Project Location":"A5-3 Zone B4 Floor","Problem>Content":"The upper part of the beam is divided into two rows, with four in the first row and two in the second row. Six steel bars are arranged in the first row on site, and the second row is missing. Make corrections immediately."}"
[0094] Example 2:
[0095] "On May 29, 2023, during the inspection of the raft slab in Area C1 of XXXX Construction Labor Service Co., Ltd. for waterproofing construction, it was found that the intersection of the plane and the facade was not made into a 45° arc shape as required by the plan, and rectification was required to be completed before May 30, 2023. The rectification notice was sent to XXX, asking him to self-inspect and report to XXX for acceptance."
[0096] "{"Project Name":"System Default","Inspector":"Call the person filling in the form","Recipient":"Wang Jiajia","Self-inspector":"XXX","Verifier":"XXX","Completion Date":"2023-05-30","Subcontractor":"XXXX Construction Labor Service Co., Ltd.","Problem Category":"Other","Sub-items":"Foundation and underground waterproofing","Project Part":"Raft slab in C1 area","Problem Content":"A 45° arc shape was not made at the intersection of the plane and the facade as required by the plan"}"
[0097] Example 3:
[0098] "On February 20, 2023, during a technical review, our company found that the outermost rows of the north and south side frames on the B2 floor of the A4 area did not reserve a safe distance from the edges, and some of the columns were exposed to the air. We required XX County Rong'an Construction Labor Service Co., Ltd. to rectify the frames according to the plan before February 25, 2023, and reserve sufficient safe distance from the edges. We sent the order to XXX and asked him to supervise the rectification."
[0099] "{"Project Name":"System Default","Inspector":"Call the person filling in the form","Recipient":"XXX","Self-inspector":" / ","Verifier":"XXX","Completion Date":"2023-02-25","Subcontractor":"XX County Rong'an Construction Labor Service Co., Ltd.","Problem Category":"Other","Sub-items":"Concrete Structure Formwork Engineering","Project Location":"A4 Area B2 Floor","Problem Content":"The outermost rows of the north and south side frames have not reserved a safe distance from the edge, and some of the vertical poles are exposed to the air"}"
[0100] Example 4:
[0101] "On March 15, 2023, our company conducted a technical review of the steel bar binding of the B4 layer in the A5-1 area and found that the staircase dowels in this area were not in place. We required XX County Rong'an Construction Labor Service Co., Ltd. to insert the column bars before March 16, 2023, and XXX must pass the inspection before pouring. The rectification notice was sent to XXX."
[0102] "{"Project Name":"System Default","Inspector":"Call the person filling in the form","Recipient":"XXX","Self-inspector":" / ","Verifier":"XXX","Completion Date":"2023-03-16","Subcontractor":"XX County Rong'an Construction Labor Service Co., Ltd.","Problem Category":"Not in accordance with the drawings","Sub-items":"Concrete structure reinforcement engineering","Project Location":"A5-1 Zone B4 Floor","Problem Content":"Staircase dowels are not in place, rectification must be completed before concrete pouring"}"
[0103] Example 5:
[0104] "On May 2, 2023, during a technical review, our company found that in the B4 area of the A8 area constructed by XX County Rong'an Construction Labor Service Co., Ltd., the steel bar binding in four places was not constructed according to the specifications, and the single-sided welding length of the steel bar and the steel plate wall lap plate did not meet the requirements. It is required to re-weld before May 4, 2023 and ensure the single-sided welding requirement of 10d. XX will report to XXX for acceptance after self-inspection."
[0105] "{"Project Name":"System Default","Inspector":"Call the person filling in the information","Recipient":"XX","Self-inspector":" / ","Verifier":"XXX","Completion Date":"2023-05-04","Subcontractor":"XX County Rong'an Construction Labor Service Co., Ltd.","Problem Category":"Not in accordance with the specifications","Sub-items":"Concrete structure reinforcement engineering","Project Location":"A8 District B4 Floor","Problem>Content":"The single-sided welding length of the lap plate between the steel bars and the steel plate wall at four locations does not meet the requirements and should be re-welded to ensure the requirement of 10d single-sided welding."}"
[0106] Example 6:
[0107] "On February 13, 2023, our company conducted a technical review of the B3-layer formwork scaffolding in Area A3 and found that the exposed length of the formwork screw was greater than 400mm. We required XX County Rong'an Construction Labor Service Co., Ltd. to adjust the bottom support height before February 15, 2023 to ensure that the exposed length of the screw does not exceed 400mm. We asked the quality engineer XXX to follow up and inspect."
[0108] "{"Project Name":"System Default","Inspector":"Call the person filling in the form","Recipient":" / ","Self-inspector":" / ","Verifier":"XXX","Completion Date":"2023-02-15","Subcontractor":"XX County Rong'an Construction Labor Service Co., Ltd.","Problem Category":"Construction not in accordance with specifications","Sub-items":"Concrete structure formwork engineering","Project Location":"A3 Area B3 Floor","Problem Content":"The exposed length of the formwork screw is greater than 400mm. Adjust the bottom support height to ensure that the exposed length of the screw does not exceed 400mm"}"
[0109] User input data: On December 3, 2022, our company Ma Yun conducted a technical review inspection of the exterior wall steel bars of the B2 layer in area A1-2 and found that the exterior wall was not equipped with hooks as required. Hooks should be installed according to the design requirements. XX County Rong'an Construction Labor Service Co., Ltd. was required to add the hooks before December 5, 2023.
[0110] Please think slowly about how to extract the content corresponding to the specified field in the dictionary from the text, and give the final result in markdown format such as "json". At the same time, do not output irrelevant content.
[0111] --------------------------------------------------------------------- In some optional implementations of this embodiment, before executing the above step 202, the above execution subject may also perform the following operation: perform knowledge enhancement on the generative large language model through knowledge data of the field to which the target form belongs.
[0112] In this implementation, the execution subject can perform knowledge enhancement on the generative large language model in the following manner:
[0113] Pre-training based on domain knowledge data: Collect a large amount of text data in the field and use this data to pre-train the large language model. In this way, the model can learn the specific vocabulary, grammar, and expression habits of the field, thereby enhancing its understanding and generation capabilities in the field.
[0114] Subgraph retrieval-based method: If the domain knowledge can be represented by a knowledge graph, a subgraph retrieval-based method can be used. This method first retrieves a relatively small subgraph (i.e., knowledge related to the domain) from the knowledge graph, and then serializes the subgraph and inputs it to the large language model as part of the prompt. This can enrich the model's relevant background knowledge and improve its understanding and generation capabilities in the field.
[0115] Continuous Prompt: Design a series of continuous prompts related to the domain. These prompts can be large paragraphs of text or keywords or phrases. When the model generates text, these prompts are used as part of the input to guide the model to generate content related to the domain.
[0116] Task-oriented Fine-tuning: Design corresponding training data and fine-tune the model for specific tasks in the field.
[0117] In this implementation, the generative large language model is enhanced based on the knowledge data of the field to which the target form belongs, thereby improving the processing capability of the generative large language model in the field to which the target form belongs, and helping to improve the accuracy of the target form.
[0118] Continue to see Figure 3 , Figure 3 FIG. 3 is a schematic diagram 300 of an application scenario of the method for generating a form based on a large model according to the present embodiment. Figure 3 In the application scenario, the user uploaded the user input data to the server 302 through the terminal device 301: "Acceptance of the guardrails from axis a to axis F on the east side of the foundation pit of Building No. 5. The vertical poles are fixed to the printed ground with expansion screws. The vertical poles are 5.5 meters apart, and the horizontal poles are 0.6 meters and 1.2 meters above the ground. The safety net is tied with a thin rope and tied firmly to the railing. There is an 18-centimeter-high color steel plate at the bottom. The footboard is tied firmly with galvanized steel wire, and the fasteners of the railing are tightened. The setting is continuous. The overall setting of the guardrail meets the requirements and is qualified for acceptance."
[0119] After obtaining the user input data, the server first determines the target type "Protection Facility Acceptance Form" to which the target form to be generated belongs based on the user input data; then, through the generative large language model, the server extracts the field data corresponding to multiple fields in the target form under the target type from the user input data to generate the target form.
[0120] In this embodiment, a method for generating a form based on a large model is provided, which can determine the target category to which the target form to be generated belongs according to the user input data, and then generate the target form under the target category based on the user input data through the generative large language model, thereby avoiding tedious operations and human errors in the manual generation process of the form, and improving the efficiency and accuracy of form generation.
[0121] In some optional implementations of this embodiment, the second prompt data is also used to characterize the target format adopted by the target form, and the target format is, for example, JSON (JavaScript Object Notation), XML (Extensible Markup Language), BSON (Binary JSON), and other formats.
[0122] In this implementation, the execution entity may generate and display a target form in a target format.
[0123] In this implementation, the target form can be generated and displayed in the format indicated by the user, thereby improving the flexibility of the form generation process and the user experience.
[0124] In some optional implementations of this embodiment, the above execution subject may also perform the following operations:
[0125] First, obtain the verification result instruction for the target form.
[0126] As an example, after displaying the target form to the user, the execution entity may display virtual buttons indicating whether the target form has passed or failed verification in the display page, so as to receive a click operation from the user on the virtual button and determine whether the target form has passed the verification.
[0127] Then, in response to determining that the target form fails verification based on the verification result indication instruction, the target form is adjusted according to the acquired editing operation.
[0128] The editing operations include but are not limited to:
[0129] Select form elements: Before editing a form, you first need to select the form element you want to edit. This may include text boxes, drop-down lists, radio buttons, check boxes, etc.
[0130] Modify form element properties: After selecting a form element, you can modify its properties, such as name, value, type, size, color, etc. These properties define the appearance and behavior of the form element.
[0131] Add or delete form elements: As needed, you can add new fields to the form or delete fields that are no longer needed.
[0132] Adjust the layout of form elements: You can use tools such as drag and drop, alignment and positioning to adjust the layout of form elements to make it better meet your design requirements.
[0133] Add or remove form groups: On some platforms, forms can be divided into multiple groups for better organization and management. You can add new groups or remove groups that are no longer needed.
[0134] Set form access permissions: You can set form access permissions as needed, such as limiting form access to certain users or user groups.
[0135] In this implementation, when the target form fails to pass the verification, an editing function for the target form is provided, which helps to further ensure the accuracy of the target form.
[0136] Continue to refer Figure 4 , shows a schematic process 400 of another embodiment of a method for generating a form based on a large model according to the present disclosure. In the process 400, the following steps are included:
[0137] Step 401, in response to determining that the number of types in the form type set is greater than a preset number of types, a preset number of filtered types are determined from the form type set according to similarities between user input data and example forms under the types in the form type set.
[0138] Step 402 : for a category in the preset number of filtered categories, determine a first preset number of iconic forms from the example forms under the category.
[0139] Step 403, generating first prompt data according to the iconic forms under the categories in the categories after the preset number of categories are filtered.
[0140] Step 404 , determining the target category according to the user input data and the first prompt data through the generative large language model.
[0141] Step 405, in response to determining that the number of example forms under the target category is greater than the second preset example number, determine a second preset example number of target example forms from the example forms under the target category based on the similarity between the user input data and the example forms under the target category.
[0142] Step 406 , generating second prompt data according to a second preset number of target example forms, historical input data corresponding to each of the plurality of target example forms, and a plurality of fields required for generating a form under the target type.
[0143] Step 407 , using the generative large language model, extracting field data corresponding to each of the multiple fields from the user input data according to the user input data and the second prompt data, and generating and displaying a target form in a target format.
[0144] It can be seen from this embodiment that Figure 2 Compared with the corresponding embodiments, the process 400 of the method for generating a form based on a large model in this embodiment specifically illustrates the generation process of the first prompt data and the second prompt data, the type determination process of the generative large language model based on the first prompt data, and the form generation process based on the second prompt data by the generative large language model, which further improves the efficiency and accuracy of form generation.
[0145] Continue to refer Figure 5 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a device for generating a form based on a large model. The system embodiment is similar to Figure 2 Corresponding to the method embodiment shown, the system can be specifically applied to various electronic devices.
[0146] like Figure 5 As shown, the device 500 for generating a form based on a large model includes: a determination unit 501, configured to determine the target category to which the target form to be generated belongs according to user input data; a generation unit 502, configured to extract field data corresponding to each of multiple fields in the target form under the target category from the user input data through a generative large language model, and generate the target form.
[0147] In some optional implementations of this embodiment, the determination unit 501 is further configured to: determine the target category according to the user input data and the first prompt data through a generative large language model, wherein the first prompt data is used to characterize an example form under each category in the form category set.
[0148] In some optional implementations of the present embodiment, the above-mentioned device also includes: an indication data generating unit (not shown in the figure), which is configured to: in response to determining that the number of types in the form type set is greater than a preset number of types, determine a preset number of filtered types from the form type set based on the similarity between the user input data and the example forms under the types in the form type set; and generate first prompt data based on the example forms under the types in the preset number of filtered types.
[0149] In some optional implementations of this embodiment, the indication data generation unit is further configured to: for a type among the preset number of filtered types, determine a first preset number of iconic forms from the example forms under the type; and generate first prompt data based on the iconic forms under the types among the preset number of filtered types.
[0150] In some optional implementations of this embodiment, the determination unit 501 is further configured to: determine a specified number of candidate categories from a set of form categories based on user input data and first prompt data through a generative large language model; and determine a target category from the specified number of candidate categories based on the acquired selection instructions.
[0151] In some optional implementations of this embodiment, the generation unit 502 is further configured to: extract field data corresponding to multiple fields from the user input data according to the user input data and the second prompt data through a generative large language model, and generate a target form, wherein the second prompt data is used to characterize multiple fields and example forms under the target category.
[0152] In some optional implementations of the present embodiment, the indication data generation unit is further configured to: in response to determining that the number of example forms under the target category is greater than a second preset example number, determine a second preset example number of target example forms from the example forms under the target category based on the similarity between the user input data and the example forms under the target category; and generate second prompt data based on the second preset example number of target example forms and multiple fields required to generate the form under the target category.
[0153] In some optional implementations of this embodiment, the indication data generation unit is further configured to generate second prompt data based on a second preset number of target example forms, historical input data corresponding to each of the multiple target example forms, and multiple fields required to generate a form under the target type.
[0154] In some optional implementations of this embodiment, the second prompt data is also used to characterize the target format adopted by the target form, and the above-mentioned generating unit 502 is further configured to: generate and display the target form adopting the target format;
[0155] In some optional implementations of this embodiment, the above-mentioned device also includes: an acquisition unit, configured to acquire a verification result indication instruction for the target form; an adjustment unit, configured to adjust the target form according to the acquired editing operation in response to determining that the target form has failed the verification based on the verification result indication instruction.
[0156] In some optional implementations of this embodiment, the above-mentioned device also includes: a knowledge enhancement unit configured to perform knowledge enhancement on the generative large language model through knowledge data of the field to which the target form belongs.
[0157] In this embodiment, a device for generating forms based on a large model is provided, which can determine the target category to which the target form to be generated belongs according to the user input data, and then generate the target form under the target category based on the user input data through the generative large language model, thereby avoiding tedious operations and human errors in the manual generation process of the form, and improving the efficiency and accuracy of form generation.
[0158] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the method for generating a form based on a large model described in any of the above embodiments can be implemented when the at least one processor executes the instructions.
[0159] According to an embodiment of the present disclosure, the present disclosure further provides a readable storage medium, which stores computer instructions, and the computer instructions are used to enable a computer to implement the method for generating a form based on a large model described in any of the above embodiments when executed.
[0160] The embodiments of the present disclosure provide a computer program product, which, when executed by a processor, can implement the method for generating a form based on a large model as described in any of the above embodiments.
[0161] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0162] like Figure 6As shown, the device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0163] A number of components in the device 600 are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0164] The computing unit 601 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 601 performs the various methods and processes described above, such as a method for generating a form based on a large model. For example, in some embodiments, the method for generating a form based on a large model may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the method for generating a form based on a large model described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to execute the method for generating a form based on a large model in any other appropriate manner (for example, by means of firmware).
[0165] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0166] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable large-model-based form-generating device, so that the program code, when executed by the processor or controller, implements the functions / operations specified in the flow chart and / or block diagram. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0167] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0168] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0169] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0170] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and virtual private servers (VPS) services; it may also be a server for a distributed system, or a server combined with a blockchain.
[0171] According to the technical solution of the embodiment of the present disclosure, a method for generating forms based on a large model is provided. The target category to which the target form to be generated belongs can be determined according to the user input data, and then the target form under the target category is generated based on the user input data through the generative large language model, thereby avoiding tedious operations and human errors in the manual generation process of the form and improving the efficiency and accuracy of form generation.
[0172] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution provided by this disclosure can be achieved, and this document does not limit this.
[0173] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A method for generating a form based on a large model, comprising: According to the user input data, determine the target type to which the target form to be generated belongs; The target form is generated by extracting field data corresponding to each of the plurality of fields in the target form under the target category from the user input data through a generative large language model.
2. The method according to claim 1, wherein: The step of determining the target type of the target form to be generated according to the user input data includes: The target category is determined by the generative large language model according to the user input data and first prompt data, wherein the first prompt data is used to characterize an example form under each category in a set of form categories.
3. The method according to claim 2, wherein: Before determining the target category according to the user input data and the first prompt data by using the generative large language model, the method further includes: In response to determining that the number of types in the form type set is greater than a preset number of types, determining the preset number of filtered types from the form type set according to the similarity between the user input data and an example form under the type in the form type set; The first prompt data is generated according to the example forms under the category among the preset number of filtered categories.
4. The method according to claim 3, wherein: The generating the first prompt data according to the example form under the category among the categories filtered by the preset number of categories includes: For the category among the preset number of filtered categories, determining a first preset number of iconic forms from the example forms under the category; The first prompt data is generated according to the iconic forms under the category among the categories filtered by the preset number of categories.
5. The method according to claim 2, wherein: The determining the target type according to the user input data and the first prompt data by using the generative large language model includes: Determine, by means of the generative large language model, a specified number of candidate categories from the form category set according to the user input data and the first prompt data; According to the obtained selection instruction, the target category is determined from the specified number of candidate categories.
6. The method according to claim 1, wherein: The method of extracting field data corresponding to a plurality of fields in a target form under the target category from the user input data by using a generative large language model to generate the target form includes: By means of the generative large language model, field data corresponding to each of the multiple fields are extracted from the user input data according to the user input data and the second prompt data, so as to generate the target form, wherein the second prompt data is used to characterize the multiple fields and the example form under the target category.
7. The method according to claim 6, wherein: Before extracting the field data corresponding to each of the plurality of fields from the user input data according to the user input data and the second prompt data by the generative large language model to generate the target form, the method further includes: In response to determining that the number of example forms under the target category is greater than a second preset number of examples, determining the second preset number of target example forms from the example forms under the target category according to the similarity between the user input data and the example forms under the target category; The second prompt data is generated according to the second preset number of example target example forms and a plurality of fields required for generating a form under the target category.
8. The method according to claim 7, wherein: The step of generating the second prompt data according to the second preset number of example target example forms and a plurality of fields required for generating a form under the target type includes: The second prompt data is generated according to the second preset number of target example forms, the historical input data corresponding to each of the multiple target example forms, and the multiple fields required to generate the form under the target type.
9. The method according to any one of claims 6 to 8, wherein: The second prompt data is also used to characterize the target format adopted by the target form, and The generating of the target form comprises: Generate and display a target form in the target format.
10. The method according to claim 9, wherein: Also includes: Obtaining a verification result instruction for the target form; In response to determining that the target form fails verification based on the verification result indication instruction, the target form is adjusted according to the acquired editing operation.
11. The method according to claim 1, wherein: Before extracting field data corresponding to a plurality of fields in the target form under the target category from the user input data by using the generative large language model and generating the target form, the method further includes: The generative large language model is enhanced with knowledge data of the field to which the target form belongs.
12. A device for generating a form based on a large model, comprising: A determination unit, configured to determine the target category to which the target form to be generated belongs according to the user input data; The generating unit is configured to extract field data corresponding to each of the plurality of fields in the target form under the target category from the user input data through a generative large language model, and generate the target form.
13. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 11.
14. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 11.
15. A computer program product comprising: A computer program which, when executed by a processor, implements the method according to any one of claims 1 to 11.
Citation Information
Cited By
Ticket forming control method and device based on large model
CN119671124A
A large model-based ticketing control method and device
CN119671124B
