import nltk
# nltk.download()# nltk.download('punkt')# nltk.download('stopwords')from nltk.tokenize import word_tokenize
from nltk.text import Text
from nltk.corpus import stopwords
from nltk import pos_tag
from nltk.chunk import RegexpParser
from nltk import ne_chunk
1 分词
str1 ="Today's weather is good, very windy and sunny, we have no classes in the afternoon,We have to play basketball tomorrow."
tokens = word_tokenize(str1)
tokens =[word.lower()for word in tokens]print(tokens[:5])# ['today', "'s", 'weather', 'is', 'good']