Document generation method and device, computer equipment and readable storage medium

By identifying and matching entity parameters in natural language document generation requests, the problem of insufficient intention understanding and word slot recognition in traditional technology is solved, and the accurate extraction and automatic filling of document parameters in intelligent reimbursement robots is realized, which improves the efficiency of reimbursement process and accuracy.

CN119312780APending Publication Date: 2025-01-14KINGDEE SOFTWARE(CHINA) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411277227.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-12
Publication Date
2025-01-14

AI Technical Summary

Technical Problem

Traditional natural language processing technology has poor intention understanding ability in intelligent reimbursement robots, low accuracy in word slot recognition, and inability to effectively extract document parameters in unstructured data, resulting in low efficiency of reimbursement process and high error rate.

Method used

By receiving the user's natural language document generation request, identifying entity parameters, determining document types, matching preset fields, obtaining missing parameters, fusing historical information, and automatically filling documents to improve matching and accuracy.

Benefits of technology

It realizes flexible understanding of user's natural language description and accurate extraction of document parameters, reduces manual review, improves the speed and accuracy of the reimbursement process, and reduces the error rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119312780A_ABST
    Figure CN119312780A_ABST
Patent Text Reader

Abstract

The invention relates to a receipt generation method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the following steps: receiving a receipt generation request initiated by a target object, wherein the receipt generation request comprises entity parameters; according to the entity parameters, determining a target document category corresponding to the document generation request, and determining a to-be-filled document belonging to the target document category, the to-be-filled document comprising a plurality of preset fields; when an entity parameter which is not matched with the at least one preset field exists in the receipt generation request, sending a parameter acquisition request for the at least one preset field to the target object; and receiving entity parameters fed back by the target object for the parameter acquisition request, and filling the to-be-filled document with the entity parameters to obtain a target document. By adopting the method, the information provided by the user can be automatically filled into the corresponding document field, and the operation process of the user is simplified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a document generation method, apparatus, computer equipment, computer-readable storage medium and computer program product. Background Art

[0002] An intelligent expense reimbursement robot is a software or hardware solution that uses artificial intelligence technology to automate the internal expense reimbursement process of an enterprise. This robot can help companies and employees simplify the expense reimbursement process, improve efficiency, and reduce the possibility of errors and fraud.

[0003] However, traditional natural language processing (NLP) technology has limitations in the development of intelligent reimbursement robots. It has poor intent understanding ability, low word slot recognition accuracy, and is unable to extract unstructured data based on the problem description entered by the user and correspond to the parameters required for the system document. Summary of the invention

[0004] Based on this, it is necessary to provide a document generation method, device, computer equipment, computer-readable storage medium and computer program product that can understand the user's intention through business description, quickly and accurately extract document information from natural language unstructured data to generate documents in response to the above technical problems.

[0005] In a first aspect, the present application provides a document generation method, comprising:

[0006] Receiving a document generation request initiated by a target object, wherein the document generation request includes entity parameters;

[0007] Determine the target document category corresponding to the document generation request according to the entity parameter, and determine the document to be filled belonging to the target document category, wherein the document to be filled includes a plurality of preset fields;

[0008] When there is an entity parameter in the document generation request that does not match at least one preset field, sending a parameter acquisition request for the at least one preset field to the target object;

[0009] Receive the entity parameters fed back by the target object in response to the parameter acquisition request, fill each of the entity parameters into the to-be-filled document, and obtain the target document.

[0010] In one embodiment, the entity parameters include parameters obtained after entity identification of the document generation request;

[0011] The step of determining the target document category corresponding to the document generation request according to the entity parameter, and determining the document to be filled belonging to the target document category, includes:

[0012] For one of the multiple candidate document categories in the document library, the preset fields corresponding to the candidate document category are matched with the entity parameters of the document generation request to obtain the matching degree between the candidate document category and the document generation request; according to the matching degree between each candidate document category in the document library and the document generation request, the target document category corresponding to the document generation request is determined from the multiple candidate document categories in the document library, and the document to be filled belonging to the target document category is searched in the document library.

[0013] In one embodiment, after determining the documents to be filled that belong to the target document category, the method further includes:

[0014] Obtain a document configuration format corresponding to the document to be filled, wherein the document configuration format includes multiple preset fields and an area to be filled corresponding to each preset field; determine a first target field whose matching degree with the entity parameters in the document generation request falls within a preset matching degree interval according to the matching degree of each preset field and the entity parameters in the document generation request; fill the entity parameters in the document generation request into the area to be filled corresponding to the first target field to obtain initial configuration data.

[0015] In one of the embodiments, the parameter acquisition request includes a final parameter acquisition text;

[0016] Before sending a parameter acquisition request for the at least one preset field to the target object, the method further includes:

[0017] If there are entity parameters in the document generation request that do not match at least one preset field in the initial configuration data, use the at least one preset field as a second target field; determine an initial parameter acquisition text based on the second target field; obtain a historical parameter acquisition text for the target object within a preset time period; and determine a final parameter acquisition text for the second target field based on the initial parameter acquisition text and the historical parameter acquisition text.

[0018] In one embodiment, determining the final parameter acquisition text for the second target field according to the initial parameter acquisition text and the historical parameter acquisition text includes:

[0019] Obtain a first fusion weight value corresponding to the initial parameter acquisition text and a second fusion weight value corresponding to the historical parameter acquisition text; match the initial parameter acquisition text and the historical parameter acquisition text; if the degree of match between the initial parameter acquisition text and the historical parameter acquisition text is greater than a preset matching degree threshold, fuse the initial parameter acquisition text and the historical parameter acquisition text according to the first fusion weight value and the second fusion weight value to obtain a final parameter acquisition text for the second target field.

[0020] In one embodiment, the parameter acquisition request includes a final parameter acquisition text; the receiving of entity parameters fed back by the target object in response to the parameter acquisition request, filling each entity parameter into the to-be-filled document, and obtaining the target document includes:

[0021] Receive entity parameters of the target object for obtaining text feedback for the final parameters; fill the entity parameters of the target object for obtaining text feedback for the final parameters into at least one preset field in the initial configuration data to obtain final configuration data; call a document creation programming interface, and convert the final configuration data into a target document through the document creation programming interface.

[0022] In a second aspect, the present application also provides a document generation device, comprising:

[0023] A receiving module, configured to receive a document generation request initiated by a target object, wherein the document generation request includes entity parameters;

[0024] A determination module, configured to determine a target document category corresponding to the document generation request according to the entity parameters, and determine a to-be-filled document belonging to the target document category, wherein the to-be-filled document includes a plurality of preset fields;

[0025] A sending module, configured to send a parameter acquisition request for at least one preset field to the target object when there is an entity parameter in the document generation request that does not match the at least one preset field;

[0026] The filling module is used to receive the entity parameters fed back by the target object in response to the parameter acquisition request, fill each entity parameter into the to-be-filled document, and obtain the target document.

[0027] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0028] Receiving a document generation request initiated by a target object, wherein the document generation request includes entity parameters;

[0029] Determine the target document category corresponding to the document generation request according to the entity parameter, and determine the document to be filled belonging to the target document category, wherein the document to be filled includes a plurality of preset fields;

[0030] When there is an entity parameter in the document generation request that does not match at least one preset field, sending a parameter acquisition request for the at least one preset field to the target object;

[0031] Receive the entity parameters fed back by the target object in response to the parameter acquisition request, fill each of the entity parameters into the to-be-filled document, and obtain the target document.

[0032] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0033] Receiving a document generation request initiated by a target object, wherein the document generation request includes entity parameters;

[0034] Determine the target document category corresponding to the document generation request according to the entity parameter, and determine the document to be filled belonging to the target document category, wherein the document to be filled includes a plurality of preset fields;

[0035] When there is an entity parameter in the document generation request that does not match at least one preset field, sending a parameter acquisition request for the at least one preset field to the target object;

[0036] Receive the entity parameters fed back by the target object in response to the parameter acquisition request, fill each of the entity parameters into the to-be-filled document, and obtain the target document.

[0037] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0038] Receiving a document generation request initiated by a target object, wherein the document generation request includes entity parameters;

[0039] Determine the target document category corresponding to the document generation request according to the entity parameter, and determine the document to be filled belonging to the target document category, wherein the document to be filled includes a plurality of preset fields;

[0040] When there is an entity parameter in the document generation request that does not match at least one preset field, sending a parameter acquisition request for the at least one preset field to the target object;

[0041] Receive the entity parameters fed back by the target object in response to the parameter acquisition request, fill each of the entity parameters into the to-be-filled document, and obtain the target document.

[0042] The above-mentioned document generation method, device, computer equipment, computer-readable storage medium and computer program product receive a document generation request initiated by a target object, wherein the document generation request includes entity parameters; the user is allowed to make a request in a natural language, rather than relying on a fixed command or format, making it more flexible and easy to use. According to the entity parameters, the target document category corresponding to the document generation request is determined, and the document to be filled belonging to the target document category is determined, wherein the document to be filled includes multiple preset fields; the document type can be automatically identified, reducing the need for manual review or classification. And by analyzing the entity parameters input by the user, the various parameters of the required document can be more accurately identified, thereby reducing errors. When there is an entity parameter in the document generation request that does not match at least one preset field, a parameter acquisition request for the at least one preset field is sent to the target object; the missing information is clarified through multiple rounds of dialogue to ensure that all necessary information is correctly captured. The entity parameters fed back by the target object for the parameter acquisition request are received, and each entity parameter is filled into the document to be filled to obtain the target document. Automatically fill in the corresponding document fields with the information provided by the user, simplifying the user's operation process. Users do not need to fill in the documents manually, which significantly speeds up the entire reimbursement process and reduces errors caused by manual errors. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0044] FIG1 is an application environment diagram of a document generation method in one embodiment;

[0045] FIG2 is a schematic diagram of a process of generating a document in one embodiment;

[0046] FIG3 is a schematic diagram of a scenario of a method for generating a document in one embodiment;

[0047] FIG4 is a schematic diagram of a flow chart of a method for generating a document in another embodiment;

[0048] FIG5 is a structural block diagram of a document generating device in one embodiment;

[0049] FIG6 is a structural block diagram of a document generating device in another embodiment;

[0050] FIG. 7 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0051] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with 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.

[0052] The document generation method provided in the embodiment of the present application can be applied in the application environment shown in FIG. 1. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The terminal 102 generates a document generation request and sends the document generation request to the server 104, so that the server 104 fills each entity parameter into the document to be filled and obtains the target document. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The head-mounted device can be a virtual reality (VR) device, an augmented reality (AR) device, smart glasses, etc. The server 104 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services.

[0053] In an exemplary embodiment, as shown in FIG2 , a document generation method is provided, which is described by taking the method applied to the server 104 in FIG1 as an example, and includes the following steps 202 to 208. Among them:

[0054] Step 202: receiving a document generation request initiated by a target object, wherein the document generation request includes entity parameters.

[0055] The target object refers to the user who uses the system or the party who initiates the document request. The "target object" here specifically refers to those who want to interact with the system through natural language to complete the document generation task, such as company employees.

[0056] A document generation request is a request expressed by a user in natural language to start the document generation process. For example, a user may say, "I am going to Guangzhou on a business trip to attend the Guangzhou International Fair tomorrow." Such a request contains the user's intention to generate a certain document (such as a business trip application form) and related information.

[0057] Entity parameters refer to specific information included in the user request, which is directly related to the generation of the document. In this solution, entity parameters can be specific values, dates, or other key information, such as "business trip start date", "business trip end date", "departure place", "destination", etc. These parameters are important components of the document.

[0058] Specifically, the target object (usually the user) first initiates a document generation request through natural language expression. For example, the user may say: "I am going to Guangzhou on a business trip to attend the Guangzhou International Fair tomorrow." Then the AI ​​Agent (artificial intelligence agent) extracts entity parameters from the user's request through natural language processing technology (NLP). Entity parameters may include: business trip start date, business trip end date, departure place, destination, etc. For example, "tomorrow", "Guangzhou", and "Guangzhou International Fair" are extracted from the user input.

[0059] Step 204, determining the target document category corresponding to the document generation request according to the entity parameters, and determining the documents to be filled belonging to the target document category, wherein the documents to be filled include a plurality of preset fields.

[0060] The target document category refers to the specific type of document that the user wants to initiate, for example, "business trip application form", "expense reimbursement form", etc.

[0061] A document to be filled in refers to a blank document template with a defined format and required fields, waiting for the user to enter relevant information. For example, the template of the "Business Trip Application Form" contains fields such as "Business Trip Start Date", "Business Trip End Date", "Departure Place", "Destination", "Business Trip Reason", and "Application Amount".

[0062] Preset fields refer to information items that are pre-set in the document to be filled in and need to be filled in by the user. For example, in the "Business Trip Application Form", "Business Trip Start Date", "Business Trip End Date" and so on are all preset fields.

[0063] Specifically, first determine the target document category corresponding to the document generation request based on the extracted entity parameters. For example, in this scenario, the AI ​​Agent determines that the user needs to initiate a "business trip application form." Then, based on the determined target document category, select the corresponding document template to be filled. For example, select the "business trip application form" template, which contains multiple preset fields, such as "business trip start date", "business trip end date", "departure place", "destination", "business trip reason" and "application amount".

[0064] Step 206: When there are entity parameters in the document generation request that do not match at least one preset field, a parameter acquisition request for at least one preset field is sent to the target object.

[0065] Among them, parameter acquisition request means that when the AI ​​Agent processes the document generation request of the user (i.e., the "target object") and finds that the information in the request is insufficient to completely fill in the preset fields of the required document, the AI ​​Agent will send an additional query to the user to obtain the missing information.

[0066] Specifically, first check whether the extracted entity parameters completely match the preset fields of the document to be filled. For example, if the user does not provide information for the preset field "business trip start date", proceed to the next step. Then for the unmatched preset fields, the AI ​​Agent sends a parameter acquisition request to the user to ask for the missing parameters. For example, the AI ​​Agent may ask: "When is the start date of your business trip?"

[0067] Step 208: receiving the entity parameters fed back by the target object in response to the parameter acquisition request, filling each entity parameter into the document to be filled, and obtaining the target document.

[0068] The target document refers to the specific business document that the user ultimately wants to create and complete. That is, the user describes the business document he wants to initiate through natural language, such as "business trip application form".

[0069] Specifically, the user first responds to the parameter acquisition request and provides the missing parameters. Then the AI ​​Agent collects the complete parameter information. Next, all the collected parameter information is filled into the corresponding document template. Then the document creation API is called to complete the document generation. Finally, the generated document link is returned to the user, allowing the user to view or further modify the document information.

[0070] In one of the embodiments, for one of the multiple candidate document categories in the document library, the preset fields corresponding to the candidate document category are matched with the entity parameters of the document generation request to obtain the matching degree between the candidate document category and the document generation request; according to the matching degree between each candidate document category in the document library and the document generation request, the target document category corresponding to the document generation request is determined from the multiple candidate document categories in the document library, and the document to be filled belonging to the target document category is searched in the document library.

[0071] The document library refers to a collection of document templates of various types. These document templates cover various common business scenarios within the enterprise, such as business trip application forms, expense reimbursement forms, purchase orders, etc. Each document template contains the standard fields and parameters required to be filled in for this type of document.

[0072] Candidate document categories refer to a group of document types selected from the document library. They may be several document types with high probability corresponding to the natural language description entered by the user. For example, when the user mentions "I am going to Guangzhou on a business trip", several document types such as "Business Trip Application Form" and "Transportation Expense Reimbursement Form" will be selected as candidate categories based on this description.

[0073] The target document category refers to the document type that the user wants to initiate after analyzing the natural language description entered by the user. For example, for the above example "I want to go to Guangzhou on a business trip", after analysis, it may be determined that the user wants to initiate a "business trip application form", so "business trip application form" is the target document category.

[0074] Specifically, firstly, the preset fields of each candidate document category are matched with the entity parameters extracted from the document generation request. The matching degree between each candidate document category and the document generation request is calculated. Then, the matching degrees between all candidate document categories and the document generation request are compared, and the candidate document category corresponding to the highest matching degree is found, and the candidate document category corresponding to the highest matching degree is used as the target document category. Finally, the document library is searched for the document to be filled that matches the target document category.

[0075] By integrating document classification and parameter extraction into one step, the number of calls to large language models is reduced, thereby improving performance and reducing costs. In addition, users do not need to understand the specific document format and requirements, but only need to simply describe their needs, which greatly improves the user experience and makes the entire process more user-friendly and efficient.

[0076] In one of the embodiments, a document configuration format corresponding to the document to be filled is obtained, the document configuration format including multiple preset fields and an area to be filled corresponding to each preset field; based on the matching degree between each preset field and the entity parameters in the document generation request, a first target field whose matching degree with the entity parameters in the document generation request falls within a preset matching degree range is determined; the entity parameters in the document generation request are filled into the area to be filled corresponding to the first target field to obtain initial configuration data.

[0077] The document configuration format refers to the document template format defined within the system, which includes various attributes and field information of the document. For example, in the example of expense report, the document configuration format may define the format of "business trip application form", including fields such as business trip start date, business trip end date, departure place, and destination.

[0078] Preset fields refer to the fields that are pre-set in the document configuration format and are used to receive specific information entered by the user. For example, in the "Business Trip Application Form", "Business Trip Start Date" and "Business Trip End Date" are preset fields.

[0079] The area to be filled is the area on the document template where the user is waiting to fill in information. In electronic documents, these areas are usually blank input boxes or designated input locations in the form.

[0080] The first target fields are those preset fields whose matching degree with the entity parameters provided by the user falls within the preset matching degree range. For example, if the user says "I am going to Guangzhou on a business trip tomorrow", then "business trip start date" and "destination" may be the first target fields because they can be directly extracted from the user's speech.

[0081] The preset matching interval refers to a range of matching between the entity parameters in the document generation request and the preset fields of the document to be filled. This interval is used to evaluate whether the matching degree between the entity parameters and the preset fields is high enough to determine whether the entity parameters can be directly filled into the corresponding preset fields. If the matching degree falls within the preset interval, the entity parameters are considered to match the preset fields and can be filled directly; otherwise, further information or parameters may be required to ensure the correct match.

[0082] Initial configuration data refers to the preliminary result after the entity parameters provided by the user are filled into the document template. For example, if the user mentions "tomorrow" as the start date of the business trip, the preset field "business trip start date" will be filled with "tomorrow" and form part of the initial configuration data.

[0083] Specifically, firstly, a document configuration format corresponding to the document to be filled is obtained, and the format includes multiple preset fields and their corresponding areas to be filled. For example, for a "business trip application form", the document configuration format may include preset fields such as "business trip start date", "business trip end date", "departure place", "destination", etc., and the area to be filled in each field.

[0084] The AI ​​Agent then matches each preset field with the entity parameters in the document generation request. For example, the user input "tomorrow" matches the preset field "business trip start date"; "Guangzhou" matches the preset field "destination".

[0085] Next, the first target field whose matching degree with the entity parameter in the document generation request input by the user falls within the preset matching degree range is determined, and the corresponding entity parameter is filled into the corresponding area to be filled. For example, "tomorrow" is filled into the area to be filled in "business trip start date"; "Guangzhou" is filled into the area to be filled in "destination".

[0086] Finally, all matching entity parameters are filled into the corresponding preset fields to form the initial configuration data. For example, the initial configuration data is presented in JSON format, such as: [{"billname":"Business trip application form","description":"Business trip, planned business trip, business trip at a certain time in the future, business trip application, application amount","parameter":"Business trip start date = tomorrow, business trip end date =, departure place =, destination = Guangzhou, business trip reason = participating in the Guangzhou International Fair, application amount = ","formmetaid":"er_tripreqbill"}].

[0087] By using the preset document configuration format, the consistency and standardization of all documents are ensured, which facilitates subsequent management and archiving. And by automatically filling the entity parameters provided by the user into the preset fields of the document, the workload of manual input is reduced and the speed of document creation is accelerated.

[0088] In one of the embodiments, if there are entity parameters in the document generation request that do not match at least one preset field in the initial configuration data, at least one preset field is used as a second target field; based on the second target field, an initial parameter acquisition text is determined; historical parameter acquisition text of the target object within a preset time period is obtained; and based on the initial parameter acquisition text and the historical parameter acquisition text, a final parameter acquisition text for the second target field is determined.

[0089] Among them, the second target field refers to the fields that are not automatically filled when the information provided by the user does not completely match the preset fields of the document. The initial parameter acquisition text refers to the question or prompt text automatically generated according to the second target field, which is used to ask the user for the missing specific information. The historical parameter acquisition text refers to the parameter acquisition text that the user has been asked in a similar situation before within a preset time period. The final parameter acquisition text refers to the inquiry text after combining the initial parameter acquisition text and the historical parameter acquisition text. Optionally, the final parameter acquisition text refers to selecting a key field in the historical parameter acquisition text, and splicing the key field to the corresponding position of the initial parameter acquisition text to obtain the final parameter acquisition text. For example, the initial parameter acquisition text is "Where do you plan to go". The historical parameter acquisition text within 3 minutes is "When do you plan to go on a business trip". At this time, the key field "Business trip" is selected in "When do you plan to go on a business trip", and the key field "Business trip" is spliced ​​to the initial parameter acquisition text "Where do you plan to go on a business trip" to obtain the final parameter acquisition text "Where do you plan to go on a business trip".

[0090] The purpose is to ask users more accurately to obtain the required information. By integrating historical information and current context, the final parameter acquisition text can obtain user information more personalized and efficiently.

[0091] Specifically, the extracted information is first matched with the preset document fields to find out the unmatched fields, i.e., the second target fields. For example, the user did not provide the "business trip start date" and "business trip end date". Then for each unmatched field, the AI ​​Agent generates an inquiry text, i.e., the initial parameter acquisition text. For example, for the "business trip start date", the AI ​​Agent will ask: "When is your business trip start date?". Next, the AI ​​Agent queries the user's historical records over the past period of time to find parameter acquisition texts that have been asked in similar situations. For example, if the user often forgets to provide the "business trip end date" in the past, the historical parameter acquisition text may contain this question. Finally, combining the initial parameter acquisition text and the historical parameter acquisition text, the AI ​​Agent generates a more personalized inquiry text to ensure that the user can quickly and accurately provide the required information. For example, the final parameter acquisition text may be: "When are your business trip start date and end date?".

[0092] In this way, AI Agent can quickly locate missing parameters, avoid unnecessary inquiries, reduce invalid conversations, and improve overall interaction efficiency. It also reduces the need for users to repeatedly provide the same information, because AI Agent can infer some known information based on historical records. By recognizing patterns in historical records, AI Agent can more accurately predict which parameters are likely to be missed by users, and then take measures to prevent such situations from happening.

[0093] In one of the embodiments, a first fusion weight value corresponding to an initial parameter acquisition text and a second fusion weight value corresponding to a historical parameter acquisition text are obtained; the initial parameter acquisition text and the historical parameter acquisition text are matched; if the degree of match between the initial parameter acquisition text and the historical parameter acquisition text is greater than a preset matching degree threshold, the initial parameter acquisition text and the historical parameter acquisition text are fused according to the first fusion weight value and the second fusion weight value to obtain a final parameter acquisition text for a second target field.

[0094] The first fusion weight value refers to the weight given to the initial parameter acquisition text when generating the final parameter acquisition text. The higher the weight value, the greater the influence of the initial parameter acquisition text in the final text.

[0095] The second fusion weight value refers to the weight given to the historical parameter acquisition text when generating the final parameter acquisition text. Similarly, the higher the weight value, the greater the influence of the historical parameter acquisition text on the final text.

[0096] The preset matching threshold is a pre-set standard value used to determine the similarity between the initial parameter acquisition text and the historical parameter acquisition text. If the matching degree of the two exceeds this threshold, they are considered to be similar enough to be fused.

[0097] Specifically, first determine the fusion weight values ​​of the initial parameter acquisition text and the historical parameter acquisition text (i.e., the first fusion weight value and the second fusion weight value). Then compare the similarity of the two types of text to see whether it exceeds the preset matching threshold. Finally, if the matching degree meets the standard, the two texts are fused according to their respective weight values ​​to generate a more personalized and effective final parameter acquisition text. For example, suppose that the user often forgets to provide the "end date of the business trip". In this case, the initial parameter acquisition text obtained is "When is the end date of your business trip?" The historical parameter acquisition text (based on the information that the user often forgets to provide in the historical records) is "When was the end date of your last business trip?" If the semantic similarity of the two texts is high and exceeds the preset matching threshold (for example, set to 0.7), it may be decided to fuse the two texts. The first fusion weight value (the weight of the initial parameter acquisition text) may be set to 0.6, which means that the importance of this text is higher. The second fusion weight value (the weight of the historical parameter acquisition text) may be set to 0.4, indicating that although it is important, it is not as important as the initial text. The final parameter acquisition text after fusion may be "When is the end date of your business trip? When did you usually end your previous business trips?"

[0098] The combination of the initial parameter acquisition text and the historical parameter acquisition text can help users better understand the specific information that needs to be provided and avoid missing key data points. And when users often forget to provide certain information, the fused final parameter acquisition text can remind users of all necessary details at once, reducing the time of back-and-forth inquiries and improving interaction efficiency. And the algorithm automatically determines the fusion weight value and matching threshold, making the whole process more automated and intelligent, reducing the burden of manual intervention. The fusion weight value and matching threshold can be flexibly adjusted according to different scenarios and user feedback to adapt to changing needs.

[0099] In one of the embodiments, entity parameters of the target object for obtaining text feedback for the final parameters are received; the entity parameters of the target object for obtaining text feedback for the final parameters are filled into at least one preset field in the initial configuration data to obtain the final configuration data; and a document creation programming interface is called to convert the final configuration data into a target document through the document creation programming interface.

[0100] The final configuration data refers to the process of filling in the preset fields in the initial configuration data after all necessary entity parameters are collected to complete the document information. It is the last configuration stage before document creation and contains all the necessary information.

[0101] The document creation programming interface refers to the application programming interface (API) used to create a specific type of document. In simple terms, it is a set of predefined functions or methods that allow developers to perform specific tasks, such as creating documents, by calling these interfaces.

[0102] Specifically, first, the entity parameters of the text feedback obtained by the target object for the final parameters are received. Here, "entity parameters" refer to specific values ​​or descriptions, which are associated with the document to be created. Then the received entity parameters are filled into at least one preset field in the initial configuration data. Here, the "initial configuration data" may contain some basic information frameworks, while the "preset fields" refer to pre-defined data items waiting for the user or system to fill in specific values. By filling in these entity parameters, the complete "final configuration data" can be obtained, which will be a specific information set for creating a document. Next, the document creation programming interface is called, which is a pre-defined API or function set specifically used to create a specific type of document. The interface is responsible for processing the "final configuration data" and converting it into the required document format. Finally, the "final configuration data" is converted into the actual target document through the document creation programming interface. This means that a specific document or record, such as an order, invoice, delivery note, etc., is created based on the provided data.

[0103] The design of the document creation programming interface makes it easy to integrate with other systems, such as ERP systems or CRM systems. Through API calls, the document creation function can be easily embedded into existing business processes. By handling the document creation process in an automated and structured manner, it not only improves efficiency and accuracy, but also greatly improves the user experience and helps achieve more efficient business process management.

[0104] In an exemplary embodiment, as shown in FIG3 , the user inputs: "I am going to Guangzhou on a business trip to attend the Canton Fair tomorrow", and the AI ​​Agent (artificial intelligence agent) enters the document classification and entity recognition process. The short-term memory is combined with the long-term memory to analyze the user's historical behavior and preferences, and the tool function is called to accurately classify and match the documents and extract unstructured data to fill in the document parameters. Performance optimization is performed here, and the two steps are combined into one to reduce the call of large models and improve performance. JSON data is returned to the AI ​​Agent in the format of [{"billname":"Business trip application form","description":"Business trip is about to take place, business trip is planned, business trip will be taken at a certain time in the future, business trip application, application amount","parameter":"Business trip start date, business trip end date, departure place, destination, business trip reason, application amount","formmetaid":"er_tripreqbill"}], and the AI ​​Agent intelligently determines that the value corresponding to the parameter name in the parameter list is empty, and then asks the user for the parameter whose value corresponding to the name is empty. This process is a multi-round dialogue clarification, and the user is constantly asked to collect parameters, and the user can modify the parameters. After AIAgent collects all the parameters, it calls the tool function with the JSON data as a parameter, calls the create document API, and returns the document link to the user, who can view or modify the document information.

[0105] In an exemplary embodiment, as shown in FIG4 , steps 402 to 412 are included. Among them:

[0106] Step 402, receiving a document generation request initiated by a target object, the document generation request including entity parameters;

[0107] Step 404: for one of the multiple candidate document categories in the document library, matching the preset fields corresponding to the candidate document category with the entity parameters of the document generation request, and obtaining the matching degree between the candidate document category and the document generation request; according to the matching degree between each candidate document category in the document library and the document generation request, determining the target document category corresponding to the document generation request from the multiple candidate document categories in the document library, and searching the document library for a to-be-filled document belonging to the target document category, wherein the to-be-filled document includes multiple preset fields;

[0108] Step 406, obtaining a document configuration format corresponding to the document to be filled, the document configuration format including a plurality of preset fields and an area to be filled corresponding to each preset field; determining a first target field whose matching degree with the entity parameter in the document generation request falls within a preset matching degree interval according to the matching degree of each preset field and the entity parameter in the document generation request; filling the entity parameter in the document generation request into the area to be filled corresponding to the first target field, and obtaining initial configuration data;

[0109] Step 408: if there are entity parameters in the document generation request that do not match at least one preset field in the initial configuration data, use at least one preset field as the second target field; determine the initial parameter acquisition text based on the second target field; obtain the historical parameter acquisition text of the target object within a preset time period; obtain a first fusion weight value corresponding to the initial parameter acquisition text, and a second fusion weight value corresponding to the historical parameter acquisition text; match the initial parameter acquisition text with the historical parameter acquisition text; if the matching degree between the initial parameter acquisition text and the historical parameter acquisition text is greater than a preset matching degree threshold, fuse the initial parameter acquisition text with the historical parameter acquisition text based on the first fusion weight value and the second fusion weight value to obtain a final parameter acquisition text for the second target field;

[0110] Step 410: When there is an entity parameter in the document generation request that does not match at least one preset field, a parameter acquisition request for at least one preset field is sent to the target object;

[0111] Step 412, receiving entity parameters of the target object for obtaining text feedback for the final parameters; filling the entity parameters of the target object for obtaining text feedback for the final parameters into at least one preset field in the initial configuration data to obtain final configuration data; calling the document creation programming interface, and converting the final configuration data into the target document through the document creation programming interface.

[0112] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0113] Based on the same inventive concept, the embodiment of the present application also provides a document generation device for implementing the document generation method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in the document generation device embodiment provided below can refer to the limitations of the document generation method above, and will not be repeated here.

[0114] In an exemplary embodiment, as shown in FIG5 , a document generating device 500 is provided, comprising: a receiving module 502 , a determining module 504 , a sending module 506 , and a filling module 508 , wherein:

[0115] A receiving module 502 is used to receive a document generation request initiated by a target object, where the document generation request includes entity parameters;

[0116] A determination module 504, configured to determine a target document category corresponding to the document generation request according to the entity parameters, and determine a to-be-filled document belonging to the target document category, wherein the to-be-filled document includes a plurality of preset fields;

[0117] The sending module 506 is used to send a parameter acquisition request for at least one preset field to a target object when there is an entity parameter in the document generation request that does not match at least one preset field;

[0118] The filling module 508 is used to receive the entity parameters fed back by the target object in response to the parameter acquisition request, fill each entity parameter into the document to be filled, and obtain the target document.

[0119] In one of the embodiments, the determination module 504 is used to match the preset fields corresponding to the candidate document category with the entity parameters of the document generation request for one of the multiple candidate document categories in the document library to obtain the matching degree between the candidate document category and the document generation request; according to the matching degree between each candidate document category in the document library and the document generation request, determine the target document category corresponding to the document generation request from the multiple candidate document categories in the document library, and search for the to-be-filled documents belonging to the target document category in the document library.

[0120] In one embodiment, the document generation device also includes an initial configuration module 510, which is used to obtain a document configuration format corresponding to the document to be filled, the document configuration format including multiple preset fields and an area to be filled corresponding to each preset field; according to the matching degree of each preset field and the entity parameters in the document generation request, determine a first target field whose matching degree with the entity parameters in the document generation request falls within a preset matching degree range; fill the entity parameters in the document generation request into the area to be filled corresponding to the first target field to obtain initial configuration data.

[0121] In one embodiment, the document generation device also includes a final module 512, which is used to use the at least one preset field as a second target field if there are entity parameters in the document generation request that do not match at least one preset field in the initial configuration data; determine the initial parameter acquisition text based on the second target field; obtain the historical parameter acquisition text of the target object within a preset time period; and determine the final parameter acquisition text for the second target field based on the initial parameter acquisition text and the historical parameter acquisition text.

[0122] In one embodiment, the document generation device also includes a final module 512, which is used to obtain a first fusion weight value corresponding to the initial parameter acquisition text and a second fusion weight value corresponding to the historical parameter acquisition text; match the initial parameter acquisition text and the historical parameter acquisition text; if the matching degree between the initial parameter acquisition text and the historical parameter acquisition text is greater than a preset matching degree threshold, fuse the initial parameter acquisition text and the historical parameter acquisition text according to the first fusion weight value and the second fusion weight value to obtain a final parameter acquisition text for the second target field.

[0123] In one embodiment, the filling module 508 is used to receive entity parameters of the target object for obtaining text feedback for the final parameters; fill the entity parameters of the target object for obtaining text feedback for the final parameters into at least one preset field in the initial configuration data to obtain the final configuration data; call the document creation programming interface, and convert the final configuration data into the target document through the document creation programming interface.

[0124] Each module in the above-mentioned document generation device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.

[0125] In another embodiment, as shown in FIG6 , FIG6 is a structural block diagram of a document generation device in another embodiment, including: a receiving module 502, a determining module 504, a sending module 506 and a filling module 508. The document generation device 500 further includes an initial configuration module 510 and a final module 512. The initial configuration module 510 is used to, if there is an entity parameter in the document generation request that does not match at least one preset field in the initial configuration data, use at least one preset field as a second target field; determine an initial parameter acquisition text according to the second target field; obtain a historical parameter acquisition text of a target object within a preset time period; and determine a final parameter acquisition text for the second target field according to the initial parameter acquisition text and the historical parameter acquisition text. The final module 512 is used to obtain a first fusion weight value corresponding to the initial parameter acquisition text and a second fusion weight value corresponding to the historical parameter acquisition text; match the initial parameter acquisition text and the historical parameter acquisition text; if the matching degree between the initial parameter acquisition text and the historical parameter acquisition text is greater than a preset matching degree threshold, fuse the initial parameter acquisition text and the historical parameter acquisition text according to the first fusion weight value and the second fusion weight value to obtain the final parameter acquisition text for the second target field.

[0126] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG7. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data related to document generation. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a document generation method is implemented.

[0127] Those skilled in the art will understand that the structure shown in FIG. 7 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0128] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0129] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0130] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0131] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0132] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0133] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0134] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A document generation method, characterized in that: The method comprises: Receiving a document generation request initiated by a target object, wherein the document generation request includes entity parameters; Determine the target document category corresponding to the document generation request according to the entity parameter, and determine the document to be filled belonging to the target document category, wherein the document to be filled includes a plurality of preset fields; When there is an entity parameter in the document generation request that does not match at least one preset field, sending a parameter acquisition request for the at least one preset field to the target object; Receive the entity parameters fed back by the target object in response to the parameter acquisition request, fill each of the entity parameters into the to-be-filled document, and obtain the target document.

2. The method according to claim 1, characterized in that The entity parameters include parameters obtained after entity identification of the document generation request; The step of determining the target document category corresponding to the document generation request according to the entity parameter, and determining the document to be filled belonging to the target document category, includes: For one of the multiple candidate document categories in the document library, a preset field corresponding to the candidate document category is matched with an entity parameter of the document generation request to obtain a matching degree between the candidate document category and the document generation request; According to the matching degree between each candidate document category in the document library and the document generation request, a target document category corresponding to the document generation request is determined from multiple candidate document categories in the document library, and a to-be-filled document belonging to the target document category is searched in the document library.

3. The method according to claim 1, characterized in that After determining the documents to be filled that belong to the target document category, the method further includes: Obtaining a document configuration format corresponding to the document to be filled, wherein the document configuration format includes a plurality of preset fields and an area to be filled corresponding to each preset field; According to the matching degree between each preset field and the entity parameter in the document generation request, determining a first target field whose matching degree with the entity parameter in the document generation request falls within a preset matching degree interval; The entity parameters in the document generation request are filled into the to-be-filled area corresponding to the first target field to obtain initial configuration data.

4. The method according to claim 3, characterized in that The parameter acquisition request includes a final parameter acquisition text; Before sending a parameter acquisition request for the at least one preset field to the target object, the method further includes: If there are entity parameters in the document generation request that do not match at least one preset field in the initial configuration data, use the at least one preset field as a second target field; According to the second target field, determining the initial parameter acquisition text; Obtaining historical parameter acquisition text of the target object within a preset time period; A final parameter acquisition text for the second target field is determined according to the initial parameter acquisition text and the historical parameter acquisition text.

5. The method according to claim 4, characterized in that The determining, according to the initial parameter acquisition text and the historical parameter acquisition text, a final parameter acquisition text for the second target field includes: Acquire a first fusion weight value corresponding to the text acquired by the initial parameter, and a second fusion weight value corresponding to the text acquired by the historical parameter; Matching the initial parameter acquisition text with the historical parameter acquisition text; If the matching degree between the initial parameter acquisition text and the historical parameter acquisition text is greater than a preset matching degree threshold, the initial parameter acquisition text and the historical parameter acquisition text are fused according to the first fusion weight value and the second fusion weight value to obtain a final parameter acquisition text for the second target field.

6. The method according to any one of claims 1 to 5, characterized in that: The parameter acquisition request includes a final parameter acquisition text; The receiving the entity parameters fed back by the target object in response to the parameter acquisition request, filling each entity parameter into the to-be-filled document, and obtaining the target document includes: Receiving entity parameters of the target object for obtaining text feedback for final parameters; Filling the entity parameter of the target object for obtaining text feedback for the final parameter into at least one preset field in the initial configuration data to obtain the final configuration data; The document creation programming interface is called, and the final configuration data is converted into a target document through the document creation programming interface.

7. A document generating device, characterized in that: The device comprises: A receiving module, configured to receive a document generation request initiated by a target object, wherein the document generation request includes entity parameters; A determination module, configured to determine a target document category corresponding to the document generation request according to the entity parameters, and determine a to-be-filled document belonging to the target document category, wherein the to-be-filled document includes a plurality of preset fields; A sending module, configured to send a parameter acquisition request for at least one preset field to the target object when there is an entity parameter in the document generation request that does not match the at least one preset field; The filling module is used to receive the entity parameters fed back by the target object in response to the parameter acquisition request, fill each entity parameter into the to-be-filled document, and obtain the target document.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.