Skip to content
/ toxic Public

Toxic Comment Classification pipeline + baseline

License

Notifications You must be signed in to change notification settings

pkubik/toxic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Toxic Comment Classification

Tensorflow model for solving a problem specified at a Kaggle problem Toxic Comment Classification.

The pipeline assumes that there exists a data directory pointed by a RESEARCH_DATA_DIR environment variable which maintains following structure:

  • $RESEARCH_DATA_DIR
    • toxic
      • preproc
        • train (preprocessed training data in TFRecords format)
        • test (preprocessed test data in TFRecords format)
        • vocab.txt (created during preprocessing step using the corpus)
        • wiki.simple.npy (preprocessed embeddings for faster training)
      • raw (raw CSV files from Kaggle)
      • wiki.simple.bin and wiki.simple.vec (fastText pretrained embeddings)

Entities written in bold must be available before the preprocessing step.

Usage

In order to run the preprocessing invoke following command from the repository root:

> python3 -m toxic.data.prepare

Train and evaluate the module using the main module directly. You might use multiple models by specifying names with a -n option. If a model with given name exists the pipeline will further train or evaluate this model. An environment variable TF_MODELS_DIR might be defined in order to store models data in specific directory. Otherwise system-specific temporary directory will be used.

> python3 -m toxic train -n xyz
... (training logs) ...

> python3 -m toxic test -n xyz
... (evaluation report) ...

About

Toxic Comment Classification pipeline + baseline

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages