autorag.nodes.passagefilter package

Submodules

autorag.nodes.passagefilter.base module

class autorag.nodes.passagefilter.base.BasePassageFilter(project_dir: str | Path, *args, **kwargs)[source]

Bases: BaseModule

cast_to_run(previous_result: DataFrame, *args, **kwargs)[source]

This function is for cast function (a.k.a decorator) only for pure function in the whole node.

autorag.nodes.passagefilter.pass_passage_filter module

class autorag.nodes.passagefilter.pass_passage_filter.PassPassageFilter(project_dir: str | Path, *args, **kwargs)[source]

Bases: BasePassageFilter

pure(previous_result: DataFrame, *args, **kwargs)[source]

autorag.nodes.passagefilter.percentile_cutoff module

class autorag.nodes.passagefilter.percentile_cutoff.PercentileCutoff(project_dir: str | Path, *args, **kwargs)[source]

Bases: BasePassageFilter

pure(previous_result: DataFrame, *args, **kwargs)[source]

autorag.nodes.passagefilter.recency module

class autorag.nodes.passagefilter.recency.RecencyFilter(project_dir: str | Path, *args, **kwargs)[source]

Bases: BasePassageFilter

pure(previous_result: DataFrame, *args, **kwargs)[source]

autorag.nodes.passagefilter.run module

autorag.nodes.passagefilter.run.run_passage_filter_node(modules: List, module_params: List[Dict], previous_result: DataFrame, node_line_dir: str, strategies: Dict) DataFrame[source]

Run evaluation and select the best module among passage filter node results.

Parameters:
  • modules – Passage filter modules to run.

  • module_params – Passage filter module parameters.

  • previous_result – Previous result dataframe. Could be retrieval, reranker, passage filter modules result. It means it must contain ‘query’, ‘retrieved_contents’, ‘retrieved_ids’, ‘retrieve_scores’ columns.

  • node_line_dir – This node line’s directory.

  • strategies – Strategies for passage filter node. In this node, we use ‘retrieval_f1’, ‘retrieval_recall’ and ‘retrieval_precision’. You can skip evaluation when you use only one module and a module parameter.

Returns:

The best result dataframe with previous result columns.

autorag.nodes.passagefilter.similarity_percentile_cutoff module

class autorag.nodes.passagefilter.similarity_percentile_cutoff.SimilarityPercentileCutoff(project_dir: str | Path, *args, **kwargs)[source]

Bases: BasePassageFilter

pure(previous_result: DataFrame, *args, **kwargs)[source]

autorag.nodes.passagefilter.similarity_threshold_cutoff module

class autorag.nodes.passagefilter.similarity_threshold_cutoff.SimilarityThresholdCutoff(project_dir: str, *args, **kwargs)[source]

Bases: BasePassageFilter

pure(previous_result: DataFrame, *args, **kwargs)[source]

autorag.nodes.passagefilter.threshold_cutoff module

class autorag.nodes.passagefilter.threshold_cutoff.ThresholdCutoff(project_dir: str | Path, *args, **kwargs)[source]

Bases: BasePassageFilter

pure(previous_result: DataFrame, *args, **kwargs)[source]

Module contents