随着 NLTK
你可以使用 NLTK(尤其是 nltk.tokenize
包)执行句子边界检测:
import nltk
text = "This is a test. Let's try this sentence boundary detector."
text_output = nltk.tokenize.sent_tokenize(text)
print('text_output: {0}'.format(text_output))
输出:
text_output: ['This is a test.', "Let's try this sentence boundary detector."]