text_plain_output_1.png
import io

import pandas as pd

root_path = '/kaggle/input/test-train'
train_path = '/kaggle/input/test-train/train_clean.txt'
import pandas as pd
import io
with open('/kaggle/input/test-train/train_clean.txt', 'r') as f:
    train_text = f.read()
train_data = pd.read_csv(io.StringIO(train_text), sep='\t', names=['label', 'comment'])
train_data['comment'] = train_data['comment'].astype(str)

comments_len = train_data.iloc[:, 1].apply(lambda x: len(str(x).split()))
comments_len