Search⌘ K
AI Features

Embeddings

Explore how to use TensorFlow's feature column API to create embeddings for sequential text data. Learn to implement sequence categorical columns and integrate embedding layers with LSTM models for efficient NLP tasks involving tokenized sequences and variable-length inputs.

Chapter Goals:

  • Use TensorFlow feature columns to create input embeddings

A. Feature columns

So far, we've dealt with pre-training an embedding model as well as training an embedding model in tandem with an LSTM. In both of these cases, we had to write our own embedding matrix and handle its initialization.

A third option for incorporating word embeddings into your LSTM training model is by using TensorFlow's feature column API. Most of these feature columns won't be discussed in this course, since they aren't directly relevant to NLP.

The feature column function we will focus on is tf.feature_column.embedding_column. It lets you incorporate an embedding matrix automatically into your ...