1.安装nltkspa
2.运行以下code
>>>import nltk>>> nltk.download('punkt')blog
3.代码:token
import nltk sentence= """At eight o'clock on Thursday morning ... Arthur didn't feel very good.""" tokens = nltk.word_tokenize(sentence) print(tokens)
4.结果class