GithubHelp home page GithubHelp logo

myminsomnia / densely-connected-cnn-with-multiscale-feature-attention Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wangshy31/densely-connected-cnn-with-multiscale-feature-attention

0.0 1.0 0.0 26.25 MB

Densely Connected CNN with Multi-scale Feature Attention for Text Classification

License: Apache License 2.0

Python 98.95% Shell 1.05%

densely-connected-cnn-with-multiscale-feature-attention's Introduction

Densely-Connected-CNN-with-Multi-scale-Feature-Attention

For Text Classification

Introduction

Densely Connected CNN with Multi-scale Feature Attention for Text Classification is initially described in an IJCAI-ECAI 2018 paper. It provides a new CNN architecture to produce variable n-gram features. It is worth nothing that:

  • It uses dense connections to build short-cut paths between upstream and downstream convolutional blocks, which enable the model to compose features of larger scale from those of smaller scale, and thus produce variable n-gram features.
  • A multi-scale feature attention is developed to adaptively select multi-scale features for classification.
  • It obtains competitive performance against state-of-the-art baselines on six benchmark datasets.

Citation

If you find these models useful in your research, please consider citing:

@article{Wang2018Densely,
    title={Densely Connected CNN with Multi-scale Feature Attention for Text Classification},
    author={Wang, Shiyao and Huang, Minlie and Deng, Zhidong},
    conference={IJCAI-ECAI 2018, Stockholm, Sweden},
    year={2018}
}

Preparation for Training & Testing

  1. Please clone the Densely-Connected-CNN-with-Multiscale-Feature-Attention repository, and we call the directory that you cloned as ${DenseAttention_ROOT}.

  2. please clone the Caffe from caffe_for_text and build it. It is a modified version of the offical repository.

  3. Please download text classification datasets from benchmark datasets which are releasd by Zhang et al., 2015. AGNews in $(DenseAttention_ROOT)/data/ag_news_csv is an example dataset in this repo.

  4. Please download pretrained word vectors from Glove.

Usage

  1. Prepare training & testing data by using original datasets, pretrained word vectors and tools in $(DenseAttention_ROOT)/data/gen_data.py. An example is in $(DenseAttention_ROOT)/data/agnews.

  2. Generate the training & testing prototxt by using tools in $(DenseAttention_ROOT)/script/gen_model.py.

  3. To perform experiments, run the script with the corresponding config file as input. For example, to train and test, use the following command

    cd $(DenseAttention_ROOT)/experiment
    ./train.sh
    

    This example uses 4 NVIDIA Titan X Pascal GPUs and the trained model as well as logs are saved in $(DenseAttention_ROOT)/experiment.

  4. Please find more details in config files and in our code.

Main Results

results

densely-connected-cnn-with-multiscale-feature-attention's People

Contributors

wangshy31 avatar

Watchers

James Cloos 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.