import matplotlib.pyplot as plt # 导入matplotlib word_per_comment = [len(comment) for comment in X_train_tokenized_lst] plt.hist(word_per_comment, bins = np.arange(0,500,10)) # 显示评论长度分布 plt.show()