{"id":39862159,"url":"https://github.com/xinbinhuang/toxicflaskapp","last_synced_at":"2026-01-18T14:02:04.143Z","repository":{"id":55611613,"uuid":"160478530","full_name":"xinbinhuang/ToxicFlaskApp","owner":"xinbinhuang","description":"A toxic comment classfication Flask App","archived":false,"fork":false,"pushed_at":"2020-12-18T04:50:21.000Z","size":38601,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2023-03-04T12:32:35.092Z","etag":null,"topics":["deep-learning","deplyment","devops","docker","flask","python","test-driven-development","text-classification"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xinbinhuang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-05T07:30:32.000Z","updated_at":"2020-12-18T04:53:01.000Z","dependencies_parsed_at":"2022-08-15T04:20:50.693Z","dependency_job_id":null,"html_url":"https://github.com/xinbinhuang/ToxicFlaskApp","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/xinbinhuang/ToxicFlaskApp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xinbinhuang%2FToxicFlaskApp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xinbinhuang%2FToxicFlaskApp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xinbinhuang%2FToxicFlaskApp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xinbinhuang%2FToxicFlaskApp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xinbinhuang","download_url":"https://codeload.github.com/xinbinhuang/ToxicFlaskApp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xinbinhuang%2FToxicFlaskApp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28537484,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T13:04:05.990Z","status":"ssl_error","status_checked_at":"2026-01-18T13:01:44.092Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","deplyment","devops","docker","flask","python","test-driven-development","text-classification"],"created_at":"2026-01-18T14:02:03.219Z","updated_at":"2026-01-18T14:02:04.122Z","avatar_url":"https://github.com/xinbinhuang.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Toxic Comment Classification Flask App\n\nThis project was originally developed for the  **NLP Project 3 workshop@Vancouver School of AI** - [Github](https://github.com/SchoolofAI-Vancouver/NLP_Project_3) \u0026 [Meetup page](https://www.meetup.com/Vancouver-School-of-AI/events/256839305/) - to demonstrate how to deploy a toxic comment text classification model using Heroku and Flask. However, to keep things simple, we built this in a hackthon way and did not put much effort in enforcing good practices.\n\nFor fun and still for fun, I am going to take it a step further by adding test-driven development (TDD), DevOps (CI/CD), container (Docker), and deployment (I am sure this was in the original workshop, but I just mention it to make it sounds fancy :). \n\n\n## Project Overview\n\nBuild a classification model that can distinguish between toxic and non-toxic comments and use the model in a real-life application.\n\nThe meetups serve as guidance. The goal is for all attendees to build a good machine learning model that can be used in a real-life application. We encourage all attendees to apply creativity to this project. There are no limits.\n\n## Installation Requirements\n\nAll code is written in Python. Please use [this guide](http://nbviewer.jupyter.org/github/johannesgiorgis/school_of_ai_vancouver/blob/master/intro_to_data_science_tools/01_introduction_to_conda_and_jupyter_notebooks.ipynb) to get Python and Jupyter Notebook up and running.\n\n## Project Setup\n\n### Training \n\nFor those who want to walk though the whole process from training to deployment, you need to download the data to train the model\n\nTo download the data, run:\n```python\npython src/download.py\n```\nThis will download the training data and pre-trained embedding file in :\n  - ./assets/data/train.csv\n  - ./assets/embedding/fasttext-crawl-300d-2m/crawl-300d-2M.vec\n  \nTo train the model, run:\n```python\npython src/train_classifier.py\n```\nThis will train a pooled GRU with FastText embedding. The text preprocessor and the model will be seriallized and stored in:\n  - ./assets/model/preprocessor.pkl\n  - ./assets/model/model.h5\n*Note*: This took ~1 hour to train on Intel Core i7-HQ CPU\n\n### Prediction\nTo get a feeling of doing predictions, run:\n```python\npython src/predict.py\n\n# output:\n# Corgi is stupid          - Toxicity: [0.99293655]\n# good boy                 - Toxicity: [0.02075008]\n# School of AI is awesome  - Toxicity: [0.01223523]\n# F**K                     - Toxicity: [0.90747666]\n```\n\n### Deployment\nTODO \n\n\n\n## Resources\n\nThe project uses data from Kaggle's [Toxic Comment Classification Challenge](https://www.kaggle.com/c/jigsaw-toxic-comment-classification-challenge). The data can be found [here](https://www.kaggle.com/c/jigsaw-toxic-comment-classification-challenge/data).\n\nIf you are struggling with implementing some of the concepts discussed at the meetup, check out [the slides notebook](https://github.com/SchoolofAI-Vancouver/NLP_Project_2/blob/master/src/slides.ipynb) as guidance. There are also many [kernels](https://www.kaggle.com/c/jigsaw-toxic-comment-classification-challenge/kernels) specific to the toxic comment challenge that you can refer to get some inspiration or help.\n\nAlternatively, ask for assistance on Slack. That's what this community is all about :)\n\n\n\n## Meetup Contributors\n\n[Akshi Chaudhary](https://github.com/akshi8)\n\n[Johannes Harmse](https://github.com/johannesharmse)\n\n[Xinbin Huang](https://github.com/xinbinhuang)\n\n[Peter Lin](https://github.com/peter0083)\n\n[Johannes G](https://github.com/johannesgiorgis)\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxinbinhuang%2Ftoxicflaskapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxinbinhuang%2Ftoxicflaskapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxinbinhuang%2Ftoxicflaskapp/lists"}