隨著 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."]