Filters

Filters are an efficient way to create queries that can be passed to ChatterBot’s storage adapters. Filters will reduce the number of statements that a chat bot has to process when it is selecting a response.

Setting filters

chatbot = ChatBot(
    "My ChatterBot",
    filters=[filters.get_recent_repeated_responses]
)
chatterbot.filters.get_recent_repeated_responses(chatbot: ChatBot, conversation: str, sample: int = 10, threshold: int = 3, quantity: int = 3) → list[str][source]

A filter that eliminates possibly repetitive responses to prevent a chat bot from repeating statements that it has recently said.