NLTK和停用词在C#应用程序中的Lookuperror

2024-09-30 08:24:14 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在从一个C应用程序运行一个python脚本。脚本在命令提示符/终端上运行良好,但在通过C代码调用时无法执行。在

它显示Resource u'corpora/stopwords' not found. Please use the NLTK Downloader to obtain the resource: >>> nltk.download(),尽管我有所有必需的数据/停止字

下面是Visual Studio中“调试”选项卡中的错误报告。

 Traceback (most recent call last):
  File "C:\Users\Amey\Anaconda3\envs\dato-env\TrainingSetsUtil.py", line 20, in <module>
    stopwords = set(stopwords.words('english'))
  File "C:\Users\Amey\Anaconda3\envs\dato-env\lib\site-packages\nltk\corpus\util.py", line 99, in __getattr__
    self.__load()
  File "C:\Users\Amey\Anaconda3\envs\dato-env\lib\site-packages\nltk\corpus\util.py", line 64, in __load
    except LookupError: raise e
LookupError: 
**********************************************************************
  Resource u'corpora/stopwords' not found.  Please use the NLTK
  Downloader to obtain the resource:  >>> nltk.download()
  Searched in:
    - 'nltk_data'
**********************************************************************

这是调用代码。

^{pr2}$

Tags: the代码inpyenv脚本lineusers

热门问题