Text-classification-with-CNN-RNN
Text classification with CNN, RNN, RCNN model by character, word level
한글 문서에 대해 classifier를 만든 예
Tensorflow(tensorflow-gpu==1.8.0)를 이용했으며, Convolutional layer, Recurrent layer를 이용
실 데이터를 사용(전에 공부용으로 수집한 데이터 인데, 문제될 경우 내리겠습니다.)
Ch01_Data_load
data link: https://drive.google.com/open?id=1vdvedBSAcVU8Dbjzuow6cL_9Tkc9zGVM -출처: W 영화 사이트
data_preprocessing.py: 텍스트 기본 전처리 진행
data_load.py: 데이터 불러오기
Jaso_mapping_utils.py: 텐서에서 자소를 onehot vector로 변환
make_VocabularyProcessor.py: 텐서에서 단어를 index로 변환
utils.py: layers, batch generate, tokenizer 등 사용할 함수 정의
Ch02_TextCNN
character level CNN text classifier
Text_CNN_config.py:
Text_CNN_model.py:
Text_CNN_train.py:
Text_CNN_predict.py:
Ch03_TextRNN
character level RNN text classifier
자소 단위의 input을 받는 RNN text classifier
불필요하게 sequence를 길게한 탓인지, 자소 단위의 RNN은 학습이 잘 되지 않음
(이에 대한 원인을 알고 있으신 분이 있으시면 메일 부탁드립니다.)
Text_RNN_config.py:
Text_RNN_model.py:
Text_RNN_train.py:
Text_RNN_predict.py:
Ch04_TextRNN_word
word level RNN text classifier
Text_RNN_word_config.py:
Text_RNN_word_model.py:
Text_RNN_word_train.py:
Text_RNN_word_predict.py:
Ch05_TextRNN_word_attention
word level RNN text classifier with attention
Text_RNN_word_attention_config.py:
Text_RNN_word_attention_model.py:
Text_RNN_word_attention_train.py:
Text_RNN_word_attention_predict.py:
Ch06_TextRCNN_word_attention
word level RCNN text classifier with attention
Text_RCNN_word_attention_config.py:
Text_RCNN_word_attention_model.py:
Text_RCNN_word_attention_train.py:
Text_RCNN_word_attention_predict.py: