All Projects → nhthang9x → Very-deep-cnn-tensorflow

nhthang9x / Very-deep-cnn-tensorflow

Licence: MIT license
Very deep CNN for text classification

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Very-deep-cnn-tensorflow

alter-nlu
Natural language understanding library for chatbots with intent recognition and entity extraction.
Stars: ✭ 45 (+150%)
Mutual labels:  text-classification, nlp-machine-learning
Text mining resources
Resources for learning about Text Mining and Natural Language Processing
Stars: ✭ 358 (+1888.89%)
Mutual labels:  text-classification, nlp-machine-learning
TextFeatureSelection
Python library for feature selection for text features. It has filter method, genetic algorithm and TextFeatureSelectionEnsemble for improving text classification models. Helps improve your machine learning models
Stars: ✭ 42 (+133.33%)
Mutual labels:  text-classification, nlp-machine-learning
nlp classification workshop
NLP Classification Workshop
Stars: ✭ 22 (+22.22%)
Mutual labels:  text-classification, nlp-machine-learning
Nlp Pretrained Model
A collection of Natural language processing pre-trained models.
Stars: ✭ 122 (+577.78%)
Mutual labels:  text-classification, nlp-machine-learning
Text Classification Keras
📚 Text classification library with Keras
Stars: ✭ 53 (+194.44%)
Mutual labels:  text-classification, nlp-machine-learning
policy-data-analyzer
Building a model to recognize incentives for landscape restoration in environmental policies from Latin America, the US and India. Bringing NLP to the world of policy analysis through an extensible framework that includes scraping, preprocessing, active learning and text analysis pipelines.
Stars: ✭ 22 (+22.22%)
Mutual labels:  text-classification, document-classification
Onnxt5
Summarization, translation, sentiment-analysis, text-generation and more at blazing speed using a T5 version implemented in ONNX.
Stars: ✭ 143 (+694.44%)
Mutual labels:  text-classification, nlp-machine-learning
Doc2vec
📓 Long(er) text representation and classification using Doc2Vec embeddings
Stars: ✭ 92 (+411.11%)
Mutual labels:  text-classification, nlp-machine-learning
Text classification
Text Classification Algorithms: A Survey
Stars: ✭ 1,276 (+6988.89%)
Mutual labels:  text-classification, nlp-machine-learning
Dan Jurafsky Chris Manning Nlp
My solution to the Natural Language Processing course made by Dan Jurafsky, Chris Manning in Winter 2012.
Stars: ✭ 124 (+588.89%)
Mutual labels:  text-classification, nlp-machine-learning
Hierarchical Attention Networks Pytorch
Hierarchical Attention Networks for document classification
Stars: ✭ 239 (+1227.78%)
Mutual labels:  text-classification, nlp-machine-learning
transfer-learning-text-tf
Tensorflow implementation of Semi-supervised Sequence Learning (https://arxiv.org/abs/1511.01432)
Stars: ✭ 82 (+355.56%)
Mutual labels:  text-classification
Machine-Learning-Models
In This repository I made some simple to complex methods in machine learning. Here I try to build template style code.
Stars: ✭ 30 (+66.67%)
Mutual labels:  nlp-machine-learning
ulm-basenet
Implementation of ULMFit algorithm for text classification via transfer learning
Stars: ✭ 94 (+422.22%)
Mutual labels:  text-classification
scicle-stopclickbait
Userscript that changes Clickbait headlines by headlines more honest to the news it links to.
Stars: ✭ 16 (-11.11%)
Mutual labels:  nlp-machine-learning
Engine
The Centrifuge process, filter and saves the relevant documents as recommendations to the relevant users
Stars: ✭ 20 (+11.11%)
Mutual labels:  nlp-machine-learning
DeepLearningReading
Deep Learning and Machine Learning mini-projects. Current Project: Deepmind Attentive Reader (rc-data)
Stars: ✭ 78 (+333.33%)
Mutual labels:  nlp-machine-learning
TextClassification
基于scikit-learn实现对新浪新闻的文本分类,数据集为100w篇文档,总计10类,测试集与训练集1:1划分。分类算法采用SVM和Bayes,其中Bayes作为baseline。
Stars: ✭ 86 (+377.78%)
Mutual labels:  text-classification
fake-news
This is a further development of the kdnuggets article on fake news classification by George McIntyre
Stars: ✭ 15 (-16.67%)
Mutual labels:  nlp-machine-learning

[TENSORFLOW] Very deep convolutional networks for Text Classification

Introduction

Here is my tensorflow implementation of the model described in the paper Very deep convolutional networks for Text Classification paper.

Datasets:

Statistics of datasets I used for experiments. These datasets could be download from link

Dataset Classes Train samples Test samples
AG’s News 4 120 000 7 600
Sogou News 5 450 000 60 000
DBPedia 14 560 000 70 000
Yelp Review Polarity 2 560 000 38 000
Yelp Review Full 5 650 000 50 000
Yahoo! Answers 10 1 400 000 60 000
Amazon Review Full 5 3 000 000 650 000
Amazon Review Polarity 2 3 600 000 400 000

Setting:

I almost keep default setting as described in the paper.

Additionally, in the original model, one epoch is seen as a loop over batch_size x num_batch records (128x5000 or 128x10000 or 128x30000), so it means that there are records used more than once for 1 epoch. In my model, 1 epoch is a complete loop over the whole dataset, where each record is used exactly once.

Training

After putting 2 files train.csv and test.csv from any dataset mentioned above into data folder, there are several options for training:

If you want to train a model with common dataset and default parameters, you could run:

  • python train.py

If you want to train a model with your preference parameters, like depth and learning rate, you could run:

  • python train.py --depth 29 --lr learning_rate: For example, python train.py --depth 29 --lr 0.001

If you want to train a model with your own dataset, you need to specify the paths to input (train and test files) and output folder:

  • python train.py --train_set path/to/training/file --test_set path/to/test/file --saved_path path/to/output/folder

You could find all trained models I have trained in link

Experiments:

I run experiments in 2 machines, one with NVIDIA TITAN X 12gb GPU and the other with NVIDIA quadro 6000 24gb GPU.

Results for test set are presented as follows: A(B):

  • A is accuracy reproduced here.
  • B is accuracy reported in the paper.

It should be noted that in experiments with depth is 49 layers, there is no accuracy reported in the paper. Therefore here I only show the results obtained from my experiments.

Depth 9 17 29 49
ag_news 87.67(90.17) 88.09(90.61) 88.01(91.33) 84.71
sogu_news 95.67(96.42) 95.89(96.49) 95.73(96.82) 95.35
db_pedia 98.33(98.44) 98.28(98.39) 98.07(98.59) 97.38
yelp_polarity 94.57(94.73) 95.20(94.95) 94.95(95.37) 95.08
yelp_review 62.44(61.96) 63.44(62.59) 62.70(63.00) 62.83
yahoo_answer 69.57(71.76) 70.03(71.75) 70.34(72.84) 69.16
amazon_review 60.34(60.81) 60.98(61.19) 60.67(61.61) 59.80
amazon_polarity 94.30(94.31) 94.60(94.57) 94.53(95.06) 94.10

Below are the training/test loss/accuracy curves for each dataset's experiments (figures for 9, 17, 29-layer model are from left to right) :

  • ag_news

  • sogou_news

  • db_pedia

  • yelp_polarity

  • yelp_review

  • amazon_review

  • amazon_polarity

You could find detail log of each experiment containing loss, accuracy and confusion matrix at the end of each epoch in trained_models/logs.txt.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].