From bf5c13d17021540bd30fbbb1c251984b5d8f1fc0 Mon Sep 17 00:00:00 2001 From: adrianeboyd Date: Mon, 20 Apr 2020 22:06:53 +0200 Subject: [PATCH] Modify jieba install message (#5328) Modify jieba install message to instruct the user to use `ChineseDefaults.use_jieba = False` so that it's possible to load pkuseg-only models without jieba installed. --- spacy/lang/zh/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spacy/lang/zh/__init__.py b/spacy/lang/zh/__init__.py index 2cf00d389..701e696a4 100644 --- a/spacy/lang/zh/__init__.py +++ b/spacy/lang/zh/__init__.py @@ -30,8 +30,10 @@ def try_jieba_import(use_jieba): except ImportError: if use_jieba: msg = ( - "Jieba not installed. Either set Chinese.use_jieba = False, " - "or install it https://github.com/fxsjy/jieba" + "Jieba not installed. Either set the default to False with " + "`from spacy.lang.zh import ChineseDefaults; ChineseDefaults.use_jieba = False`, " + "or install it with `pip install jieba` or from " + "https://github.com/fxsjy/jieba" ) raise ImportError(msg)