Report compiling style self-adaptive migration method and system based on large language model

By constructing a fine-tuned large language model with professional field reasoning and analysis style, it solves the problem that existing technology is difficult to generate reports that meet professional field standards, improves the professionalism and logic of reports, and meets users' needs for personalized customization. .

CN119337836APending Publication Date: 2025-01-21STATE GRID HUBEI ELECTRIC POWER RES INST +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411295165.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-16
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

Existing report generation techniques are difficult to generate reports that meet the standards of professional fields, and lack professionalism and logic, especially in comprehensive analysis reports across disciplines or across fields.

Method used

Adopt the adaptive migration method based on a large -language model, adaptive migration method, and the fine -tuning large language model with professional field reasoning and analysis style by constructing a large -adjustment and analysis style of professional fields. Generate charts and eventually form a professional report.

Benefits of technology

It improves the model's understanding of specific industry terminology, analysis methods and professional requirements, improves the usability, accuracy and timeliness of data analysis, and enhances the degree of personalization and user experience of reports.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119337836A_ABST
    Figure CN119337836A_ABST
Patent Text Reader

Abstract

The invention provides a report compiling style self-adaptive migration method and system based on a large language model, and the method comprises the steps: constructing a fine-tuning large language model with a professional field inference analysis style according to a collected professional field analysis report; extracting and splitting local chapter themes according to user requirements by utilizing a fine-tuning large language model, and respectively generating data query and analysis schemes conforming to professional fields; the local chapter theme and the data table structure information serve as contexts to be transmitted to the fine-tuning large language model, and an analysis report text is generated; packaging a specific data processing flow, constructing a toolkit containing a data processing tool, and generating workflow data by using the toolkit; analyzing local chapter themes by adopting a fine-tuning large language model, extracting key features, matching corresponding drawing functions and workflow data, and automatically generating a chart; and splicing the analysis report text with the chart to form a final report. According to the invention, the generated report can better conform to the standard of the professional field.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of artificial intelligence, and in particular relates to a report compilation style adaptive migration method and system based on a large language model. Background Art

[0002] There are two main methods of report generation at present: one is to generate fixed-format reports from fixed-structure data sources, and the other is to generate reports directly from data information and user requirements based on natural language processing (NLP) technology. Although these two methods meet the needs of report generation to a certain extent, they each have some shortcomings.

[0003] The method of generating fixed-format reports from fixed-structure data sources relies on predefined templates and fixed data structures. For business scenarios with rapidly changing requirements, it is difficult to quickly adapt to new requirements. Once the template is set, any new requirements or changes in data structure require the template to be redesigned and adjusted, resulting in slow response and poor adaptability. When the data source structure changes, the template may need to be modified a lot, and the maintenance cost is high. This high maintenance cost not only increases the complexity of the system, but may also cause errors during the adjustment process, affecting the accuracy and reliability of the report. In addition, due to the standardized design of the template, the generated reports are often in a fixed format, which is difficult to meet the user's needs for personalized and customized reports. Users may need to analyze the same data from different angles, which requires the preparation of different processing logic and templates, increasing the complexity and development cost of the system. This method cannot flexibly respond to the personalized needs of users, and the generated reports lack diversity and pertinence, making it difficult to provide deeply customized analysis results.

[0004] Based on natural language processing (NLP) technology, the method of directly generating reports from data information and user requirements is limited by the model's own capabilities and has limited performance in generating analysis in a specific language style: general models use general corpus during training and lack an in-depth understanding of the unique language style and terminology in a specific field. The generated reports often lack professionalism and understanding of some conventional habits in a specific field, which makes it difficult for the generated reports to meet the requirements of the field in terms of wording, expression, and content depth. The ability to analyze according to specific ideas is also limited. Existing report generation technologies usually rely on preset templates and rules, lacking flexibility and intelligence. When faced with complex analysis tasks, they find it difficult to combine different data sources and multiple analysis methods for comprehensive reasoning and judgment, resulting in the generated reports lacking logic and reasoning depth. This deficiency is particularly evident in comprehensive analysis reports that require cross-disciplinary or cross-field analysis, affecting the overall quality and practicality of the reports. Summary of the invention

[0005] The technical problem to be solved by the present invention is to provide a method and system for adaptively migrating report compilation styles based on a large language model, so that the generated reports are more in line with the standards of the professional field.

[0006] The technical solution adopted by the present invention to solve the above technical problems is: a report writing style adaptive migration method based on a large language model, comprising:

[0007] Based on the collected professional field analysis reports, a fine-tuned large language model with professional field reasoning and analysis style is constructed;

[0008] Utilizing the fine-tuned large language model, extract and split local chapter topics according to user needs, and generate data query and analysis solutions that meet professional fields respectively;

[0009] Passing the local chapter topic and data table structure information as context to the fine-tuned large language model to generate analysis report text, wherein the data table structure information is obtained using the data query and analysis scheme;

[0010] Encapsulate specific data processing flows, construct toolkits containing data processing tools, and use the toolkits to generate workflow data;

[0011] The fine-tuned large language model is used to analyze the local chapter topics, extract key features, match corresponding drawing functions and the workflow data, and automatically generate charts;

[0012] The analysis report text is combined with the chart to form a final report.

[0013] Furthermore, the construction of a fine-tuned large language model with a professional field reasoning and analysis style based on the collected professional field analysis reports specifically includes:

[0014] Extract professional knowledge and analysis style from the professional field analysis reports, build a knowledge graph containing vertical domain knowledge and indicators, and a text dataset containing professional report analysis process and reasoning analysis style information;

[0015] Clean and normalize the input and output text data in the text data set, annotate the report analysis process, and form a processed data set;

[0016] A low-rank quantized QLoRA model is constructed based on the large oracle model, and the QLoRA model is efficiently fine-tuned using the processed data set to obtain the fine-tuned large language model.

[0017] Furthermore, the use of the fine-tuned large language model to extract and split local chapter topics according to user needs, and generate data query and analysis solutions that meet professional fields, specifically including:

[0018] Utilizing the fine-tuned large language model, extracting and logically splitting multiple local chapter topics from user needs;

[0019] According to the topic of each local chapter, based on the understanding ability of the fine-tuned large prediction model, the corresponding indicator information is automatically extracted from the knowledge graph to generate data query and analysis solutions that meet the needs of the field;

[0020] The knowledge graph is a pre-built analysis indicator library covering a wide range of professional fields and a graph of related knowledge.

[0021] Furthermore, the local chapter theme and data table structure information are passed as context to the fine-tuned large language model to generate an analysis report text, specifically including:

[0022] Passing the local chapter topic and data table structure information as context to the fine-tuned large language model, using the fine-tuned large language model to generate SQL statements to query the required raw data from the data source;

[0023] Passing the callable data processing tools and raw data to the fine-tuned large language model for reasoning, generating workflow data, and extracting required data features;

[0024] According to the local chapter theme, the data features are analyzed according to the analysis style of the original report to generate an analysis report text.

[0025] Furthermore, the specific data processing flow is encapsulated to construct a toolkit containing data processing tools, which specifically includes:

[0026] According to the characteristics of professional field report processing, the Pandas data structure is used to encapsulate the specific data processing process, obtain data processing tools, and construct a toolkit containing data processing tools;

[0027] Generate toolkit documentation, which is called to generate workflow data when fine-tuning large language model interactions.

[0028] Furthermore, the data processing tools include simple calculation tools, classification and labeling tools, format conversion tools and data sorting tools.

[0029] Furthermore, the fine-tuned large language model is used to analyze the local chapter topics, extract key features, match corresponding drawing functions and the workflow data, and automatically generate charts, specifically including:

[0030] The fine-tuned large language model is used to analyze the local chapter topic, extract key features, match the corresponding drawing function in the drawing function library through the key features, and select a suitable chart type;

[0031] Passing the callable data processing tool information and the data structure to be processed to the fine-tuned large language model for reasoning, generating workflow data, and processing the workflow data to obtain the data structure required by the drawing function;

[0032] Use the generated workflow data to automatically generate a chart based on the selected chart type.

[0033] Furthermore, the key features include analysis subjects, screening conditions and analysis dimensions.

[0034] Furthermore, it also includes: regularly or irregularly collecting the professional field analysis reports and constructing and optimizing the fine-tuned large language model.

[0035] A report writing style adaptive transfer system based on a large language model, comprising:

[0036] A fine-tuned large language model construction module is used to build a fine-tuned large language model with professional field reasoning analysis style based on the collected professional field analysis reports;

[0037] An extraction and splitting module is used to use the fine-tuned large language model to extract and split local chapter topics according to user needs, and generate data query and analysis solutions that meet professional fields respectively;

[0038] An analysis report text generation module, used to pass the local chapter theme and data table structure information as context to the fine-tuned large language model to generate an analysis report text, wherein the data table structure information is obtained through the data query and analysis scheme;

[0039] A workflow data generation module is used to encapsulate a specific data processing flow, construct a toolkit containing data processing tools, and use the toolkit to generate workflow data;

[0040] A chart generation module, for analyzing the local chapter topics using the fine-tuned large language model, extracting key features, matching corresponding drawing functions and the workflow data, and automatically generating charts;

[0041] A report generation module is used to combine the analysis report text with the chart to form a final report

[0042] The beneficial effects of the present invention are: by constructing a fine-tuned large language model with professional domain reasoning style, the model's understanding of specific industry terminology, analysis methods and professional requirements is improved; vertical domain experience is taken into account in data query and analysis plans, the availability, accuracy and timeliness of data analysis are improved, and user preferences are taken into account in the report generation process, improving user experience and the degree of personalized customization of reports. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 It is a schematic diagram of the principle of a report compilation style adaptive migration method based on a large language model according to an embodiment of the present invention.

[0044] Figure 2 is a schematic diagram of a tool kit according to an embodiment of the present invention;

[0045] Figure 3 It is a flow chart of calling a toolkit to generate workflow data according to an embodiment of the present invention. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention 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 invention and are not used to limit the present invention.

[0047] Glossary:

[0048] QloRA: A quantization-based language model fine-tuning technique, which is a quantization algorithm that uses quantization ideas to optimize LoRA.

[0049] RAG: Retrieval Augmented Generation, is a natural language processing method that combines information retrieval and text generation.

[0050] SQL: Structured Query Language.

[0051] Pandas: An open source Python data analysis library that provides high-performance, easy-to-use data structures and data analysis tools.

[0052] WorkFlow: Workflow.

[0053] The present invention provides a report writing style adaptive migration method based on a large language model, such as Figure 1 As shown, including:

[0054] S1. Based on the collected professional field analysis reports, a fine-tuned large language model with professional field reasoning style is constructed; specifically including:

[0055] 1.1. Extract professional knowledge and analysis style from the professional field analysis report, construct a knowledge graph containing vertical domain knowledge and indicators, and a text dataset containing professional report analysis process and reasoning analysis style information.

[0056] 1.2. Clean and normalize the input and output text data in the text dataset, annotate the report analysis process, and form a processed dataset.

[0057] 1.3. A low-rank quantized QLoRA model is constructed based on the large oracle model, and the QLoRA model is efficiently fine-tuned using the processed data set to obtain the fine-tuned large language model.

[0058] By introducing transfer learning technology and using processed data sets to efficiently fine-tune the large language model, the large language model can learn and master the analytical style and report structure of professional field reports. The model can quickly adapt to the generation of reports with different styles and reasoning ideas in specific fields. By fine-tuning or incrementally learning the large language model in related fields, the model's understanding of specific industry terms, analytical methods, and professional requirements can be improved, and the language style of professional field reports can be imitated to a certain extent, thereby improving the professionalism and logic of report generation.

[0059] S2. Using the fine-tuned large language model, extract and split local chapter topics according to user needs, and generate data query and analysis solutions that meet professional fields respectively; specifically including:

[0060] 2.1. Utilize the fine-tuned large language model to extract and logically split multiple local chapter topics from user needs. Considering the personalized needs and preferences of users, introduce recommendation system technology to generate report content that suits their preferences based on their historical feedback and behavior habits. Through personalized recommendations, improve user experience and the degree of personalized customization of reports, and increase user acceptance and frequency of use of automatically generated reports.

[0061] 2.2. According to the topic of each local chapter, based on the understanding ability of the fine-tuned large prediction model, the corresponding indicator information is automatically extracted from the knowledge graph to generate data query and analysis solutions that are suitable for this field.

[0062] The knowledge graph is a pre-built analysis indicator library covering a wide range of professional fields and a graph of related knowledge. The knowledge graph is used to construct key concepts and relationships in the field, assisting the model in a deeper semantic understanding and reasoning of professional content. With the support of the knowledge graph, the model can better grasp the logical structure of the report and the inherent connection between vertical domain concepts, and improve the coherence and logic of the generated report. When generating a report, it is possible to refer to key concepts and standardized indicators in the field, thereby improving the logic and professionalism of the report and the accuracy of the generated charts.

[0063] S3, passing the local chapter theme and data table structure information as context to the fine-tuned large language model to generate an analysis report text; specifically including:

[0064] 3.1. The local chapter topic and data table structure information are passed as context to the fine-tuned large language model, and the fine-tuned large language model is used to generate SQL statements to query the required original data from the data source; the data table structure information is obtained through RAG technology (using the data query and analysis solution).

[0065] SQL is a widely used query language in relational databases, and the process of converting natural language into SQL queries is considered a semantic parsing problem. Semantic parsing has a long history of research in the field of natural language processing (NLP), and aims to map natural language input into a specific structured query form. By generating SQL queries from natural language, users can directly query the database using everyday language, thereby more conveniently obtaining important business-related information. The fine-tuned large language model improves the efficiency and accuracy of vertical domain data queries and significantly reduces the technical threshold for users.

[0066] If the analysis dimension of a local chapter topic after splitting is the change of a variable over time, then the topic and the underlying data table structure are passed to the large language model. After the large language model generates the corresponding SQL query statement, it extracts Figure 3 The InputData shown contains three columns: ID, timestamp time, and specific variable value, which are used as raw data for subsequent data processing.

[0067] 3.2. Pass the callable data processing tools and raw data to the fine-tuned large language model for reasoning, generate workflow data, and extract required data features.

[0068] Introducing structured data analysis technology to automatically extract and analyze structured information from diverse data sources. By effectively analyzing structured data in the form of data tables, databases, APIs, etc., it provides richer and more accurate data support for report generation, enhancing the credibility and comprehensiveness of generated reports.

[0069] 3.3. According to the local chapter theme, the data features are analyzed in accordance with the analysis style of the original report to generate an analysis report text.

[0070] S4. Encapsulate a specific data processing flow and construct a toolkit, which includes data processing tools for generating workflow data; specifically, the toolkit includes:

[0071] 4.1. According to the characteristics of professional field report processing, use Pandas data structure to encapsulate specific data processing processes, obtain data processing tools, and construct a toolkit containing data processing tools, such as Figure 2 As shown, the data processing tools include simple calculation tools, classification and labeling tools, format conversion tools and data sorting tools.

[0072] 4.2. Generate toolkit documents, which are used to generate workflow data when fine-tuning large language model interactions, such as Figure 3 shown.

[0073] For specific data analysis processes, packaged data processing tools can interact with large models with higher stability and accuracy. Figure 3 The data flow prototype is a 96-point power data table in the power field. When the original InputData data is used directly, the number of rows in the data table is huge, which becomes a performance bottleneck in the subsequent data processing process. After using the vertical domain customized WorkFlow tool (transposing to a wide table, normalizing by row, etc.), it can significantly reduce the errors when the large language model calls the normalization and clustering algorithms, and significantly improve the algorithm processing speed.

[0074] S5, using the fine-tuned large language model to analyze the local chapter theme, extract features, match the corresponding drawing function and the workflow data, and automatically generate a chart; specifically including:

[0075] 5.1. Use the fine-tuned large language model to analyze the local chapter topics, extract key features, match corresponding functions in the drawing function library through the key features, and select appropriate chart types; the key features include analysis subjects, screening conditions and analysis dimensions.

[0076] 5.2. The callable data processing tool information and the data structure to be processed are passed to the fine-tuned large language model for reasoning, workflow data is generated, and the data structure required by the drawing function is obtained through processing.

[0077] 5.3. The large language model uses the processed workflow data to automatically call the selected chart type drawing function to intuitively display the data features to the user.

[0078] If Figure 3 After connecting ClusteredData and NormedData on id, select the chart type as line chart and call the corresponding drawing function. Different clustered_ids are assigned different colors to intuitively display the clustering results to the user.

[0079] S6. Combine the analysis report text and charts to form a final report.

[0080] By integrating multiple information forms such as text, images, and tables, we can use multimodal fusion technology to generate richer and more vivid report content. By combining information input from different modes, we can expand the model's ability to understand data and improve the comprehensiveness and visualization of report generation.

[0081] Furthermore, in order to optimize the large language model, the professional field analysis reports may be collected regularly or irregularly to construct and optimize the fine-tuned large language model.

[0082] As a second aspect of the present invention, the present invention further provides a report automatic generation system, comprising:

[0083] A fine-tuned large language model construction module is used to build a fine-tuned large language model with professional field reasoning analysis style based on the collected professional field analysis reports;

[0084] An extraction and splitting module is used to use the fine-tuned large language model to extract and split local chapter topics according to user needs, and generate data query and analysis solutions that meet professional fields respectively;

[0085] An analysis report text generation module, used to pass the local chapter theme and data table structure information as context to the fine-tuned large language model to generate an analysis report text, wherein the data table structure information is obtained through the data query and analysis scheme;

[0086] A workflow data generation module is used to encapsulate a specific data processing flow, construct a toolkit containing data processing tools, and use the toolkit to generate workflow data;

[0087] A chart generation module, for analyzing the local chapter topics using the fine-tuned large language model, extracting key features, matching corresponding drawing functions and the workflow data, and automatically generating charts;

[0088] The report generation module is used to combine the analysis report text with the chart to form a final report.

[0089] The present invention fine-tunes the large language model so that the model can grasp and apply the analysis style and chapter structure of a specific professional field. This includes in-depth study of field-specific terminology, expressions, and logical structures. Through this process, the generated report will be more in line with the standards of the professional field, with a high degree of professionalism and logic, and can meet the needs of users in different fields: a) The model can automatically identify and apply domain-specific language styles and terminology. b) The report reasoning and analysis structure conforms to the norms of the professional field, with clear logic and distinct levels. c) Enhance the adaptability and flexibility of the model in different professional fields and with diverse structured data.

[0090] For specific analysis topics, the present invention realizes efficient and accurate data analysis and chart generation by constructing automated data query and processing workflows: a) Automatically query and extract relevant data from information sources. b) Construct data processing workflows according to the analysis topics, including data cleaning, feature extraction and analysis. c) Generate charts corresponding to the analysis results to intuitively display data features. d) Perform feature reasoning and analysis based on the data processing results, and provide clear and accurate conclusions.

[0091] This highly automated professional report generation process not only ensures the efficiency and accuracy of data query and processing, and improves the professionalism of reasoning and analysis, but also includes accompanying charts to enhance the readability and persuasiveness of the report.

[0092] It should be understood that those skilled in the art can make improvements or changes based on the above description, and all these improvements and changes should fall within the scope of protection of the appended claims of the present invention.

Claims

1. A report writing style adaptive migration method based on a large language model, characterized in that: include: Based on the collected professional field analysis reports, a fine-tuned large language model with professional field reasoning and analysis style is constructed; Utilizing the fine-tuned large language model, extract and split local chapter topics according to user needs, and generate data query and analysis solutions that meet professional fields respectively; Passing the local chapter topic and data table structure information as context to the fine-tuned large language model to generate analysis report text, wherein the data table structure information is obtained using the data query and analysis scheme; Encapsulate specific data processing flows, construct toolkits containing data processing tools, and use the toolkits to generate workflow data; The fine-tuned large language model is used to analyze the local chapter topics, extract key features, match corresponding drawing functions and the workflow data, and automatically generate charts; The analysis report text is combined with the chart to form a final report.

2. The method for adaptively migrating report writing styles based on a large language model according to claim 1, characterized in that: The method of constructing a fine-tuned large language model with a professional field reasoning and analysis style based on the collected professional field analysis reports specifically includes: Extract professional knowledge and analysis style from the professional field analysis reports, build a knowledge graph containing vertical domain knowledge and indicators, and a text dataset containing professional report analysis process and reasoning analysis style information; Clean and normalize the input and output text data in the text data set, annotate the report analysis process, and form a processed data set; A low-rank quantized QLoRA model is constructed based on the large oracle model, and the QLoRA model is efficiently fine-tuned using the processed data set to obtain the fine-tuned large language model.

3. The method for adaptively migrating report writing styles based on a large language model according to claim 1, characterized in that: The method of using the fine-tuned large language model to extract and split local chapter topics according to user needs and generate data query and analysis solutions that meet professional fields, specifically includes: Utilizing the fine-tuned large language model, extracting and logically splitting multiple local chapter topics from user needs; According to the topic of each local chapter, based on the understanding ability of the fine-tuned large prediction model, the corresponding indicator information is automatically extracted from the knowledge graph to generate data query and analysis solutions that meet the needs of the field; The knowledge graph is a pre-built analysis indicator library covering a wide range of professional fields and a graph of related knowledge.

4. The method for adaptively transferring report writing style based on a large language model according to claim 1, characterized in that: The method of passing the local chapter theme and data table structure information as context to the fine-tuned large language model to generate an analysis report text specifically includes: Passing the local chapter topic and data table structure information as context to the fine-tuned large language model, using the fine-tuned large language model to generate SQL statements to query the required raw data from the data source; Passing the callable data processing tools and raw data to the fine-tuned large language model for reasoning, generating workflow data, and extracting required data features; According to the local chapter theme, the data features are analyzed according to the analysis style of the original report to generate an analysis report text.

5. The method for adaptively transferring report writing style based on a large language model according to claim 1, characterized in that: The specific data processing flow is encapsulated to construct a toolkit containing data processing tools, specifically including: According to the characteristics of professional field report processing, the Pandas data structure is used to encapsulate the specific data processing process, obtain data processing tools, and construct a toolkit containing data processing tools; Generate toolkit documentation, which is called to generate workflow data when fine-tuning large language model interactions.

6. The method for adaptively transferring report writing style based on a large language model according to claim 5, characterized in that: The data processing tools include simple calculation tools, classification and labeling tools, format conversion tools and data sorting tools.

7. The method for adaptively migrating report writing styles based on a large language model according to claim 1, characterized in that: The method of using the fine-tuned large language model to analyze the local chapter topics, extract key features, match the corresponding drawing functions and the workflow data, and automatically generate charts specifically includes: The fine-tuned large language model is used to analyze the local chapter topic, extract key features, match the corresponding drawing function in the drawing function library through the key features, and select a suitable chart type; Passing the callable data processing tool information and the data structure to be processed to the fine-tuned large language model for reasoning, generating workflow data, and processing the workflow data to obtain the data structure required by the drawing function; Use the generated workflow data to automatically generate a chart based on the selected chart type.

8. The method for adaptively transferring report writing style based on a large language model according to claim 7, characterized in that: The key features include analysis subject, screening conditions and analysis dimensions.

9. The method for adaptively transferring report writing style based on a large language model according to claim 1, characterized in that: Also includes: Collect the professional field analysis reports regularly or irregularly to build and optimize the fine-tuned large language model.

10. A report writing style adaptive migration system based on a large language model, characterized in that: include: A fine-tuned large language model construction module is used to build a fine-tuned large language model with professional field reasoning analysis style based on the collected professional field analysis reports; An extraction and splitting module is used to use the fine-tuned large language model to extract and split local chapter topics according to user needs, and generate data query and analysis solutions that meet professional fields respectively; An analysis report text generation module, used to pass the local chapter theme and data table structure information as context to the fine-tuned large language model to generate an analysis report text, wherein the data table structure information is obtained through the data query and analysis scheme; A workflow data generation module is used to encapsulate a specific data processing flow, construct a toolkit containing data processing tools, and use the toolkit to generate workflow data; A chart generation module, for analyzing the local chapter topics using the fine-tuned large language model, extracting key features, matching corresponding drawing functions and the workflow data, and automatically generating charts; The report generation module is used to combine the analysis report text with the chart to form a final report.