Join the SIG TFX-Addons community and help make TFX even better!

tfx.components.experimental.data_view.binder_component.DataViewBinder

A component that binds a DataView to ExamplesArtifact.

Inherits From: BaseComponent, BaseNode

It takes as inputs a channel of Examples and a channel of DataView, and binds the DataView (i.e. attaching information from the DataView as custom properties) to the Examples in the input channel, producing new Examples Artifacts that are identical to the input Examples (including the uris), except for the additional information attached.

Example:

  # We assume Examples are imported by ExampleGen
  example_gen = ...
  # First, create a dataview:
  data_view_provider = TfGraphDataViewProvider(
      module_file=module_file,
      create_decoder_func='create_decoder')
  # Then, bind the DataView to Examples:
  data_view_binder = DataViewBinder(
      input_examples=example_gen.outputs['examples'],
      data_view=data_view_provider.outputs['data_view'],
      )
  # Downstream component can then consume the output of the DataViewBinder:
  stats_gen = StatisticsGen(
      examples=data_view_binder.outputs['output_examples'], ...)

spec types.ComponentSpec object for this component instance.
custom_executor_spec Optional custom executor spec overriding the default executor specified in the component attribute.

outputs Component's output channel dict.