Python 中的自然语言处理(NLP)
Fouad Trad
Machine Learning Engineer


使计算机能够分析人类语言









import nltknltk.download('punkt_tab')text = "NLP is fun. Let's dive into it!"sentences = nltk.sent_tokenize(text)print(sentences)
["NLP is fun.", "Let's dive into it!"]

text = "Claim your free prize now!"words = nltk.word_tokenize(text)print(words)
['Claim', 'your', 'free', 'prize', 'now', '!']

Python 中的自然语言处理(NLP)