使用结巴分词,会输出如下日志:
Building prefix dict from /usr/lib/python2.7/site-packages/jieba/dict.txt ... Loading model from cache /tmp/jieba.cache Loading model cost 0.182227134705 seconds. Prefix dict has been built succesfully.
logging日志级别(5个等级),从低到高分别是:
DEBUG INFO WARNING ERROR CRITICAL
不显示debug信息,只要大于 logging.DEBUG 级别即可,比如:
import logging jieba.setLogLevel(logging.INFO)
参考:
jieba如何关闭stderr的日志 #255