diff --git a/deeppavlov/models/preprocessors/squad_preprocessor.py b/deeppavlov/models/preprocessors/squad_preprocessor.py index 4fdb0631d6..888a6070cf 100644 --- a/deeppavlov/models/preprocessors/squad_preprocessor.py +++ b/deeppavlov/models/preprocessors/squad_preprocessor.py @@ -39,6 +39,11 @@ def __init__(self, context_limit, question_limit, char_limit, *args, **kwargs): self.context_limit = context_limit self.question_limit = question_limit self.char_limit = char_limit + try: + import nltk + nltk.data.find('tokenizers/punkt') + except LookupError: + nltk.download('punkt') def __call__(self, contexts_raw, questions_raw, **kwargs): contexts = []