Method and apparatus for text output in data analysis

By determining the measurement and methods of analyzing tasks in the data analysis, extract features and ordinary parameters, adjust and fill the initial text expression template, solve the problem that the existing technology output cannot adapt to the diversity analysis scene, realize flexibility and accuracy Sexual text output results.

WO2025016327A1PCT designated stage expired Publication Date: 2025-01-23ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/105270
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-07-14
Filing Date
2024-07-12
Publication Date
2025-01-23

AI Technical Summary

Technical Problem

The text output in data analysis in the prior art cannot adapt to the diversity of analysis scenarios, resulting in the flexibility and accuracy of text output cannot be guaranteed.

Method used

By determining the measurement and analysis method of the target analysis task, extract the value of the feature parameters and the general parameter, obtain the initial text expression template, and adjust the content of the template according to the feature parameter value, fill the ordinary parameter value to generate text output results.

Benefits of technology

The flexibility and accuracy of the output result of the text can meet the needs of different analysis scenarios and reduce the cost of user understanding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024105270_23012025_PF_FP_ABST
    Figure CN2024105270_23012025_PF_FP_ABST
Patent Text Reader

Abstract

A method and apparatus for text output in data analysis. The method comprises: determining a measurement and analysis method for a target analysis task, and executing the target analysis task on the basis of the measurement and analysis method to obtain a data analysis result; on the basis of parameter configuration information, extracting from the data analysis result a first parameter value of a preset feature parameter and a second parameter value of a preset general parameter; acquiring an initial textual expression template configured for the analysis method; on the basis of the first parameter value, adjusting content of the initial textual expression template to obtain a special-purpose textual expression template; and on the basis of the second parameter value, filling the special-purpose textual expression template to obtain a text output result of the data analysis result.
Need to check novelty before this filing date? Find Prior Art

Description

Text output method and device in data analysis

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on July 14, 2023, with application number 2023108712164 and application name “Text Output Method and Device in Data Analysis”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] One or more embodiments of this specification relate to the field of computers, and more particularly, to a text output method and apparatus in data analysis. Background Art

[0003] In the field of data analysis, data analysis results are often presented to users in the form of charts. This form of expression takes up a lot of screen space and is difficult for users to understand, making it less concise and efficient than natural language. For example, in multidimensional analysis scenarios, charts displaying indicator data from multiple dimensions require users to understand the charts, analyze and compare the indicator data from multiple dimensions, and summarize the data characteristics. Natural language expression can directly provide data characteristics, reducing the user's understanding cost. Data analysis can also be statistical analysis of private data, which needs to be protected from disclosure.

[0004] In the prior art, when text output is performed in data analysis, it is often unable to adapt to the diversity of analysis scenarios, so that the flexibility and accuracy of the text output cannot be guaranteed.

[0005] Summary of the Invention

[0006] One or more embodiments of this specification describe a method and apparatus for text output in data analysis, which can adapt to the diversity of analysis scenarios and ensure the flexibility and accuracy of text output.

[0007] In a first aspect, a text output method for data analysis is provided, the method comprising:

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

[0009] Extracting a first parameter value of a preset characteristic parameter and a second parameter value of a common parameter from the data analysis result according to the parameter configuration information;

[0010] Obtaining an initial text expression template configured for the analysis method;

[0011] Adjusting the content of the initial text expression template according to the first parameter value to obtain a dedicated text expression template;

[0012] According to the second parameter value, the dedicated text expression template is filled in to obtain a text output result of the data analysis result.

[0013] In one possible implementation, determining the metrics and analysis methods targeted by the target analysis task includes:

[0014] receiving an instruction for triggering the target analysis task, which carries a metric identifier and a method identifier;

[0015] 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.

[0016] In one possible implementation, determining the metrics and analysis methods targeted by the target analysis task includes:

[0017] receiving an instruction for triggering the target analysis task, which carries a metric identifier and an analysis intent;

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

[0019] In a possible implementation, the initial text expression template is configured as a first structure; the first structure includes content identifiers to be filled corresponding to the common parameters, and content identifiers to be adjusted corresponding to the characteristic parameters.

[0020] In a possible implementation, the initial text expression template includes at least one preconfigured article structure, the article structure includes at least one preconfigured paragraph, the paragraph includes at least one preconfigured sentence, and the sentence includes at least one preconfigured phrase.

[0021] Furthermore, the parameter value of the characteristic parameter is used to identify whether the first business phenomenon occurs; and the adjusting the content of the initial text expression template includes:

[0022] Determining whether the first parameter value falls within a preset first value range; the first value range indicates that the first business phenomenon has not occurred;

[0023] When it is determined that the first parameter value belongs to a preset first value range, the first article structure for describing the first business phenomenon in the initial text expression template is deleted or the first paragraph in the first article structure is deleted.

[0024] Furthermore, the first business phenomenon is a data abnormal state.

[0025] Furthermore, the parameter value of the characteristic parameter is used to identify a target analysis result that occurs in the possible first analysis result and the second analysis result; and adjusting the content of the initial text expression template includes:

[0026] Determining whether the first parameter value falls within a preset second value range; the second value range identifies the target analysis result as the first analysis result;

[0027] When it is determined that the first parameter value belongs to a preset second value range, determining 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;

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

[0029] Furthermore, the first analysis result is that the metric value increases on a month-on-month basis; the second analysis result is that the metric value decreases on a month-on-month basis; the first optional word is the highest; and the second optional word is the lowest.

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

[0031] Adjusting the content of the first initial sub-template according to the first parameter value to obtain a first dedicated sub-template;

[0032] Selecting a second initial sub-template to be adjusted from a plurality of second initial sub-templates according to the first dedicated sub-template;

[0033] The content of the selected second initial sub-template is adjusted to obtain a second dedicated sub-template; the first dedicated sub-template and the second dedicated sub-template constitute the dedicated text expression template.

[0034] In a possible implementation, filling in the dedicated text expression template includes:

[0035] Searching the dedicated text expression template for a position of a parameter identifier corresponding to a second parameter value;

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

[0037] In a second aspect, a text output device for data analysis is provided, the device comprising:

[0038] An execution unit, configured to determine a metric and an analysis method targeted by a target analysis task, and execute the target analysis task according to the metric and the analysis method to obtain a data analysis result;

[0039] an extraction unit, configured to extract a first parameter value of a preset characteristic parameter and a second parameter value of a common parameter from the data analysis result obtained by the execution unit according to the parameter configuration information;

[0040] an acquiring unit, configured to acquire an initial text expression template configured for the analysis method determined by the executing unit;

[0041] an adjusting unit, configured to adjust the content of the initial text expression template obtained by the obtaining unit according to the first parameter value extracted by the extracting unit, to obtain a dedicated text expression template;

[0042] A filling unit is used to fill in 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 a text output result of the data analysis result obtained by the execution unit.

[0043] According to a third aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to execute the method according to the first aspect.

[0044] In a fourth aspect, a computing device is provided, comprising a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method of the first aspect is implemented.

[0045] Through the method and apparatus provided in the embodiments of this specification, first, the metric and analysis method targeted by the target analysis task are determined, and the target analysis task is performed according to the metric and analysis method to obtain a data analysis result; then, according to the 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 result; then, 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 special text expression template; finally, according to the second parameter value, the special text expression template is filled to obtain a 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, and the 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 value of the feature parameter in the data analysis result, to obtain a special text expression template, and then the special text expression template is filled based on the parameter value of the common parameter in the data analysis result to obtain a text output result, wherein the parameter value of the feature parameter reflects the characteristics of the analysis scenario, can adapt to the diversity of the analysis scenario, and ensure the flexibility and accuracy of the text output. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0047] FIG1 is a schematic diagram of an implementation scenario of an embodiment disclosed in this specification;

[0048] FIG2 shows a flow chart of a text output method in data analysis according to one embodiment;

[0049] FIG3 is a schematic diagram showing an online processing process in data analysis according to one embodiment;

[0050] FIG4 is a schematic diagram showing a processing process for an initial text expression template according to one embodiment;

[0051] FIG5 shows a schematic block diagram of a text output device in data analysis according to one embodiment. DETAILED DESCRIPTION

[0052] The solution provided in this specification is described below in conjunction with the accompanying drawings.

[0053] Figure 1 is a schematic diagram of an implementation scenario for an embodiment disclosed in this specification. This implementation scenario involves text output in data analysis. It is understood that the text output is outputting data analysis results through natural language expression. Data analysis: Analyze large amounts of collected data using appropriate statistical analysis methods, summarize, understand, and digest them to maximize the data's functionality and effectiveness. Data analysis is the process of detailed study and summary of data in order to extract useful information and form conclusions.

[0054] Referring to Figure 1, in the field of data analysis, data analysis results are often output to users in the form of charts. For example, a table shows the measurement value of a certain metric in each month, and a pie chart shows the proportion of the measurement value of a certain metric in each city. This expression method requires a large amount of screen space and is not easy for users to understand, and cannot directly provide data features. However, the text "The measurement value today is 100, an increase of 10% month-on-month. The month-on-month trend has gradually increased in the past three months. Among them, the cities with the highest proportion are Shanghai (15%) and Beijing (12%). The top three growth contributors are Shanghai, Guangzhou, and Hangzhou" can directly provide data features, reducing the user's understanding cost.

[0055] Data analysis involves a variety of scenarios. For example, the metrics targeted by the analysis task may be the company's sales volume or financial returns, the analysis methods used may be month-on-month or year-on-year, and the data analysis results may be month-on-month increase, month-on-month decrease, year-on-year increase, year-on-year decrease, etc.

[0056] In the embodiments of this specification, a text output of the data analysis results is obtained by pre-configuring a text expression template and then populating the text expression template based on the data analysis results. Specifically, an initial text expression template is pre-configured for the analysis method, and then the initial text expression template is adjusted based on the data analysis results to obtain a dedicated text expression template. The dedicated text expression template is then populated to obtain the text output, thereby adapting to the diversity of analysis scenarios.

[0057] Figure 2 shows a flow chart of a text output method in data analysis according to an embodiment, which can be based on the implementation scenario shown in Figure 1. As shown in Figure 2, the text output method in data analysis in this embodiment includes the following steps: Step 21, determining the metric and analysis method targeted by the target analysis task, and executing the target analysis task according to the metric and analysis method to obtain the data analysis result; Step 22, extracting the first parameter value of the pre-set feature parameter and the second parameter value of the common parameter from the data analysis result according to the parameter configuration information; Step 23, obtaining the initial text expression template configured for the analysis method; Step 24, adjusting the content of the initial text expression template according to the first parameter value to obtain a special text expression template; Step 25, filling the special 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.

[0058] First, in step 21, the metric and analysis method targeted by the target analysis task are determined, and the target analysis task is executed according to the metric and analysis method to obtain data analysis results. It is understood that data analysis is performed on large amounts of data. Determining the metric targeted by the target analysis task can correspondingly determine the data to be analyzed, while the analysis method reflects how the data is analyzed and determines the parameters included in the data analysis results.

[0059] In the embodiments of this specification, the above-mentioned metrics and analysis methods can be set directly by the user; or the user can first set the above-mentioned metrics and analysis intentions, and then the computer determines the analysis method corresponding to the analysis intention. For example, the user's analysis intentions can include multiple intentions such as recent changes in a certain metric, long-term trends, proportions of various dimensions, 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 takes up a lot of screen space and is not easy to summarize data features. However, data features can be directly given through textual expression.

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

[0061] receiving an instruction for triggering the target analysis task, which carries a metric identifier and a method identifier;

[0062] 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.

[0063] In this example, the user directly sets the above-mentioned metrics and analysis methods, which enables accurate determination of the analysis method.

[0064] In another example, determining the metrics and analysis methods targeted by the target analysis task includes:

[0065] receiving an instruction for triggering the target analysis task, which carries a metric identifier and an analysis intent;

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

[0067] In this example, the user first sets the above-mentioned 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 to facilitate user understanding and operation.

[0068] Then, in step 22, based on the parameter configuration information, a first parameter value of a pre-set characteristic parameter and a second parameter value of a common parameter are extracted from the data analysis result. It is understandable that the parameter configuration information records which parameters are characteristic parameters and which parameters are common parameters.

[0069] In the embodiments of this specification, characteristic parameters and common parameters are pre-set, while the first parameter value and the second parameter value are extracted from the data analysis results. In other words, the first parameter value and the second parameter value cannot be known before the data analysis. 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 indicator, etc., and the parameter value of the common parameter can be the indicator value of the preset indicator, etc.

[0070] Then, in step 23, an initial text expression template configured for the analysis method is obtained. It is understandable that there are usually multiple categories of analysis methods, and an initial text expression template can be configured for each category of analysis method.

[0071] In one example, the initial text expression template is configured as a first structure; the first structure includes content identifiers to be filled corresponding to the common parameters, and content identifiers to be adjusted corresponding to the characteristic parameters.

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

[0073] In one example, the initial text expression template includes at least one preconfigured article structure, the article structure includes at least one preconfigured paragraph, the paragraph includes at least one preconfigured sentence, and the sentence includes at least one preconfigured phrase.

[0074] In the embodiments of this specification, the text output result can be regarded as a narrative, and its construction can follow the following strategies:

[0075] Strategy one: first establish the main structure of the article, and then fill in the content within the structure.

[0076] An article first has a main structure, such as a "general-specific" or "general-specific-general" structure. Each structure carries a narrative. For example, in a "general-specific-general" structure, the current data situation is summarized first, followed by a detailed explanation of the current data phenomena and their impact across various dimensions, and finally a summary of the resulting problems and future plans. The main structure of an article can be determined by the article's theme or application scenario. A "general" or "specific" structure is called an article structure (section). An article can contain one or more article structures, and this relationship can be expressed as narrative-*section.

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

[0078] Once the article structure is determined, each paragraph configured within the structure is not guaranteed to exist. For example, in a "total-specific-specific-total" structure, if the second "specific" describes abnormal data in different dimensions, if no abnormal data exists, no paragraph will appear in the article structure, and the "total-specific-specific-total" structure will be displayed as a "total-specific-total" structure. Similarly, if an article structure contains three paragraphs describing year-over-year, trend, and fluctuation analysis of a metric, respectively, if the data analysis results indicate no fluctuation—that is, if the data is considered normal—then the corresponding fluctuation analysis paragraph description is not required. A paragraph can contain multiple statements, which together constitute the content to be described in the paragraph. A statement can include data features, analysis conclusions, a business phrase, or an objective phenomenon. Whether a paragraph is displayed in the article is determined by whether the content or phenomenon described in the paragraph has occurred. A paragraph within a structure can be defined as a topic structure. An article structure can contain one or more topics, and this relationship can be expressed 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 analytical method (analytic). The relationship between the topic structure and the analytical method can be expressed as topic-*analytic.

[0079] Strategy three: A statement can contain one or more analytical conclusions, and whether the conclusion should exist is determined by whether it makes sense.

[0080] A statement often covers multiple analysis conclusions or query results. Each analysis conclusion and query result can be considered as an independent data query or a call to a data analysis interface. Therefore, an analysis method can correspond to an existing insight service, such as year-on-year and month-on-month analysis, fluctuation analysis, etc. In the embodiment of this specification, the role of the analysis method is essentially to extract the part that needs to be calculated in a statement for subsequent logic to generate text. In the description stage, the conclusion given by the analysis result may be meaningless. In this case, the conclusion may not be described. Therefore, whether the content in a statement needs to be displayed is also determined by the result of the analysis method that generates this sentence. The structure of text or phrases is defined as a phrase. A statement can be composed of multiple phrases. This relationship can be expressed as analytic*-phrase.

[0081] Strategy four: one analysis method can correspond to multiple paragraphs.

[0082] Most analytical methods, such as month-on-month analysis and trend analysis, can be described in a single sentence. However, scenarios such as fluctuation analysis often require one or more paragraphs to describe possible analytical conclusions. Paragraphs and analytical methods don't have a strong correspondence here, so analytical methods can be described in multiple paragraphs. Paragraphs in the description stage are defined as paragraphs, and the relationship between analytical methods, paragraphs, and phrases can be expressed as analytic-*paragraph-*phrase.

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

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

[0085] Strategy six: The presentation form of the analysis method is determined by the data structure.

[0086] The data produced by an analysis method may have two structures: Map or List <map>Generally speaking, Map is a flat structure, presented in short sentences, List <map>The structure can be presented as a list or separator. Since each word in a sentence can be an independent phrase, the internal structure of the phrase can be used to define its display behavior. For example, this structure can be used to support scenarios such as value highlighting, trend chart details for trend descriptions, and text interaction related to other paragraphs.

[0087] Strategy seven: Each entity independently determines its own description method.

[0088] The aforementioned entities refer to backend entities, namely the narrative, topic, and analytical methods. The relationship between these three entities is one-to-many. The descriptions of analytical methods can be concatenated using conjunctions without any logical association. Query associations are determined by the connections in the query plan.

[0089] Then, 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 understandable that the above adjustment may include two aspects: one is adjusting the structure of the template, and the other is adjusting the phrases in the template.

[0090] In one example, the parameter value of the characteristic parameter is used to identify whether the first business phenomenon occurs; and adjusting the content of the initial text expression template includes:

[0091] Determining whether the first parameter value falls within a preset first value range; the first value range indicates that the first business phenomenon has not occurred;

[0092] When it is determined that the first parameter value belongs to a preset first value range, the first article structure for describing the first business phenomenon in the initial text expression template is deleted or the first paragraph in the first article structure is deleted.

[0093] Furthermore, the first business phenomenon is a data abnormal state.

[0094] In this example, for possible business phenomena, the article structure or paragraph used to describe the business phenomenon is pre-configured in the initial text expression template. Subsequently, it can be determined whether the business phenomenon has occurred based on the parameter value of the characteristic parameter, and the structure of the template can be flexibly adjusted when it is determined that the business phenomenon has not occurred, making the template more suitable for specific analysis scenarios.

[0095] In one example, the parameter value of the characteristic parameter is used to identify a target analysis result that occurs in the possible first analysis result and the second analysis result; and adjusting the content of the initial text expression template includes:

[0096] Determining whether the first parameter value falls within a preset second value range; the second value range identifies the target analysis result as the first analysis result;

[0097] When it is determined that the first parameter value belongs to a preset second value range, determining 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;

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

[0099] Furthermore, the first analysis result is that the metric value increases on a month-on-month basis; the second analysis result is that the metric value decreases on a month-on-month basis; the first optional word is the highest; and the second optional word is the lowest.

[0100] In this example, optional words used to describe the two possible analysis results are pre-configured in the initial text expression template. Subsequently, the type of analysis result that occurred can be determined based on the parameter value of the feature parameter, and the phrases in the template can be flexibly adjusted after the analysis result is determined, making the template more suitable for specific analysis scenarios.

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

[0102] Adjusting the content of the first initial sub-template according to the first parameter value to obtain a first dedicated sub-template;

[0103] Selecting a second initial sub-template to be adjusted from a plurality of second initial sub-templates according to the first dedicated sub-template;

[0104] The content of the selected second initial sub-template is adjusted to obtain a second dedicated sub-template; the first dedicated sub-template and the second dedicated sub-template constitute the dedicated text expression template.

[0105] In this example, multiple sub-templates are set in the initial text expression template, and there is an association relationship between the sub-templates with a sequence. The parameter value of the characteristic parameter not only affects the content of the sub-template in the front order, but also affects the selection of the sub-template in the back order, thereby facilitating the flexible combination of sub-templates, increasing the reuse of sub-templates, and making the template more suitable for specific analysis scenarios.

[0106] Finally, in step 25, the dedicated text expression template is filled in according to the second parameter value to obtain a 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% increase over the previous month, where the 10% here is the content that needs to be filled in.

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

[0108] Searching the dedicated text expression template for a position of a parameter identifier corresponding to a second parameter value;

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

[0110] The embodiments of this specification can be implemented according to the following logic: the analysis method (analytic) generates a variable (variable), and the variable (variable) constitutes a data pool, which contains the data analysis results of this analysis method, including data or conclusions. The structure (structure) determines the description form, including what structure to use (phrase, paragraph, bullet), how to organize it (content template), and the corresponding relationship with the data (variable_id). The variable (variable) + structure (structure) is used to describe text data. Both can determine whether the data is displayed. The variable determines the display features and content, and the structure determines the display structure and order. Natural language generation (NLG) objects at all levels complete text generation through this structure. A topic structure (topic) contains multiple analysis methods (analytic). The analysis method (analytic) describes a set of queries that can be associated or merged. As a data query service call, each analysis method (analytic) is executed in parallel to summarize the result data at the topic structure level and generate an article structure (section) through the structure of the topic structure (structure). A narrative contains multiple topic structures. A topic structure includes business descriptions that can be linked or merged. As an abstraction of the text structure, each topic structure is executed in parallel to aggregate the results at the narrative level, and the article schema is generated through the structure of the narrative.

[0111] FIG3 is a schematic diagram of the online processing process in data analysis according to one embodiment. Referring to FIG3 , the user first sets the metrics and analysis methods for this analysis task respectively, and then the computer performs the analysis to obtain the parameter values ​​of the characteristic parameters and the parameter values ​​of the common parameters. Then, a special text expression template is determined based on the parameter values ​​of the characteristic parameters and the analysis method, and the special text expression template is filled in according to the parameter values ​​of the common parameters to obtain a text output result. It can be understood that the above-mentioned special text expression template is obtained by adjusting the initial text expression template. The initial text expression template is pre-configured for the analysis method. According to the parameter values ​​of the characteristic parameters, the content of the initial text expression template is adjusted to obtain a special text expression template.

[0112] FIG4 is a schematic diagram showing the processing process for the initial text expression template according to an embodiment. Referring to FIG4 , the initial text expression template includes several elements. After obtaining the current initial text expression template configured for the analysis method, the various elements included therein can be scanned to extract the text elements therein; for the text elements, it is determined whether the text element belongs to a static element. It can be understood that a static element can be considered as a constant; if it is determined that the text element belongs to a static element, the text element is directly output as part of the text output result; if it is determined that the text element does not belong to a static element, it is further determined whether the text element belongs to an ordinary variable. It can be understood that an ordinary variable is the aforementioned ordinary parameter; if it is determined that the text element belongs to an ordinary variable, the value of the ordinary variable is used as part of the text output result after rendering data; if it is determined that the text element does not belong to an ordinary variable, it is further determined whether the text element belongs to a feature variable. It is understood that the feature variable is the aforementioned feature parameter; if it is determined that the text element belongs to the feature variable, the hit feature is further determined based on the value of the feature variable. For example, a value greater than 10 will result in a significant increase in hits, and a value less than 0 will result in an abnormal decrease in hits; then the corresponding feature output strategy is selected based on the hit feature, and it is determined whether the feature output strategy belongs to a common strategy or a template strategy; when it is determined that the strategy belongs to a common strategy, the output content corresponding to the feature output strategy is used as part of the text data result after rendering the data; when it is determined that the strategy belongs to a template strategy, the output content corresponding to the 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; in addition, if it is determined that the text element does not belong to the feature variable, it is assumed that the text element belongs to the strategy variable, and the text element is used as the value of the strategy variable.

[0113] It can be understood that the processing process shown in Figure 4, the process of adjusting the initial text expression template to obtain a special text expression template, and the process of filling the special text expression template are carried out simultaneously. Optionally, the two can also be carried out successively. For example, first adjust the initial text expression template to obtain a special text expression template, and then fill in the special text expression template to obtain the text output result.

[0114] 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, each analysis method may be configured with its corresponding initial text expression template. An analysis method may be pre-configured with one initial text expression template, or may be configured with multiple initial text expression templates. An initial text expression template may include multiple initial text expression sub-templates. The characteristic parameters involved in an analysis method may be one or more, and the common parameters involved in an analysis method may be one or more. It is understandable 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.

[0115] In the embodiment of this specification, constructing the text output result mainly includes the following core steps. First, the initial text expression template must be pre-configured, that is, the output structure must be designed. 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 executing the data analysis task and obtaining the data analysis result, a variable structure (AbstractVariable) is constructed from the data analysis result. For example, the variable structure is {"metric_name":"unit price","metric_value":2}; then, the variable structure and the initial text expression template are used to generate structured text content. The structured text content obtained is "unit price is 2"; finally, the text structure is generated using the structural characteristics. For example, the generated text structure is a phrase {"phrase":[{"value":"unit price"},{"value":"is"},{"value":2}]}.

[0116] According to the method provided in the embodiment of this specification, the metric and analysis method for the target analysis task are first determined, and the target analysis task is performed according to the metric and analysis method to obtain a data analysis result; then, according to the 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 result; then, 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 special text expression template; finally, according to the second parameter value, the special text expression template is filled to obtain a text output result of the data analysis result. As can be seen from the above, in the embodiment of this specification, an initial text expression template is configured for the analysis method, and the 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 value of the feature parameter in the data analysis result, to obtain a special text expression template, and then the special text expression template is filled based on the parameter value of the common parameter in the data analysis result to obtain a text output result, wherein the parameter value of the feature parameter reflects the characteristics of the analysis scenario, can adapt to the diversity of the analysis scenario, and ensure the flexibility and accuracy of the text output.

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

[0118] An execution unit 51 is configured to determine a metric and an analysis method for a target analysis task, and execute the target analysis task according to the metric and the analysis method to obtain a data analysis result;

[0119] An extraction unit 52 is configured to extract a first parameter value of a preset characteristic parameter and a second parameter value of a common parameter from the data analysis result obtained by the execution unit 51 according to the parameter configuration information;

[0120] An acquiring unit 53 is configured to acquire an initial text expression template configured for the analysis method determined by the executing unit 51;

[0121] an adjusting unit 54 configured to adjust the content of the initial text expression template obtained by the obtaining unit 53 according to the first parameter value extracted by the extracting unit 52 to obtain a dedicated text expression template;

[0122] The filling unit 55 is configured to fill in the dedicated text expression template obtained by the adjusting unit 54 according to the second parameter value extracted by the extracting unit 52 , so as to obtain a text output result of the data analysis result obtained by the executing unit 51 .

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

[0124] A first receiving subunit is configured to receive an instruction for triggering the target analysis task, which carries a metric identifier and a method identifier;

[0125] The first determining subunit is used 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.

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

[0127] A second receiving subunit is configured to receive an instruction for triggering the target analysis task, which carries a metric identifier and an analysis intent;

[0128] The second determining sub-unit is used to determine the metric identified by the metric identifier obtained by the second receiving sub-unit 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 sub-unit and the correspondence between the pre-set analysis intent and the analysis method.

[0129] Optionally, as an embodiment, the initial text expression template is configured as a first structure; the first structure includes content identifiers to be filled corresponding to the common parameters, and content identifiers to be adjusted corresponding to the characteristic parameters.

[0130] Optionally, as an embodiment, the initial text expression template includes at least one preconfigured article structure, the article structure includes at least one preconfigured paragraph, the paragraph includes at least one preconfigured sentence, and the sentence includes at least one preconfigured phrase.

[0131] Furthermore, the parameter value of the characteristic parameter is used to identify whether the first service phenomenon occurs; the adjustment unit 54 includes:

[0132] A first judging subunit is configured to judge whether the first parameter value falls within a preset first value range; the first value range indicates that the first business phenomenon has not occurred;

[0133] The deletion subunit is used to delete the first article structure used to describe the first business phenomenon in the initial text expression template or delete the first paragraph in the first article structure when the first judgment subunit determines that the first parameter value belongs to the preset first value range.

[0134] Furthermore, the first business phenomenon is a data abnormal state.

[0135] Furthermore, the parameter value of the characteristic parameter is used to identify the target analysis result that occurs in the possible first analysis result and the second analysis result; the adjustment unit 54 includes:

[0136] A second judgment subunit is configured to judge whether the first parameter value belongs to a preset second value range; the second value range indicates that the target analysis result is the first analysis result;

[0137] a selection subunit, configured to, when the second judgment subunit determines that the first parameter value belongs to a preset second value range, determine 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;

[0138] The selection subunit is also used 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.

[0139] Furthermore, the first analysis result is that the metric value increases on a month-on-month basis; the second analysis result is that the metric value decreases on a month-on-month basis; the first optional word is the highest; and the second optional word is the lowest.

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

[0141] a first adjusting sub-unit, configured to adjust the content of the first initial sub-template according to the first parameter value to obtain a first dedicated sub-template;

[0142] a selection subunit, configured to select a second initial sub-template to be adjusted from a plurality of second initial sub-templates based on the first dedicated sub-template obtained by the first adjustment subunit;

[0143] The second adjusting sub-unit is used to adjust the content of the second initial sub-template selected by the selecting sub-unit to obtain a second special sub-template; the first special sub-template and the second special sub-template constitute the special text expression template.

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

[0145] A search subunit, configured to search the dedicated text expression template for a position of a parameter identifier corresponding to a second parameter value;

[0146] The filling subunit is used to fill the second parameter value into the position of the parameter identifier found by the searching subunit in the dedicated text expression template to obtain the text output result of the data analysis result.

[0147] Through the device provided by the embodiment of this specification, the execution unit 51 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 the data analysis result; then the extraction unit 52 extracts the first parameter value of the pre-set characteristic parameter and the second parameter value of the common parameter from the data analysis result according to the parameter configuration information; then the acquisition unit 53 obtains 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 special text expression template; finally, the filling unit 55 fills the special 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 embodiment of this specification, an initial text expression template is configured for the analysis method. The 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 characteristic parameters in the data analysis results to obtain a special text expression template. The special text expression template is then filled in based on the parameter values ​​of the common parameters in the data analysis results to obtain a text output result. Among them, the parameter values ​​of the characteristic parameters reflect the characteristics of the analysis scenario, can adapt to the diversity of the analysis scenario, and ensure the flexibility and accuracy of the text output.

[0148] According to another embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to execute the method described in conjunction with FIG. 2 .

[0149] According to yet another embodiment, a computing device is provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method described in conjunction with FIG. 2 is implemented.

[0150] Those skilled in the art will appreciate that, in one or more of the above examples, the functions described herein may be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions may be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.

[0151] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solution of the present invention should be included in 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 targeted by the target analysis task, and perform the target analysis task according to the metrics and analysis methods to obtain data analysis results; Extracting a first parameter value of a preset characteristic parameter and a second parameter value of a common parameter from the data analysis result according to the parameter configuration information; Obtaining an initial text expression template configured for the analysis method; According to the first parameter value, adjusting the content of the initial text expression template to obtain a dedicated text expression template; According to the second parameter value, the dedicated text expression template is filled in to obtain a text output result of the data analysis result.

2. The method according to claim 1, wherein: The determination of the metrics and analysis methods targeted by the target analysis task includes: receiving an instruction for triggering 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 targeted by the target analysis task includes: receiving an instruction for triggering the target analysis task, which carries a metric identifier and an analysis intent; The metric identified by the metric identifier is determined as the metric targeted by the target analysis task, and based on the analysis intent and the correspondence between the pre-set analysis intent and the analysis method, the analysis method corresponding to the analysis intent is determined as the analysis method targeted by the target analysis task.

4. The method according to claim 1, wherein: The initial text expression template is configured as a first structure; the first structure includes content identifiers to be filled corresponding to the common parameters and content identifiers to be adjusted corresponding to the characteristic parameters.

5. The method according to claim 1, wherein: The initial text expression template includes at least one preconfigured article structure, the article structure includes at least one preconfigured paragraph, the paragraph includes at least one preconfigured sentence, and the sentence includes at least one preconfigured phrase.

6. The method according to claim 5, wherein: The parameter value of the characteristic parameter is used to identify whether the first business phenomenon occurs; and the content of adjusting the initial text expression template includes: Determine whether the first parameter value belongs to a preset first value range; the first value range identifies the first service The phenomenon did not occur; When it is determined that the first parameter value belongs to a preset first value range, the first article structure for describing the first business phenomenon in the initial text expression template is deleted or the first paragraph in the first article structure is deleted.

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 value of the characteristic parameter is used to identify the target analysis result that occurs in the possible first analysis result and the second analysis result; The adjusting 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 indicates that the target analysis result is the first analysis result; When it is determined that the first parameter value belongs to the preset second value range, determining 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, it is determined that the first phrase in the initial text expression template includes 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 is that the metric value increases on a month-on-month basis; the second analysis result is that the metric value decreases on a month-on-month basis; the first optional word is the highest; and the second optional word is the lowest.

10. The method according to claim 5, wherein: The initial text expression template includes a first initial sub-template and a plurality of second initial sub-templates in a sequential order; The adjusting the content of the initial text expression template includes: According to the first parameter value, adjusting the content of the first initial sub-template to obtain a first dedicated sub-template; Selecting a second initial sub-template to be adjusted from a plurality of second initial sub-templates according to the first dedicated sub-template; The content of the selected second initial sub-template is adjusted to obtain a second special sub-template; the first special sub-template and the second special sub-template constitute the special text expression template.

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

12. A text output device in data analysis, the device comprising: An execution unit, used to determine the metric and analysis method targeted by the target analysis task, and execute the target analysis task according to the metric and analysis method to obtain a data analysis result; The extraction unit is used to extract the pre-set data from the data analysis result obtained by the execution unit according to the parameter configuration information. A first parameter value of a set characteristic parameter and a second parameter value of a common parameter; An acquisition unit, used to acquire an initial text expression template configured for the analysis method determined by the execution unit; an adjusting unit, configured to adjust the content of the initial text expression template acquired by the acquiring unit according to the first parameter value extracted by the extracting unit, so as to obtain a dedicated text expression template; A filling unit is used to fill in 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 a 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 execute the method according to any one of claims 1 to 11.

14. A computing device comprising a memory and a processor, wherein the memory stores executable codes, and when the processor executes the executable codes, the method according to any one of claims 1 to 11 is implemented.

Citation Information

Patent Citations

  • Analysis report obtaining method and device, electronic equipment and storage medium

    CN111125204A

  • Data analysis report generation method and device, mobile terminal and storage medium

    CN111198942A

  • Text output method and device in data analysis

    CN116933752A

  • Agent apparatus and method

    US20180285829A1