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

阅读 112

2022-03-30

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)

0 0 举报