From 0a394affe5ada938c0cdd89132ba8051770adcf4 Mon Sep 17 00:00:00 2001 From: Omarzintan Date: Fri, 7 Jan 2022 20:42:50 -0500 Subject: [PATCH] fix bug in tagging.py with spacy en model --- chatterbot/tagging.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chatterbot/tagging.py b/chatterbot/tagging.py index ea3c31d26..79fbb4636 100644 --- a/chatterbot/tagging.py +++ b/chatterbot/tagging.py @@ -23,7 +23,10 @@ def __init__(self, language=None): self.punctuation_table = str.maketrans(dict.fromkeys(string.punctuation)) - self.nlp = spacy.load(self.language.ISO_639_1.lower()) + if self.language.ISO_639_1.lower() == 'en': + self.nlp = spacy.load('en_core_web_sm') + else: + self.nlp = spacy.load(self.language.ISO_639_1.lower()) def get_text_index_string(self, text): """