Method, device and electronic equipment for generating analysis report

Through NL2SQL technology and slot recognition, combined with historical data to learn fine-grained templates, an accurate and diverse analysis report is generated, which solves the problems of low template extraction efficiency and poor deep learning control in the existing technology, and realizes user-interactive data analysis report generation.

CN113642303BActive Publication Date: 2025-08-12ALIBABA GROUP HOLDING LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202010343686.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-04-27
Publication Date
2025-08-12
Estimated Expiration
2040-04-27

AI Technical Summary

Technical Problem

The existing template-based text generation methods rely on manual feature engineering, making it difficult to efficiently extract high-quality templates, and deep learning-based methods are difficult to control the accuracy of generated content, resulting in the generated text not matching the input data.

Method used

NL2SQL technology is used to analyze user intentions, combine insight data tables and slot recognition, and learn fine-grained template configuration using historical data, generate professional information descriptions at paragraph level, and model training is carried out through user interaction adjustment samples.

Benefits of technology

It realizes the generation of accurate and diverse single-sentence descriptions, which can be effectively spliced into a whole paragraph, provide global information descriptions, and continuously improve the generation templates through user interaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113642303B_ABST
    Figure CN113642303B_ABST
Patent Text Reader

Abstract

The present invention provides a method, device, and electronic device for generating an analysis report. The method comprises: receiving a user query; parsing the user intent in the query; querying preset natural language generation (NLG) storage information based on the user intent to obtain descriptive information corresponding to the query; and generating an analysis report for the query based on the descriptive information. The NLG storage information is generated by using an NLG algorithm to generate and store corresponding text descriptions of structured information generated by insights. The present invention can efficiently learn a set of accurate NLG templates using historical data and apply them to the field of automatic report generation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of interactive data analysis, and in particular to a method, device and electronic device for generating an analysis report. Background Art

[0002] Many companies are experimenting with automated reporting using software. For structured information, they might need to present it in charts or generate textual descriptions to help users better understand the content.

[0003] There are generally two approaches to text generation technology used at the underlying level: template-based and deep learning-based. Deep learning-based models are primarily data-driven, require minimal human intervention, and easily produce rich and fluent text descriptions. However, users often lack direct control over content generation, making it difficult to ensure that the output text matches the input data. Currently, rule-based and template-based approaches are still the mainstream. These methods offer significant interpretability and controllability, making it easier to ensure the accuracy of the output text. However, template-based approaches currently have certain limitations: extracting high-quality templates still relies heavily on manual feature engineering or rule-based intervention. Therefore, efficiently extracting templates is a pressing issue that needs to be addressed. Summary of the Invention

[0004] One purpose of the present invention is to provide a method for generating an analysis report, which cooperates with NL2SQL technology and insights into data tables to interactively generate information descriptions, uses slot identification and domain rules to learn fine-grained template configurations, and uses historical data to automatically learn global granularity template solutions to automatically generate paragraph-level professional information descriptions.

[0005] To achieve the above objectives, an embodiment of the present invention provides a method for generating an analysis report, the method comprising:

[0006] Receive user inquiry information;

[0007] Analyzing the user's intention in the query information;

[0008] Querying preset natural language generation (NLG) storage information according to the user's intention to obtain description information corresponding to the query information;

[0009] generating an analysis report of the query information according to the description information;

[0010] The NLG storage information is generated by using an NLG algorithm to generate corresponding text descriptions from the structured information generated by the insights and store them.

[0011] Furthermore, parsing the user intention in the query information includes: parsing the query information into a plurality of structured fields, where the plurality of structured fields are used to represent the user intention.

[0012] Furthermore, the method also includes: generating corresponding SQL statements based on the multiple structured fields using the NL2SQL technology; correspondingly, querying in the preset natural language generation (NLG) storage information based on the user intention includes: querying in the preset NLG storage information using the SQL statement.

[0013] Furthermore, generating an analysis report of the query information based on the description information includes: performing slot identification on the description information to obtain information of different slots; organizing the information of different slots according to the rules in the domain rule library to obtain single-sentence description information; and concatenating multiple single-sentence description information to generate an analysis report of the query information.

[0014] Furthermore, the description information of multiple single sentences is concatenated, including: identifying a slot of interest in a single sentence, and abstracting the single sentence into an intermediate frame according to the slot of interest; clustering the intermediate frames of multiple single sentences to obtain one or more features of each intermediate frame; selecting appropriate intermediate frames as templates for multiple single sentences according to the constructed sorting model; filling the slot information of interest in the single sentence into the template, and splicing them.

[0015] Furthermore, clustering the intermediate frames of the plurality of single sentences includes clustering the intermediate frames according to verbs or modifiers in the single sentences.

[0016] Furthermore, the method further comprises: providing corresponding synonym libraries for information in different slots, wherein the words in the synonym libraries are used to replace the information in the corresponding slots when generating the description information of a single sentence.

[0017] Furthermore, the method also includes: receiving adjustment information of the user for the analysis report; generating high-weight samples according to the adjustment information; and training the NLG storage information using the high-weight samples.

[0018] An embodiment of the present invention further provides a device for generating an analysis report, the device comprising:

[0019] Receiving module, receiving user's inquiry information;

[0020] An analysis module, which analyzes the user intention in the query information;

[0021] A query module, which queries the preset natural language generation (NLG) storage information according to the user's intention and obtains description information corresponding to the query information;

[0022] A generating module, generating an analysis report of the query information according to the description information;

[0023] The NLG storage information is generated by using an NLG algorithm to generate corresponding text descriptions from the structured information generated by the insights for storage.

[0024] Furthermore, in the parsing module, the user intention in the query information includes: parsing the query information into a plurality of structured fields, and the plurality of structured fields are used to represent the user intention.

[0025] Furthermore, the parsing module also generates corresponding SQL statements based on the multiple structured fields using the NL2SQL technology; accordingly, querying in the preset natural language generation NLG storage information based on the user intention includes: querying in the preset NLG storage information using the SQL statement.

[0026] Furthermore, in the generation module, generating an analysis report of the query information based on the description information includes: performing slot identification on the description information to obtain information of different slots; organizing the information of different slots according to the rules in the domain rule library to obtain description information of a single sentence; and concatenating the description information of multiple single sentences to generate an analysis report of the query information.

[0027] Furthermore, the description information of multiple single sentences is concatenated, including: identifying a slot of interest in a single sentence, and abstracting the single sentence into an intermediate frame according to the slot of interest; clustering the intermediate frames of multiple single sentences to obtain one or more features of each intermediate frame; selecting appropriate intermediate frames as templates for multiple single sentences according to the constructed sorting model; filling the slot information of interest in the single sentence into the template, and splicing them.

[0028] Furthermore, clustering the intermediate frames of the plurality of single sentences includes clustering the intermediate frames according to verbs or modifiers in the single sentences.

[0029] Furthermore, the generation module also provides corresponding synonym libraries for information in different slots, and the words in the synonym libraries are used to replace the information in the corresponding slots when generating the description information of a single sentence.

[0030] Furthermore, the device also includes an adjustment module for receiving adjustment information of the user on the analysis report; generating high-weight samples according to the adjustment information; and training the NLG storage information using the high-weight samples.

[0031] An embodiment of the present invention further provides an electronic device, comprising:

[0032] storage device;

[0033] one or more processors;

[0034] The storage device is used to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the aforementioned method for generating an analysis report.

[0035] An embodiment of the present invention further provides a computer program product, comprising computer program instructions, which, when executed by a processor, are used to implement the aforementioned method for generating an analysis report.

[0036] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed, the aforementioned method for generating an analysis report is implemented.

[0037] The beneficial effects of the present invention are as follows: the present invention mainly solves the problem of how to use historical data to efficiently learn a set of accurate NLG templates and apply them to the field of automatic report generation. The present invention proposes a method for generating data analysis reports that achieves user interaction by combining NL2SQL technology to parse user intent and cooperate with insight data tables to perform selective text generation. The method adopts slot identification, domain knowledge rules, synonym libraries and other schemes to generate more accurate and diverse single-sentence descriptions. Through the scheme of single-sentence framework clustering, scattered single-sentence descriptions can be effectively spliced into a paragraph as a whole to form a paragraph template, thereby giving users a global information description. On the user interface, through the user's interactive modification, the modified part of the sample can be added to the historical data as high-weight training data to retrain the model, thereby continuously improving the generated template. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0039] Figure 1This is a flow chart of a method according to embodiment 1 of the present invention.

[0040] Figure 2 This is an example diagram of a fine-grained template.

[0041] Figure 3 This is a diagram of the domain reasoning relationship graph and synonym library.

[0042] Figure 4 This is a block diagram of a device according to embodiment 2 of the present invention. DETAILED DESCRIPTION

[0043] To facilitate understanding and implementation of the present invention by those skilled in the art, the technical solutions of the present invention are clearly and completely described below with reference to the accompanying drawings. It is apparent that the embodiments described are only some, not all, of the present invention. All other embodiments derived by those skilled in the art based on the embodiments of the present invention without inventive effort are intended to fall within the scope of protection of the present invention.

[0044] Natural Language Generation (NLG) is the study of giving computers the ability to express and write like humans, that is, to be able to automatically generate a high-quality natural language text based on some key information and its internal expression in the machine through a planning process. Generally speaking, the processing steps of NLG mainly include the following three steps: paragraph planning, micro-planning and surface implementation. Paragraph planning involves the question of what to write, which is mainly achieved through user interaction, intent recognition, and content selection. Micro-planning involves the question of how to write, which is mainly achieved through domain knowledge rules, slot recognition, etc. Surface implementation involves the issue of good writing, which is mainly expressed through accuracy, readability, and diversity.

[0045] NL2SQL (Natural Language to SQL) is a technology that converts natural language questions into SQL query statements through technologies such as intent recognition. NL2SQL is not introduced in detail in this patent application.

[0046] Example 1

[0047] See Figure 1 A first embodiment of the present invention provides a method for automatically generating an interactive data analysis report, the method comprising:

[0048] S101: Receive user query information. For example, the user enters the query "Yesterday's overall GMV situation of Tmall" through the interactive interface.

[0049] S102: Analyze the user intention in the query information.

[0050] Parsing the user intent in the query information includes: parsing the query information into multiple structured fields, where the multiple structured fields are used to represent the user intent. Specifically, based on the multiple structured fields, the NL2SQL technology is used to generate corresponding SQL statements. For example, when a user asks "What was the overall GMV of Tmall yesterday?", the intent parsing model will parse this question into the format of implicit table 1. Implicit table 1 has three structured fields: d1, d2, and d3. The NL2SQL technology then restores this to the corresponding SQL statement:

[0051] Select GMV from insights table where date = yesterday and domain = Tmall.

[0052] S103. According to the user's intention, a query is performed in the preset natural language generation (NLG) storage information to obtain descriptive information corresponding to the query information. In the interactive query report scenario, for the chapter planning stage, it can be generated according to the following logic. The intelligent insight platform uses the insight algorithm to generate a batch of exception tables, drill-down tables, etc. in the field every day. The backend uses the NLG algorithm to periodically generate corresponding text descriptions from the structured information generated by the insight for storage. At the top level, the user's intention is parsed through some NL2SQL methods, and queries are performed in the NLG storage information through these intentions to obtain the information the user wants to inquire about.

[0053] Use the above SQL statement to query information in the pre-generated insight table to obtain the corresponding information description: Yesterday, Tmall's overall GMV was ** billion yuan, a significant year-on-year increase of 20% and a slight increase of 1% month-on-month, showing an overall upward trend.

[0054] S104: Generate an analysis report of the query information according to the description information.

[0055] Specifically, step S104 includes: S1041, performing slot identification on the description information to obtain information of different slots; organizing the information of different slots according to rules in the domain rule library to obtain description information of a single sentence.

[0056] During the micro-planning phase, this solution primarily relies on slot identification and domain inference rules. Slot identification technology abstracts the information to be expressed, such as what dimension of information is being discussed, which indicators within these dimensions are of interest, and how these indicators perform.

[0057] After abstracting these slots, we can use similar Figure 2Some templates are used to generate corresponding descriptions. Among them, some modifiers, such as whether the current indicator is very obvious or abnormally significant, are the surface implementations in the NLG step, that is, the question of how to write the current copy well. Specifically for the current scenario, some simpler solutions can be adopted, such as setting some domain rule libraries. Figure 3 As shown in the figure, for some specific dimension indicators, by setting corresponding thresholds for different descriptions and designing corresponding synonym libraries, we can achieve a certain degree of description diversity. This will generate text descriptions similar to the following lines:

[0058] This week, the GMV of consumer electronics (783 million) soared 27.8% year-on-year.

[0059] 3C digital products (433 million) saw a rapid year-on-year increase of 38.2%, with the mobile phone subcategory showing the most outstanding performance with a year-on-year increase of more than 40%.

[0060] By industry, 3C digital products and household appliances are more significantly affected.

[0061] S1042: Concatenate the description information of multiple single sentences to generate an analysis report of the query information.

[0062] The slot identification and domain knowledge rules mentioned above are all used to accurately, professionally, and diversely describe information in single-sentence descriptions. However, a complete data analysis report should be composed of multiple sentences in series. Therefore, this invention focuses on optimizing the function of automatically extracting single-sentence templates from training and splicing them into a complete paragraph. The specific steps are as follows:

[0063] S1042A. Identify the domain labels of interest in each sentence, including predicates and entity words, and abstract the training corpus.

[0064] Organize the corpus, sort out the key slots, and then abstract the original sentence into an intermediate framework. For example, the following two sentences can be abstracted into a similar framework:

[0065] In terms of industries, 3C digital products and household appliances are more significantly affected.

[0066] From a regional perspective, the increases were most significant in Shanghai and Beijing.

[0067] Can be abstracted into:

[0068] From the perspective of [dimension], [performance modifier] is affected by [dimensional entity] and [dimensional entity].

[0069] From the perspective of [dimension], [dimensional entity] and [dimensional entity] region [performance modifier].

[0070] After this step, each sentence is represented in the style of intermediate frame templates.

[0071] S1042B. Cluster the intermediate frames according to some semi-empirical methods, such as clustering based only on verbs or modifiers in the template.

[0072] a.{CuId:001}–From the perspective of [dimension], [performance modifier] is affected by [dimensional entity] and [dimensional entity].

[0073] b.{CuId:001} – From the perspective of [dimension], [dimensional entity] and [dimensional entity] region [performance modifier].

[0074] c.{CuId:002}–[Dimensional entity] also has [verb] compared to the previous year.

[0075] Each template is labeled with a category ID CuId. We can see that the two intermediate frames a and b belong to the same cluster.

[0076] S1042C, each cuid class counts some features.

[0077] For example, the template class distribution at each position (for example, if cuid1 appears 5 times, cuid2 2 times, and cuid3 1 time in the first sentence, then the template in cuid1 is most likely to be selected in the first sentence), as well as the average number of verbs, average number of entities, ngram word frequency, etc.

[0078] S1042D, build a sorting model to select the appropriate template for each position.

[0079] One or more training samples can be generated for each sentence at each position in each training document. If it is a point-wise model, the current sentence and the candidate template are directly matched (using methods such as edit distance). If a match is found, the template sample at the current position is marked as 1, otherwise it is marked as 0.

[0080] In listwise matching, each template has several features, and the labels are ranked from 1 to 10. The current sentence is then matched against the templates using methods such as edit distance (top 10 can be selected for simplification). We can also generate new metrics based on the above statistics, such as whether the cuid of the current template matches the cuid of the template with the highest number of occurrences at the current position, the degree of entity overlap between the current template and the template with the highest number of occurrences at the current position, and so on.

[0081] Finally, the sorting model can be trained using an SVM sorting model based on the above features. Of course, these features also reveal a sequential relationship: the template at position N depends on several templates preceding it. This allows for training using an LSTM model.

[0082] S1042E, template-based generation.

[0083] When generating, the algorithm works sentence by sentence. Each time it reaches a certain position, it uses feature scoring and the model to select the most appropriate template, then fills it in based on the input data. The generated sentence is appended to the end of the new article, and then the next sentence is generated.

[0084] Finally, the following complete paragraph description can be generated:

[0085] This week, the GMV of consumer electronics (783 million) soared 27.8% year-on-year.

[0086] By industry, 3C digital products and household appliances are more significantly affected.

[0087] 3C digital products (433 million) saw a rapid year-on-year increase of 38.2%, with the mobile phone subcategory showing the most outstanding performance with a year-on-year increase of more than 40%.

[0088] By region, the increases were most significant in Shanghai and Beijing.

[0089] Optionally, the method further includes step S105, receiving adjustment information of the user for the analysis report; generating high-weight samples according to the adjustment information; and training the NLG storage information using the high-weight samples.

[0090] Through the user interaction interface, users can adjust the information of unsatisfactory single-sentence granularity, or adjust the order of single sentences in the global granularity template. The adjusted results can be used as high-weight samples to participate in the historical template learning model, retrain the template, and continuously improve the existing template.

[0091] Example 2

[0092] See Figure 4 The second embodiment of the present invention provides an interactive data analysis report automatic generation device 400, the device comprising:

[0093] Receiving module 401, receiving user's inquiry information;

[0094] Parsing module 402, parsing the user intention in the query information;

[0095] A query module 403 queries the preset natural language generation (NLG) storage information according to the user's intention to obtain description information corresponding to the query information;

[0096] A generating module 404 generates an analysis report of the query information according to the description information;

[0097] The NLG storage information is generated by using an NLG algorithm to generate corresponding text descriptions from the structured information generated by the insights for storage.

[0098] Preferably, the adjustment module 405 is configured to receive adjustment information of the user for the analysis report; generate high-weight samples according to the adjustment information; and train the NLG storage information using the high-weight samples.

[0099] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices, modules and units can refer to the corresponding processes of the aforementioned method embodiments and will not be repeated here.

[0100] In addition, an embodiment of the present invention further discloses an electronic device, which includes a storage device and one or more processors, wherein the storage device is used to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in Example 1.

[0101] An embodiment of the present invention further discloses a computer program product, including computer program instructions, which are used to implement the method of the first embodiment when the instructions are executed by a processor.

[0102] An embodiment of the present invention further discloses a computer-readable storage medium having a computer program stored thereon. When the computer program is executed, the method of the first embodiment is implemented.

[0103] The flowcharts and block diagrams in the accompanying drawings illustrate possible architectures, functions, and operations of methods, apparatus, and computer program products according to various embodiments of the present invention. In this regard, each box in the flowcharts and block diagrams may represent a module, program segment, or portion of code, comprising one or more computer-executable instructions for implementing a logical function. It should also be noted that in some alternative implementations, the functions noted in the boxes may also occur in an order different from that noted in the accompanying drawings. It should also be noted that each box or combination of boxes in the block diagrams and flowcharts may be implemented using a dedicated hardware-based system that performs the specified function or action, or may be implemented using a combination of dedicated hardware and computer instructions.

[0104] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.

[0105] The above description of the disclosed embodiments is intended to enable those skilled in the art to implement or use the present invention. The above embodiments are provided for illustrative purposes only and are not intended to limit the scope of the present invention. It will be apparent to those skilled in the art that other variations or modifications may be made based on the above description, and such variations or modifications will fall within the scope of the present invention.

Claims

1. A method for generating an analysis report, characterized in that: include: Receive user inquiry information; Analyzing the user's intention in the query information; Querying preset natural language generation (NLG) storage information according to the user's intention to obtain description information corresponding to the query information; Perform slot identification on the description information to obtain information of different slots; According to the rules in the domain rule library, the information of the different slots is organized to obtain description information of a single sentence; Concatenate the description information of multiple single sentences to generate an analysis report of the query information; The NLG storage information is generated by using an NLG algorithm to generate corresponding text descriptions from the structured information generated by the insights and store them.

2. The method according to claim 1, characterized in that The analyzing the user intention in the query information includes: The query information is parsed into a plurality of structured fields, where the plurality of structured fields are used to represent the user intention.

3. The method according to claim 2, characterized in that The method further comprises: Generate corresponding SQL statements using NL2SQL technology according to the multiple structured fields; Accordingly, the querying in the preset natural language generation (NLG) storage information according to the user intention includes: The SQL statement is used to query the preset NLG storage information.

4. The method according to claim 1, wherein The step of concatenating the description information of multiple single sentences includes: Identifying a focused slot in a single sentence, and abstracting the single sentence into an intermediate frame according to the focused slot; Clustering the intermediate frames of multiple single sentences to obtain one or more features of each intermediate frame; According to the constructed sorting model, select appropriate intermediate frames as templates for multiple sentences; Fill in the slot information of interest in a single sentence into the template and splice it.

5. The method according to claim 4, characterized in that Clustering the intermediate frames of multiple single sentences includes: The intermediate frames are clustered according to the verbs or modifiers in the single sentence.

6. The method according to claim 1, characterized in that The method further comprises: A corresponding synonym library is provided for information in different slots, and the words in the synonym library are used to replace the information in the corresponding slot when generating the description information of a single sentence.

7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: receiving adjustment information of the user for the analysis report; generating high-weight samples according to the adjustment information; The NLG stored information is trained using the high-weight samples.

8. A device for generating an analysis report, characterized in that: The device comprises: A receiving module, configured to receive inquiry information from a user; A parsing module, configured to parse the user's intention in the query information; A query module, configured to query preset natural language generation (NLG) storage information according to the user's intention and obtain description information corresponding to the query information; A generation module is configured to identify slots of the description information to obtain information of different slots; organize the information of different slots according to rules in a domain rule library to obtain description information of a single sentence; and concatenate the description information of multiple single sentences to generate an analysis report of the query information; The NLG storage information is generated by using an NLG algorithm to generate corresponding text descriptions from the structured information generated by the insights and store them.

9. An electronic device, characterized in that: The device comprises: storage device; one or more processors; The storage device is used to store one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method for generating an analysis report according to any one of claims 1 to 7.

10. A computer program product, comprising computer program instructions, which, when executed by a processor, are used to implement the method for generating an analysis report according to any one of claims 1 to 7.

11. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed, the method for automatically generating an analysis report according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Cognitive conversational agent for providing personalized insights on-the-fly

    CN109992650A