深度学习_NLP常用库报错问题解决

发布于:2024-03-30 ⋅ 阅读:(112) ⋅ 点赞:(0)

1、SpaCy

can‘t find model ‘zh_core_web_sm‘. It doesn‘t seem to be a python package or a valid path to a data

或者

can‘t find model ‘en_core_web_sm‘. It doesn‘t seem to be a python package or a valid path to a data

安装最新的版本:

en_core_web_sm ·发布 ·爆炸/空间模型 (github.com)

zh_core_web_sm · Releases · explosion/spacy-models (github.com)

pip install zh_core_web_sm-3.7.0.tar.gz

pip install en_core_web_sm-3.7.1.tar.gz

 

2、nltk

LookupError: 
**********************************************************************
  Resource punkt not found.
  Please use the NLTK Downloader to obtain the resource:

  >>> import nltk
  >>> nltk.download('punkt')
  
  For more information see: NLTK :: Installing NLTK Data

  Attempted to load tokenizers/punkt/PY3/english.pickle

  Searched in:
    - '/root/nltk_data'
    - '/root/miniconda3/nltk_data'
    - '/root/miniconda3/share/nltk_data'
    - '/root/miniconda3/lib/nltk_data'
    - '/usr/share/nltk_data'
    - '/usr/local/share/nltk_data'
    - '/usr/lib/nltk_data'
    - '/usr/local/lib/nltk_data'
    - ''
**********************************************************************

 nltk/nltk_data:NLTK 数据 (github.com)

将其解压缩,连同tokenizers文件夹放至报错的任一目录下即可 

3、paddle、ddparser

解决ModuleNotFoundError: No module named ‘paddle‘

CPU版

python -m pip install paddlepaddle==2.4.2 -i https://pypi.tuna.tsinghua.edu.cn/simple

GPU版

python -m pip install paddlepaddle-gpu==2.4.2 -i https://pypi.tuna.tsinghua.edu.cn/simple

本文含有隐藏内容,请 开通VIP 后查看

网站公告

今日签到

点亮在社区的每一天
去签到