jieba How can I accelerate custom user dict loading?

luaexgnf  于 2022-10-26  发布在  其他
关注(0)|答案(1)|浏览(180)

I have a word list which has more than 800 million words in a txt file, when I use it, it will take more than 10 minutes to load,
jieba.load_userdict(r"/path/to/my/file/dict.txt")
so how can I accelerate loading method.

yr9zkbsy

yr9zkbsy1#

you can write a OOP Class and initiate the dictionary from there.
After that call the class and its function in another python file and keep it looping using while True.

相关问题