autorag.schema package¶
Submodules¶
autorag.schema.base module¶
autorag.schema.metricinput module¶
- class autorag.schema.metricinput.MetricInput(query: str | None = None, queries: List[str] | None = None, retrieval_gt_contents: List[List[str]] | None = None, retrieved_contents: List[str] | None = None, retrieval_gt: List[List[str]] | None = None, retrieved_ids: List[str] | None = None, prompt: str | None = None, generated_texts: str | None = None, generation_gt: List[str] | None = None, generated_log_probs: List[float] | None = None)[source]¶
Bases:
object
- classmethod from_dataframe(qa_data: DataFrame) List[MetricInput] [source]¶
Convert a pandas DataFrame into a list of MetricInput instances. qa_data: pd.DataFrame: qa_data DataFrame containing metric data.
- Returns:
List[MetricInput]: List of MetricInput objects created from DataFrame rows.
- generated_log_probs: List[float] | None = None¶
- generated_texts: str | None = None¶
- generation_gt: List[str] | None = None¶
- prompt: str | None = None¶
- queries: List[str] | None = None¶
- query: str | None = None¶
- retrieval_gt: List[List[str]] | None = None¶
- retrieval_gt_contents: List[List[str]] | None = None¶
- retrieved_contents: List[str] | None = None¶
- retrieved_ids: List[str] | None = None¶
autorag.schema.module module¶
autorag.schema.node module¶
- class autorag.schema.node.Node(node_type: str, strategy: Dict, node_params: Dict, modules: List[autorag.schema.module.Module])[source]¶
Bases:
object
- get_param_combinations() Tuple[List[Callable], List[Dict]] [source]¶
This method returns a combination of module and node parameters, also corresponding modules.
- Returns:
Each module and its module parameters.
- Return type:
Tuple[List[Callable], List[Dict]]
- node_params: Dict¶
- node_type: str¶
- run_node: Callable¶
- strategy: Dict¶
- autorag.schema.node.extract_values(node: Node, key: str) List[str] [source]¶
This function extract values from node’s modules’ module_param.
- Parameters:
node – The node you want to extract values from.
key – The key of module_param that you want to extract.
- Returns:
The list of extracted values. It removes duplicated elements automatically.
- autorag.schema.node.extract_values_from_nodes(nodes: List[Node], key: str) List[str] [source]¶
This function extract values from nodes’ modules’ module_param.
- Parameters:
nodes – The nodes you want to extract values from.
key – The key of module_param that you want to extract.
- Returns:
The list of extracted values. It removes duplicated elements automatically.
- autorag.schema.node.extract_values_from_nodes_strategy(nodes: List[Node], key: str) List[Any] [source]¶
This function extract values from nodes’ strategy.
- Parameters:
nodes – The nodes you want to extract values from.
key – The key string that you want to extract.
- Returns:
The list of extracted values. It removes duplicated elements automatically.
- autorag.schema.node.module_type_exists(nodes: List[Node], module_type: str) bool [source]¶
This function check if the module type exists in the nodes.
- Parameters:
nodes – The nodes you want to check.
module_type – The module type you want to check.
- Returns:
True if the module type exists in the nodes.