開始使用免費開始

為評論長度建立一個特徵

你已經操作過一個字串與由字串組成的清單,現在該用更大的資料樣本了。

在這個練習中,你的任務是使用熟悉的 reviews 資料集,為評論的長度建立一個新的特徵。

本練習屬於課程

Python 情感分析

檢視課程

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

# Import the needed packages
_____

# Tokenize each item in the review column 
word_tokens = [____(review) for review in reviews.review]

# Print out the first item of the word_tokens list
print(word_tokens[0])
編輯並執行程式碼