<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Train Toxicity Model
This notebook trains a model to detect toxicity in online comments. It uses a CNN architecture for text classification trained on the Wikipedia Talk Labels
Step1:  Load Data
Step2:  Train Models
Step3:  Random model
Step4:  Plain wikipedia model
Step5:  Debiased model
<ASSISTANT_TASK:>
Python Code:
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import pandas as pd
from model_tool import ToxModel
Explanation: Train Toxicity Model
This notebook trains a model to detect toxicity in online comments. It uses a CNN architecture for text classification trained on the Wikipedia Talk Labels: Toxicity dataset and pre-trained GloVe embeddings which can be found at:
http://nlp.stanford.edu/data/glove.6B.zip
(source page: http://nlp.stanford.edu/projects/glove/).
This model is a modification of example code found in the Keras Github repository and released under an MIT license. For further details of this license, find it online or in this repository in the file KERAS_LICENSE. 
Usage Instructions
(TODO: nthain) - Move to README
Prior to running the notebook, you must:
Download the Wikipedia Talk Labels: Toxicity dataset
Download pre-trained GloVe embeddings
(optional) To skip the training step, you will need to download a model and tokenizer file. We are looking into the appropriate means for distributing these (sometimes large) files.
End of explanation
SPLITS = ['train', 'dev', 'test']
wiki = {}
debias = {}
random = {}
for split in SPLITS:
    wiki[split] = '../data/wiki_%s.csv' % split
    debias[split] = '../data/wiki_debias_%s.csv' % split
    random[split] = '../data/wiki_debias_random_%s.csv' % split
Explanation: Load Data
End of explanation
hparams = {'epochs': 4}
Explanation: Train Models
End of explanation
MODEL_NAME = 'cnn_debias_random_tox_v3'
debias_random_model = ToxModel(hparams=hparams)
debias_random_model.train(random['train'], random['dev'], text_column = 'comment', label_column = 'is_toxic', model_name = MODEL_NAME)
random_test = pd.read_csv(random['test'])
debias_random_model.score_auc(random_test['comment'], random_test['is_toxic'])
Explanation: Random model
End of explanation
MODEL_NAME = 'cnn_wiki_tox_v3'
wiki_model = ToxModel(hparams=hparams)
wiki_model.train(wiki['train'], wiki['dev'], text_column = 'comment', label_column = 'is_toxic', model_name = MODEL_NAME)
wiki_test = pd.read_csv(wiki['test'])
wiki_model.score_auc(wiki_test['comment'], wiki_test['is_toxic'])
Explanation: Plain wikipedia model
End of explanation
MODEL_NAME = 'cnn_debias_tox_v3'
debias_model = ToxModel(hparams=hparams)
debias_model.train(debias['train'], debias['dev'], text_column = 'comment', label_column = 'is_toxic', model_name = MODEL_NAME)
debias_test = pd.read_csv(debias['test'])
debias_model.score_auc(debias_test['comment'], debias_test['is_toxic'])
Explanation: Debiased model
End of explanation
<END_TASK>