text_plain_output_1.png
from sklearn.feature_extraction.text import CountVectorizer

import numpy as np

import pandas as pd

train = pd.read_csv('../input/train.csv')
test = pd.read_csv('../input/test.csv')

train_ = train['comment_text']
test_ = test['comment_text']
alldata = pd.concat([train_, test_], axis=0)
alldata = pd.DataFrame(alldata)

alldata.comment_text.fillna('blllllllllllllllllllllllaaaaaaaaaaaaaaaahhhhhhhh...!!!', inplace=True)

countvec = CountVectorizer(max_features=1500, ngram_range=(1, 2))

countvecdata = countvec.fit_transform(alldata['comment_text'])

countvec_df = pd.DataFrame(countvecdata.todense())

col = ['toxic', 'severe_toxic', 'obscene', 'threat', 'insult', 'identity_hate']
preds = np.zeros((test.shape[0], len(col)))

subm = pd.read_csv('sample_submission.csv')
submid = pd.DataFrame({'id': subm['id']})
submission = pd.concat([submid, pd.DataFrame(preds, columns=col)], axis=1)
submission.to_csv('submission_001.csv', index=False)