Plugins¶
Plugin registry with entry-point discovery.
- nlp_shap.plugins.registry.PluginFactory¶
Callable that materializes a plugin instance.
- class nlp_shap.plugins.registry.PluginRegistry[source]¶
Bases:
objectRegister and resolve pipeline plugins by group and name.
- register(group: PluginGroup | str, name: str, factory: Callable[[], object]) None[source]¶
Register a plugin factory under
groupandname.
- resolve(group: PluginGroup | str, name: str) object[source]¶
Instantiate a plugin registered under
groupandname.
- names(group: PluginGroup | str) tuple[str, ...][source]¶
Return sorted plugin names registered for
group.
- load_entry_points(group: PluginGroup | str) None[source]¶
Discover and register plugins from a packaging entry-point group.
Plugin group identifiers for entry-point loading.
- class nlp_shap.plugins.groups.PluginGroup(*values)[source]¶
Bases:
StrEnumEntry-point groups registered in packaging metadata.
- ESTIMATORS = 'nlp_shap.estimators'¶
Coalition-sampling estimator plugins.
- ESTIMANDS = 'nlp_shap.estimands'¶
Coalition payoff aggregation plugins.
- VALUE_FNS = 'nlp_shap.value_fns'¶
Utility scoring plugins for coalition outputs.
- BACKENDS = 'nlp_shap.backends'¶
Model inference backend plugins.
- PARTITIONS = 'nlp_shap.partitions'¶
Player-partitioning plugins for conversation snapshots.
- ABSENCE_POLICIES = 'nlp_shap.absence_policies'¶
Absence-policy plugins for rendering masked snapshots.
Built-in plugin registration hooks.
- nlp_shap.plugins.builtin.register_builtin_plugins(registry: PluginRegistry) None[source]¶
Register built-in partition, absence-policy, and estimator plugins.
Plugin registry context helpers.
- class nlp_shap.plugins.context.PluginContext(registry: PluginRegistry)[source]¶
Bases:
objectRegistry handle passed through pipeline setup.
- registry: PluginRegistry¶
Plugin registry used to resolve pipeline components.