Source code for nlp_shap.protocols.partition
"""Player partition protocol."""
from typing import Protocol
from ..domain.conversation import ConversationSnapshot
from ..domain.players import PlayerSet
[docs]
class PlayerPartitioner(Protocol):
"""Partition a conversation snapshot into explainability players."""
@property
def name(self) -> str:
"""Return the registered partition identifier."""
[docs]
def partition(self, snapshot: ConversationSnapshot) -> PlayerSet:
"""Derive ordered players from the snapshot."""