Skip to content

Commit 4dff532

Browse files
committed
chore: Turn off jieba debug log
1 parent 8c81748 commit 4dff532

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/sphinxnotes/snippet/keyword.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,17 @@ class Extractor(object):
2323

2424
def __init__(self):
2525
# Import NLP libs here to prevent import overhead
26+
import logging
2627
from langid import rank
27-
from jieba import cut_for_search
28+
from jieba import cut_for_search, setLogLevel
2829
from pypinyin import lazy_pinyin
2930
from stopwordsiso import stopwords
3031
from wordsegment import load, segment
3132

33+
# Turn off jieba debug log.
34+
# https://github.com/fxsjy/jieba/issues/255
35+
setLogLevel(logging.INFO)
36+
3237
load()
3338
self._detect_langs = rank
3439
self._tokenize_zh_cn = cut_for_search

0 commit comments

Comments
 (0)