def _sentence_tokenizer(self, language):
try:
path = to_string("tokenizers/punkt/%s.pickle") % to_string(language)
return nltk.data.load(path)
except (LookupError, zipfile.BadZipfile):
raise LookupError(
"NLTK tokenizers are missing. Download them by following command: "
'''python -c "import nltk; nltk.download('punkt')"'''
)
tokenizers.py 文件源码
python
阅读 29
收藏 0
点赞 0
评论 0
评论列表
文章目录