diff --git a/haystack/components/preprocessors/recursive_chunker.py b/haystack/components/preprocessors/recursive_chunker.py index be9d6c6e53..d9b6454951 100644 --- a/haystack/components/preprocessors/recursive_chunker.py +++ b/haystack/components/preprocessors/recursive_chunker.py @@ -38,7 +38,7 @@ def _check_params(self): @staticmethod def _get_custom_sentence_tokenizer(): try: - from haystack.components.preprocessors.sentence_tokenizer import Language, SentenceSplitter, nltk_imports + from haystack.components.preprocessors.sentence_tokenizer import SentenceSplitter except (LookupError, ModuleNotFoundError): raise Exception("You need to install NLTK to use this function. You can install it via `pip install nltk`") return SentenceSplitter(language="en")