tfds.transform.apply_filter

Filters examples for whom fn returns true on input_feature.

fn the function that returns whether the input feature of an example should be filtered.
input_feature the input feature to apply fn to. If this is the empty string, then fn will receive the entire example.

function that can be applied to filter examples.