我目前正在尝试 使用 crfsuite 库从这个博客https://towardsdatascience.com/named-entity-recognition-and-classification-with-scikit-learn-f05372f07ba2复制某些方法,该库应该有一个名为keep_tempfiles = False如图所示的属性在https://sklearn-crfsuite.readthedocs.io/en/latest/_modules/sklearn_crfsuite/estimator.html 中。
但是,当我在 jupyter notebook 中运行这段代码时
crf = sklearn_crfsuite.CRF(algorithm='lbfgs',c1=0.1,c2=0.1,max_iterations=100,all_possible_transitions=True)
crf.fit(X_train, y_train)
Run Code Online (Sandbox Code Playgroud)
我收到以下错误
AttributeError Traceback (most recent call last)
/usr/lib/python3/dist-packages/IPython/core/formatters.py in __call__(self, obj, include, exclude)
968
969 if method is not None:
--> 970 return method(include=include, exclude=exclude)
971 return None
972 else:
~/.local/lib/python3.8/site-packages/sklearn/base.py in _repr_mimebundle_(self, **kwargs)
462 def _repr_mimebundle_(self, **kwargs):
463 """Mime bundle used by jupyter kernels to display estimator"""
--> 464 output = {"text/plain": repr(self)}
465 if get_config()["display"] == …Run Code Online (Sandbox Code Playgroud)