vps交流

[疑问] TypeError: 'set' object is not subscriptable 求解决


通过word2vec产生词典,调包发生错误
from wordexpansion import W2VModels
import os

#初始化模型。  lang参数设置语言类型。“chinese”或”english“
model = W2VModels(cwd=os.getcwd(), lang=’english’)  #语料数据documents.txt
model.train(documents=list(open(‘datasets/05-初识文本分析/data/documents.txt’,encoding=’utf-8′).readlines()))
报错
File "D:stattoolsAnacondalibsite-packagesmultistopcode.py", line 18, in setlang
    self.stopwords_set = self.multistopwords[lang]
TypeError: ‘set’ object is not subscriptable

检查code.py文件
附件里是源代码
求大佬看怎么修复错误

[疑问]  TypeError: 'set' object is not subscriptable 求解决

检查code.py文件.pdf

半小时前 上传

点击文件名下载附件

69.76 KB, 下载次数: 0

求大佬帮忙