application_vnd.jupyter.stderr_output_1.png image_output_1.png
from sklearn.model_selection import train_test_split

from sklearn.preprocessing import LabelEncoder

import pandas as pd

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

df = pd.read_csv('/kaggle/input/bbc-fulltext-and-category/bbc-text.csv')
df

df.isna().sum()

x_train, x_test = train_test_split(df, random_state=1, test_size=0.2)
(x_train.shape, x_test.shape)

y_train = x_train['category']
x_train = x_train['text']

le = LabelEncoder()
le.fit(y_train)