richliao/textClassifier
소개
문서 분류용 계층적 어텐션 네트워크(Hierarchical Attention Networks) 텍스트 분류기.
시스템 및 인프라측정된 스타 증가
- in 24h
- 0
- in 7 days
- +1
- in 15 days
- +2
- in 1 month
- 0
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginaltextClassifier
textClassifierHATT.py has the implementation of Hierarchical Attention Networks for Document Classification. Please see the my blog for full detail. Also see Keras Google group discussion
textClassifierConv has implemented Convolutional Neural Networks for Sentence Classification - Yoo Kim. Please see the my blog for full detail.
textClassifierRNN has implemented bidirectional LSTM and one level attentional RNN. Please see the my blog for full detail.
update on 6/22/2017
To derive the attention weight which can be useful to identify important words for the classification. Please see my latest update on the post. All you need to do is run a forward pass right before attention layer output. The result is not very promising. I will update the post once I have further result.
This repo is forked from https://github.com/richliao/textClassifier and we find some issue here. So we update the textClassifierHATT with python 2.7 and keras 2.0.8
# clone the repo
git clone {repo address}
# install Dependent library
cd textClassifier
pip install -r req.xt
# download imdb train from Kaggle in the below link and keep the files in the working directory
https://www.kaggle.com/c/word2vec-nlp-tutorial/download/labeledTrainData.tsv
# download glove word vector
wget http://nlp.stanford.edu/data/glove.6B.zip
unzip glove.6B.zip
# install nltk 'punkt' using the following code in python interpretor
>>>import nltk
>>>nltk.download('punkt')
# train the model
python textClassifierHATT.py
# note if in case while installing word2vec, cython error occurs then
pip install --upgrade cython
Enjoy!
관련 프로젝트 살펴보기
불러오는 중…