A Data Analysis Report Generation Method Based on a Large Language Model

By using a large language model to decompose and generate data analysis reports, the problem of relying on personal experience in existing technologies has been solved, achieving efficient and accurate report generation and improving the quality and credibility of the reports.

CN118626523BActive Publication Date: 2025-10-28MYCOS DATA CORP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410793717.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-19
Publication Date
2025-10-28
Estimated Expiration
2044-06-19

AI Technical Summary

Technical Problem

Current data analysis report production relies on personal experience, resulting in insufficient depth of analysis, breadth of information, and production efficiency, making it difficult to consistently and efficiently integrate domain knowledge and industry information.

Method used

By employing a large language model, the report structure is broken down into fragmented tasks, data is stored using structured tables, and prompt words are generated by combining natural language processing and vector search to correct logical errors and produce high-quality reports.

Benefits of technology

It enables the automated generation of data analysis reports, improving production efficiency and report quality, reducing human error, and enhancing the accuracy and credibility of the reports.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118626523B_ABST
    Figure CN118626523B_ABST
Patent Text Reader

Abstract

This invention discloses a data analysis report generation method based on a large language model, belonging to the field of data analysis technology. The method includes the following steps: breaking down the overall structure of the analysis report into several fragmented analysis tasks, and clarifying the data sources, data indicators, and various textual information to be analyzed within each task; storing all fragmented analysis tasks in a structured table format; storing the data required for this report in a temporary database and converting it all into tagged natural language text. This invention utilizes a large language model to automate the generation of data analysis reports, quickly understanding data content, identifying key information, and generating clearly structured and logically coherent text based on this information. This significantly improves report production efficiency. This efficient data analysis report generation method enables analysts to respond to business needs more quickly and improve work efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data analysis technology, specifically to a method for generating data analysis reports based on a large language model. Background Technology

[0002] In the process of creating data analysis reports in the same field, there are usually a lot of reusable analytical logic. When using these analytical logics to write reports, it is necessary to comprehensively consider multiple aspects such as the data structure, sample conditions, current policy information, and industry information. For example, when creating a report on the quality of talent training in universities, it is often necessary to comprehensively consider multi-dimensional information such as graduates, current students, regional economic conditions, and industry needs.

[0003] However, in existing data analysis report production techniques, the writing of textual analysis is often based on the report writer's personal experience, interpreting data, judging phenomena, and then summarizing. This approach places high demands on the writer's data analysis and industry insight capabilities. On the other hand, it fails to guarantee the depth of analysis, breadth of information retrieval, and production efficiency of the resulting report, hindering the reuse of knowledge systems in data analysis reports within the same field. Therefore, how to stably and efficiently integrate and analyze domain knowledge, various types of data, and industry information to form high-quality reports has become a major pain point in data analysis report writing. Summary of the Invention

[0004] The purpose of this invention is to provide a method for generating data analysis reports based on a large language model, so as to solve the problems mentioned in the background art.

[0005] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:

[0006] A method for generating data analysis reports based on a large language model includes the following steps:

[0007] S1. Break down the overall structure of the analysis report into several segmented analysis tasks, and clarify the data sources, data indicators, and various textual information that need to be analyzed in each segment; store all segmented analysis tasks in a structured table format.

[0008] S2. Store the data required for this report in a temporary database and convert it all into labeled natural language text;

[0009] S3. For each segmented analysis task, combine the analysis logic in the structured table with the relevant data expressed in natural language, and then use vector search to supplement and improve the prompt word template with relevant policy information and industry information to finally form a complete prompt word.

[0010] S4. Repeat the prompts for each fragment analysis task and call the large language model to merge and organize the generated text content into the main content framework of the analysis report.

[0011] S5. Take the merged text content as input, guide the large model to correct logical errors and semantic incoherence in the text content with prompt words, and summarize each paragraph and add summary text.

[0012] S6. Output the complete report text content and review it. After review, make modifications and polishing.

[0013] A further improvement to the technical solution of this invention lies in the following: In step S1, the process of splitting the analysis report and constructing the structured table includes:

[0014] S11. Clarify the overall structure of the analysis report, conduct a framework analysis of the overall structure of the analysis report, and obtain the constituent framework of the analysis report, which are: abstract, introduction, background, methods, results, discussion and conclusion;

[0015] S12. Decompose the framework of the analysis report into several segmented analysis tasks, and focus each segmented analysis task on a specific topic of the analysis report;

[0016] S13. Define the analysis objectives for each fragment analysis task and clarify the problem to be solved by each fragment analysis task;

[0017] S14. Determine the data source for each fragment analysis task, set data indicators according to the analysis objectives of the fragment analysis task, and obtain the corresponding raw data from each data source.

[0018] S15. Construct a structured table to store the association information of each fragment analysis task, wherein the structured table includes a sequence of divisions of task number, task description, data source, data indicators and related text information;

[0019] S16. Based on the analysis objectives of the fragment analysis task, fill in the relevant information in the structured table.

[0020] A further improvement to the technical solution of this invention lies in the fact that, in step S2, the conversion process of tagged natural language text includes:

[0021] S21. Based on the data type and structure of the analysis report, create a temporary database and load the structured tables into the temporary database;

[0022] S22. Clean and preprocess the raw data, remove invalid or erroneous data, unify the data format, and import the data collected from various data sources into structured tables in a temporary database;

[0023] S23. For the associated data of each fragment analysis task, assign classification labels to it, extract the associated data of the fragment analysis task, and use natural language generation technology to convert the data into natural language text. During the conversion process, add corresponding labels to the generated natural language text according to the data type and context information, such as title, paragraph, list, etc.

[0024] S24. Integrate the generated labeled natural language text and store it in a temporary database. Create a new natural language text table to save the natural language text, ensuring that the text description is consistent with the original data.

[0025] A further improvement to the technical solution of the present invention is that: in step S3, the process of forming the complete prompt word includes:

[0026] S31. Extract data related to the current fragment analysis task from the structured tables in the temporary database, and extract text descriptions related to the fragment analysis task from the natural language text tables. By matching the data in the structured tables with the keywords in the natural language text tables, identify the analysis logic in the structured tables, and associate the analysis logic with the corresponding natural language text descriptions.

[0027] S32. Extract keywords related to the analysis task from natural language text, and construct an initial prompt word template based on the analysis logic and keywords;

[0028] S33. Use the Word2Vec algorithm to train word vectors, determine the objective function that maximizes the prediction context probability of a given word, convert relevant policy information and industry information into word vector representations, calculate document vectors by calculating the weighted average of all word vectors in the natural language text, store the document vectors in the constructed index structure, and generate query vectors based on the keywords in the initial prompt word template. Use cosine similarity to search for vectors similar to the query vector in the index, compare the similarity between the two vectors, find relevant policy information and industry information, and extract relevant content from the search results to supplement and improve the prompt word template.

[0029] S34. Integrate the relevant content extracted from the search results into the initial prompt word template, and perform grammar and logic checks to ensure that the generated prompt words are grammatically and logically correct.

[0030] A further improvement to the technical solution of this invention lies in the following: In step S33, the objective function for maximizing the prediction context probability of a given word is expressed as follows:

[0031]

[0032] Where J(θ) represents the loss function, used to evaluate and optimize the model parameters θ, and analyze each word w in the sequence. t The m words before and after it w t+j The relationship between T and t is: log p(w t+j |w t ) indicates that given the current word w t Under the condition that word w t+j The logarithm of the probability of occurrence;

[0033] The formula for calculating document vectors is:

[0034]

[0035] Among them, v D Let n be the vector representation of document D, and w be the number of distinct words in document D. i Let TF(w) represent the i-th word in document D. i ) indicates the word w i The term frequency in a document, i.e., the number of times a word appears in the document, is represented by IDF(w). i ) indicates the word w i Inverse document frequency (IVF) measures the rarity of a word across all documents. Indicator w i The vector representation of a word refers to the vector in a word embedding space;

[0036] The formula for calculating the query vector is:

[0037]

[0038] Among them, v Q Let b be the vector representation of query Q, and b represent the number of distinct words in query Q. l This indicates a query for the l-th word in Q, TF(q) l ) indicates word q l Querying word frequencies in Q, For the word q l The vector representation of .

[0039] A further improvement to the technical solution of this invention lies in: in step S33, cosine similarity is used to search for vectors similar to the query vector in the index, and the expression for comparing the similarity between two vectors is as follows:

[0040]

[0041] Among them, S p This represents the similarity between two vectors A and B, where A... p Let B represent the component of vector A in the p-th dimension. pLet represent the p-th dimension component of vector B, where d represents the dimension of the vector, and w p Let |A| represent the weight of the p-th dimension. p ·B p | represents A p ·B p The absolute value of S p The value range is [-1, 1].

[0042] A further improvement to the technical solution of this invention lies in the fact that, in step S4, the process of merging the main content framework of the analysis report includes:

[0043] S41. Store the prompt words for each fragment analysis task in a list and configure the large language model;

[0044] S42. Call the large language model, pass the current prompt word as input to the large language model, so that the large language model can generate text content according to the prompt word, and save the generated text content for subsequent merging and processing;

[0045] S43. According to the structural requirements of the analysis report, classify the generated text content into different structural frameworks, fine-tune the generated text, and merge the text content generated by each fragment analysis task into the main content framework of the analysis report to ensure clear and coherent logic.

[0046] S44. Based on the main content framework of the analysis report, obtain the total number of sentences, total number of words in sentences, total number of sentences, number of grammatical errors, number of transition words, number of logical connectors, number of keyword occurrences, and number of different words. Obtain the grammar evaluation index, coherence evaluation index, logical evaluation index, information importance evaluation index, and lexical diversity evaluation index respectively. Analyze them comprehensively to obtain the text quality evaluation coefficient and evaluate the quality of the text content.

[0047] A further improvement to the technical solution of this invention lies in the fact that the calculation formula for the text quality assessment coefficient is:

[0048]

[0049] Among them, A c G represents the text quality evaluation coefficient, where x represents the total number of sentences, and G represents the total number of sentences. c Let C represent the grammar evaluation index, which is the grammar score of the c-th sentence. c L represents the coherence assessment index, which is the coherence score of the c-th sentence. c I represents the logical evaluation index, which is the logical score of the c-th sentence. c V represents the information importance assessment index, which is the information importance score of the c-th sentence. cThis represents the lexical diversity assessment index, specifically the lexical diversity score of the c-th sentence. It should be noted that A... c The value range is [0, 1], where 0 represents poor text quality and 1 represents high text quality;

[0050] in, Where, N y N represents the number of syntax errors. zc Total number of words in the sentence;

[0051] Where, N g N represents the number of transition words used. zc The total number of sentences;

[0052] Where, N lc The number of logical connectors used, where x represents the total number of sentences;

[0053] Where, N gc N represents the number of times the keyword appears. zc Total number of words in the sentence;

[0054] Where, N bc N represents the number of distinct words. zc This represents the total number of words in the sentence.

[0055] A further improvement to the technical solution of the present invention is that the specific process of S5 includes:

[0056] S51. Organize and merge the text content, and preprocess the text content to remove unnecessary spaces and line breaks to ensure consistent formatting;

[0057] S52. Provide prompt words, and take the preprocessed text content and prompt words as input. Call the large model to process the text content, analyze the vocabulary, sentence structure and context information in the text content, identify logical errors and semantic incoherence, and correct and supplement the summary text.

[0058] S53. Using the corrected text content and new prompts as input, the large model is called again for processing, and the corrected and supplemented text content is summarized and concluded.

[0059] A further improvement to the technical solution of this invention is that, in step S6, the review process for the complete report text content includes:

[0060] S61. After the model completes the content summarization and conclusion, merge the text content of each part into a complete report in logical order, and adjust the report format according to the report requirements.

[0061] S62. Manually review the text content of the output report to check for logical errors, semantic inconsistencies, and inaccurate information.

[0062] S63. Based on the results of manual review, correct any errors, omissions, or redundancies in the report, and modify and polish the text content of the report.

[0063] S64. After completing the revisions and polishing, conduct a comprehensive review of the entire report to ensure that there are no omissions or areas for improvement. Once the report content is confirmed to be correct, the format is standardized, and the language is fluent, designate it as the final version.

[0064] Due to the adoption of the above technical solution, the technical progress achieved by this invention compared to the prior art is as follows:

[0065] 1. This invention provides a data analysis report generation method based on a large language model. By utilizing a large language model, the method can automatically generate data analysis reports, quickly understand data content, identify key information, and generate clearly structured and logically coherent text based on this information. This can significantly improve the efficiency of report production. This efficient data analysis report generation method enables analysts to respond to business needs more quickly and improve work efficiency.

[0066] 2. This invention provides a data analysis report generation method based on a large language model. The large language model has natural language understanding and generation capabilities, and can generate accurate and clear report content based on input data and prompts. The report generated by the large model has high accuracy and professionalism, and can effectively avoid errors or subjective biases caused by human factors, which helps to improve the quality and credibility of the report, so that decision-makers can trust and rely on the content of the report more.

[0067] 3. This invention provides a data analysis report generation method based on a large language model. Through natural language processing technology, it generates high-quality analysis reports, understands the deeper meaning behind the data, discovers the potential patterns and trends in the data, and expresses them accurately and clearly. The large language model can automatically check for grammatical errors, spelling errors, and logical errors in the report, ensuring the professionalism and accuracy of the report. Attached Figure Description

[0068] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.

[0069] Figure 1This is a flowchart of the method of the present invention;

[0070] Figure 2 This is a flowchart illustrating the process of splitting the analysis report and constructing structured tables in this invention.

[0071] Figure 3 This is a flowchart illustrating the formation process of the complete prompt words of this invention;

[0072] Figure 4 This is a flowchart summarizing the main content framework of the analysis report of this invention. Detailed Implementation

[0073] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0074] Example 1, as Figure 1-3 As shown, this invention provides a method for generating data analysis reports based on a large language model, comprising the following steps:

[0075] S1. Decompose the overall structure of the analysis report into several segmented analysis tasks, clarifying the data sources, data indicators, and various textual information to be analyzed. Store all segmented analysis tasks in a structured table format. Define the overall structure of the analysis report, perform a framework analysis to obtain the report's constituent framework, which includes an abstract, introduction, background, methods, results, discussion, and conclusions. Decompose this framework into several segmented analysis tasks, focusing each task on a specific theme. Define the analysis objectives for each task, clarify the problem to be solved, determine the data source, set data indicators based on the analysis objectives, and obtain the corresponding raw data from each data source. Construct a structured table to store the related information for each segmented analysis task. The structured table includes a task number, task description, data source, data indicators, and a sequence of related textual information. Fill in the information according to the analysis objectives of each segmented analysis task. The structured tables contain related information. The data required for this report is stored in a temporary database and converted into tagged natural language text. Based on the data type and structure of the analysis report, a temporary database is created, and the structured tables are loaded into it. The original data is cleaned and preprocessed to remove invalid or erroneous data, unify the data format, and ensure data consistency. Data collected from various data sources is imported into the structured tables in the temporary database. For the related data of each fragment analysis task, classification labels are assigned, and the related data of the fragment analysis tasks are extracted. Natural language generation technology (NLG) is used to convert the data into natural language text. During the conversion process, corresponding labels, such as titles, paragraphs, and lists, are added to the generated natural language text according to the data type and context information. The generated tagged natural language text is integrated and stored in the temporary database. A new natural language text table is created to save the natural language text, ensuring that the text description is consistent with the original data, which facilitates the subsequent report writing and analysis process.

[0076] S3. For each segmented analysis task, combine the analysis logic in the structured table with relevant data expressed in natural language. Then, use vector search to supplement and improve the prompt word template with relevant policy and industry information to form a complete prompt word. Extract data related to the current segmented analysis task from the structured table in the temporary database, and extract text descriptions related to the segmented analysis task from the natural language text table. By matching the data in the structured table with the keywords in the natural language text table, identify the analysis logic in the structured table, and associate the analysis logic with the corresponding natural language text description to ensure that the text description accurately reflects the logic content. Extract keywords related to the analysis task from the natural language text, and construct an initial prompt word template based on the analysis logic and keywords. The system uses the Word2Vec algorithm to train word vectors, determines the objective function to maximize the probability of predicting the context for a given word, converts relevant policy and industry information into word vector representations, calculates document vectors by calculating the weighted average of all word vectors in the natural language text, stores the document vectors in the constructed index structure, and generates query vectors based on keywords in the initial prompt word template. It uses cosine similarity to search for vectors similar to the query vector in the index, compares the similarity between the two vectors, finds relevant policy and industry information, extracts relevant content from the search results to supplement and improve the prompt word template, integrates the relevant content extracted from the search results into the initial prompt word template, and performs grammatical and logical checks to ensure that the generated prompt words are grammatically and logically correct.

[0077] Furthermore, the objective function that maximizes the probability of predicting the context for a given word is expressed as:

[0078]

[0079] Where J(θ) represents the loss function, used to evaluate and optimize the model parameters θ, and analyze each word w in the sequence. t The m words before and after it w t+j The relationship between them is as follows: T represents the total number of words in the sequence, and t represents a time point. ∑ represents the summation over all time points t in the sequence. -m≤j≤m,j≠ 0log p(w t+j |w t ) represents the summation over every possible offset j, including cases where j is negative or positive, but excluding cases where j = 0, log p(w t+j |w t ) indicates that given the current word w t Under the condition that word w t+j The logarithm of the probability of occurrence;

[0080] The formula for calculating document vectors is:

[0081]

[0082] Among them, v D Let n be the vector representation of document D, and w be the number of distinct words in document D. i Let TF(w) represent the i-th word in document D. i ) indicates the word w i The term frequency in a document, i.e., the number of times a word appears in the document, is represented by IDF(w). i ) indicates the word w i Inverse document frequency (IVF) measures the rarity of a word across all documents. Indicator w i The vector representation of a word refers to the vector in a word embedding space;

[0083] The formula for calculating the query vector is:

[0084]

[0085] Among them, v Q Let b be the vector representation of query Q, and b represent the number of distinct words in query Q. l This indicates a query for the l-th word in Q, TF(q) l ) indicates word q l Querying word frequencies in Q, For the word q l Vector representation of;

[0086] Furthermore, cosine similarity is used to search for vectors similar to the query vector in the index. The expression for comparing the similarity between two vectors is as follows:

[0087]

[0088] Among them, S p This represents the similarity between two vectors A and B, where A... p Let B represent the component of vector A in the p-th dimension. p Let represent the p-th dimension component of vector B, where d represents the dimension of the vector, and w p Let |A| represent the weight of the p-th dimension. p ·B p | represents A p ·B p The absolute value of S p The value range of w is [-1, 1]. It should be noted that if vectors A and B have the same components in a certain dimension, and the weight w p If the weight w is large, then that dimension contributes positively to the similarity; if vectors A and B have opposite components in a certain dimension, and the weight w is large... pIf the value is large, then that dimension contributes negatively to the similarity score.

[0089] S4. Repeat the prompts for each fragment analysis task and call the large language model to merge and organize the generated text content into the main content framework of the analysis report.

[0090] S5. Take the merged text content as input, guide the large model to correct logical errors and semantic incoherence in the text content with prompt words, and summarize each paragraph and add summary text.

[0091] S6. Output the complete report text content and review it. After review, make modifications and polishing.

[0092] Example 2, as Figure 4 As shown, based on Embodiment 1, the present invention provides a technical solution: Preferably, in S4, the process of merging the main content framework of the analysis report includes:

[0093] The prompts for each fragment analysis task are stored in a list, and a large language model is configured. The large language model is then invoked, and the current prompt is passed as input to generate text content based on the prompt. The generated text content is saved for subsequent merging and organization. According to the structural requirements of the analysis report, the generated text content is categorized into different structural frameworks. The generated text is fine-tuned to ensure its fluency and accuracy. The text content generated by each fragment analysis task is merged into the main content framework of the analysis report to ensure logical clarity and coherence. Based on the text content of the main content framework of the analysis report, the total number of sentence logs, total number of words per sentence, total number of sentences, number of grammatical errors, number of transition words, number of logical connectors, number of keyword occurrences, and number of different words are obtained. Grammar evaluation index, coherence evaluation index, logical evaluation index, information importance evaluation index, and lexical diversity evaluation index are obtained respectively. A comprehensive analysis is performed to obtain the text quality evaluation coefficient to evaluate the quality of the text content.

[0094] Furthermore, the formula for calculating the text quality assessment coefficient is as follows:

[0095]

[0096] Among them, A c G represents the text quality evaluation coefficient, where x represents the total number of sentences, and G represents the total number of sentences. c Let C represent the grammar evaluation index, which is the grammar score of the c-th sentence. c L represents the coherence assessment index, which is the coherence score of the c-th sentence. c I represents the logical evaluation index, which is the logical score of the c-th sentence. cV represents the information importance assessment index, which is the information importance score of the c-th sentence. c This represents the lexical diversity assessment index, specifically the lexical diversity score of the c-th sentence. It should be noted that A... c The value range of G is [0, 1], where 0 represents poor text quality and 1 represents high text quality. c C c L c I c The values ​​are generally high, indicating that the text performs well in terms of syntax, coherence, logic, and information importance. c It will tend towards a higher value; if V c A lower value indicates that the text uses a lot of repetitive words, which will reduce the A score. c The value;

[0097] Where, N y N represents the number of syntax errors. zc Total number of words in the sentence;

[0098] Where, N g N represents the number of transition words used. zc The total number of sentences;

[0099] Where, N lc The number of logical connectors used, where x represents the total number of sentences;

[0100] Where, N gc N represents the number of times the keyword appears. zc Total number of words in the sentence;

[0101] Where Nbc is the number of distinct words, and Nzc is the total number of words in the sentence;

[0102] Furthermore, the specific process of S5 includes:

[0103] Organize and merge the text content, and preprocess it to remove unnecessary spaces and line breaks to ensure consistent formatting. Provide prompts and input the preprocessed text content and prompts to a large model for processing. Analyze the vocabulary, sentence structure, and contextual information in the text content to identify logical errors and semantic incoherence. Correct and supplement the text with summary text. Input the corrected text content and new prompts to the large model again for processing. Summarize and conclude each corrected and supplemented text content to ensure clear logic and reasonable structure.

[0104] In S6, the review process for the complete report text content includes:

[0105] After the model completes the content summarization and generalization, the text content of each part is merged into a complete report in logical order. The report format is adjusted according to the report requirements, and the output report text content is manually reviewed to check for logical errors, semantic incoherence, and inaccurate information. Based on the manual review results, errors, omissions, or redundant content in the report are corrected, and the text content of the report is modified and polished. After the modification and polishing are completed, the entire report is reviewed again to ensure that there are no omissions or areas that need improvement. After confirming that the report content is correct, the format is standardized, and the language is fluent, it is designated as the final version.

[0106] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for generating data analysis reports based on a large language model, characterized in that: Includes the following steps: S1. Break down the overall structure of the analysis report into several segmented analysis tasks, and clarify the data sources, data indicators, and various textual information that need to be analyzed in each segment; store all segmented analysis tasks in a structured table format. S2. Store the data required for this report in a temporary database and convert it all into labeled natural language text; S3. For each segmented analysis task, combine the analytical logic in the structured table with relevant data expressed in natural language, and then use vector search to supplement and improve the prompt word template with relevant policy information and industry information, ultimately forming a complete prompt word, including: S31. Extract data related to the current fragment analysis task from the structured tables in the temporary database, and extract text descriptions related to the fragment analysis task from the natural language text tables. By matching the data in the structured tables with the keywords in the natural language text tables, identify the analysis logic in the structured tables, and associate the analysis logic with the corresponding natural language text descriptions. S32. Extract keywords related to the analysis task from natural language text, and construct an initial prompt word template based on the analysis logic and keywords; S33. Use the Word2Vec algorithm to train word vectors, determine the objective function that maximizes the prediction context probability of a given word, convert relevant policy information and industry information into word vector representations, calculate document vectors by calculating the weighted average of all word vectors in the natural language text, store the document vectors in the constructed index structure, and generate query vectors based on the keywords in the initial prompt word template. Use cosine similarity to search for vectors similar to the query vector in the index, compare the similarity between the two vectors, find relevant policy information and industry information, and extract relevant content from the search results. S34. Integrate the relevant content extracted from the search results into the initial prompt word template, and perform grammar and logic checks; S4. Repeat the prompts for each fragment analysis task and call the large language model to merge and organize the generated text content into the main content framework of the analysis report. S5. Take the merged text content as input, guide the large model to correct logical errors and semantic incoherence in the text content with prompt words, and summarize each paragraph and add summary text. S6. Output the complete report text content and review it. After review, make modifications and polishing.

2. The data analysis report generation method based on a large language model according to claim 1, characterized in that: In step S1, the process of splitting the analysis report and constructing structured tables includes: S11. Clarify the overall structure of the analysis report, conduct a framework analysis of the overall structure of the analysis report, and obtain the constituent framework of the analysis report, which are: abstract, introduction, background, methods, results, discussion and conclusion; S12. Decompose the framework of the analysis report into several segmented analysis tasks, and focus each segmented analysis task on the theme of the analysis report; S13. Define the analysis objectives for each fragment analysis task and clarify the problem to be solved by each fragment analysis task; S14. Determine the data source for each fragment analysis task, set data indicators according to the analysis objectives of the fragment analysis task, and obtain the corresponding raw data from each data source. S15. Construct a structured table to store the association information of each fragment analysis task, wherein the structured table includes a sequence of divisions of task number, task description, data source, data indicators and related text information; S16. Based on the analysis objectives of the fragment analysis task, fill in the relevant information in the structured table.

3. The method for generating a data analysis report based on a large language model according to claim 2, characterized in that: In step S2, the conversion process of tagged natural language text includes: S21. Based on the data type and structure of the analysis report, create a temporary database and load the structured tables into the temporary database; S22. Clean and preprocess the raw data, and import the data collected from various data sources into structured tables in a temporary database; S23. For the associated data of each fragment analysis task, assign classification labels to it, extract the associated data of the fragment analysis task, and use natural language generation technology to convert the data into natural language text. During the conversion process, add corresponding labels to the generated natural language text according to the data type and context information. S24. Integrate the generated labeled natural language text and store it in a temporary database. Create a new natural language text table to save the natural language text.

4. The data analysis report generation method based on a large language model according to claim 1, characterized in that: In step S33, the objective function that maximizes the probability of predicting the context for a given word is expressed as follows: ; in, Represents the loss function. This represents the total number of words in the sequence. Indicates a point in time. Indicates that in the given current word Under the condition of words The logarithm of the probability of occurrence; The formula for calculating document vectors is: ; in, For document The vector representation of , Document The number of different words in the text Document The first in One word, Indicator Word frequency in the document, Indicator Inverse document frequency, Indicator Vector representation of; The formula for calculating the query vector is: ; in, For query The vector representation of , Indicates query The number of different words in the text Indicates query The first in One word, Indicator In the query word frequency in For words The vector representation of .

5. The data analysis report generation method based on a large language model according to claim 1, characterized in that: In step S33, cosine similarity is used to search for vectors similar to the query vector in the index. The expression for comparing the similarity between two vectors is as follows: ; in, Represent two vectors and Similarity between them Representing vectors In the The components of the dimension, Representing vectors In the The components of the dimension, Represents the dimension of a vector. Indicates the first Dimensional weights, express The absolute value, The range of values ​​is .

6. The data analysis report generation method based on a large language model according to claim 1, characterized in that: In S4, the process of merging the main content framework of the analysis report includes: S41. Store the prompt words for each fragment analysis task in a list and configure the large language model; S42. Call the large language model, pass the current prompt word as input to the large language model, so that the large language model can generate text content according to the prompt word, and save the generated text content. S43. According to the structural requirements of the analysis report, classify the generated text content into different structural frameworks, fine-tune the generated text, and merge the text content generated by each fragment analysis task into the main content framework of the analysis report. S44. Based on the main content framework of the analysis report, obtain the total number of sentences, total number of words in sentences, total number of sentences, number of grammatical errors, number of transition words, number of logical connectors, number of keyword occurrences, and number of different words. Obtain the grammar evaluation index, coherence evaluation index, logical evaluation index, information importance evaluation index, and lexical diversity evaluation index respectively. Analyze them comprehensively to obtain the text quality evaluation coefficient and evaluate the quality of the text content.

7. The data analysis report generation method based on a large language model according to claim 6, characterized in that: The formula for calculating the text quality assessment coefficient is as follows: ; in, This represents the text quality evaluation coefficient. Indicates the total number of sentences. Indicates the grammar evaluation index, Indicates the consistency assessment index. This represents the logical evaluation index. Indicator of information importance assessment index Indicating a vocabulary diversity assessment index, The range of values ​​is ,in This indicates poor text quality. This indicates that the text quality is high.

8. The data analysis report generation method based on a large language model according to claim 6, characterized in that: The specific process of S5 includes: S51. Organize and merge the text content, and preprocess the text content; S52. Provide prompt words, and take the preprocessed text content and prompt words as input. Call the large model to process the text content, analyze the vocabulary, sentence structure and context information in the text content, identify logical errors and semantic incoherence, and correct and supplement the summary text. S53. Using the corrected text content and new prompts as input, the large model is called again for processing, and the corrected and supplemented text content is summarized and concluded.

9. The method for generating a data analysis report based on a large language model according to claim 8, characterized in that: In S6, the review process for the complete report text content includes: S61. After the model completes the content summarization and conclusion, merge the text content of each part into a complete report in logical order, and adjust the report format according to the report requirements. S62. Manually review the text content of the output report to check for logical errors, semantic inconsistencies, and inaccurate information. S63. Based on the results of manual review, correct errors, omissions and redundant content in the report, and modify and polish the text content of the report. S64. After completing the revisions and polishing, conduct a comprehensive review of the entire report to confirm that the content is correct and designate it as the final version.

Citation Information

Patent Citations

  • Financial time sequence prediction method based on big language model fusion domain knowledge

    CN118035845A

  • Computer implemented methods for the automated analysis or use of data, including use of a large language model

    WO2023161630A1