跳转至

方法注册表

提取方法的注册表函数和配置。


注册表函数

hyperextract.methods.registry

Method Registry - Central registry for all extraction methods.

This module provides a unified registry for method templates, enabling consistent creation and management of method-based knowledge extraction.

Functions

register_method(name: str, method_class: Type, autotype: str, description: str = '') -> None

Register a method in the registry.

Parameters:

Name Type Description Default
name str

Method name (e.g., "light_rag")

required
method_class Type

The method class

required
autotype str

AutoType category (e.g., "graph", "hypergraph")

required
description str

Method description

''

get_method(name: str) -> Optional[Dict[str, Any]]

Get method info by name.

Parameters:

Name Type Description Default
name str

Method name

required

Returns:

Type Description
Optional[Dict[str, Any]]

Method info dict or None if not found

list_methods() -> Dict[str, Dict[str, Any]]

List all registered methods.

Returns:

Type Description
Dict[str, Dict[str, Any]]

Dict mapping method names to their info

get_method_cfg(name: str) -> Optional[MethodCfg]

Get method configuration as MethodCfg.

Parameters:

Name Type Description Default
name str

Method name

required

Returns:

Type Description
Optional[MethodCfg]

MethodCfg or None if not found

list_method_cfgs() -> Dict[str, MethodCfg]

List all method configurations.

Returns:

Type Description
Dict[str, MethodCfg]

Dict mapping "method/{name}" to MethodCfg


方法配置

hyperextract.methods.registry.MethodCfg

Bases: BaseModel

Configuration model for method templates.

Attributes

name: str instance-attribute

type: str instance-attribute

description: str = '' class-attribute instance-attribute