Data analysis report generation method based on large language model
By using a data analysis report generation method based on a large language model, splitting the report structure and combining structured tables and natural language text, the problem of insufficient analysis depth and efficiency in the existing technology is solved, and efficient and high-quality report generation is achieved. Ensure the logical clarity and credibility of the report.
Patent Information
- Application Number
- CN202410793717.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-19
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2044-06-19
AI Technical Summary
In the existing data analysis report production technology, it is difficult to guarantee the depth of analysis, breadth of information search, and production efficiency, which leads to obstacles in the reuse of knowledge systems and makes it difficult to comprehensively analyze domain knowledge, data, and industry information stably and efficiently to form high-quality reports.
Adopt a data analysis report generation method based on a large language model, split the report structure, combine structured tables and natural language text, use vector search to supplement prompt words, generate the main content framework of the report, and use the large language model to correct logical errors and supplement Summarize text and finally output a high-quality report.
It realizes the automatic generation of data analysis reports, improves the efficiency and quality of report production, ensures a clear structure and logical coherence of the report, reduces errors and subjective bias caused by human factors, and improves the credibility of the report.
Smart Images

Figure CN118626523A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data analysis, and in particular to a method for generating a data analysis report based on a large language model. Background Art
[0002] In the process of making data analysis reports in the same field, there are usually a large number of reusable analysis logics. When using these analysis logics to write reports, it is necessary to comprehensively consider the data structure, sample conditions, current policy information, industry information and other aspects involved. For example, when making a report on the quality of talent training in colleges and universities, it is often necessary to comprehensively consider multi-dimensional information such as graduates, students, regional economic conditions, and industry needs.
[0003] However, in the existing data analysis report production technology, the writing of text analysis is often based on the personal experience of the report producer, who interprets the data, judges the phenomena, and then summarizes and concludes. On the one hand, this method places high demands on the producer's data analysis ability and industry insight. On the other hand, for the output report, its analysis depth, information search breadth and production efficiency cannot be guaranteed, which hinders the reuse of knowledge systems in data analysis reports in the same field. Therefore, how to stably and efficiently integrate domain knowledge, various types of data and industry information into a comprehensive analysis to form a high-quality report has become a major pain point in data analysis report writing. Summary of the invention
[0004] The purpose of the present invention is to provide a method for generating a data analysis report based on a large language model to solve the problems raised in the above-mentioned background technology.
[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0006] A method for generating a data analysis report based on a large language model comprises the following steps:
[0007] S1. Split the overall structure of the analysis report into several fragmented analysis tasks, and clarify the data sources, data indicators and various text information involved in the analysis; all fragmented analysis tasks are stored in a structured table format;
[0008] S2. Store the data required for this report in a temporary database and convert all of them into natural language text with labels;
[0009] S3. For each segmented analysis task, the analysis logic in the structured table is combined with the relevant data expressed in natural language, and then the prompt word template is supplemented and improved using the content of relevant policy information and industry information through vector search, and finally a complete prompt word is formed;
[0010] S4, looping through the prompt words of each segment analysis task and calling the large language model to merge and organize the generated text content into the main content framework of the analysis report;
[0011] S5. Use the merged text content as input, and guide the large model to correct the logical errors and semantic incoherence in the text content in the form of prompt words, summarize each paragraph of content, and supplement the summary text;
[0012] S6. Output the complete report text and review it, and then make modifications and polish it after review.
[0013] A further improvement of the technical solution of the present invention is that in 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 on the overall structure of the analysis report, and obtain the composition framework of the analysis report, which includes summary, introduction, background, methods, results, discussion and conclusion;
[0015] S12. Decompose the analysis report framework into several fragmentary analysis tasks, and focus each fragmentary analysis task on a specific topic of the analysis report;
[0016] S13. Define the analysis objectives for each segment analysis task and clarify the problems to be solved by each segment analysis task;
[0017] S14, determining the data source of each segment analysis task, setting data indicators according to the analysis objectives of the segment analysis task, and obtaining corresponding raw data from each data source;
[0018] S15, constructing a structured table to store the associated information of each segment analysis task, wherein the structured table includes a task number, a task description, a data source, a data indicator, and a division sequence of related text information;
[0019] S16. Fill in the content of the related information in the structured table according to the analysis goal of the fragment analysis task.
[0020] A further improvement of the technical solution of the present invention is that in S2, the conversion process of the natural language text with labels includes:
[0021] S21. Create a temporary database according to the data type and structure of the analysis report, and load the structured table 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 a structured table in a temporary database;
[0023] S23, assigning classification labels to the associated data of each fragment analysis task, extracting the associated data of the fragment analysis task, and converting the data into natural language text using natural language generation technology. During the conversion process, adding corresponding labels such as title, paragraph, list, etc. to the generated natural language text according to the type and context information of the data;
[0024] S24. Integrate the generated natural language text with labels and store them in a temporary database. Create a new natural language text table to save the natural language text to ensure that the text description is consistent with the original data.
[0025] A further improvement of the technical solution of the present invention is that in S3, the process of forming the complete prompt word includes:
[0026] S31, extracting data related to the current fragment analysis task from the structured table in the temporary database, and extracting text descriptions related to the fragment analysis task from the natural language text table, identifying the analysis logic in the structured table by matching the data in the structured table with the keywords in the natural language text table, and associating the analysis logic with the corresponding natural language text description;
[0027] S32, extracting keywords related to the analysis task from the natural language text, and constructing an initial prompt word template according to the analysis logic and keywords;
[0028] S33. Use the Word2Vec algorithm to train word vectors, determine the objective function that maximizes the probability of predicting a given word context, convert relevant policy information and industry information content into word vector representation, calculate the document vector by calculating the weighted average of all word vectors in the natural language text, store the document vector in the constructed index structure, and generate a query vector 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 content, extract relevant content from the search results, and use it to supplement and improve the prompt word template;
[0029] S34, integrating the relevant content extracted from the search results into the initial prompt word template, and performing grammar and logic checks to ensure that the generated prompt words are grammatically and logically correct.
[0030] A further improvement of the technical solution of the present invention is that in S33, the expression form of the objective function of maximizing the probability of a given word prediction context is:
[0031]
[0032] Among them, J(θ) represents the loss function, which is used to evaluate and optimize the model parameters θ. t and the m words before and after it w t+j The relationship between, T represents the total number of words in the sequence, t represents the time point, log p(w t+j |w t ) means that given the current word w t Under the condition that t+j The logarithm of the probability of occurrence;
[0033] The calculation formula for the document vector is:
[0034]
[0035] Among them, v D is the vector representation of document D, n represents the number of different words in document D, and w i represents the i-th word in document D, TF(w i ) represents word w i The word frequency in the document, that is, the number of times the word appears in the document, IDF(w i ) represents word w i The inverse document frequency measures the rarity of a word in all documents. Representation word w i The vector representation of refers to the vector in a certain word embedding space;
[0036] The calculation formula of the query vector is:
[0037]
[0038] Among them, v Q is the vector representation of query Q, b represents the number of different words in query Q, and q l represents the lth word in the query Q, TF(q l ) represents word q l The frequency of terms in the query Q, For word q l The vector representation of .
[0039] A further improvement of the technical solution of the present invention is that in S33, the cosine similarity is used to search the index for a vector similar to the query vector, and the expression form of comparing the similarity between the two vectors is:
[0040]
[0041] Among them, S p Represents the similarity between two vectors A and B, A p represents the component of vector A in the pth dimension, B prepresents the component of vector B in the pth dimension, d represents the dimension of the vector, and w p represents the weight of the pth dimension, |A p ·B p | indicates A p ·B p The absolute value of S p The value range is [-1, 1].
[0042] A further improvement of the technical solution of the present invention is that in S4, the process of merging the main content framework of the analysis report includes:
[0043] S41, storing the prompt words of each segment analysis task in a list, and configuring a large language model;
[0044] S42, calling the large language model, passing the current prompt word as input to the large language model, allowing the large language model to generate text content according to the prompt word, and saving the generated text content for subsequent merging and sorting;
[0045] S43. According to the structural requirements of the analysis report, the generated text content is classified into different composition frameworks, the generated text is fine-tuned, and the text content generated by each fragment analysis task is merged into the main content framework of the analysis report to ensure clear logic and coherence;
[0046] S44. Based on the text content of the main content framework of the analysis report, obtain the total number of sentence pairs, the total number of words in a sentence, the total number of sentences, the number of grammatical errors, the number of transition words used, the number of logical conjunctions used, the number of keyword occurrences, and the number of different words, and obtain the grammar evaluation index, coherence evaluation index, logic evaluation index, information importance evaluation index, and vocabulary diversity evaluation index respectively. Comprehensively analyze to obtain the text quality evaluation coefficient, and analyze and evaluate the quality of the text content.
[0047] A further improvement of the technical solution of the present invention is that the calculation formula of the text quality evaluation coefficient is:
[0048]
[0049] Among them, A c represents the text quality assessment coefficient, x represents the total number of sentences, G c Represents the grammatical evaluation index, which is the grammatical score of the cth sentence, C c represents the coherence evaluation index, which is the coherence score of the cth sentence, L c Represents the logical evaluation index, which is the logical score of the cth sentence, I c represents the information importance evaluation index, which is the information importance score of the cth sentence, V crepresents the lexical diversity evaluation index, which is the lexical diversity score of the cth sentence. It should be noted that A c The value range of is [0, 1], where 0 indicates poor text quality and 1 indicates high text quality;
[0050] in, Among them, N y is the number of grammatical errors, N zc is the total number of words in the sentence;
[0051] Among them, N g N is the number of transition words used. zc is the total number of sentence pairs;
[0052] Among them, N lc is the number of logical connectives used, and x represents the total number of sentences;
[0053] Among them, N gc is the number of times the keyword appears, N zc is the total number of words in the sentence;
[0054] Among them, N bc is the number of different words, N zc is the total number of words in the sentence.
[0055] A further improvement of the technical solution of the present invention is that the specific process of S5 includes:
[0056] S51, collating the merged text content, and preprocessing the text content to remove unnecessary spaces and line breaks to ensure a unified format;
[0057] S52, providing prompt words, and taking the preprocessed text content and prompt words as input, calling the large model for processing, analyzing the vocabulary, sentence structure and context information in the text content, identifying the existing logical errors and semantic incoherence, and correcting them and supplementing the summary text;
[0058] S53, taking the corrected text content and the new prompt words as input, calling the large model again for processing, and summarizing and concluding each paragraph of text content after correction and supplementation.
[0059] A further improvement of the technical solution of the present invention is that in S6, the review process of the complete report text content includes:
[0060] S61. After the model is completed, the text content of each part is combined into a complete report in a logical order, and the format of the report is adjusted according to the report requirements;
[0061] S62. Manually review the output report text to check whether there are any logical errors, incoherent semantics, or inaccurate information;
[0062] S63. Based on the manual review results, correct the errors, omissions or redundant contents in the report, and modify and polish the text content of the report;
[0063] S64. After completing the revisions and polishing, conduct another comprehensive review of the entire report to ensure that there are no missed errors or areas that need improvement. After confirming that the report content is correct, the format is standard, and the language is fluent, it will be finalized.
[0064] Due to the adoption of the above technical solution, the present invention has the following technical advances compared with the prior art:
[0065] 1. The present invention provides a data analysis report generation method based on a large language model. The large language model is used to realize the automatic generation of data analysis reports, quickly understand the data content, identify key information, and generate a text with a clear structure and logical coherence based on this information, which 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. The present invention provides a method for generating a data analysis report based on a large language model. The large language model has the ability to understand and generate natural language, 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. The present invention provides a data analysis report generation method based on a large language model. Through natural language processing technology, a high-quality analysis report is generated. By understanding the deep meaning behind the data, the potential rules and trends in the data are discovered and expressed accurately and clearly. The large language model can automatically check the grammatical errors, spelling errors and logical errors in the report to ensure the professionalism and accuracy of the report. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0069] Figure 1is a flow chart of the method of the present invention;
[0070] Figure 2 A flowchart for splitting the analysis report and constructing a structured table of the present invention;
[0071] Figure 3 The figure is a flow chart of forming a complete prompt word of the present invention;
[0072] Figure 4 The combined flow chart of the main content framework of the analysis report of the present invention. DETAILED DESCRIPTION
[0073] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0074] Embodiment 1, as Figure 1-3 As shown, the present invention provides a method for generating a data analysis report based on a large language model, comprising the following steps:
[0075] S1. Split the overall structure of the analysis report into several fragmentary analysis tasks, and clarify the data sources, data indicators and various text information involved in the analysis; all fragmentary analysis tasks are stored in a structured table, clarify the overall structure of the analysis report, conduct a framework analysis on the overall structure of the analysis report, and obtain the structural framework of the analysis report, which are abstract, introduction, background, methods, results, discussion and conclusion. Decompose the structural framework of the analysis report into several fragmentary analysis tasks, and focus each fragmentary analysis task on the specific topic of the analysis report. Define the analysis goal for each fragmentary analysis task, clarify the problem to be solved by each fragmentary analysis task, determine the data source of each fragmentary analysis task, set data indicators according to the analysis goal of the fragmentary analysis task, and obtain the corresponding original data from each data source. Construct a structured table to store the related information of each fragmentary analysis task, where the structured table includes the task number, task description, data source, data indicators and the division sequence of related text information. Fill in the task number according to the analysis goal of the fragmentary analysis task. Fill in the content of the associated information in the structured table, store the data required for this report in a temporary database, and convert all of them into labeled natural language text. Create a temporary database based on the data type and structure of the analysis report, and load the structured table into the temporary database. Clean and preprocess the original data, remove invalid or erroneous data, unify the data format, ensure data consistency, and import the data collected from various data sources into the structured table in the temporary database. For the associated data of each fragment analysis task, assign classification labels to it, and extract the associated data of the fragment analysis task. Use natural language generation technology NLG 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. The generated labeled natural language text is integrated and stored in the temporary database. Create a new natural language text table to save the natural language text to ensure that the text description is consistent with the original data, which is convenient for subsequent report writing and analysis process;
[0076] S3. For each segmented analysis task, the analysis logic in the structured table is combined with the relevant data expressed in natural language, and then the prompt word template is supplemented and improved by using the content of relevant policy information and industry information through vector search, and finally a complete prompt word is formed. The data related to the current segmented analysis task is extracted from the structured table in the temporary database, and the text description related to the segmented analysis task is extracted from the natural language text table. By matching the data in the structured table with the keywords in the natural language text table, the analysis logic in the structured table is identified, and the analysis logic is associated with the corresponding natural language text description to ensure that the text description accurately reflects the logical content. The keywords related to the analysis task are extracted from the natural language text, and the initial prompt word template is constructed based on the analysis logic and keywords. board, use the Word2Vec algorithm to train word vectors, determine the objective function that maximizes the probability of predicting a given word context, convert relevant policy information and industry information content into word vector representation, calculate the document vector by calculating the weighted average of all word vectors in the natural language text, store the document vector in the constructed index structure, and generate a query vector 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 content, extract relevant content from the search results to supplement and improve the prompt word template, 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;
[0077] Furthermore, the objective function of maximizing the probability of predicting the context of a given word is expressed as:
[0078]
[0079] Among them, J(θ) represents the loss function, which is used to evaluate and optimize the model parameters θ. t and the m words before and after it w t+j The relationship between, T represents the total number of words in the sequence, t represents the time point, represents the sum of all time points t in the sequence, ∑ -m≤j≤m,j≠ 0log p(w t+j |w t ) represents the summation of each possible offset j, including the cases where j is negative and positive, but excluding j = 0, log p(w t+j |w t ) means that given the current word w t Under the condition that t+j The logarithm of the probability of occurrence;
[0080] The calculation formula for the document vector is:
[0081]
[0082] Among them, v D is the vector representation of document D, n represents the number of different words in document D, and w i represents the i-th word in document D, TF(w i ) represents word w i The word frequency in the document, that is, the number of times the word appears in the document, IDF(w i ) represents word w i The inverse document frequency measures the rarity of a word in all documents. Representation word w i The vector representation of refers to the vector in a certain word embedding space;
[0083] The calculation formula of the query vector is:
[0084]
[0085] Among them, v Q is the vector representation of query Q, b represents the number of different words in query Q, and q l represents the lth word in the query Q, TF(q l ) represents word q l The frequency of terms in the query Q, For word q l The vector representation of ;
[0086] Furthermore, cosine similarity is used to search for vectors similar to the query vector in the index, and the similarity between two vectors is expressed as:
[0087]
[0088] Among them, S p Represents the similarity between two vectors A and B, A p represents the component of vector A in the pth dimension, B p represents the component of vector B in the pth dimension, d represents the dimension of the vector, and w p represents the weight of the pth dimension, |A p ·B p | indicates A p ·B p The absolute value of S p The value range 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 is larger, then the contribution of this dimension to the similarity is positive; if vectors A and B have opposite components in a certain dimension and the weight w pIf it is larger, the contribution of this dimension to the similarity is negative;
[0089] S4, looping through the prompt words of each segment analysis task and calling the large language model to merge and organize the generated text content into the main content framework of the analysis report;
[0090] S5. Use the merged text content as input, and guide the large model to correct the logical errors and semantic incoherence in the text content in the form of prompt words, summarize each paragraph of content, and supplement the summary text;
[0091] S6. Output the complete report text and review it, and then make modifications and polish it after review.
[0092] Embodiment 2, as Figure 4 As shown, based on Example 1, the present invention provides a technical solution: Preferably, in S4, the merging process of the main content framework of the analysis report includes:
[0093] The prompt words of each fragment analysis task are stored in a list, and a large language model is configured. The large language model is called, and the current prompt word is passed as input to the large language model, so that the large language model generates text content according to the prompt word, and the generated text content is saved for subsequent merging and sorting. According to the structural requirements of the analysis report, the generated text content is classified into different composition frameworks, and 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 clear logic and coherence. Based on the text content of the main content framework of the analysis report, the total number of sentence pairs, the total number of words in a sentence, the total number of sentences, the number of grammatical errors, the number of transition words used, the number of logical conjunctions used, the number of keyword occurrences, and the number of different words are obtained. The grammar evaluation index, coherence evaluation index, logic evaluation index, information importance evaluation index, and vocabulary diversity evaluation index are respectively obtained. The text quality evaluation coefficient is obtained through comprehensive analysis, and the quality of the text content is analyzed and evaluated;
[0094] Furthermore, the calculation formula of the text quality assessment coefficient is:
[0095]
[0096] Among them, A c represents the text quality assessment coefficient, x represents the total number of sentences, G c Represents the grammatical evaluation index, which is the grammatical score of the cth sentence, C c represents the coherence evaluation index, which is the coherence score of the cth sentence, L c Represents the logical evaluation index, which is the logical score of the cth sentence, I crepresents the information importance evaluation index, which is the information importance score of the cth sentence, V c represents the lexical diversity evaluation index, which is the lexical diversity score of the cth sentence. It should be noted that A c The value range of G is [0, 1], where 0 indicates poor text quality and 1 indicates high text quality. c , C c , L c ,I c The values of A are generally high, indicating that the text performs well in terms of grammar, coherence, logic, and information importance. c will tend to higher values; if V c A lower value indicates that the text uses more repeated words, which will reduce A c The value of
[0097] Among them, N y is the number of grammatical errors, N zc is the total number of words in the sentence;
[0098] Among them, N g N is the number of transition words used. zc is the total number of sentence pairs;
[0099] Among them, N lc is the number of logical connectives used, and x represents the total number of sentences;
[0100] Among them, N gc is the number of times the keyword appears, N zc is the total number of words in the sentence;
[0101] Among them, Nbc is the number of different words, and Nzc is the total number of words in the sentence;
[0102] Furthermore, the specific process of S5 includes:
[0103] Arrange the merged text content, pre-process the text content, remove unnecessary spaces and line breaks, ensure uniform format, provide prompt words, and use the pre-processed text content and prompt words as input, call the big model for processing, analyze the vocabulary, sentence structure and context information in the text content, identify the existing logical errors and semantic incoherence, correct them and supplement the summary text, use the corrected text content and new prompt words as input, call the big model again for processing, summarize and conclude each corrected and supplemented text content, and 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 induction and conclusion, the text content of each part is merged into a complete report in a logical order, and the format of the report is adjusted according to the report requirements. The output report text content is manually reviewed to check whether there are logical errors, semantic incoherence, and inaccurate information. According to the results of the manual review, the errors, omissions, or redundant content in the report are corrected, and the text content of the report is modified and polished. After completing the modification and polishing, the entire report is reviewed again to ensure that there are no missed errors or areas that need improvement. After confirming that the report content is correct, the format is standardized, and the language is fluent, it is determined as the final version.
[0106] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for generating data analysis reports based on a large language model, Features: The following steps are involved: S1. Split the overall structure of the analysis report into several fragmented analysis tasks, and clarify the data sources, data indicators and various text information involved in the analysis; all fragmented analysis tasks are stored in a structured table format; S2. Store the data required for this report in a temporary database and convert all of them into natural language text with labels; S3. For each segmented analysis task, the analysis logic in the structured table is combined with the relevant data expressed in natural language, and then the prompt word template is supplemented and improved using the content of relevant policy information and industry information through vector search, and finally a complete prompt word is formed; S4, looping through the prompt words of each segment analysis task and calling the large language model to merge and organize the generated text content into the main content framework of the analysis report; S5. Use the merged text content as input, and guide the large model to correct the logical errors and semantic incoherence in the text content in the form of prompt words, summarize each paragraph of content, and supplement the summary text; S6. Output the complete report text and review it, and then make modifications and polish it after review.
2. According to the method for generating a data analysis report based on a large language model according to claim 1, Features: In S1, the process of splitting the analysis report and constructing the structured table includes: S11. Clarify the overall structure of the analysis report, conduct a framework analysis on the overall structure of the analysis report, and obtain the composition framework of the analysis report, which includes summary, introduction, background, methods, results, discussion and conclusion; S12. Decompose the analysis report framework into several fragmentary analysis tasks, and focus each fragmentary analysis task on a specific topic of the analysis report; S13. Define the analysis objectives for each segment analysis task and clarify the problems to be solved by each segment analysis task; S14, determining the data source of each segment analysis task, setting data indicators according to the analysis objectives of the segment analysis task, and obtaining corresponding raw data from each data source; S15, constructing a structured table to store the associated information of each segment analysis task, wherein the structured table includes a task number, a task description, a data source, a data indicator, and a division sequence of related text information; S16. Fill in the content of the related information in the structured table according to the analysis goal of the fragment analysis task.
3. According to the method for generating a data analysis report based on a large language model according to claim 2, Features: In S2, the conversion process of the labeled natural language text includes: S21. Create a temporary database according to the data type and structure of the analysis report, and load the structured table into the temporary database; S22, cleaning and preprocessing the raw data, and importing the data collected from various data sources into a structured table in a temporary database; S23, assigning classification labels to the associated data of each segment analysis task, extracting the associated data of the segment analysis task, and converting the data into natural language text using natural language generation technology. During the conversion process, adding corresponding labels to the generated natural language text according to the type and context information of the data; S24, integrating the generated natural language texts with labels and storing them in a temporary database, and creating a natural language text table to save the natural language texts.
4. According to the method for generating a data analysis report based on a large language model according to claim 3, Features: In S3, the process of forming a complete prompt word includes: S31, extracting data related to the current fragment analysis task from the structured table in the temporary database, and extracting text descriptions related to the fragment analysis task from the natural language text table, identifying the analysis logic in the structured table by matching the data in the structured table with the keywords in the natural language text table, and associating the analysis logic with the corresponding natural language text description; S32, extracting keywords related to the analysis task from the natural language text, and constructing an initial prompt word template according to the analysis logic and keywords; S33. Use the Word2Vec algorithm to train word vectors, determine the objective function that maximizes the probability of predicting a given word context, convert relevant policy information and industry information content into word vector representation, calculate the document vector by calculating the weighted average of all word vectors in the natural language text, store the document vector in the constructed index structure, and generate a query vector 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 content, and extract relevant content from the search results; S34, integrating the relevant content extracted from the search results into the initial prompt word template, and performing grammar and logic checks.
5. According to the method for generating a data analysis report based on a large language model according to claim 4, Features: In S33, the expression form of maximizing the given word prediction context probability objective function is: Among them, J(θ) represents the loss function, T represents the total number of words in the sequence, t represents the time point, logp(w t+j |w t ) means that given the current word w t Under the condition that t+j The logarithm of the probability of occurrence; The calculation formula for the document vector is: Among them, v D is the vector representation of document D, n represents the number of different words in document D, and w i represents the i-th word in document D, TF(w i ) represents word w i The word frequency in the document, IDF(w i ) represents word w i The inverse document frequency of Representation word w i The vector representation of ; The calculation formula of the query vector is: Among them, v Q is the vector representation of query Q, b represents the number of different words in query Q, and q l represents the lth word in the query Q, TF(q l ) represents word q l The frequency of terms in the query Q, For word q l The vector representation of .
6. According to the method for generating a data analysis report based on a large language model as described in claim 4, Features: In S33, the cosine similarity is used to search the index for a vector similar to the query vector, and the similarity between the two vectors is compared in the form of: Among them, S p Represents the similarity between two vectors A and B, A p represents the component of vector A in the pth dimension, B p represents the component of vector B in the pth dimension, d represents the dimension of the vector, and w p represents the weight of the pth dimension, |A p ·B p | indicates A p ·B p The absolute value of S p The value range is [-1,1].
7. According to claim 1, a method for generating a data analysis report based on a large language model, Features: In S4, the process of merging the main content framework of the analysis report includes: S41, storing the prompt words of each segment analysis task in a list, and configuring a large language model; S42, calling the large language model, passing the current prompt word as input to the large language model, allowing the large language model to generate text content according to the prompt word, and saving the generated text content; S43, according to the structural requirements of the analysis report, classify the generated text content into different composition 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 text content of the main content framework of the analysis report, obtain the total number of sentence pairs, the total number of words in a sentence, the total number of sentences, the number of grammatical errors, the number of transition words used, the number of logical conjunctions used, the number of keyword occurrences, and the number of different words, and obtain the grammar evaluation index, coherence evaluation index, logic evaluation index, information importance evaluation index, and vocabulary diversity evaluation index respectively. Comprehensively analyze to obtain the text quality evaluation coefficient, and analyze and evaluate the quality of the text content.
8. According to the method for generating a data analysis report based on a large language model according to claim 7, Features: The calculation formula of the text quality evaluation coefficient is: Among them, A c represents the text quality assessment coefficient, x represents the total number of sentences, G c represents the grammar evaluation index, C c represents the coherence evaluation index, L c Represents the logical evaluation index, I c represents the information importance evaluation index, V c represents the vocabulary diversity evaluation index, A c The value range is [0,1], where 0 indicates poor text quality and 1 indicates high text quality.
9. The method for generating a data analysis report based on a large language model according to claim 7, Features: The specific process of S5 includes: S51, arranging the merged text content and preprocessing the text content; S52, providing prompt words, and taking the preprocessed text content and prompt words as input, calling the large model for processing, analyzing the vocabulary, sentence structure and context information in the text content, identifying the existing logical errors and semantic incoherence, and correcting them and supplementing the summary text; S53, taking the corrected text content and the new prompt words as input, calling the large model again for processing, and summarizing and concluding each paragraph of text content after correction and supplementation.
10. A method for generating a data analysis report based on a large language model according to claim 9, Features: In S6, the review process of the complete report text content includes: S61. After the model is completed, the text content of each part is combined into a complete report in a logical order, and the format of the report is adjusted according to the report requirements; S62. Manually review the output report text to check whether there are any logical errors, incoherent semantics, or inaccurate information; S63. Based on the manual review results, correct the errors, omissions or redundant contents in the report, and modify and polish the text content of the report; S64. After completing the revisions and polishing, conduct another comprehensive review of the entire report to confirm that the report content is correct and make it the final version.
Citation Information
Patent Citations
Financial time sequence prediction method based on big language model fusion domain knowledge
CN118035845A
Text information extraction method and device, equipment and storage medium
CN118193681A
Computer implemented methods for the automated analysis or use of data, including use of a large language model
WO2023161630A1
Cited By
Knowledge-enhanced large model data analysis agent visualization method
CN119226387A
A Visualization Method for a Knowledge-Enhanced Large Model Data Analysis Agent
CN119226387B
Data analysis report generation method and related device
CN119250051A
Detection report auditing management method and device
CN119378516A
Prompt-based ESG report text analysis method and system
CN119441474A
