Applied artificial intelligence technology for narrative generation using an invocable analysis service
Disclosed herein are example embodiments of an improved narrative generation system where an analysis service that executes data analysis logic that supports story generation is segregated from an authoring service that executes authoring logic for story generation through an interface. Accordingly, when the authoring service needs analysis from the analysis service, it can invoke the analysis service through the interface. By exposing the analysis service to the authoring service through the shared interface, the details of the logic underlying the analysis service are shielded from the authoring service (and vice versa where the details of the authoring service are shielded from the analysis service). Through parameterization of operating variables, the analysis service can thus be designed as a generalized data analysis service that can operate in a number of different content verticals with respect to a variety of different story types.
1 . A natural language generation (NLG) method for applying artificial intelligence using one or more processors to generate a narrative about designated data, the method comprising:
providing a shared interface between an analysis service and an authoring service, wherein the authoring service executes authoring logic for narrative generation, wherein the analysis service executes data analysis logic to support one or more story types, wherein the analysis service and the authoring service are segregated so that (1) details of the data analysis logic are shielded from the authoring service and (2) details of the authoring logic are shielded from the analysis service, so that the authoring service and the analysis service are each selectively invocable, and so that the analysis logic is generally applicable to a plurality of data visualization types based on parameterization of operating variables;
providing a user interface to the analysis service to select one or more of a plurality of different analytics, wherein at least one of the plurality of analytics is operable to produce data structured according to one or more story types presented in the user interface and one or more data visualizations comprising graphical diagrams of data being analyzed;
invoking the analysis service via the user interface to execute the one or more analytics on the designated data, wherein the invoking includes configuring the analysis service for analyzing the designated data including the one or more data visualizations, wherein the configuring of the analysis service comprises instantiating an analysis application configured based on parameters received during the invoking, the parameters identifying a data visualization type, and the analysis application using one or more analysis libraries to analyze the designated data and generate structured data;
receiving, at the authoring service via the shared interface, structured data from the analysis service, the structured data indicative of one or more insights about the designated data and one or more insights determined based on the one or more data visualizations; and
generating a narrative about the structured data via the authoring service, wherein the narrative expresses at least one or more of the insights about the one or more data visualizations as natural language text.
2 . The method recited in claim 1 , wherein the analysis service is further configured to select a subset of the analytics for execution based on a parameter determined based on user input provided via the user interface.
3 . The method recited in claim 1 , wherein the structured data comprises visualization data, comprising at least one of line chart data, bar chart data, histogram data, pie chart data, and/or scatterplot data.
4 . The method recited in claim 1 , wherein the designated data comprises a plurality of values for a plurality of fields of the designated data, wherein a plurality of the analytics are parameterizable for execution to analyze values within the designated data to generate metadata about the designated data that is indicative of one or more insights about the designated data, wherein the structured data comprises the generated metadata.
5 . The method recited in claim 1 , wherein the authoring service is further configured to communicate a structured message to the analysis service to invoke the analysis service.
6 . The method recited in claim 5 , wherein the analysis service is further configured, in response to invocation by the authoring service through the user interface, to select a subset of the analytics for execution based on a parameter in the structured message.
7 . The method recited in claim 6 , wherein the structured message further comprises at least a portion of the designated data from which the narrative is generated; and
wherein the analysis service is further configured, in response to invocation by the authoring service through the interface, to select the subset of the analytics for execution based on (1) the structured message parameter and (2) designated data within the structured message.
8 . The method recited in claim 6 , wherein the analysis service is further configured to (1) resolve an analytics configuration based on the structured message, wherein the resolved analytics configuration enables the selected subset of the analytics, (2) instantiate an analytics application based on the analytics configuration, (3) execute the instantiated analytics application to selectively invoke the selected subset of the analytics, and (4) receive and serialize a plurality of results from the selectively invoked subset of the analytics.
9 . The method recited in claim 8 , wherein the analytics configuration specifies an order of precedence for the selectively invoked subset of the analytics.
10 . The method recited in claim 8 , wherein the analytics configuration specifies a parameter value for use in controlling at least one of the selectively invoked subset of the analytics.
11 . Non-transitory computer readable media having instructions stored thereon for performing a natural language generation (NLG) method for applying artificial intelligence using one or more processors to generate a narrative about designated data, the method comprising:
providing a shared interface between an analysis service and an authoring service, wherein the authoring service executes authoring logic for narrative generation, wherein the analysis service executes data analysis logic to support one or more story types, wherein the analysis service and the authoring service are segregated so that (1) details of the data analysis logic are shielded from the authoring service and (2) details of the authoring logic are shielded from the analysis service, so that the authoring service and the analysis service are each selectively invocable, and so that the analysis logic is generally applicable to a plurality of data visualization types based on parameterization of operating variables;
providing a user interface to the analysis service to select one or more of a plurality of different analytics, wherein at least one of the plurality of analytics is operable to produce data structured according to one or more story types presented in the user interface and one or more data visualizations comprising graphical diagrams of data being analyzed;
invoking the analysis service via the user interface to execute the one or more analytics on the designated data, wherein the invoking includes configuring the analysis service for analyzing the designated data including the one or more data visualizations, wherein the configuring of the analysis service comprises instantiating an analysis application configured based on parameters received during the invoking, the parameters identifying a data visualization type, and the analysis application using one or more analysis libraries to analyze the designated data and generate structured data;
receiving, at the authoring service via the shared interface, structured data from the analysis service, the structured data indicative of one or more insights about the designated data and one or more insights determined based on the one or more data visualizations; and
generating a narrative about the structured data via the authoring service, wherein the narrative expresses at least one or more of the insights about the one or more data visualizations as natural language text.
12 . The non-transitory computer readable media recited in claim 11 , wherein the analysis service is further configured to select a subset of the analytics for execution based on a parameter determined based on user input provided via the user interface.
13 . The non-transitory computer readable media recited in claim 11 , wherein the structured data comprises visualization data, comprising at least one of line chart data, bar chart data, histogram data, pie chart data, and/or scatterplot data.
14 . The non-transitory computer readable media recited in claim 11 , wherein the designated data comprises a plurality of values for a plurality of fields of the designated data, wherein a plurality of the analytics are parameterizable for execution to analyze values within the designated data to generate metadata about the designated data that is indicative of one or more insights about the designated data, wherein the structured data comprises the generated metadata.
15 . The non-transitory computer readable media recited in claim 11 , wherein the authoring service is further configured to communicate a structured message to the analysis service to invoke the analysis service.
16 . The non-transitory computer readable media recited in claim 15 , wherein the analysis service is further configured, in response to invocation by the authoring service through the user interface, to select a subset of the analytics for execution based on a parameter in the structured message.
17 . A system including a hardware processor, the system configured to perform a natural language generation (NLG) method for applying artificial intelligence using one or more processors to generate a narrative about designated data, the method comprising:
providing a shared interface between an analysis service and an authoring service, wherein the authoring service executes authoring logic for narrative generation, wherein the analysis service executes data analysis logic to support one or more story types, wherein the analysis service and the authoring service are segregated so that (1) details of the data analysis logic are shielded from the authoring service and (2) details of the authoring logic are shielded from the analysis service, so that the authoring service and the analysis service are each selectively invocable, and so that the analysis logic is generally applicable to a plurality of data visualization types based on parameterization of operating variables;
providing a user interface to the analysis service to select one or more of a plurality of different analytics, wherein at least one of the plurality of analytics is operable to produce data structured according to one or more story types presented in the user interface and one or more data visualizations comprising graphical diagrams of data being analyzed;
invoking the analysis service via the user interface to execute the one or more analytics on the designated data, wherein the invoking includes configuring the analysis service for analyzing the designated data including the one or more data visualizations, wherein the configuring of the analysis service comprises instantiating an analysis application configured based on parameters received during the invoking, the parameters identifying a data visualization type, and the analysis application using one or more analysis libraries to analyze the designated data and generate structured data;
receiving, at the authoring service via the shared interface, structured data from the analysis service, the structured data indicative of one or more insights about the designated data and one or more insights determined based on the one or more data visualizations; and
generating a narrative about the structured data via the authoring service, wherein the narrative expresses at least one or more of the insights about the one or more data visualizations as natural language text.
18 . The system recited in claim 17 , wherein the analysis service is further configured to select a subset of the analytics for execution based on a parameter determined based on user input provided via the user interface.
19 . The system recited in claim 17 , wherein the structured data comprises visualization data, comprising at least one of line chart data, bar chart data, histogram data, pie chart data, and/or scatterplot data.
20 . The system recited in claim 17 , wherein the designated data comprises a plurality of values for a plurality of fields of the designated data, wherein a plurality of the analytics are parameterizable for execution to analyze values within the designated data to generate metadata about the designated data that is indicative of one or more insights about the designated data, wherein the structured data comprises the generated metadata.