相关疑难解决方法(0)

如何调整NLTK句子标记器

我正在使用NLTK来分析一些经典文本而我正在努力解决逐句文本的问题.例如,这是我从Moby Dick获得的代码段:

import nltk
sent_tokenize = nltk.data.load('tokenizers/punkt/english.pickle')

'''
(Chapter 16)
A clam for supper? a cold clam; is THAT what you mean, Mrs. Hussey?" says I, "but
that's a rather cold and clammy reception in the winter time, ain't it, Mrs. Hussey?"
'''
sample = 'A clam for supper? a cold clam; is THAT what you mean, Mrs. Hussey?" says I, "but that\'s a rather cold and clammy reception in the winter time, ain\'t it, Mrs. Hussey?"'

print …
Run Code Online (Sandbox Code Playgroud)

python nlp nltk

34
推荐指数
3
解决办法
2万
查看次数

标签 统计

nlp ×1

nltk ×1

python ×1