Search⌘ K
AI Features

String Features

Explore how to convert string values to bytes and add them as Features in a TensorFlow Example object. Learn to build a feature dictionary that integrates string data efficiently into your machine learning input pipeline.

Chapter Goals:

  • Add the string features of a DataFrame’s row to a feature dictionary

A. Adding string features

The third type of TensorFlow Feature object that can be used in an Example object is a BytesList TensorFlow Feature. This can represent either byte values (e.g. image data) or string values. For string values, we need to convert them to the bytes type prior to initializing a BytesList ...