[Experimental] Add FilterComponent for row-level example filtering#7868
Open
vkarampudi wants to merge 1 commit into
Open
[Experimental] Add FilterComponent for row-level example filtering#7868vkarampudi wants to merge 1 commit into
vkarampudi wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces an experimental
FilterComponentto TFX, addressing a long-standing feature request (Issue #6909) for row-level example filtering within pipelines.Currently, TFX has no built-in component to filter anomalous or unwanted examples after ingestion. The
Transformcomponent (TFT) is strictly map-only and does not support dropping rows. As a result, users have had to write custom Apache Beam code or perform out-of-band pre-processing. The newFilterComponentprovides a clean, native, and reusable way to filter datasets split-by-split using a user-defined Python function.Proposed Changes
component.py):FilterSpecandFilterComponent.Exampleschannel and a string import path to a Python filter function (filter_fn_path).filtered_examplesExampleschannel.executor.py):Examplesartifact (e.g.,train,eval).beam.Filter.component_test.py: Verifies component instantiation and spec parsing.executor_test.py: Runs a full integration test with simulatedtrainandevalsplits, executing the Beam filter pipeline and verifying correct output records.Usage Example