首页 > 编程语言 > 详细

记录一下WordNet多线程下的bug

时间:2021-05-04 10:10:58      阅读: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. 

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

参考

最佳解决方案地址

记录一下WordNet多线程下的bug

原文:https://www.cnblogs.com/future-dream/p/14728625.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!