资源算法text-classification-by-cnn

text-classification-by-cnn

2020-03-31 | |  52 |   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

用户评价
全部评价

热门资源

  • TensorFlow-Course

    This repository aims to provide simple and read...

  • seetafaceJNI

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

  • mxnet_VanillaCNN

    This is a mxnet implementation of the Vanilla C...

  • vsepp_tensorflow

    Improving Visual-Semantic Embeddings with Hard ...

  • DuReader_QANet_BiDAF

    Machine Reading Comprehension on DuReader Usin...