Jump to content

Natural Language Generation Example for Spotfire® 1.0.0

1 Screenshot


An extensible natural language generation Spotfire dashboard implemented through a TERR data function.


With the help of a TERR data function users can now implement natural language generation inside Spotfire. The Spotfire dashboard is pre-loaded with generic template sentences that can be customized to more specific use cases. The TERR data function can be extended by following a set of design rules that are indicated within the script. The verbosity, level of detail and tone of the generated language can also be specified, and different languages can be added. 

It is possible to specify the verbosity, level of detail, and tone of the generated language. An end user without R programming skills can change the generated language to fit with the application.


The data used in this example is the edits taken from the Wikipedia RSS feed. The data contains the number of edited characters, the timestamp of each edit, the country, and continent of the editor etc. 

This is how the example works:

  1. The input data is loaded and the visualizations are rendered.
  2. An IronPython script is used to extract data from the line chart, including the line chart configuration (what columns are used on its axis).
  3. The extracted data is passed to the natural language generation data function, which also takes the NLG map as input. The NLG map is a template for how the language should be generated given a set of input parameters and using a set of placeholder variables.
  4. The natural language generation data function executes and identifies a set of insights and key facts about the input data. It then generates the natural language using the NLG map, the input parameters, the insights, and facts and it replaces the placeholder variables in the NLG map with values it has calculated. The generated language is placed in a document property that can be used in the Spotfire visualizations as needed.

Below is a schematic overview of how it works:



Release 1.0.0

Published: March 2020

Initial release

  • Create New...