liveBook · Manning

Sequence

As explained in Natural Language Processing in Action, Second Edition

A time series is a sequence of observations indexed by successive points in time.

A sequence is an ordered series of observations, such as daily weather or hourly scooter rentals. For an RNN to process numerical data over time, represent each observation as a numerical vector. section 8.1.1

An RNN can produce an output for each sequence element. For forecasting, use it to predict the next element, then feed that prediction back in to forecast later steps. section 8.1.1

Table 8.1 The many inputs and outputs of RNNs
Type
Description
Applications
One to many
One input tensor used to generate a sequence of output tensors
Generate chat messages, answer questions, describe images
Many to one
A sequence of input tensors gathered up into a single output tensor
Classify or tag text according to its language, intent, or other characteristics
Many to many
A sequence of input tensors used to generate a sequence of output tensors
Translate, tag, or anonymize the tokens within a sequence of tokens, answer questions, participate in a conversation

RNNs can map a single input to a sequence, a sequence to one output, or one sequence to another. section 8.1

How Natural Language Processing in Action, Second Edition covers it

How deep it goes
Explains vector representation and recursive prediction, while deferring the details of backpropagation through time.
Examples
Uses scooter rentals, freeway traffic, and weather as sequential data, with future weather and traffic as prediction targets.
What it assumes
Represent sequence elements as numerical vectors; word embeddings are one example for language.
What you can do after
Apply sequences through RNNs to predict the next observation and extend forecasts recursively.
How it connects
Connects sequences to recurrent neural networks, word embeddings, and backpropagation through time.

Also explained in

Compare how 22 books explain sequence →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Natural Language Processing in Action, Second Edition. The section links point to the parts of the book it draws on.