【发布时间】:2020-07-14 00:08:00
【问题描述】:
我为电子邮件分类器创建了自定义预测例程。在预处理时,我使用的是 nltk。模型创建成功,但是当我发送请求时,GCP 无法下载所需的 nltk 文件。当我的预处理文件是这样的时候
import nltk
class MyPreprocess(object):
def __init__(self):
pass
def to_sentences(self, text):
sentences = nltk.sent_tokenize(text)
我收到以下错误:
Resource [93mpunkt[0m not found.
Please use the NLTK Downloader to obtain the resource:
nltk.download('punkt')
Attempted to load [93mtokenizers/punkt/PY3/english.pickle[0m
如果我在 import 语句后添加 nltk.download('punkt'),我会收到另一个类似这样的错误:
ERROR:root:Unexpected error when loading the model: problem in predictor - OSError: [Errno 30] Read-only file system: '/root/nltk_data'
【问题讨论】:
标签: google-cloud-platform nltk google-cloud-ml