python - AttributeError:模块“sst”没有属性“train_reader”
问题描述
我对情绪分析很陌生。尝试使用 Stanford Sentiment Treebank(sst) 并遇到错误。
from nltk.tree import Tree
import os
import sst
trees = "C:\\Users\m\data\trees"
tree, score = next(sst.train_reader(trees))
[输出]:
AttributeError Traceback (most recent call last)
<ipython-input-19-4101f90b0b16> in <module>()
----> 1 tree, score = next(sst.train_reader(trees))
AttributeError: module 'sst' has no attribute 'train_reader'
解决方案
我猜你正在导入 sst 包 selenium-simple-test,这不是你要找的。
如果出现错误,请尝试 sst.discover()
TypeError: discover() missing 4 required positional arguments: 'test_loader', 'package', 'dir_path', and 'names'
您正在使用 selenium-simple-test 包
推荐阅读
- python - 将带有字段名称的条目列表提取到字典 DJango 模型中
- pytest - 如何参数化我的夹具并获取测试数据来参数化我的测试
- python - 如何在 pandas 的组中删除某种类型的值?
- python - 使用元素的索引进行交换
- ios - 为什么 Picker 的 .onReceive 都会触发?
- javascript - req.flash 不是功能快递护照
- android - 添加 com.google.android.material 后,Android 底部导航栏颜色变为黑色
- neo4j - 通过 neo4j 密码中的过滤器处理参数化顺序
- javascript - 如何按角色数组过滤对象?
- python-3.x - 同时使用多个虚拟环境的可能性