Text output method and apparatus in data analysis

CN116933752BActive Publication Date: 2026-10-23ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310871216.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-14
Publication Date
2026-10-23
Estimated Expiration
2043-07-14

AI Technical Summary

Technical Problem

[0003]现有技术中,在进行数据分析中的文本输出时,常常无法适应分析场景的多样性,使得文本输出的灵活性和精确性无法得到保证

Benefits of technology

[0043]通过本说明书实施例提供的方法和装置,首先确定目标分析任务所针对的度量和分析方法,并根据所述度量和分析方法执行所述目标分析任务,得到数据分析结果;然后根据参数配置信息,从所述数据分析结果中提取预先设定的特征参数的第一参数值,和普通参数的第二参数值;接着获取针对所述分析方法配置的初始文字表达模板;再根据所述第一参数值,调整所述初始文字表达模板的内容,得到专用文字表达模板;最后根据所述第二参数值,填充所述专用文字表达模板,得到所述数据分析结果的文本输出结果。由上可见,本说明书实施例,针对分析方法配置初始文字表达模板,该初始文字表达模板能够体现分析方法的特性,并且该初始文字表达模板不是固定不变的,而是可以根据数据分析结果中特征参数的参数值进行调整的,得到专用文字表达模板,再基于数据分析结果中普通参数的参数值填充该专用文字表达模板,就得到了文本输出结果,其中,特征参数的参数值体现了分析场景的特性,能够适应分析场景的多样性,保证文本输出的灵活性和精确性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116933752B_ABST
    Figure CN116933752B_ABST
Patent Text Reader

Abstract

The embodiment of the specification provides a text output method and device in data analysis, the method comprises the following steps: determining a metric and an analysis method for a target analysis task, and performing the target analysis task according to the metric and the analysis method to obtain a data analysis result; extracting a first parameter value of a pre-set feature parameter and a second parameter value of a general parameter from the data analysis result according to parameter configuration information; obtaining an initial literal expression template configured for the analysis method; adjusting the content of the initial literal expression template according to the first parameter value to obtain a special literal expression template; and filling the special literal expression template according to the second parameter value to obtain a text output result of the data analysis result. The method can adapt to the diversity of analysis scenes and guarantee the flexibility and accuracy of the text output.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to one or more embodiments in the field of computers, and more particularly to text output methods and apparatus in data analysis. Background Technology

[0002] In the field of data analysis, results are often presented to users in the form of charts and graphs. This method requires significant screen space and is not easily understood by users, unlike the concise and efficient use of natural language. For example, in multidimensional analysis scenarios, displaying multiple dimensions of indicator data through charts requires users to interpret the charts, analyze and compare the data across multiple dimensions, and summarize the data characteristics. Natural language, on the other hand, can directly present these data characteristics, reducing the user's comprehension burden. Furthermore, data analysis can include statistical analysis of private data, necessitating the protection of this privacy.

[0003] In existing technologies, text output in data analysis often fails to adapt to the diversity of analysis scenarios, making it impossible to guarantee the flexibility and accuracy of text output. Summary of the Invention

[0004] This specification describes one or more embodiments of a text output method and apparatus in data analysis, which can adapt to the diversity of analysis scenarios and ensure the flexibility and accuracy of text output.

[0005] Firstly, a method for text output in data analysis is provided, the method including:

[0006] Determine the metrics and analysis methods targeted by the target analysis task, and execute the target analysis task according to the metrics and analysis methods to obtain data analysis results;

[0007] Based on the parameter configuration information, extract the first parameter value of the pre-set feature parameter and the second parameter value of the ordinary parameter from the data analysis results;

[0008] Obtain the initial text expression template configured for the analysis method;

[0009] Based on the first parameter value, adjust the content of the initial text expression template to obtain a dedicated text expression template;

[0010] Based on the second parameter value, the special text expression template is filled to obtain the text output result of the data analysis result.

[0011] In one possible implementation, the determination of the metrics and analysis methods targeted by the objective analysis task includes:

[0012] Receive an instruction that triggers the target analysis task, which carries a metric identifier and a method identifier;

[0013] The metric identified by the metric identifier is determined as the metric targeted by the target analysis task, and the analysis method identified by the method identifier is determined as the analysis method targeted by the target analysis task.

[0014] In one possible implementation, the determination of the metrics and analysis methods targeted by the objective analysis task includes:

[0015] Receive an instruction to trigger the target analysis task, which carries a metric identifier and analysis intent;

[0016] The metric identified by the metric identifier is determined as the metric targeted by the target analysis task, and the analysis method corresponding to the analysis intent is determined as the analysis method targeted by the target analysis task based on the analysis intent and the pre-set correspondence between analysis intent and analysis method.

[0017] In one possible implementation, the initial text expression template is configured as a first structure; the first structure includes a content identifier to be filled corresponding to the general parameters, and a content identifier to be adjusted corresponding to the feature parameters.

[0018] In one possible implementation, the initial text expression template includes at least one pre-configured article structure, the article structure including at least one pre-configured paragraph, the paragraph including at least one pre-configured statement, and the statement including at least one pre-configured phrase.

[0019] Furthermore, the parameter values ​​of the feature parameters are used to identify whether the first business phenomenon has occurred; adjusting the content of the initial text expression template includes:

[0020] Determine whether the value of the first parameter belongs to a preset first value range; the first value range indicates that the first business phenomenon has not occurred;

[0021] When it is determined that the first parameter value belongs to a preset first value range, delete the first article structure in the initial text expression template used to describe the first business phenomenon or delete the first paragraph in the first article structure.

[0022] Furthermore, the first business phenomenon is a data anomaly state.

[0023] Furthermore, the parameter values ​​of the feature parameters are used to identify the target analysis result that may occur in the first and second analysis results; adjusting the content of the initial text expression template includes:

[0024] Determine whether the first parameter value belongs to a preset second value range; the second value range identifies the target analysis result as the first analysis result;

[0025] When it is determined that the first parameter value belongs to a preset second value range, it is determined that the first phrase in the initial text expression template includes a first optional word; the first optional word is used to describe the first analysis result;

[0026] When it is determined that the first parameter value does not belong to the preset second value range, the first phrase in the initial text expression template is determined to include a second optional word; the second optional word is used to describe the second analysis result.

[0027] Furthermore, the first analysis result shows a month-on-month increase in the metric value; the second analysis result shows a month-on-month decrease in the metric value; the first selectable word is the highest; and the second selectable word is the lowest.

[0028] Furthermore, the initial text expression template includes a first initial sub-template and multiple second initial sub-templates in a sequential order; adjusting the content of the initial text expression template includes:

[0029] Based on the first parameter value, adjust the content of the first initial sub-template to obtain the first dedicated sub-template;

[0030] Based on the first dedicated sub-template, select the second initial sub-template to be adjusted from a plurality of second initial sub-templates;

[0031] Adjust the content of the selected second initial sub-template to obtain the second dedicated sub-template; the first dedicated sub-template and the second dedicated sub-template constitute the dedicated text expression template.

[0032] In one possible implementation, filling the dedicated text expression template includes:

[0033] Find the location of the parameter identifier corresponding to the second parameter value in the dedicated text expression template;

[0034] The second parameter value is filled into the position of the parameter identifier in the special text expression template to obtain the text output result of the data analysis result.

[0035] Secondly, a text output device for data analysis is provided, the device comprising:

[0036] An execution unit is used to determine the measurement and analysis methods targeted by the target analysis task, and to execute the target analysis task according to the measurement and analysis methods to obtain data analysis results;

[0037] The extraction unit is used to extract the first parameter value of the pre-set feature parameter and the second parameter value of the ordinary parameter from the data analysis results obtained by the execution unit according to the parameter configuration information.

[0038] The acquisition unit is used to acquire the initial text expression template configured for the analysis method determined by the execution unit;

[0039] An adjustment unit is used to adjust the content of the initial text expression template obtained by the acquisition unit according to the first parameter value extracted by the extraction unit, so as to obtain a special text expression template;

[0040] The filling unit is used to fill the special text expression template obtained by the adjustment unit according to the second parameter value extracted by the extraction unit, so as to obtain the text output result of the data analysis result obtained by the execution unit.

[0041] Thirdly, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method of the first aspect.

[0042] Fourthly, a computing device is provided, including a memory and a processor, wherein the memory stores executable code, and the processor executes the executable code to implement the method of the first aspect.

[0043] The method and apparatus provided in the embodiments of this specification first determine the measurement and analysis method targeted by the target analysis task, and execute the target analysis task according to the measurement and analysis method to obtain data analysis results; then, according to parameter configuration information, extract the first parameter value of the pre-set feature parameters and the second parameter value of the ordinary parameters from the data analysis results; next, obtain an initial text expression template configured for the analysis method; then, adjust the content of the initial text expression template according to the first parameter value to obtain a dedicated text expression template; finally, fill the dedicated text expression template according to the second parameter value to obtain the text output result of the data analysis result. As can be seen from the above, in the embodiments of this specification, an initial text expression template is configured for the analysis method. This initial text expression template can reflect the characteristics of the analysis method, and it is not fixed but can be adjusted according to the parameter values ​​of the feature parameters in the data analysis results to obtain a dedicated text expression template. Then, by filling the dedicated text expression template based on the parameter values ​​of the ordinary parameters in the data analysis results, the text output result is obtained. The parameter values ​​of the feature parameters reflect the characteristics of the analysis scenario, can adapt to the diversity of analysis scenarios, and ensure the flexibility and accuracy of the text output. Attached Figure Description

[0044] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0045] Figure 1 This is a schematic diagram illustrating an implementation scenario of one embodiment disclosed in this specification;

[0046] Figure 2 A flowchart illustrating a text output method in data analysis according to one embodiment is shown;

[0047] Figure 3 A schematic diagram illustrating an online processing procedure in data analysis according to one embodiment is shown;

[0048] Figure 4 A schematic diagram illustrating the processing procedure for an initial text expression template according to one embodiment is shown;

[0049] Figure 5 A schematic block diagram of a text output device in data analysis according to one embodiment is shown. Detailed Implementation

[0050] The solution provided in this specification will now be described with reference to the accompanying drawings.

[0051] Figure 1 This is a schematic diagram illustrating an implementation scenario of one embodiment disclosed in this specification. This implementation scenario involves text output in data analysis; that is, the aforementioned text output refers to the output of data analysis results through natural language expression. Data analysis: Analyzing large amounts of collected data using appropriate statistical analysis methods, summarizing, understanding, and digesting them to maximize the development of data functions and leverage their potential. Data analysis is the process of detailed study and summarization of data to extract useful information and form conclusions.

[0052] Reference Figure 1 In the field of data analysis, data analysis results are often presented to users in the form of charts. For example, a table shows the value of a certain metric for each month, and a pie chart shows the percentage of the value of a certain metric for each city. This way of presentation takes up a lot of screen space and is not easy for users to understand, and it cannot directly give the data characteristics. However, the text "The metric value is 100 today, an increase of 10% month-on-month. The month-on-month trend has been gradually rising over the past three months. Among them, the cities with the highest percentage are Shanghai (15%) and Beijing (12%). The top three cities in terms of growth contribution are Shanghai, Guangzhou, and Hangzhou" can directly give the data characteristics and reduce the user's understanding cost.

[0053] Data analysis faces diverse analytical scenarios. For example, the metrics targeted by the analytical task can be a company's sales or financial returns, the analytical methods can be month-on-month or year-on-year comparisons, and the data analysis results can be month-on-month increases, month-on-month decreases, year-on-year increases, year-on-year decreases, etc.

[0054] This embodiment of the specification describes a method for obtaining text output results of data analysis by pre-configuring a text expression template and then filling the template with data analysis results. Specifically, an initial text expression template is pre-configured for the analysis method, and then a dedicated text expression template is obtained by adjusting the initial template based on the data analysis results. Filling this dedicated template with data expression results yields the text output, thus adapting to the diversity of analysis scenarios.

[0055] Figure 2 This diagram illustrates a text output method in data analysis according to one embodiment, which can be based on... Figure 1 The implementation scenario is shown. For example... Figure 2 As shown, the text output method in data analysis in this embodiment includes the following steps: Step 21, determine the measurement and analysis method targeted by the target analysis task, and execute the target analysis task according to the measurement and analysis method to obtain data analysis results; Step 22, extract the first parameter value of the pre-set feature parameter and the second parameter value of the ordinary parameter from the data analysis results according to the parameter configuration information; Step 23, obtain the initial text expression template configured for the analysis method; Step 24, adjust the content of the initial text expression template according to the first parameter value to obtain a dedicated text expression template; Step 25, fill the dedicated text expression template according to the second parameter value to obtain the text output result of the data analysis result. The specific execution method of each of the above steps is described below.

[0056] First, in step 21, the metrics and analysis methods targeted by the objective analysis task are determined, and the objective analysis task is executed according to the metrics and analysis methods to obtain data analysis results. It is understood that data analysis involves analyzing large amounts of data. Determining the metrics targeted by the objective analysis task determines the data to be analyzed, while the analysis method reflects how the data is analyzed and also determines the parameters included in the data analysis results.

[0057] In the embodiments described in this specification, the user can directly set the above-mentioned measurement and analysis methods; or the user can first set the above-mentioned measurement and analysis intentions, and then the computer determines the analysis method corresponding to the analysis intention. For example, the user's analysis intention may include various intentions such as recent changes in a certain metric, long-term trends, the proportion of each dimension, and fluctuation analysis. If graphical means such as reports are used, it is necessary to set up components such as indicator cards, pie charts, line charts, and fluctuation analysis, which occupies a lot of screen space and makes it difficult to summarize data characteristics. However, data characteristics can be directly given through textual descriptions.

[0058] In one example, determining the metrics and analysis methods targeted by the objective analysis task includes:

[0059] Receive an instruction that triggers the target analysis task, which carries a metric identifier and a method identifier;

[0060] The metric identified by the metric identifier is determined as the metric targeted by the target analysis task, and the analysis method identified by the method identifier is determined as the analysis method targeted by the target analysis task.

[0061] In this example, the above-mentioned metrics and analysis methods are directly set by the user, which can accurately determine the analysis methods.

[0062] In another example, the determination of the metrics and analysis methods targeted by the objective analysis task includes:

[0063] Receive an instruction to trigger the target analysis task, which carries a metric identifier and analysis intent;

[0064] The metric identified by the metric identifier is determined as the metric targeted by the target analysis task, and the analysis method corresponding to the analysis intent is determined as the analysis method targeted by the target analysis task based on the analysis intent and the pre-set correspondence between analysis intent and analysis method.

[0065] In this example, the user first sets the aforementioned metrics and analysis intent, and then the computer determines the analysis method corresponding to the analysis intent. The analysis intent is a textual expression that is easy for the user to understand, and the analysis method is a formulaic abstract expression. The user sets the analysis intent, which is convenient for the user to understand and operate.

[0066] Then, in step 22, based on the parameter configuration information, the first parameter value of the pre-defined feature parameters and the second parameter value of the ordinary parameters are extracted from the data analysis results. It can be understood that the parameter configuration information records which parameters are feature parameters and which are ordinary parameters.

[0067] In this embodiment of the specification, the characteristic parameters and general parameters are preset, while the first parameter value and the second parameter value are extracted from the data analysis results. That is to say, the first parameter value and the second parameter value cannot be known before the data analysis. Among them, the parameter value of the characteristic parameter can be used to indicate the purpose of the analysis method, the meaning or characteristics of the preset index, etc., and the parameter value of the general parameter can be the index value of the preset index, etc.

[0068] Next, in step 23, an initial text expression template configured for the analysis method is obtained. It is understood that analysis methods typically fall into multiple categories, and an initial text expression template can be configured separately for each category of analysis method.

[0069] In one example, the initial text expression template is configured as a first structure; the first structure contains a content identifier to be filled corresponding to the general parameters, and a content identifier to be adjusted corresponding to the feature parameters.

[0070] For example, the initial text template configured for the analysis method is "month-on-month A (increase / decrease) B", where A represents the feature parameter, A (increase / decrease) represents the content to be adjusted, and B represents the ordinary parameter, which also represents the content to be filled.

[0071] In one example, the initial text expression template includes at least one pre-configured article structure, the article structure includes at least one pre-configured paragraph, the paragraph includes at least one pre-configured statement, and the statement includes at least one pre-configured phrase.

[0072] In the embodiments described in this specification, the text output result can be regarded as a narrative, and its construction can follow the following strategy:

[0073] Strategy 1: First, establish the main structure of the article, then fill in the content within that structure.

[0074] An article first has a main structure, such as a "general-specific" or "general-specific-general" structure. Each structure carries a narrative content. For example, in a "general-specific-general" structure, the current data situation is summarized first, then the data phenomena and their impacts are described from various dimensions, and finally, the resulting problems and future plans are summarized. The main structure of an article can be determined by its theme or application scenario. A "general" or "specific" structure is called an article structure (section). An article can contain one or more article structures; this relationship can be represented as narrative-*section.

[0075] Strategy Two: Each paragraph contains a complete analysis and description of a business phenomenon, and the data analysis results determine whether it should exist.

[0076] Once the article structure is determined, the paragraphs configured for each structure are not guaranteed to exist. For example, in a "general-specific-specific-general" structure, if the second "specific" describes the data in anomaly states from different dimensions, and there is no anomaly data, then no paragraph will exist in this article structure; therefore, "general-specific-specific-general" will be displayed as "general-specific-general". Similarly, if an article structure contains three paragraphs describing year-on-year and month-on-month comparisons, trends, and anomaly analysis, respectively, and the data analysis results indicate no anomalies (i.e., the data is considered normal), then there is no need to output the description of the anomaly analysis paragraph. A paragraph can contain multiple statements, which together constitute the content described in the paragraph. A statement can contain data characteristics, analysis conclusions, a business phrase, or an objective phenomenon. Whether a paragraph is displayed depends on whether the content or phenomenon described in the paragraph has occurred. A paragraph in a structure can be defined as a topic. An article structure can contain one or more topics; this relationship can be represented as section-*topic. A paragraph can contain multiple statements. A statement structure includes one or more conclusions, data, or user descriptions. The structure that produces such statements can be defined as an analysis method. The relationship between the topic structure and the analysis method can be represented as topic-*analytic.

[0077] Strategy 3: A statement can contain one or more analytical conclusions, and whether or not it should exist depends on whether the conclusion is meaningful.

[0078] A single statement often encompasses multiple analytical conclusions or query results. Each analytical conclusion and query result can be considered an independent data query or data analysis interface call. Therefore, an analytical method can correspond to an existing insight service, such as year-on-year / month-on-month comparisons or fluctuation analysis. In the embodiments of this specification, the function of the analytical method is essentially to extract the part of a statement that needs to be calculated, for subsequent logic to generate text. During the description phase, the conclusion given by the analytical result may be meaningless. In this case, the conclusion may not be described. Therefore, whether the content of a statement needs to be displayed is also determined by the result of the analytical method that generated the statement. The structure of text or phrases is defined as a phrase. A statement can consist of multiple phrases, and this relationship can be represented as analytic*-phrase.

[0079] Strategy 4: One analysis method can be applied to multiple paragraphs.

[0080] Most analytical methods, such as month-on-month comparisons and trends, can be described in a single sentence. However, scenarios like volatility analysis often require one or more paragraphs to describe the possible analytical conclusions. There is no strong correspondence between paragraphs and analytical methods here. Therefore, analytical methods can contain multiple paragraphs in their descriptive form. In the description phase, a paragraph is defined as a paragraph. The relationship between analytical methods, paragraphs, and phrases can be represented as (analytic-*paragraph-*phrase).

[0081] Strategy five: The analysis method not only determines your query behavior, but also your description method.

[0082] An analytical method can essentially be abstracted as obtaining a result from a dataset through a set of logics; the meaning of this result, whether the result is meaningful, and how to describe it can all be determined by itself. In principle, the analytical methods are independent of each other.

[0083] Strategy Six: The presentation format of the analysis method is determined by the data structure.

[0084] The data produced by an analysis method may exist in two structures: Map or List. <map>Generally, Maps have a flat structure and are presented using short sentences, while Lists... <map>The structure can be presented as a list or with delimiters. Since each word in a sentence can be an independent phrase, the behavior displayed within this phrase can be defined. For example, scenarios such as numerical highlighting, detailed trend charts describing trends, and text interactions linking to other paragraphs can all be handled by this structure.

[0085] Strategy 7: Each entity independently decides its own description method.

[0086] The entities mentioned above refer to the backend entities, namely the three entity objects: narrative, topic, and analysis method. The relationship between the three is one-to-many. The descriptions of the analysis methods can simply be linked together without describing the logical connection. The relationship in the query will be determined by the connection of the query plan.

[0087] In step 24, the content of the initial text expression template is adjusted according to the first parameter value to obtain a dedicated text expression template. It is understood that the above adjustments can include two aspects: adjusting the structure of the template and adjusting the phrases within the template.

[0088] In one example, the parameter value of the feature parameter is used to identify whether the first business phenomenon has occurred; adjusting the content of the initial text expression template includes:

[0089] Determine whether the value of the first parameter belongs to a preset first value range; the first value range indicates that the first service phenomenon has not occurred;

[0090] When it is determined that the first parameter value belongs to a preset first value range, delete the first article structure in the initial text expression template used to describe the first business phenomenon or delete the first paragraph in the first article structure.

[0091] Furthermore, the first business phenomenon is a data anomaly state.

[0092] In this example, for potential business phenomena, an article structure or paragraphs describing the business phenomenon are pre-configured in the initial text expression template. Subsequently, the occurrence of the business phenomenon can be determined based on the parameter values ​​of the feature parameters. If the business phenomenon is determined not to have occurred, the structure of the template can be flexibly adjusted to make the template more suitable for specific analysis scenarios.

[0093] In one example, the parameter values ​​of the feature parameters are used to identify the target analysis result that may occur in the first and second analysis results; adjusting the content of the initial text expression template includes:

[0094] Determine whether the first parameter value belongs to a preset second value range; the second value range identifies the target analysis result as the first analysis result;

[0095] When it is determined that the first parameter value belongs to a preset second value range, it is determined that the first phrase in the initial text expression template includes a first optional word; the first optional word is used to describe the first analysis result;

[0096] When it is determined that the first parameter value does not belong to the preset second value range, the first phrase in the initial text expression template is determined to include a second optional word; the second optional word is used to describe the second analysis result.

[0097] Furthermore, the first analysis result shows a month-on-month increase in the metric value; the second analysis result shows a month-on-month decrease in the metric value; the first selectable word is the highest; and the second selectable word is the lowest.

[0098] In this example, optional words for describing the two possible analysis results are pre-configured in the initial text expression template. Subsequently, the type of analysis result can be determined based on the parameter values ​​of the feature parameters, and the phrases in the template can be flexibly adjusted after determining the analysis result to make the template more suitable for specific analysis scenarios.

[0099] In one example, the initial text expression template includes a first initial sub-template and multiple second initial sub-templates in a sequential order; adjusting the content of the initial text expression template includes:

[0100] Based on the first parameter value, adjust the content of the first initial sub-template to obtain the first dedicated sub-template;

[0101] Based on the first dedicated sub-template, select the second initial sub-template to be adjusted from a plurality of second initial sub-templates;

[0102] Adjust the content of the selected second initial sub-template to obtain the second dedicated sub-template; the first dedicated sub-template and the second dedicated sub-template constitute the dedicated text expression template.

[0103] In this example, multiple sub-templates are set in the initial text expression template. The sub-templates with a sequential order are related to each other. The parameter values ​​of the feature parameters not only affect the content of the sub-templates that are ranked first, but also affect the selection of the sub-templates that are ranked later. This makes it easier to flexibly combine the sub-templates, increases the reusability of the sub-templates, and makes the templates more suitable for specific analysis scenarios.

[0104] Finally, in step 25, the dedicated text expression template is filled in according to the second parameter value to obtain the text output result of the data analysis result. It is understood that the text output result usually includes some specific data analysis results, for example, a 10% month-on-month increase, where the 10% is the content that needs to be filled in.

[0105] In one example, filling the dedicated text expression template includes:

[0106] Locate the parameter identifier corresponding to the second parameter value in the dedicated text expression template;

[0107] The second parameter value is filled into the position of the parameter identifier in the special text expression template to obtain the text output result of the data analysis result.

[0108] In the embodiments described in this specification, the implementation can follow the following logic: An analysis method generates variables, which constitute a data pool containing the data analysis results of this analysis method, including data or conclusions. The structure determines the descriptive form, including the structure used (phrase, paragraph, bullet), the organization method (contenttemplate), and the correspondence with the data (variable_id). Variables and structure are used to describe text data; both can determine whether the data is displayed. Variables determine the displayed features and content, while structure determines the display structure and order. All levels of natural language generation (NLG) objects complete text generation through this structure. A topic structure contains multiple analysis methods. Each analysis method describes a set of related or mergeable queries, acting as a data query service call. The analysis methods execute in parallel, summarizing the results at the topic structure level. The topic structure's structure then generates the article structure (section). A narrative contains multiple topic structures. Each topic structure includes related or mergeable business descriptions. As an abstraction of text structure, each topic structure is executed in parallel, and the results are aggregated at the narrative level. The narrative's schema is then generated through the narrative's structure.

[0109] Figure 3 This diagram illustrates an online processing procedure in data analysis according to one embodiment. (Refer to...) Figure 3 First, the user sets the metrics and analysis methods for this analysis task. Then, the computer performs the analysis, obtaining the parameter values ​​for feature parameters and ordinary parameters. Next, a dedicated text expression template is determined based on the feature parameter values ​​and the analysis method. This dedicated text expression template is then filled with the parameter values ​​for the ordinary parameters, resulting in the text output. It is understood that the aforementioned dedicated text expression template is obtained by adjusting an initial text expression template. An initial text expression template is pre-configured for the analysis method; the content of this initial text expression template is adjusted according to the feature parameter values ​​to obtain the dedicated text expression template.

[0110] Figure 4 This diagram illustrates a processing procedure for an initial text expression template according to one embodiment. (Refer to...) Figure 4 The initial text expression template includes several elements. After obtaining the current initial text expression template configured for the analysis method, its various elements can be scanned to extract the text elements. For each text element, it is determined whether it is a static element (constant). If the text element is determined to be a static element, it is directly output as part of the text output result. If the text element is not determined to be a static element, it is further determined whether it is a common variable (or, as mentioned earlier, a common parameter). If the text element is determined to be a common variable, its value is processed by rendering data and used as part of the text output result. If the text element is not determined to be a common variable, it is further determined whether it is a feature variable. The solution involves defining the feature variables as the aforementioned feature parameters. If a text element is determined to belong to a feature variable, the hit feature is further determined based on the value of that feature variable. For example, a value greater than 10 indicates a significant increase, while a value less than 0 indicates an abnormal decrease. Then, a corresponding feature output strategy is selected based on the hit feature, and it is determined whether the feature output strategy is a normal strategy or a template strategy. When the strategy is determined to be a normal strategy, the output content corresponding to that feature output strategy is rendered and used as part of the text data result. When the strategy is determined to be a template strategy, the output content corresponding to that feature output strategy is used as the value of the strategy variable, and the value of the strategy variable is used to determine the next initial text expression template. Furthermore, if a text element is determined not to belong to a feature variable, it is assumed to belong to the strategy variable, and the text element is used as the value of the strategy variable.

[0111] Understandable, Figure 4 The process shown involves adjusting the initial text expression template to obtain a dedicated text expression template, and filling the dedicated text expression template. These processes are performed simultaneously. Optionally, they can be performed sequentially. For example, the initial text expression template can be adjusted first to obtain a dedicated text expression template, and then the dedicated text expression template can be filled to obtain the text output result.

[0112] In the embodiments of this specification, an analysis task may target one or more metrics, and an analysis task may target one or more analysis methods. When there are multiple analysis methods, an initial text expression template can be configured for each analysis method. An analysis method may have one pre-configured initial text expression template or multiple initial text expression templates. An initial text expression template may include multiple initial text expression sub-templates. The feature parameters involved in an analysis method may be one or more, and the ordinary parameters involved in an analysis method may be one or more. It is understood that when an analysis task corresponds to multiple initial text expression templates, the processing method for each initial text expression template is similar, and will not be elaborated here.

[0113] The embodiments in this specification describe the following core steps for constructing the text output result. First, an initial text expression template is pre-configured, which is the design of the output structure. For example, the initial text expression template is "${metric_name} is ${metric_value}", where metric_name represents the variable name and metric_value represents the variable value. Then, after performing the data analysis task and obtaining the data analysis results, a variable structure (AbstractVariable) is constructed from the data analysis results. For example, the variable structure is {"metric_name":"unit price","metric_value":2}. Next, structured text content is generated using the variable structure and the initial text expression template, resulting in the structured text content "unit price is 2". Finally, the text structure is generated using the structural characteristics, such as the generated text structure being the phrase {"phrase":[{"value":"unit price"},{"value":"is"},{"value":2}]}.

[0114] The method provided in the embodiments of this specification first determines the measurement and analysis method targeted by the target analysis task, and executes the target analysis task according to the measurement and analysis method to obtain data analysis results. Then, according to parameter configuration information, a first parameter value of a pre-set feature parameter and a second parameter value of a common parameter are extracted from the data analysis results. Next, an initial text expression template configured for the analysis method is obtained. Then, according to the first parameter value, the content of the initial text expression template is adjusted to obtain a dedicated text expression template. Finally, according to the second parameter value, the dedicated text expression template is filled to obtain the text output result of the data analysis result. As can be seen from the above, in the embodiments of this specification, an initial text expression template is configured for the analysis method. This initial text expression template can reflect the characteristics of the analysis method, and the initial text expression template is not fixed but can be adjusted according to the parameter values ​​of the feature parameters in the data analysis results to obtain a dedicated text expression template. Then, the dedicated text expression template is filled based on the parameter values ​​of the common parameters in the data analysis results to obtain the text output result. The parameter values ​​of the feature parameters reflect the characteristics of the analysis scenario, can adapt to the diversity of analysis scenarios, and ensure the flexibility and accuracy of the text output.

[0115] According to another embodiment, a text output device for data analysis is also provided, which is used to perform the methods provided in the embodiments of this specification. Figure 5 A schematic block diagram of a text output device in data analysis according to one embodiment is shown. Figure 5 As shown, the device 500 includes:

[0116] The execution unit 51 is used to determine the measurement and analysis method targeted by the target analysis task, and execute the target analysis task according to the measurement and analysis method to obtain data analysis results;

[0117] Extraction unit 52 is used to extract the first parameter value of the pre-set feature parameter and the second parameter value of the ordinary parameter from the data analysis results obtained by execution unit 51 according to parameter configuration information;

[0118] The acquisition unit 53 is used to acquire the initial text expression template configured for the analysis method determined by the execution unit 51;

[0119] The adjustment unit 54 is used to adjust the content of the initial text expression template obtained by the acquisition unit 53 according to the first parameter value extracted by the extraction unit 52, so as to obtain a special text expression template;

[0120] The filling unit 55 is used to fill the special text expression template obtained by the adjustment unit 54 according to the second parameter value extracted by the extraction unit 52, so as to obtain the text output result of the data analysis result obtained by the execution unit 51.

[0121] Optionally, as an embodiment, the execution unit 51 includes:

[0122] The first receiving subunit is used to receive an instruction that triggers the target analysis task, which carries a metric identifier and a method identifier;

[0123] The first determining subunit is configured to determine the metric identified by the metric identifier obtained by the first receiving subunit as the metric targeted by the target analysis task, and to determine the analysis method identified by the method identifier obtained by the first receiving subunit as the analysis method targeted by the target analysis task.

[0124] Optionally, as an embodiment, the execution unit 51 includes:

[0125] The second receiving subunit is used to receive an instruction that triggers the target analysis task, which carries a metric identifier and analysis intent;

[0126] The second determining subunit is used to determine the metric identified by the metric identifier obtained by the second receiving subunit as the metric targeted by the target analysis task, and to determine the analysis method corresponding to the analysis intent as the analysis method targeted by the target analysis task based on the analysis intent obtained by the second receiving subunit and the pre-set correspondence between analysis intent and analysis method.

[0127] Optionally, as an embodiment, the initial text expression template is configured as a first structure; the first structure includes a content identifier to be filled corresponding to the general parameters, and a content identifier to be adjusted corresponding to the feature parameters.

[0128] Optionally, as an embodiment, the initial text expression template includes at least one pre-configured article structure, the article structure including at least one pre-configured paragraph, the paragraph including at least one pre-configured statement, and the statement including at least one pre-configured phrase.

[0129] Furthermore, the parameter values ​​of the feature parameters are used to identify whether the first service phenomenon has occurred; the adjustment unit 54 includes:

[0130] The first judgment subunit is used to determine whether the first parameter value belongs to a preset first value range; the first value range indicates that the first service phenomenon has not occurred.

[0131] The deletion subunit is used to delete the first article structure describing the first business phenomenon or delete the first paragraph in the first article structure when the first judgment subunit determines that the first parameter value belongs to a preset first value range.

[0132] Furthermore, the first business phenomenon is a data anomaly state.

[0133] Furthermore, the parameter values ​​of the feature parameters are used to identify the target analysis result that may occur in the first and second analysis results; the adjustment unit 54 includes:

[0134] The second judgment subunit is used to determine whether the first parameter value belongs to a preset second value range; the second value range identifies the target analysis result as the first analysis result;

[0135] The selection subunit is used to determine that the first phrase in the initial text expression template includes a first optional word when the second judgment subunit determines that the first parameter value belongs to a preset second value range; the first optional word is used to describe the first analysis result.

[0136] The selection subunit is further configured to determine that the first phrase in the initial text expression template includes a second optional word when the second judgment subunit determines that the first parameter value does not belong to the preset second value range; the second optional word is used to describe the second analysis result.

[0137] Furthermore, the first analysis result shows a month-on-month increase in the metric value; the second analysis result shows a month-on-month decrease in the metric value; the first selectable word is the highest; and the second selectable word is the lowest.

[0138] Furthermore, the initial text expression template includes a first initial sub-template and multiple second initial sub-templates in a sequential order; the adjustment unit 54 includes:

[0139] The first adjustment subunit is used to adjust the content of the first initial sub-template according to the first parameter value to obtain the first dedicated sub-template;

[0140] A sub-unit is selected to select a second initial sub-template to be adjusted from a plurality of second initial sub-templates based on a first dedicated sub-template obtained by the first adjustment sub-unit.

[0141] The second adjustment subunit is used to adjust the content of the second initial sub-template selected by the selection subunit to obtain the second special sub-template; the first special sub-template and the second special sub-template constitute the special text expression template.

[0142] Optionally, as an embodiment, the filling unit 55 includes:

[0143] The search subunit is used to find the location of the parameter identifier corresponding to the second parameter value in the dedicated text expression template;

[0144] The fill sub-unit is used to fill the second parameter value into the position of the parameter identifier found by the search sub-unit in the dedicated text expression template, so as to obtain the text output result of the data analysis result.

[0145] Using the apparatus provided in the embodiments of this specification, firstly, the execution unit 51 determines the measurement and analysis method targeted by the target analysis task, and executes the target analysis task according to the measurement and analysis method to obtain data analysis results; then, the extraction unit 52 extracts the first parameter value of the pre-set feature parameter and the second parameter value of the ordinary parameter from the data analysis results according to the parameter configuration information; next, the acquisition unit 53 acquires the initial text expression template configured for the analysis method; then, the adjustment unit 54 adjusts the content of the initial text expression template according to the first parameter value to obtain a dedicated text expression template; finally, the filling unit 55 fills the dedicated text expression template according to the second parameter value to obtain the text output result of the data analysis result. As can be seen from the above, in the embodiments of this specification, an initial text expression template is configured for the analysis method. This initial text expression template can reflect the characteristics of the analysis method. Moreover, this initial text expression template is not fixed, but can be adjusted according to the parameter values ​​of the feature parameters in the data analysis results to obtain a dedicated text expression template. Then, the dedicated text expression template is filled with the parameter values ​​of the ordinary parameters in the data analysis results to obtain the text output result. Among them, the parameter values ​​of the feature parameters reflect the characteristics of the analysis scenario, can adapt to the diversity of analysis scenarios, and ensure the flexibility and accuracy of text output.

[0146] According to another embodiment, a computer-readable storage medium is also provided, on which a computer program is stored, which, when executed in a computer, causes the computer to perform a combination Figure 2 The method described.

[0147] According to another embodiment, a computing device is also provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements a combination... Figure 2 The method described.

[0148] Those skilled in the art will recognize that, in one or more of the examples above, the functions described in this invention can be implemented using hardware, software, firmware, or any combination thereof. When implemented in software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium.

[0149] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solution of the present invention should be included within the scope of protection of the present invention.< / map> < / map>

Claims

1. A text output method in data analysis, the method comprising: Determine the metrics and analysis methods for the target analysis task, and execute the target analysis task according to the metrics and analysis methods to obtain data analysis results; Based on the parameter configuration information, extract the first parameter value of the pre-set feature parameter and the second parameter value of the ordinary parameter from the data analysis results; Obtain the initial text expression template configured for the analysis method; Based on the first parameter value, adjust the content of the initial text expression template to obtain a dedicated text expression template; Based on the second parameter value, the special text expression template is filled to obtain the text output result of the data analysis result.

2. The method according to claim 1, wherein, The determination of the metrics and analysis methods for the target analysis task includes: Receive an instruction that triggers the target analysis task, which carries a metric identifier and a method identifier; The metric identified by the metric identifier is determined as the metric targeted by the target analysis task, and the analysis method identified by the method identifier is determined as the analysis method targeted by the target analysis task.

3. The method according to claim 1, wherein, The determination of the metrics and analysis methods for the target analysis task includes: Receive an instruction to trigger the target analysis task, which carries a metric identifier and analysis intent; The metric identified by the metric identifier is determined as the metric targeted by the target analysis task, and the analysis method corresponding to the analysis intent is determined as the analysis method targeted by the target analysis task based on the analysis intent and the pre-set correspondence between analysis intent and analysis method.

4. The method according to claim 1, wherein, The initial text expression template is configured as a first structure; the first structure contains a content identifier to be filled corresponding to the general parameters, and a content identifier to be adjusted corresponding to the feature parameters.

5. The method according to claim 1, wherein, The initial text expression template includes at least one pre-configured article structure, which includes at least one pre-configured paragraph, which includes at least one pre-configured statement, and which includes at least one pre-configured phrase.

6. The method according to claim 5, wherein, The parameter values ​​of the feature parameters are used to identify whether the first business phenomenon has occurred; adjusting the content of the initial text expression template includes: Determine whether the value of the first parameter belongs to a preset first value range; the first value range indicates that the first service phenomenon has not occurred; When it is determined that the first parameter value belongs to a preset first value range, delete the first article structure in the initial text expression template used to describe the first business phenomenon or delete the first paragraph in the first article structure.

7. The method according to claim 6, wherein, The first business phenomenon is an abnormal data state.

8. The method according to claim 5, wherein, The parameter values ​​of the feature parameters are used to identify the target analysis result that may occur in the first and second analysis results; The adjustment of the content of the initial text expression template includes: Determine whether the first parameter value belongs to a preset second value range; the second value range identifies the target analysis result as the first analysis result; When it is determined that the first parameter value belongs to a preset second value range, it is determined that the first phrase in the initial text expression template includes a first optional word; the first optional word is used to describe the first analysis result; When it is determined that the first parameter value does not belong to the preset second value range, the first phrase in the initial text expression template is determined to include a second optional word; the second optional word is used to describe the second analysis result.

9. The method according to claim 8, wherein, The first analysis result shows a month-on-month increase in the metric value; the second analysis result shows a month-on-month decrease in the metric value; the first selectable word is the highest; the second selectable word is the lowest.

10. The method according to claim 5, wherein, The initial text expression template includes a first initial sub-template and multiple second initial sub-templates in a sequential order; The adjustment of the content of the initial text expression template includes: Based on the first parameter value, adjust the content of the first initial sub-template to obtain the first dedicated sub-template; Based on the first dedicated sub-template, select the second initial sub-template to be adjusted from a plurality of second initial sub-templates; Adjust the content of the selected second initial sub-template to obtain the second dedicated sub-template; the first dedicated sub-template and the second dedicated sub-template constitute the dedicated text expression template.

11. The method according to claim 1, wherein, The process of filling the dedicated text expression template includes: Locate the parameter identifier corresponding to the second parameter value in the dedicated text expression template; The second parameter value is filled into the position of the parameter identifier in the special text expression template to obtain the text output result of the data analysis result.

12. A text output device for data analysis, the device comprising: An execution unit is used to determine the metrics and analysis methods targeted by the objective analysis task, and to execute the objective analysis task according to the metrics and analysis methods to obtain data analysis results; The extraction unit is used to extract the first parameter value of the pre-set feature parameter and the second parameter value of the ordinary parameter from the data analysis results obtained by the execution unit according to the parameter configuration information. The acquisition unit is used to acquire the initial text expression template configured for the analysis method determined by the execution unit; An adjustment unit is used to adjust the content of the initial text expression template obtained by the acquisition unit according to the first parameter value extracted by the extraction unit, so as to obtain a special text expression template; The filling unit is used to fill the special text expression template obtained by the adjustment unit according to the second parameter value extracted by the extraction unit, so as to obtain the text output result of the data analysis result obtained by the execution unit.

13. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method of any one of claims 1-11.

14. A computing device comprising a memory and a processor, wherein the memory stores executable code, and the processor, when executing the executable code, implements the method of any one of claims 1-11.

Citation Information

Patent Citations

  • Document processing method, computer equipment and storage medium

    CN115935915A

  • Document editing method and device, server, terminal, and storage medium

    WO2022095520A1