autorag.nodes.passageaugmenter package

Submodules

autorag.nodes.passageaugmenter.base module

class autorag.nodes.passageaugmenter.base.BasePassageAugmenter(project_dir: str, *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.

static sort_by_scores(augmented_contents, augmented_ids, augmented_scores, top_k: int, reverse: bool = True)[source]

autorag.nodes.passageaugmenter.pass_passage_augmenter module

class autorag.nodes.passageaugmenter.pass_passage_augmenter.PassPassageAugmenter(project_dir: str, *args, **kwargs)[source]

Bases: BasePassageAugmenter

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

Run the passage augmenter node - PassPassageAugmenter module.

Parameters:
  • previous_result – The previous result Dataframe.

  • top_k – You must input the top_k value to get the top k results.

  • kwargs – Not affected.

Returns:

DataFrame with retrieved_contents, retrieved_ids, and retrieve_scores columns

autorag.nodes.passageaugmenter.prev_next_augmenter module

class autorag.nodes.passageaugmenter.prev_next_augmenter.PrevNextPassageAugmenter(project_dir: str, embedding_model: str = 'openai', *args, **kwargs)[source]

Bases: BasePassageAugmenter

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

Run the passage augmenter node - PrevNextPassageAugmenter module.

Parameters:
  • previous_result – The previous result Dataframe.

  • top_k – You must input the top_k value to get the top k results.

  • kwargs – Not affected.

Returns:

DataFrame with retrieved_contents, retrieved_ids, and retrieve_scores columns

autorag.nodes.passageaugmenter.prev_next_augmenter.prev_next_augmenter_pure(ids: List[str], corpus_df: DataFrame, mode: str, num_passages: int)[source]

autorag.nodes.passageaugmenter.run module

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

Module contents