Skip to content

szxSpark/Hierarchical-Attention-Network

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hierarchical-Attention-Network

HAN model. Three versions.

  • version 1: Tensorflow, dynamic GRU
  • version 2: Pytorch, pack_padded_sequence
  • version 3: Pytorch, mask matrix

Paper

Hierarchical Attention Network (readed in 2017/10 by szx)

Task Instruction

  • Text Classification

Code Instruction

  • data: API for loading text data

  • models: HAN model

    • hierarchical_tf.py : version 1
    • hierarchical_pack.py : version 2
    • hierarchical_mask.py : version 3
  • preprocessor: Data preprocessing

  • utils: tools for training

  • config.py: hyperparameters for models

Run code

CUDA_VISIBLE_DEVICES=X python train.py --model-id 4 --is-save (y or n)

Write in the end

  • The model was implemented in BDCI2017.

  • We implement eight models, such as FastText, TextCNN, TextRNN, RCNN, HAN, CNNInception, CNNWithDoc2Vec, RCNNWithDoc2Vec.

  • I just make contribution to HAN model.

  • Thanks for my teammates, lhliu, dyhu.

About

HAN model. Three versions.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages