记录一下WordNet多线程下的bug

时间:2021-05-23 23:47:26   收藏:0   阅读:0

使用线程池的时候,WordNet会出现lazyrender的错误,通过查看一些资料,使用下面的方法去解决:

import nltk
from nltk.corpus import sentiwordnet as swn
# Do this first, that‘ll do something eval() 
# to "materialize" the LazyCorpusLoader
next(swn.all_senti_synsets()) 

# Your other code here. 

记录一下,这个问题查了很久。

参考

最佳解决方案地址

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!