简体   繁体   English

如何在Bluemix上下载Spacy语言模型

[英]How to download Spacy language model on Bluemix

I have a python program I am pushing to bluemix. 我有一个Python程序正在推向bluemix。 The program uses spacy. 该程序使用spacy。 I am not using any buildpack since bluemix doesn't require one for python. 我没有使用任何buildpack,因为bluemix不需要一个python。 I put spacy in my requirements.txt and do the push. 我将spacy放入我的requirements.txt中,然后进行推送。 Spacy requires installing language models. Spacy需要安装语言模型。 The command to install the english language model is the following: 以下是安装英语语言模型的命令:

python -m spacy.en.download all python -m spacy.en.download全部

How can I do this on bluemix? 我如何在bluemix上做到这一点?

https://spacy.io/docs/usage/ https://spacy.io/docs/usage/

My guess is that before you push to Bluemix you need to specify the data path to download SpaCy to within your project directory. 我的猜测是,在推送到Bluemix之前,您需要指定数据路径以将SpaCy下载到您的项目目录中。 Just create a folder in your project for the language model and put it in there. 只需在项目中为语言模型创建一个文件夹,然后将其放在其中即可。

According to your link, this can be done with the following command: 根据您的链接,可以使用以下命令完成此操作:

python -m spacy.en.download all --data-path /some/dir

Then just push your project to Bluemix like you would before. 然后像以前一样将您的项目推送到Bluemix。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM