热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

使用NER_sklearn.ipynbCRF实现,出现的问题

Traceback(mostrecentcalllast):FileD:\software\Anaconda3\envs\NER\lib\site-packages\IPytho



Traceback (most recent call last):
File "D:\software\Anaconda3\envs\NER\lib\site-packages\IPython\core\interactiveshell.py", line 3418, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 1, in
runfile('D:/Users/lee/Downloads/Compressed/ailearning-master/ailearning-master/ner/test.py', wdir='D:/Users/lee/Downloads/Compressed/ailearning-master/ailearning-master/ner')
File "D:\software\PyCharm Community Edition 2019.1.1\helpers\pydev\_pydev_bundle\pydev_umd.py", line 197, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File "D:\software\PyCharm Community Edition 2019.1.1\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "D:/Users/lee/Downloads/Compressed/ailearning-master/ailearning-master/ner/test.py", line 342, in
rs.fit(X_train, y_train)
File "D:\software\Anaconda3\envs\NER\lib\site-packages\sklearn\utils\validation.py", line 63, in inner_f
return f(*args, **kwargs)
File "D:\software\Anaconda3\envs\NER\lib\site-packages\sklearn\model_selection\_search.py", line 765, in fit
base_estimator = clone(self.estimator)
File "D:\software\Anaconda3\envs\NER\lib\site-packages\sklearn\utils\validation.py", line 63, in inner_f
return f(*args, **kwargs)
File "D:\software\Anaconda3\envs\NER\lib\site-packages\sklearn\base.py", line 74, in clone
new_object_params = estimator.get_params(deep=False)
File "D:\software\Anaconda3\envs\NER\lib\site-packages\sklearn\base.py", line 195, in get_params
value = getattr(self, key)
AttributeError: 'CRF' object has no attribute 'keep_tempfiles'

好像是python 3.7不支持,尝试改成3.6.4

Please note and check the following:
* The Python version is: Python3.6 from "D:\software\Anaconda3\envs\NER\python.exe"
* The NumPy version is: "1.19.4"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: No module named 'numpy.core._multiarray_umath'

然后又要改numpy为 1.16.0

Traceback (most recent call last):
File "D:\software\Anaconda3\envs\NER\lib\site-packages\IPython\core\interactiveshell.py", line 3418, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 1, in
runfile('D:/Users/lee/Downloads/Compressed/ailearning-master/ailearning-master/ner/test.py', wdir='D:/Users/lee/Downloads/Compressed/ailearning-master/ailearning-master/ner')
File "D:\software\PyCharm Community Edition 2019.1.1\helpers\pydev\_pydev_bundle\pydev_umd.py", line 197, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File "D:\software\PyCharm Community Edition 2019.1.1\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "D:/Users/lee/Downloads/Compressed/ailearning-master/ailearning-master/ner/test.py", line 6, in
import pandas as pd
File "D:\software\PyCharm Community Edition 2019.1.1\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "D:\software\Anaconda3\envs\NER\lib\site-packages\pandas\__init__.py", line 38, in
) from e
ImportError: C extension: No module named 'pandas._libs.interval' not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inp

然后又要重装pandas

File "C:\Users\lee\AppData\Roaming\Python\Python36\site-packages\sklearn\base.py", line 21, in
from .utils import _IS_32BIT
File "D:\software\PyCharm Community Edition 2019.1.1\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "C:\Users\lee\AppData\Roaming\Python\Python36\site-packages\sklearn\utils\__init__.py", line 20, in
from scipy.sparse import issparse
File "D:\software\PyCharm Community Edition 2019.1.1\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "D:\software\Anaconda3\envs\NER\lib\site-packages\scipy\__init__.py", line 151, in
from scipy._lib._ccallback import LowLevelCallable
File "D:\software\PyCharm Community Edition 2019.1.1\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "D:\software\Anaconda3\envs\NER\lib\site-packages\scipy\_lib\_ccallback.py", line 1, in
from . import _ccallback_c
ImportError: cannot import name '_ccallback_c'

然后又要重装scipy
pip uninstall scipy
pip install scipy

Traceback (most recent call last):
File "D:\software\Anaconda3\envs\NER\lib\site-packages\IPython\core\interactiveshell.py", line 3418, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 1, in
runfile('D:/Users/lee/Downloads/Compressed/ailearning-master/ailearning-master/ner/test.py', wdir='D:/Users/lee/Downloads/Compressed/ailearning-master/ailearning-master/ner')
File "D:\software\PyCharm Community Edition 2019.1.1\helpers\pydev\_pydev_bundle\pydev_umd.py", line 197, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File "D:\software\PyCharm Community Edition 2019.1.1\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "D:/Users/lee/Downloads/Compressed/ailearning-master/ailearning-master/ner/test.py", line 164, in
import sklearn_crfsuite
File "D:\software\PyCharm Community Edition 2019.1.1\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "D:\software\Anaconda3\envs\NER\lib\site-packages\sklearn_crfsuite\__init__.py", line 2, in
from .estimator import CRF
File "D:\software\PyCharm Community Edition 2019.1.1\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "D:\software\Anaconda3\envs\NER\lib\site-packages\sklearn_crfsuite\estimator.py", line 6, in
import pycrfsuite
File "D:\software\PyCharm Community Edition 2019.1.1\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "D:\software\Anaconda3\envs\NER\lib\site-packages\pycrfsuite\__init__.py", line 2, in
from ._pycrfsuite import *
File "D:\software\PyCharm Community Edition 2019.1.1\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
ModuleNotFoundError: No module named 'pycrfsuite._pycrfsuite'

然后又要重装
pip uninstall python-crfsuite
pip install python-crfsuite

Top negative:
-1.003934 O word.lower():democrats
-1.014938 O +1:word.lower():military
-1.016890 O -1:word.lower():emirates
-1.038674 B-gpe +1:postag:NN
-1.123186 O -1:word.lower():extremist
-1.128056 O +1:word.lower():was
-1.143572 B-geo -1:word.lower():with
-1.177887 B-geo word[-2:]:ma
-1.181155 I-per +1:postag[:2]:NN
-1.186787 B-gpe word[-3:]:can
-1.201166 I-tim word.istitle()
-1.257182 I-per bias
-1.273856 O word.isupper()
-1.285654 O word[-2:]:sh
-1.294274 O postag:NNPS
-1.301724 B-art -1:word.istitle()
-1.361519 O word[-3:]:ish
-1.374149 B-org -1:postag:NNP
-1.447830 B-gpe -1:word.istitle()
-1.568004 O postag[:2]:NN
-1.660512 O word[-2:]:an
-1.685406 B-gpe word[-3:]:ean
-1.899461 B-gpe -1:word.lower():from
-1.909397 B-geo -1:postag[:2]:NN
-1.954756 B-per -1:postag:NNP
-2.099129 B-gpe word.lower():european
-2.361597 B-gpe -1:word.lower():in
-3.268760 O word.isdigit()
-4.204295 O word.istitle()
-5.503867 O postag:NNP

成功运行!



推荐阅读
  • 本文深入探讨了使用Puppet进行软件包分发与管理的方法。首先介绍了fpm这一跨平台的软件包制作工具,其简便的操作流程使得软件包的创建变得轻松快捷。fpm的项目地址为:https://github.com/jordansissel/fpm。通过结合Puppet和fpm,可以实现高效、可靠的软件包管理和部署。 ... [详细]
  • 掌握Android UI设计:利用ZoomControls实现图片缩放功能
    本文介绍了如何在Android应用中通过使用ZoomControls组件来实现图片的缩放功能。ZoomControls提供了一种简单且直观的方式,让用户可以通过点击放大和缩小按钮来调整图片的显示大小。文章详细讲解了ZoomControls的基本用法、布局设置以及与ImageView的结合使用方法,适合初学者快速掌握Android UI设计中的这一重要功能。 ... [详细]
  • 利用树莓派畅享落网电台音乐体验
    最近重新拾起了闲置已久的树莓派,这台小巧的开发板已经沉寂了半年多。上个月闲暇时间较多,我决定将其重新启用。恰逢落网电台进行了改版,回忆起之前在树莓派论坛上看到有人用它来播放豆瓣音乐,便萌生了同样的想法。通过一番调试,终于实现了在树莓派上流畅播放落网电台音乐的功能,带来了全新的音乐享受体验。 ... [详细]
  • 本文介绍了如何利用Apache POI库高效读取Excel文件中的数据。通过实际测试,除了分数被转换为小数存储外,其他数据均能正确读取。若在使用过程中发现任何问题,请及时留言反馈,以便我们进行更新和改进。 ... [详细]
  • 本文深入探讨了CGLIB BeanCopier在Bean对象复制中的应用及其优化技巧。相较于Spring的BeanUtils和Apache的BeanUtils,CGLIB BeanCopier在性能上具有显著优势。通过详细分析其内部机制和使用场景,本文提供了多种优化方法,帮助开发者在实际项目中更高效地利用这一工具。此外,文章还讨论了CGLIB BeanCopier在复杂对象结构和大规模数据处理中的表现,为读者提供了实用的参考和建议。 ... [详细]
  • 如何高效启动大数据应用之旅?
    在前一篇文章中,我探讨了大数据的定义及其与数据挖掘的区别。本文将重点介绍如何高效启动大数据应用项目,涵盖关键步骤和最佳实践,帮助读者快速踏上大数据之旅。 ... [详细]
  • 本文探讨了基于点集估算图像区域的Alpha形状算法在Python中的应用。通过改进传统的Delaunay三角剖分方法,该算法能够生成更加灵活和精确的形状轮廓,避免了单纯使用Delaunay三角剖分时可能出现的过大三角形问题。这种“模糊Delaunay三角剖分”技术不仅提高了形状的准确性,还增强了对复杂图像区域的适应能力。 ... [详细]
  • 掌握PHP编程必备知识与技巧——全面教程在当今的PHP开发中,了解并运用最新的技术和最佳实践至关重要。本教程将详细介绍PHP编程的核心知识与实用技巧。首先,确保你正在使用PHP 5.3或更高版本,最好是最新版本,以充分利用其性能优化和新特性。此外,我们还将探讨代码结构、安全性和性能优化等方面的内容,帮助你成为一名更高效的PHP开发者。 ... [详细]
  • Go 项目中数据库配置文件的优化与应用 ... [详细]
  • 优化后的标题:深入解析09版Jedis客户端
    深入解析09版Jedis客户端,本文将详细介绍如何在Java项目中正确配置Jedis以操作Redis。首先,确保项目的JDK版本和编译器设置正确。接着,通过Maven或Gradle导入必要的依赖项,如 `redis.clients:jedis`。此外,文章还将探讨Jedis连接池的配置与优化,以及常见问题的解决方案,帮助开发者高效使用Jedis进行Redis操作。 ... [详细]
  • 本文深入解析了Python在处理HTML过滤时的实现方法及其应用场景。通过具体实例,详细介绍了如何利用Python代码去除HTML字符串中的标签和其他无关信息,确保内容的纯净与安全。此外,文章还探讨了该技术在网页抓取、数据清洗等领域的实际应用,为开发者提供了宝贵的参考。 ... [详细]
  • PyCharm 作为 JetBrains 出品的知名集成开发环境(IDE),提供了丰富的功能和强大的工具支持,包括项目视图、代码结构视图、代码导航、语法高亮、自动补全和错误检测等。本文详细介绍了 PyCharm 的高级使用技巧和程序调试方法,旨在帮助开发者提高编码效率和调试能力。此外,还探讨了如何利用 PyCharm 的插件系统扩展其功能,以满足不同开发场景的需求。 ... [详细]
  • 在Python中,是否可以通过使用Tkinter或ttk库创建一个具有自动换行功能的多行标签,并使其宽度能够随着父容器的变化而动态调整?例如,在调整NotePad窗口宽度时,实现类似记事本的自动换行效果。这种功能在设计需要显示长文本的对话框时非常有用,确保文本内容能够完整且美观地展示。 ... [详细]
  • 利用 Python 管道实现父子进程间高效通信 ... [详细]
  • CentOS 7环境下Jenkins的安装与前后端应用部署详解
    CentOS 7环境下Jenkins的安装与前后端应用部署详解 ... [详细]
author-avatar
林白LS
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有