Skip to content

Guides to using TensorFlow Ranking + functions for working with TFR in the wild

License

Notifications You must be signed in to change notification settings

avatria/tfr-helpers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

tfr-helpers

Guides to using TensorFlow Ranking, and functions for working with TFR in the wild.

Have you wanted to use TensorFlow Ranking for your ranking machine learning tasks? At Avatria, learning-to-rank is at the core of what we do, so the answer was an obvious "yes" for us. But nobody on the team had extensive TensorFlow experience, and we soon found that there was a lot of activation energy required to get off the ground and to the races with tensorflow-ranking. After our data science team got TFR working the way we wanted it, we wanted to share our learnings with you so that others can have an easier go of it.

There are two main components of this repo: a set of tutorials and guides that explain how and why TFR works the way it does. These guides can help you do everything from convert your .csv's to Google protobufs to setting a learning rate decay schedule. Second, a python package with utility methods for data format conversion, feature scaling, and model exporting.

TFR tutorials

  1. Introduction to Tensorflow features, Protocol Buffers (protobufs), and Example Lists with Context (ELWCs).
  2. Getting your data to work with TensorFlow datasets for ranking.
  3. Groupwise Scoring Functions and standing up the key components of the Tensorflow Ranking Estimator.
  4. Exporting and importing SavedModels.
  5. Performance hacks.

Other TFR resources

Here are some links to learning resources that we found helpful for getting TensorFlow Ranking up and running.

Code

The tfr_helpers package provides utilities for converting your ranking datasets and pandas DataFrames into ELWCs, a rather complex data structure.

Other functionality:

  • Exporting ranker estimators to SavedModel protobuf format.
  • Extract model predictions on new .tfrecords files.
  • Load .tfrecords files containing ELWC protos into dataframes for inspection.

Sample data

About

Guides to using TensorFlow Ranking + functions for working with TFR in the wild

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published