Source code for mllm_shap.connectors.filters

"""Token filtering strategies for audio-shap connectors."""

from .base.filters import TokenFilter


[docs] class KeepAllTokens(TokenFilter): """A token filter that does not exclude any tokens.""" phrases_to_exclude: set[str] = set() """No tokens are excluded by this strategy."""
[docs] class ExcludePunctuationTokensFilter(TokenFilter): """A token filter that removes common punctuation tokens.""" phrases_to_exclude: set[str] = {".", ",", "!", "?", ";", ":"} """Excludes standard inter-punctuation tokens."""