frex.pipeline_stages package
Subpackages
Submodules
frex.pipeline_stages.pipeline_stage module
- class frex.pipeline_stages.pipeline_stage.PipelineStage[source]
Bases:
abc.ABC
This is the base class for custom stages that will be run in a pipeline.
PipelineStages are callable classes which should take input candidates and context and yield out candidates. Candidates yielded by a PipelineStage might be entirely new (e.g., a generator stage generated new candidates) or they may be updated in some way (e.g., a scorer stage added a new score to an existing candidate that was passed in).
- abstract __call__(*, candidates: Generator[frex.models.candidate.Candidate, None, None], context: Any) Generator[frex.models.candidate.Candidate, None, None] [source]
Execute some function to apply and yield new or updated candidates.
- Parameters
candidates – A Generator yielding candidates. In the setup of a FREx Pipeline, this is typically another PipelineStage that is yielding candidates into the next stage.
context – The current context being used to execute the Pipeline.
- Returns
A Generator, yielding new Candidate objects.