Skip to content
프로젝트

dongjun-Lee/text-classification-models-tf

GitHub에서 보기

소개

텍스트 분류 모델의 Tensorflow 구현입니다.

AI 및 머신러닝

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
-1
in 7 days
-1
in 15 days
-1
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Text Classification Models with Tensorflow

Tensorflow implementation of Text Classification Models.

Implemented Models:

  1. Word-level CNN [paper]
  2. Character-level CNN [paper]
  3. Very Deep CNN [paper]
  4. Word-level Bidirectional RNN
  5. Attention-Based Bidirectional RNN [paper]
  6. RCNN [paper]

Semi-supervised text classification(Transfer learning) models are implemented at [dongjun-Lee/transfer-learning-text-tf].

Requirements

  • Python3
  • Tensorflow
  • pip install -r requirements.txt

Usage

Train

To train classification models for dbpedia dataset,

$ python train.py --model="<MODEL>"

(<Model>: word_cnn | char_cnn | vd_cnn | word_rnn | att_rnn | rcnn)

Test

To test classification accuracy for test data after training,

$ python test.py --model="<TRAINED_MODEL>"

Sample Test Results

Trained and tested with dbpedia dataset. (dbpedia_csv/train.csv, dbpedia_csv/test.csv)

Model WordCNN CharCNN VDCNN WordRNN AttentionRNN RCNN *SA-LSTM *LM-LSTM
Accuracy 98.42% 98.05% 97.60% 98.57% 98.61% 98.68% 98.88% 98.86%

(SA-LSTM and LM-LSTM are implemented at [dongjun-Lee/transfer-learning-text-tf].)

Models

1. Word-level CNN

Implementation of Convolutional Neural Networks for Sentence Classification.

2. Char-level CNN

Implementation of Character-level Convolutional Networks for Text Classification.

3. Very Deep CNN (VDCNN)

Implementation of Very Deep Convolutional Networks for Text Classification.

4. Word-level Bi-RNN

Bi-directional RNN for Text Classification.

  1. Embedding layer
  2. Bidirectional RNN layer
  3. Concat all the outputs from RNN layer
  4. Fully-connected layer

5. Attention-Based Bi-RNN

Implementation of Attention-Based Bidirectional Long Short-Term Memory Networks for Relation Classification.

6. RCNN

Implementation of Recurrent Convolutional Neural Networks for Text Classification.

References

관련 프로젝트 살펴보기

불러오는 중…