0
点赞
收藏
分享

微信扫一扫

已解决:AttributeError: ‘CRF‘ object has no attribute ‘keep_tempfiles‘

探头的新芽 2022-03-30 阅读 112

1. 场景

使用NLTK+sklean_crfsuite 训练模型遇到抱错:

AttributeError: 'CRF' object has no attribute 'keep_tempfiles'

2.解决

确定包的版本:

$ pip install -U 'scikit-learn<0.24'

将代码片段换成:

try:
    crf.fit(X_train, y_train)
except AttributeError:
    pass

在这里插入图片描述

举报

相关推荐

0 条评论