close

nltk 是使用python進行自然語言處理最常使用的library

安裝方式如下:

pip install nltk

使用word_tokenize可以將給定句子分割成單字

 

sentence = "Have a nice day"
tokens=nltk.word_tokenize(sentence)
tokens

效果如下

image

 

 

 

 

 


arrow
arrow
    文章標籤
    NLP nltk
    全站熱搜

    低階ㄇㄋ 發表在 痞客邦 留言(0) 人氣()