Dynamic template adaptive report generation method and device based on large model
By adopting a dynamic template adaptive report generation method based on a large model, the problems of high labor costs and slow response in traditional report generation in professional and highly constrained scenarios are solved, and efficient, flexible and accurate report generation is achieved, which is suitable for professional scenarios such as financial analysis and investment reports.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-24
- Publication Date
- 2026-04-07
AI Technical Summary
Traditional report generation suffers from high labor costs, slow response, and delayed updates in highly specialized scenarios. Furthermore, generating reports directly from large models makes it difficult to achieve in-depth reasoning and dynamic logical arrangement, resulting in bottlenecks in the accuracy and timeliness of highly specialized reports.
A dynamic template adaptive report generation method based on a large model is adopted. By determining the data source information and target examples, the method uses the knowledge base to match and recommend chapter slot templates, and performs slot correction or large language model generation through overlap calculation to dynamically adjust the report content.
It improves the efficiency and accuracy of report generation, reduces development costs, achieves greater flexibility and timeliness in reports, and ensures high professionalism and accuracy in reports.
Smart Images

Figure CN121809436A_ABST
Abstract
Description
Technical Field
[0001] This article belongs to the field of computer technology, specifically relating to a dynamic template adaptive report generation device based on a large model. Background Technology
[0002] Traditional report generation relies on predefined templates to reduce repetitive work, but in highly constrained professional scenarios (such as financial analysis and investment reports), it still faces pain points such as high labor costs and slow response times. While large models can directly generate basic text, they struggle to achieve in-depth reasoning and dynamic logical arrangement, resulting in a triple bottleneck in the accuracy, depth, and timeliness of highly professional reports that urgently needs to be overcome.
[0003] The limitations of traditional technologies are specifically manifested in the following aspects: ① Structural rigidity: predefined templates cannot dynamically adapt to data characteristics to generate evaluation descriptions; ② Lagging updates: content iteration requires the redevelopment of templates, resulting in a decline in timeliness; ③ Lack of reusability: new report types require completely customized development, which is costly.
[0004] Therefore, there is an urgent need for a technology that can quickly generate reports by combining large models. Summary of the Invention
[0005] To address the aforementioned problems in existing technologies, the purpose of this paper is to provide a dynamic template adaptive report generation device based on a large model, which can improve the efficiency of report generation.
[0006] To solve the above-mentioned technical problems, the specific technical solution presented in this paper is as follows: On the one hand, this paper provides a dynamic template adaptive report generation method based on a large model, the method including: Determine the data source information and target sample for the report to be generated, wherein the data source information includes at least a list of data source indicators; Based on the target example and the preset knowledge base, a recommended chapter slot template is obtained by matching. The knowledge base is a collection of historically retained chapter slot templates. The chapter slot template includes at least a list of indicator slots and an evaluative description slot. Calculate the overlap between the recommended chapter slot template and the data source information; When there is a high degree of overlap between the recommended chapter slot template and the data source information, the recommended chapter slot template is corrected to dynamically generate the target chapter slot template. When there is a low degree of overlap between the candidate chapter slot template and the data source information, the data source information and the target sample are input into the large language model to obtain the target chapter slot template. The data source information is filled into the target chapter slot template to obtain the generated report.
[0007] Furthermore, after determining the target sample, the following is also included: The target example is parsed using a large language model to determine its chapter structure; Generate a content summary for each chapter to obtain the chapter summary for each chapter; Based on the chapter structure and the chapter summary corresponding to each chapter, chapter groups and chapter summary groups are obtained.
[0008] Furthermore, based on the target example and the preset knowledge base, a recommended chapter slot template is obtained, including: Obtain the template vector of each chapter slot template in the knowledge base; Extract the sample vector of the target sample; Calculate the similarity between the sample vector and the template vector of each chapter slot template; Recommended chapter slot templates are determined based on the similarity between the sample vectors and the template vectors of each chapter slot template.
[0009] Further, based on the similarity between the sample vector and the template vector of each chapter slot template, a recommended chapter slot template is determined, including: The chapter slot template corresponding to the template vector with the highest similarity is determined as the recommended chapter slot template, or The chapter slot templates corresponding to template vectors with similarity exceeding a preset threshold are identified as recommended chapter slot templates.
[0010] Further, calculating the overlap between the recommended chapter slot template and the data source information includes: The overlap between the indicator slot list in the recommended chapter slot template and the data source indicator list in the data source information is calculated. The overlap includes at least the number of indicators that overlap between the indicator slot list and the data source indicator list.
[0011] Furthermore, the method also includes: When the number of indicators in the data source indicator list is not less than a preset number, and the ratio of the number of overlapping indicators to the number of indicators in the indicator slot list exceeds a preset ratio, it is judged as a high degree of overlap; or If the number of indicators in the data source indicator list is lower than the preset number, and the number of overlapping indicators is the same as the number of indicators in the indicator slot list, then it is judged as high overlap. All cases except those with high overlap are judged as low overlap.
[0012] Furthermore, when there is a high degree of overlap between the recommended chapter slot template and the data source information, slot correction is performed on the recommended chapter slot template to dynamically generate the target chapter slot template, including: Based on the overlap between the indicator slot list in the recommended chapter slot template and the data source indicator list in the data source information, the overlapping indicator slots and the differential indicator slots are determined. Based on the position of the difference indicator slot in the indicator slot list, determine the associated text of the difference indicator slot; The associated text and the data source indicator list are input into the large language model to obtain the recommended indicator slots for the differences in the data source indicator list; Based on the overlapping indicator slots and the recommended indicator slots, the recommended chapter slot template is corrected to dynamically generate the target chapter slot template.
[0013] Furthermore, when there is a low degree of overlap between the candidate chapter slot template and the data source information, the data source information and the target sample are input into the large language model to obtain the target chapter slot template, including: Input the chapter group and chapter summary group of the target example, as well as the list of data source indicators, into the large language model to obtain all recommendation indicator slots; Based on all the recommended indicator slots, the recommended chapter slot template is corrected to dynamically generate the target chapter slot template.
[0014] Further, the data source information is filled into the target chapter slot template to obtain the generated report, including: Based on the correspondence between the indicator slots in the target chapter slot template and the data source indicator list, the values in the data source indicator list are filled into the corresponding indicator slots. Based on the target chapter slot template after filling in the values, the evaluative description slots in the target chapter slot template are filled using the large language model to obtain the generated report.
[0015] On the other hand, this paper also provides a dynamic template adaptive report generation device based on a large model, the device comprising: The basic data determination module is used to determine the data source information and target sample of the report to be generated. The data source information includes at least a list of data source indicators. The recommended chapter slot template determination module is used to match the target example with a preset knowledge base to obtain a recommended chapter slot template. The knowledge base is a collection of historically retained chapter slot templates. The chapter slot template includes at least a list of indicator slots and an evaluative description slot. The overlap calculation module is used to calculate the overlap between the recommended chapter slot template and the data source information; The first correction module is used to perform slot correction on the recommended chapter slot template and dynamically generate the target chapter slot template when there is a high degree of overlap between the recommended chapter slot template and the data source information. The second correction module is used to input the data source information and the target sample into the large language model to obtain the target chapter slot template when the candidate chapter slot template and the data source information have a low degree of overlap. The report generation module is used to fill the data source information into the target chapter slot template to obtain the generated report.
[0016] Using the above technical solution, the dynamic template adaptive report generation method and apparatus based on a large model described in this paper determines the data source information and target sample of the report to be generated. The data source information includes at least a list of data source indicators. Based on the target sample and a preset knowledge base, a recommended chapter slot template is obtained. The knowledge base is a set of historically retained chapter slot templates, and each chapter slot template includes at least a list of indicator slots and an evaluative description slot. The overlap between the recommended chapter slot template and the data source information is calculated. When the overlap between the recommended chapter slot template and the data source information is high, the... The recommended chapter slot template undergoes slot correction to dynamically generate a target chapter slot template. When the candidate chapter slot template has low overlap with the data source information, the data source information and the target example are input into a large language model to obtain the target chapter slot template. The data source information is then filled into the target chapter slot template to generate the report. The method provided in this paper performs multi-layer semantic parsing of the text structure using a large model, dynamically recommends or generates content templates by chapter, and combines indicator slots and evaluative description slots to finally output the target report. The accuracy of the report requirements is ensured by using both indicator and evaluative description slots. To make the above and other objects, features and advantages of this document more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments or prior art described herein, the accompanying drawings used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this article. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1This document illustrates the steps of a dynamic template adaptive report generation method based on a large model, as provided in this embodiment. Figure 2 A flowchart illustrating the method provided in the embodiments of this article is shown; Figure 3 A schematic diagram of the target sample in the embodiments of this article is shown; Figure 4 This document illustrates a schematic diagram of the target sample analysis in an embodiment of the invention. Figure 5 A schematic diagram of the target chapter slot template in the embodiments of this article is shown; Figure 6 A schematic diagram of the final report in the embodiments described herein is shown; Figure 7 This document illustrates a schematic diagram of the framework of a dynamic template adaptive report generation device based on a large model, as provided in an embodiment of this paper. Figure 8 A schematic diagram of the framework of the computer device provided in the embodiments of this article is shown. Detailed Implementation
[0019] The technical solutions in the embodiments described below will be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments described herein, and not all of the embodiments. Based on the embodiments described herein, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this document.
[0020] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings herein are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, apparatus, product, or device that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0021] The technical terms used in the text are explained below: Traditional meaning of slot: extracting the values of explicitly defined attributes (slot types) of a given entity (query) from a large corpus (slot fillers).
[0022] Indicator slot: A numerical parameterized dynamic placeholder used to replace the indicator value when generating reports later.
[0023] Evaluation description slot: A text-based, parameterized, dynamic placeholder used to replace the evaluation description generated by the large model when generating subsequent reports.
[0024] Among them, the indicator slots basically meet the characteristics of traditional slots, while the evaluative descriptions expand the concept of slots. The definition value of the evaluative description is not a fixed mapping value, but a dynamic value based on the context.
[0025] Traditional report generation relies on predefined templates to reduce repetitive work, but in highly constrained professional scenarios (such as financial analysis and investment reports), it still faces pain points such as high labor costs and slow response times. While large models can directly generate basic text, they struggle to achieve in-depth reasoning and dynamic logical arrangement, resulting in a triple bottleneck in the accuracy, depth, and timeliness of highly professional reports that urgently needs to be overcome.
[0026] To address the aforementioned issues, this paper presents a dynamic template-based adaptive report generation method based on a large model, which can improve the efficiency of report generation. Figure 1 This document illustrates the steps of a dynamic template adaptive report generation method based on a large model, as provided in the embodiments. While this specification provides the operational steps described in the embodiments or flowcharts, more or fewer steps may be included based on conventional or non-creative methods. The order of steps listed in the embodiments is merely one possible execution order among many and does not represent the only possible order. In actual system or device products, the methods shown in the embodiments or accompanying drawings can be executed sequentially or in parallel. Specifically, as shown... Figure 1 and Figure 2 As shown, the method may include: S101: Determine the data source information and target sample of the report to be generated, wherein the data source information includes at least a list of data source indicators; S102: Match the target example with the preset knowledge base to obtain a recommended chapter slot template. The knowledge base is a collection of historically retained chapter slot templates. The chapter slot template includes at least an indicator slot list and an evaluative description slot. S103: Calculate the overlap between the recommended chapter slot template and the data source information; S104: When there is a high degree of overlap between the recommended chapter slot template and the data source information, the recommended chapter slot template is corrected to dynamically generate the target chapter slot template. S105: When the candidate chapter slot template and the data source information have a low degree of overlap, the data source information and the target sample are input into the large language model to obtain the target chapter slot template; S106: Fill the data source information into the target chapter slot template to obtain the generated report.
[0027] This specification can be understood as follows: based on the target example of the report to be generated, the corresponding recommended chapter slot template is determined so that the values in the data source can be automatically inserted into the corresponding slots quickly. At the same time, the compatibility between the recommended chapter slot template and the data source is also taken into account. Thus, the slot template can be dynamically adjusted using a large language model, thereby changing the inherent problems of traditional fixed templates, improving the efficiency and reliability of report generation, and reducing development costs.
[0028] The target sample can be a template for the report to be generated, including the composition of the chapters and the main content of the report output. This makes it easier to combine the data source information to output a report similar to the target sample. For example, sample file D serves as the target sample for the user to generate report d. That is, the final report d can be generated based on the chapters of sample D and the data source information of the report to be generated.
[0029] Therefore, after determining the target sample, the following is also included: The target example is parsed using a large language model to determine its chapter structure; Generate a content summary for each chapter to obtain the chapter summary for each chapter; Based on the chapter structure and the chapter summary corresponding to each chapter, chapter groups and chapter summary groups are obtained.
[0030] This step can be understood as a preliminary step in generating the entire report, which involves parsing the target sample to obtain its document structure, facilitating subsequent automatic matching and numerical filling.
[0031] For example, such as Figure 3 As shown, this is a portion of the target sample content. The target sample file is parsed using a large model to extract its document structure and determine its chapter structure, such as first-level chapters like abstract and overview. Of course, within each first-level chapter structure, secondary chapter structures, such as second- and third-level chapter structures, can be identified, allowing for the acquisition of its complete document structure. This facilitates accurate data filling in subsequent steps. Figure 4As shown, a chapter group can be represented as C∈{C1、C2……Cn}, where Cn represents the nth chapter. For each chapter, a content summary is generated to obtain the chapter name and chapter summary group ND∈{N1D1、N2D2、……、NnDn}, where NnDn represents the chapter name of the Nth chapter and the corresponding chapter summary D.
[0032] The data source information can be represented as a list of data source indicators, denoted as L∈{L1,L2……Ln}, where Ln represents the value corresponding to the nth indicator name.
[0033] The knowledge base is a collection of historical chapter slot templates, which are pre-stored by users and the corresponding chapter slot templates when generating reports in the past. By setting up the knowledge base, historical slot templates can be reused, and overlapping content can be directly used, thereby improving the efficiency of report generation.
[0034] In this embodiment of the specification, a recommended chapter slot template is obtained by matching the target example with a preset knowledge base, including: Obtain the template vector of each chapter slot template in the knowledge base; Extract the sample vector of the target sample; Calculate the similarity between the sample vector and the template vector of each chapter slot template; Recommended chapter slot templates are determined based on the similarity between the sample vectors and the template vectors of each chapter slot template.
[0035] In other words, all chapter slot templates in knowledge base K have undergone vector extraction, which can be obtained through a pre-trained semantic coding model (such as Sentence-BERT) to form a vector library. Each vector in the vector library has a one-to-one mapping relationship with a chapter slot template. In this way, when performing similarity calculation, the corresponding chapter slot template can be quickly located. Similarity calculation can be performed using similarity calculation methods such as cosine similarity, Euclidean distance, or Mann distance. The specific formula used is set according to the actual situation. Furthermore, when the knowledge base is large, an approximate nearest neighbor index can be constructed through FAISS to accelerate the matching process and improve matching efficiency.
[0036] In one embodiment of this specification, determining a recommended chapter slot template based on the similarity between the sample vector and the template vector of each chapter slot template includes: The chapter slot template corresponding to the template vector with the highest similarity is determined as the recommended chapter slot template, or The chapter slot templates corresponding to template vectors with similarity exceeding a preset threshold are identified as recommended chapter slot templates.
[0037] In other words, a recommended chapter slot template can be selected, such as the chapter slot template with the highest similarity. This ensures a higher degree of matching between the recommended chapter slot template and the target sample, resulting in better matching during subsequent numerical filling and correction, and reducing the number of manual interventions. Of course, in some other embodiments, multiple recommended chapter slot templates can be recommended to facilitate dynamic adjustment of the correction slot template based on the data source information. A preset threshold can be set to ensure that the recommended chapter slot templates are effective, enabling efficient automatic report generation with a high degree of matching.
[0038] For example, a pre-configured AI matching model is used for similarity calculation and filtering: Al-Dev>#Start searching for approximate slot templates… #Four similar templates found, re-sorting and filtering in progress… # Get template, approximate branch 0.97351342 Chapter slot templates should include at least a list of indicator slots and evaluative description slots, and can be matched in the following ways: AI-Dev> Discover the list of indicator slots: ["A. Banker's Acceptance Bill Balance", "A. Documentary Credit Balance within One Year", "2.2.A. Documentary Credit Balance over One Year", "3.A. Guarantee Balance", "3.1.A. Financing Guarantee Balance", "3.2.A. Non-Financing Guarantee Balance"], and discover the list of descriptive slots ["Increase / Decrease Description" "Increase / Decrease Description"].
[0039] In this embodiment of the specification, calculating the overlap between the recommended chapter slot template and the data source information includes: The overlap between the indicator slot list in the recommended chapter slot template and the data source indicator list in the data source information is calculated. The overlap includes at least the number of indicators that overlap between the indicator slot list and the data source indicator list.
[0040] This can be understood as follows: after determining the recommended chapter slot template, it is also necessary to calculate the overlap between the data source information and the recommended chapter slot template to determine the degree of matching between the recommended chapter slot template and the data source. This allows for adjustments and corrections to the recommended chapter slot template, ensuring that data can be automatically filled, achieving fully automated dynamic processing, reducing human intervention, and improving the efficiency and reliability of report generation.
[0041] For example, the slot overlap determination process can be evaluated by the similarity of indicator slots. The indicator slot list l∈{l1, l2……ln} is compared with the data source indicator list group L∈{L1, L2……Ln} from the previous step to determine the number of overlapping items, s. For example, the data source indicator list can be: L∈["A Acceptance Bills_Balance","A Documentary Credit Balance within One Year","2.2.A Documentary Credit Balance over One Year"","3.A Guarantee Balance","3.1.A Financing Guarantee Balance","3.2.A Non-Financing Guarantee Balance"], while the recommended chapter slot template M... The indicator slot list l∈["A Acceptance Bills_Balance","A Documentary Credit Balance within One Year","2.2.A Documentary Credit Balance over One Year","3.A Guarantee Balance","All Balances","3.2.A Non-Financing Guarantee Balance",""] is judged by the overlap calculation rules, and 5 overlapping items are obtained. The difference indicator slot Diff is "All Balances".
[0042] In the embodiments described in this specification, the method further includes: When the number of indicators in the data source indicator list is not less than a preset number, and the ratio of the number of overlapping indicators to the number of indicators in the indicator slot list exceeds a preset ratio, it is judged as a high degree of overlap; or If the number of indicators in the data source indicator list is lower than the preset number, and the number of overlapping indicators is the same as the number of indicators in the indicator slot list, then it is judged as high overlap. All cases except those with high overlap are judged as low overlap.
[0043] In other words, two sets of high overlap evaluation rules are set according to the number of indicators in the data source indicator list to fully identify the utilization of the recommended chapter slot template, and to avoid excessive modification and correction, thereby causing unnecessary waste of resources.
[0044] For example, the first judgment method is: when the number of data source indicator list L is greater than or equal to a indicators, s / l is greater than b%, which is judged as highly overlapping. The non-overlapping slots are judged as differential indicator slots, and the differential indicator slots Diff∈{Diff1, Diff2……Diffn}. The second method of judgment: When the number of data source indicator lists L is less than a, s=l, and it is judged as highly overlapping. The non-overlapping slots are judged as differential indicator slots, and the differential indicator slots Diff∈{Diff1, Diff2……Diffn}; For example, if we set 'a' to 30, the number of indicator slots 'l' in the recommended chapter slot template is 20, and 'b' is 50, then when the number of data source indicator list 'L' is 50, we can use the first judgment method to calculate the overlap rate and find that there are 15 overlapping items 's'. At this time, 's / l' = 15 / 20 = 75%, so 's / l' > 50%. Therefore, we can conclude that the recommended chapter slot template and the data source indicator list have a high degree of overlap, and the utilization rate of the recommended chapter slot template is relatively high, so it can be used.
[0045] When processing recommended chapter slot templates with high overlap, only the difference index slots need to be corrected, specifically: When there is a high degree of overlap between the recommended chapter slot template and the data source information, slot correction is performed on the recommended chapter slot template to dynamically generate the target chapter slot template, including: Based on the overlap between the indicator slot list in the recommended chapter slot template and the data source indicator list in the data source information, the overlapping indicator slots and the differential indicator slots are determined. Based on the position of the difference indicator slot in the indicator slot list, determine the associated text of the difference indicator slot; The associated text and the data source indicator list are input into the large language model to obtain the recommended indicator slots for the differences in the data source indicator list; Based on the overlapping indicator slots and the recommended indicator slots, the recommended chapter slot template is corrected to dynamically generate the target chapter slot template.
[0046] In other words, for recommended chapter slot templates with high overlap, most of the indicator slots can be used directly. Only the discrepancy indicator slots need to be corrected. These discrepancy indicator slots should be understood as slots in the recommended chapter slot template where the indicator slots do not match the data source indicator list. The associated text can be the text between the discrepancy indicator slot and the previous slot. By leveraging the semantic analysis capabilities of the large model and combining it with the data source information that does not match the data source indicator list, the discrepancy indicator slots can be dynamically corrected to obtain a template that fully matches the data source indicator list. This improves the reliability of the template and the efficiency of subsequent report generation.
[0047] For example, the text between the previous slot l(n-1) and the next slot l(n+1) of the slot ln containing the difference indicator slot Diffn, along with the data source indicator list L∈{L1,L2……Ln}, is input into the large model. Relying on the capabilities of the large model, the difference indicator slots are re-recommended in L, the indicator slots are corrected, and the chapter slot template m is dynamically generated. For example, template correction is performed based on existing indicators. The text before and after the difference indicator slot Diff is input into the large model, and selection is made based on existing indicators L. The large model corrects "various balances" to "3.1.A Financing Guarantee Balance" based on semantics. The correction process is as follows: AI-Dev > Difference Slot Judgment: Difference Value 1 Obtain the difference text: The overall balance of guarantee business is 40.33 billion yuan. The balance of financing guarantees is the input indicator for comparison. The indicator "3.1.A Financing Guarantees_Balance" is not matched. The historical indicator "Balance of Various Items" LLM output slot matching result: {"result":"3.1.A Financing Guarantees_Balance"} Fill the slots according to the recommended chapter slot template, replace the slots with the corresponding indicator names, and display them on the page as follows: Figure 4 The image shown is a portion of the corrected recommended chapter slot template.
[0048] In this embodiment of the specification, when there is a low degree of overlap between the candidate chapter slot template and the data source information, the data source information and the target sample are input into the large language model to obtain the target chapter slot template, including: Input the chapter group and chapter summary group of the target example, as well as the list of data source indicators, into the large language model to obtain all recommendation indicator slots; Based on all the recommended indicator slots, the recommended chapter slot template is corrected to dynamically generate the target chapter slot template.
[0049] In other words, when there is a low overlap in indicator slots, the recommended chapter slot template is not very useful. Therefore, it is necessary to dynamically generate new chapter slot templates. For example, based on the chapter name and chapter summary ND, the data source indicator list L, and relying on the large language model capabilities, all indicator slots in L can be recommended again, and chapter slot template m can be dynamically generated.
[0050] For example, if the input metric for this report is L∈["Credit_Agreement Balance","Credit_Other Guarantee Balance"], and the template contains l∈["Various Loans_Credit Loans","Credit Loans_Normal","Credit Loans_Non-Performing","Normal Credit Loans_Normal","Normal Credit Loans_Special Attention"], none of them overlap, so the overlap is 0.0. The overlap of the other two historical templates is also below the threshold. Therefore, the large model capability is directly called to combine the metric to generate the target chapter slot template.
[0051] In another embodiment of this specification, after obtaining the corrected target chapter slot template, the target chapter slot template can also be stored in the knowledge base K to update and improve the number of templates in the knowledge base.
[0052] In this embodiment of the specification, the data source information is filled into the target chapter slot template to obtain the generated report, including: Based on the correspondence between the indicator slots in the target chapter slot template and the data source indicator list, the values in the data source indicator list are filled into the corresponding indicator slots. Based on the target chapter slot template after filling in the values, the evaluative description slots in the target chapter slot template are filled using the large language model to obtain the generated report.
[0053] Specifically, based on the target chapter slot template m, data is retrieved from its indicator slot ln, and the corresponding indicator values from the data source are filled into the indicator slot ln. Based on the target chapter slot template m and the slot ln after being filled with values, an evaluative description is generated for its evaluative slot comm, such as... Figure 6 The image shown is an example of the final report.
[0054] The method for generating dynamic report templates using large model technology provided in the embodiments of this specification has the following main advantages compared with the prior art: 1. Flexibility: A large model is used to deeply participate in the writing of the text itself. A generative solution is adopted in the evaluative description slots to avoid rigid terminology. The original fixed templates that had to be developed in advance are now dynamically generated. At the same time, the accuracy of the report requirements is ensured through both indicator-based and evaluative description slots.
[0055] 2. Accuracy: By mapping data to indicator slots, the uncertainty caused by simply using large-scale probabilistic models is avoided. Instead, a local slicing approach by chapter is adopted. This avoids the uncertainty caused by large-scale modifications and preserves these slices in the knowledge base for subsequent recommendations, thereby achieving the accumulation of knowledge generated in the report.
[0056] 3. Scalability: All slots can be visualized, and manual adjustments and interventions can be made at any time. At the same time, large models can also perform local slicing corrections.
[0057] Based on the methods provided above, this specification also provides a dynamic template adaptive report generation device based on a large model, such as... Figure 7 As shown, the device includes: The basic data determination module 710 is used to determine the data source information and target sample of the report to be generated, wherein the data source information includes at least a list of data source indicators; The recommended chapter slot template determination module 720 is used to match the target example with a preset knowledge base to obtain a recommended chapter slot template. The knowledge base is a collection of historically retained chapter slot templates. The chapter slot template includes at least a list of indicator slots and an evaluative description slot. The overlap calculation module 730 is used to calculate the overlap between the recommended chapter slot template and the data source information; The first correction module 740 is used to perform slot correction on the recommended chapter slot template and dynamically generate the target chapter slot template when there is a high degree of overlap between the recommended chapter slot template and the data source information. The second correction module 750 is used to input the data source information and the target sample into the large language model to obtain the target chapter slot template when the candidate chapter slot template and the data source information have a low degree of overlap. The report generation module 760 is used to fill the data source information into the target chapter slot template to obtain the generated report.
[0058] This means that the apparatus provided in the embodiments of this specification is used to solve the problem that traditional report generation lacks logical judgment ability due to its reliance on fixed templates. It performs multi-layered semantic analysis of the text structure through a large model, dynamically recommends or generates content templates by chapter, and combines indicator slots and evaluative description slots to finally output the target report.
[0059] This embodiment provides a computer device, the internal structure of which can be shown in the following diagram. Figure 8 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used for communication with external terminals via a network connection.
[0060] Those skilled in the art will understand that Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0061] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0062] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0063] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0064] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile 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. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0065] It should also be understood that, in the embodiments herein, the term "and / or" is merely a description of the relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following associated objects have an "or" relationship.
[0066] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this document.
[0067] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0068] In the embodiments provided herein, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the couplings or direct couplings or communication connections shown or discussed may be indirect couplings or communication connections through some interfaces, devices, or units, or they may be electrical, mechanical, or other forms of connection.
[0069] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the embodiments described herein, depending on actual needs.
[0070] This document uses specific embodiments to illustrate the principles and implementation methods of this document. The descriptions of the embodiments above are only for the purpose of helping to understand the methods and core ideas of this document. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this document. Therefore, the content of this specification should not be construed as a limitation of this document.
Claims
1. A dynamic template adaptive report generation method based on a large model, characterized in that, The method includes: Determine the data source information and target sample for the report to be generated, wherein the data source information includes at least a list of data source indicators; Based on the target example and the preset knowledge base, a recommended chapter slot template is obtained by matching. The knowledge base is a collection of historically retained chapter slot templates. The chapter slot template includes at least a list of indicator slots and an evaluative description slot. Calculate the overlap between the recommended chapter slot template and the data source information; When there is a high degree of overlap between the recommended chapter slot template and the data source information, the recommended chapter slot template is corrected to dynamically generate the target chapter slot template. When there is a low degree of overlap between the candidate chapter slot template and the data source information, the data source information and the target sample are input into the large language model to obtain the target chapter slot template. The data source information is filled into the target chapter slot template to obtain the generated report.
2. The method for generating adaptive reports based on dynamic templates using a large model according to claim 1, characterized in that, After determining the target sample, the following is also included: The target example is parsed using a large language model to determine its chapter structure; Generate a content summary for each chapter to obtain the chapter summary for each chapter; Based on the chapter structure and the chapter summary corresponding to each chapter, chapter groups and chapter summary groups are obtained.
3. The method for dynamic template adaptive report generation based on a large model according to claim 1, characterized in that, Based on the target example and the preset knowledge base, a recommended chapter slot template is obtained, including: Obtain the template vector of each chapter slot template in the knowledge base; Extract the sample vector of the target sample; Calculate the similarity between the sample vector and the template vector of each chapter slot template; Recommended chapter slot templates are determined based on the similarity between the sample vectors and the template vectors of each chapter slot template.
4. The method for generating adaptive reports based on dynamic templates using a large model according to claim 3, characterized in that, Based on the similarity between the sample vector and the template vector of each chapter slot template, a recommended chapter slot template is determined, including: The chapter slot template corresponding to the template vector with the highest similarity is determined as the recommended chapter slot template, or The chapter slot templates corresponding to template vectors with similarity exceeding a preset threshold are identified as recommended chapter slot templates.
5. The method for generating adaptive reports based on dynamic templates using a large model according to claim 1, characterized in that, Calculating the overlap between the recommended chapter slot template and the data source information includes: The overlap between the indicator slot list in the recommended chapter slot template and the data source indicator list in the data source information is calculated. The overlap includes at least the number of indicators that overlap between the indicator slot list and the data source indicator list.
6. The method for dynamic template adaptive report generation based on a large model according to claim 5, characterized in that, The method further includes: When the number of indicators in the data source indicator list is not less than a preset number, and the ratio of the number of overlapping indicators to the number of indicators in the indicator slot list exceeds a preset ratio, it is judged as a high degree of overlap; or If the number of indicators in the data source indicator list is lower than the preset number, and the number of overlapping indicators is the same as the number of indicators in the indicator slot list, then it is judged as high overlap. All cases except those with high overlap are judged as low overlap.
7. The method for generating adaptive reports based on dynamic templates using a large model according to claim 5, characterized in that, When there is a high degree of overlap between the recommended chapter slot template and the data source information, slot correction is performed on the recommended chapter slot template to dynamically generate the target chapter slot template, including: Based on the overlap between the indicator slot list in the recommended chapter slot template and the data source indicator list in the data source information, the overlapping indicator slots and the differential indicator slots are determined. Based on the position of the difference indicator slot in the indicator slot list, determine the associated text of the difference indicator slot; The associated text and the data source indicator list are input into the large language model to obtain the recommended indicator slots for the differences in the data source indicator list; Based on the overlapping indicator slots and the recommended indicator slots, the recommended chapter slot template is corrected to dynamically generate the target chapter slot template.
8. The method for generating adaptive reports based on dynamic templates using a large model according to claim 5, characterized in that, When the candidate chapter slot template has low overlap with the data source information, the data source information and the target sample are input into the large language model to obtain the target chapter slot template, including: Input the chapter group and chapter summary group of the target example, as well as the list of data source indicators, into the large language model to obtain all recommendation indicator slots; Based on all the recommended indicator slots, the recommended chapter slot template is corrected to dynamically generate the target chapter slot template.
9. The method for generating adaptive reports based on dynamic templates using a large model according to claim 1, characterized in that, The data source information is filled into the target chapter slot template to obtain the generated report, which includes: Based on the correspondence between the indicator slots in the target chapter slot template and the data source indicator list, the values in the data source indicator list are filled into the corresponding indicator slots. Based on the target chapter slot template after filling in the values, the evaluative description slots in the target chapter slot template are filled using the large language model to obtain the generated report.
10. A dynamic template adaptive report generation device based on a large model, characterized in that, The device includes: The basic data determination module is used to determine the data source information and target sample of the report to be generated. The data source information includes at least a list of data source indicators. The recommended chapter slot template determination module is used to match the target example with a preset knowledge base to obtain a recommended chapter slot template. The knowledge base is a collection of historically retained chapter slot templates. The chapter slot template includes at least a list of indicator slots and an evaluative description slot. The overlap calculation module is used to calculate the overlap between the recommended chapter slot template and the data source information; The first correction module is used to perform slot correction on the recommended chapter slot template and dynamically generate the target chapter slot template when there is a high degree of overlap between the recommended chapter slot template and the data source information. The second correction module is used to input the data source information and the target sample into the large language model to obtain the target chapter slot template when the candidate chapter slot template and the data source information have a low degree of overlap. The report generation module is used to fill the data source information into the target chapter slot template to obtain the generated report.