Python jieba.initialize() Examples

The following are 3 code examples of jieba.initialize(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module jieba , or try the search function .
Example #1
Source File: dbscan_analysis.py    From ns4_chatbot with Apache License 2.0 5 votes vote down vote up
def init(self):
		# logger.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logger.DEBUG,filename='log.txt')
		logger.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logger.DEBUG)
		logger.getLogger("gensim").setLevel(logger.WARNING)
		logger.getLogger("jieba").setLevel(logger.WARNING)

		jieba.initialize()
		jieba.load_userdict("data/addwords.txt")
		jieba.analyse.set_stop_words('data/stopwords.txt') 
Example #2
Source File: crawl.py    From MillionHeroAssistant with MIT License 5 votes vote down vote up
def jieba_initialize():
    if not platform.system().upper().startswith("WINDOWS"):
        jieba.enable_parallel(multiprocessing.cpu_count())
    jieba.load_userdict('resources/QAattrdic.txt')
    jieba.initialize() 
Example #3
Source File: jieba_tokenizer.py    From DeepPavlov with Apache License 2.0 5 votes vote down vote up
def __init__(self, **kwargs) -> None:
        jieba.initialize()
        pass