Back to Blog

Defining the Context Layer in NLG Part 2: What Does It Mean?

In the first part of Defining the Context Layer in NLG, we discussed the context layer for the opening, or lede, of our story. The next NLG story element we want to outline is actually the final element in the narrative: the ending. Much like any good fiction writer dreams up the ending of their story and writes to that ending, good NLG leaves the reader with actionable information-and the creator should write to that. Outlining the context layer for the ending works a lot like outlining the beginning, only instead of outlining all viable ledes (the shortest possible summarization of the most important facts hidden within the data), we’ll be listing, prioritizing, and grouping all the potential endings. Potential endings can take any format. That’s a business decision based solely on the purpose of the content. But there are some commonalities for good endings, and that gives us a place to start.

What Does It Mean?

If you’re having trouble thinking up a good ending for your NLG content, remember: all good stories have meaning. In other words, all content has some purpose for its existence, whether it’s to sell something, mark progress, or even provide an update until more information arrives.

Think about the purpose of your NLG content. We read sports content because we’re fans of the sport, the team, or the player, and there’s usually some financial transaction involved with that fandom, whether it’s advertising, merchandise, or tickets.

Spoiler alert: It’s usually advertising.

We read finance content because we want our net worth to increase. We read business intelligence reports because we need to make important decisions for our business, and data makes those decisions easier (most of the time). We read product descriptions of 4K televisions to make those same kinds of important decisions, only for our living rooms.

Much like we grouped our ledes into Records, Trends, and Deltas, there are three major categories we can group into for our endings:

  1. Call To Action
  2. Greater Goal
  3. Next Event


Call to Action

Call to Action is the broadest use of NLG, and it can take many forms. For example, NLG alerts about earthquakes prompt the reader to decide whether or not to take shelter without having to know much about earthquake data. Stories about stock performance prompt us to buy, sell, or hold, by analyzing performance over time or against other securities. Stories about retail products, if written well, help us decide to put that product in our shopping cart.

In some cases, we know enough about what the data is telling us to be suggestive or prescriptive about what the call to action might be. But this gets tricky quickly.

Remember, we’re providing the reader with the information to make a decision, not necessarily making that decision for them. Suggesting available options and predicted outcomes is usually where that prescriptive process ends.

Remember, we’re providing the reader with the information to make a decision, not necessarily making that decision for them.

Greater Goal

Stories that lead to a Greater Goal mark progress along the way to the desired outcome. Business intelligence provides some great examples here. We’re looking for better sales volume, revenue, margins, profits, whatever it may be. We set metrics for key performance indicators of progress towards these goals, and we watch the data come in. In best cases, that data flow is constant.

The result is a myriad of charts, graphs, data plots, any assortment of visual representations of all this business intelligence data. The focus of NLG in this scenario is to summarize that visual information and apply it to whatever goals are determined by the business. In plain English (or whatever the preferred language might be).

Next Event

Next Event is more of a placeholder, where this narrative is one of a series, and that series is ultimately the whole story. The next event is usually the point at which the “what does it mean” part of the narrative could change. It’s used when what happens next is as important or even more important that what just happened.

Example: Team X will play Team Y on Monday, and a victory there would clinch the division title.

Like the groupings in our NLG lede, each category is totally optional and you can have more than one scenario from more than one category in your ending. So once you break down all viable potential endings and prioritize them, you can also group them into primary and secondary endings.

In our Team X example above, note that you have both a greater goal (championship) and a next event (progress-changing outcome) in a single sentence.

The Middle: Why Did It Happen

Of course, all of this context is going to be constrained by the length of the narrative.

If you’re working with a single sentence, you might just have the lede. If you’ve got two sentences, you might squeeze in a lede and an ending. If you’ve got four paragraphs, you’ll need to bulk up the middle.

If the lede is “What Just Happened” and the ending is “What Does It Mean,” then the middle is “Why Did It Happen.” The middle should include, at the very least, the most relevant supporting information for each data point determined in the lede.

Here’s an updated example from the last post:

ABCD soared 3.5% yesterday to close at $52.25, a new 52-week high. The stock also saw weekly gains of 6.2%, marking its best week since 2012.

Our lede contains the basic necessary information as well as a delta lede (3.5%) and two record ledes (52-week high and best week).

Our middle should include any relevant supporting information for those ledes.

The last time ABCD hit a 52-week high was January 8th, 2013, when the stock closed at $52.02. The better-than-average weekly performance is in line with the rest of sector X, which as a group rose 5.5% this week, the best week for the sector since 2014.  

But we can also add some additional information that may not be directly lede-related.

Trading volume for ABCD has been falling over the last several weeks, however, and reached a six-week low yesterday with just under 500K shares changing hands.

Finally, we can close with a next event and very subtle call to action.

As earnings approach on Tuesday, analysts remain mixed on ABCD, with two giving the stock a buy rating, four hold, and one sell.

Note that any stated information in either the middle or the ending should have some unique trigger. For instance, if this is a daily stock report, then we don’t want to mention a relatively static analyst ratings data point. We may only do this shortly before an earnings release or if any of those ratings change.


That’s just another decision in a seemingly endless list of decisions to be made when creating NLG. Once the context layer is outlined, we’ll end up with content that is concise, useful, and sometimes even entertaining.

Cookie Permissions
You can select which categories of cookies your computer stores. Click the YES/NO toggles below to turn each category of cookie on and off. Click Save and Accept when you are done. For a full list of cookies in each category, visit our Privacy Policy page