资源算法text-classification-by-cnn

text-classification-by-cnn

2020-03-31 | |  30 |   0 |   0

text-classification-by-cnn

A convolutional neural network model for sentence classification by using tensorflow.

Requirement

  • python3

  • tensorflow 1.6.0

  • numpy

  • python-gflags (for processing the input arguments)

  • gensim (for loading the pre-train word vectors)

Model structure

图片.png

Start training

python train.py

Visualizing results in TensorBoard

tensorboard --logdir /"PATH_OF_CODE"/log/"TIMESTAMP"/summaries/

Descreption of files

  • inputs (directory):

  • data_helpers.py: It contains functions for the data loading (include pre-trained word vectors), data clean and generating batch data for training.

  • text_cnn.py: The core function for generating a cnn for text classification. Model structure: embedding layer -> convolutional layer -> max-pooling layer -> softmax layer.

  • train.py: It implements the reading parameters, data preperation and training procedure.

Refer to the papers

[1]. Kim, Y. (2014). Convolutional neural networks for sentence classification. Eprint Arxiv.

[2]. Zhang, Y., & Wallace, B. (2015). A sensitivity analysis of (and practitioners' guide to) convolutional neural networks for sentence classification. Computer Science.


上一篇:CNN-LSTM-Text-Classification

下一篇:text-classification-with-convnets

用户评价
全部评价

热门资源

  • Keras-ResNeXt

    Keras ResNeXt Implementation of ResNeXt models...

  • seetafaceJNI

    项目介绍 基于中科院seetaface2进行封装的JAVA...

  • spark-corenlp

    This package wraps Stanford CoreNLP annotators ...

  • capsnet-with-caps...

    CapsNet with capsule-wise convolution Project ...

  • inferno-boilerplate

    This is a very basic boilerplate example for pe...