jieba 分詞不顯示日志


問題

每一次我用jieba進行分詞的時候,都會有

Building prefix dict from the default dictionary ...
Loading model from cache /tmp/jieba.cache
Loading model cost 0.128 seconds.
Prefix dict has been built succesfully.

這樣的提示。怎么去除這些提示呢?

解決方案

import logging
jieba.setLogLevel(logging.INFO)

jieba.setLogLevel(20)

參考:

https://github.com/fxsjy/jieba/issues/529


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM