Git Product home page Git Product logo

nsfwcontentdetection's Introduction

NSFW Content Detection

Based on the repository TextClassifiers by datnnt1997. Textclassifiers: Collection of Text Classification/Document Classification/Sentence Classification/Sentiment Analysis models for PyTorch

Prerequisites

Install dependencies:
pip3 install -r requirements.txt

Training

python3 run.py --mode train --config configs/fasttext_config.yaml

Models

Results

Initial results on the test set

S. No. Model Training Test
Loss F1 Loss Precision Recall F1
1 TextRNN 0.097278 0.4952 0.098633 0.28 0.01 0.01
2 TextCNN 0.082481 0.5407 0.092145 0.32 0.06 0.1
3 LSTM Attention 0.084443 0.498 0.088827 0.31 0.02 0.04
4 RCNN 0.071199 0.5568 0.086385 0.43 0.02 0.04
5 FastText 0.096211 0.4972 0.099686 0.33 0.01 0.02
6 Transformer 0.09527 0.501 0.097861 0.33 0.01 0.03

Results on balanced dataset (under sampling)

S. No. Model Training Test
Loss F1 Loss Precision Recall F1
1 TextRNN 0.536789 0.7388 0.572004 0.71 0.71 0.71
2 TextCNN 0.176651 0.9328 0.86567 0.64 0.78 0.71
3 LSTM Attention 0.537625 0.7379 0.590331 0.7 0.7 0.7
4 RCNN 0.442955 0.7994 0.560319 0.75 0.67 0.71
5 FastText 0.659113 0.6 0.647117 0.67 0.6 0.63
6 Transformer 0.479358 0.773 0.612778 0.71 0.68 0.7

Results on balanced dataset (over sampling)

S. No. Model Training Test
Loss F1 Loss Precision Recall F1
1 TextRNN 0.519968 0.7486 0.600619 0.7 0.68 0.69
2 TextCNN 0.375668 0.8312 0.887177 0.79 0.46 0.58
3 LSTM Attention 0.574681 0.7066 0.594618 0.71 0.65 0.68
4 RCNN 0.536011 0.734 0.559934 0.74 0.68 0.71
5 FastText 0.73637 0.5292 0.683402 0.65 0.43 0.52
6 Transformer 0.530028 0.7354 0.60349 0.71 0.69 0.7

References

[1] Joulin, Armand, Edouard Grave, and Piotr Bojanowski Tomas Mikolov. "Bag of Tricks for Efficient Text Classification." EACL 2017 (2017): 427.

[2] Kim, Yoon. "Convolutional Neural Networks for Sentence Classification." Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP). 2014.

[3] Lai, Siwei, et al. "Recurrent convolutional neural networks for text classification." In Proc. Conference of the Association for the Advancement of Artificial Intelligence (AAAI). 2015.

[4] Du, Changshun, and Lei Huang. "Text classification research with attention-based recurrent neural networks." International Journal of Computers Communications & Control 13.1 (2018): 50-61.

[5] Vaswani, Ashish, et al. "Attention is all you need." Proceedings of the 31st International Conference on Neural Information Processing Systems. Curran Associates Inc., 2017.

nsfwcontentdetection's People

Contributors

datnnt1997 avatar pradyumnach avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.