text_plain_output_1.png
from nltk import word_tokenize

from nltk.corpus import stopwords

from nltk.tokenize import word_tokenize

import pandas as pd  # For data handling

df = pd.read_csv('../input/google-war-news/war-news.csv', encoding='latin1')

df.isnull().sum()

df.dropna(subset=['Summary'], inplace=True)

T = df['Summary'].str.split(' \n\n---\n\n').str[0]
T = T.str.replace('-', ' ').str.replace('[^\\w\\s]', '').str.replace('\n', ' ').str.lower()
stop = stopwords.words('english')
T = T.apply(lambda x: ' '.join((x for x in x.split() if not x.isdigit())))
T = T.apply(lambda words: ' '.join((word.lower() for word in words.split() if word not in stop)))

T1 = T.values.tolist()

T1 = T.apply(word_tokenize)

T1