Homage to classic NLP: generating the weather forecast

December 15, 2022

Miss Jane is an experimental Alexa experience of a weather forecaster from the 1800s. Miss Jane delivers real-time weather forecasts in a tone of voice from the Regency era, using words and phrases modelled from English novels of the time.

Alexa, ask Miss Jane for the weather in Seattle

Seattle is entertaining a temperature of 43 degrees and skies cast over with clouds. I cannot but suppose that tomorrow shall be gloomy and bereft of sunbreaks, with a temperature as lofty as 45 degrees and as humble as 34.


Try it yourself. Enter a town or ZIP code:  

How does it work?

The utility of a weather forecast depends on its accuracy and clarity, and so the output of the Miss Jane system is constrained to deliver phrasing that reflects the forecast with high precision.

The system first makes an API call to obtain the raw numerical codes for the conditions, forecast and expected temperatures of a given location. Then it applies a probabilistic rule system on the numbers to generate the response (rather than applying, say, a 'black box' AI such as a Large Language Model, which may be prone to hallucination and thereby misleading forecasts).

In the example above, the weather API supplied a weather code of 804 (roughly defined as 'overcast cloud: 85-100%') for both the current and the next day's weather. The Miss Jane system took this and produced phrases such as skies cast over with clouds and gloomy and bereft of sunbreaks, using a lexicon of words and phrases from the 1800s, and generative rules that encode grammatical structure, agreement, etc. Probabilistic selection takes place at many points during generation in order to obtain variety in the delivery of multiple forecasts based on the same code.

The other aspects of the Miss Jane experience, including greetings, help, error messages, etc., are generated in the same way.

What systems are involved?

Miss Jane uses Tonality AI's capabilities for Alexa integration and text generation, and the OpenWeather API for current conditions and forecast.

For those users who are interested in more than just the language of the era, the add-on Ask Jane Anything offers a broad chat experience, including period-appropriate etiquette advice, recipes, contemporary quotations, and general question-answering supported by an LLM chat model.