- 전체
- Sample DB
- database modeling
- [표준 SQL] Standard SQL
- G-SQL
- 10-Min
- ORACLE
- MS SQLserver
- MySQL
- SQLite
- postgreSQL
- 데이터아키텍처전문가 - 국가공인자격
- 데이터 분석 전문가 [ADP]
- [국가공인] SQL 개발자/전문가
- NoSQL
- hadoop
- hadoop eco system
- big data (빅데이터)
- stat(통계) R 언어
- XML DB & XQuery
- spark
- DataBase Tool
- 데이터분석 & 데이터사이언스
- Engineer Quality Management
- [기계학습] machine learning
- 데이터 수집 및 전처리
- 국가기술자격 빅데이터분석기사
- 암호화폐 (비트코인, cryptocurrency, bitcoin)
[기계학습] machine learning Recurrent Neural Network for Text Calssification
2018.07.02 11:30
Recurrent Neural Network for Text Calssification
rnn-text-classification-tf-master.zip
Tensorflow implementation of RNN(Recurrent Neural Network) for sentiment analysis, one of the text classification problems. There are three types of RNN models, 1) Vanilla RNN, 2) Long Short-Term Memory RNN and 3) Gated Recurrent Unit RNN.
Data: Movie Review
- Movie reviews with one sentence per review. Classification involves detecting positive/negative reviews (Pang and Lee, 2005)
- Download "sentence polarity dataset v1.0" at the Official Download Page
- Located in "data/rt-polaritydata/" in my repository
- rt-polarity.pos contains 5331 positive snippets
- rt-polarity.neg contains 5331 negative snippets
Usage
Train
-
positive data is located in "data/rt-polaritydata/rt-polarity.pos"
-
negative data is located in "data/rt-polaritydata/rt-polarity.neg"
-
"GoogleNews-vectors-negative300" is used as pre-trained word2vec model
-
Display help message:
$ python train.py --help
-
Train Example:
1. Vanilla RNN
$ python train.py --cell_type "vanilla" \ --pos_dir "data/rt-polaritydata/rt-polarity.pos" \ --neg_dir "data/rt-polaritydata/rt-polarity.neg"\ --word2vec "GoogleNews-vectors-negative300.bin"
2. Long Short-Term Memory (LSTM) RNN
$ python train.py --cell_type "lstm" \ --pos_dir "data/rt-polaritydata/rt-polarity.pos" \ --neg_dir "data/rt-polaritydata/rt-polarity.neg"\ --word2vec "GoogleNews-vectors-negative300.bin"
3. Gated Reccurrent Unit (GRU) RNN
$ python train.py --cell_type "gru" \ --pos_dir "data/rt-polaritydata/rt-polarity.pos" \ --neg_dir "data/rt-polaritydata/rt-polarity.neg"\ --word2vec "GoogleNews-vectors-negative300.bin"
Evalutation
-
Movie Review dataset has no test data.
-
If you want to evaluate, you should make test dataset from train data or do cross validation. However, cross validation is not implemented in my project.
-
The bellow example just use full rt-polarity dataset same the train dataset
-
Evaluation Example:
$ python eval.py \ --pos_dir "data/rt-polaritydata/rt-polarity.pos" \ --neg_dir "data/rt-polaritydata/rt-polarity.neg" \ --checkpoint_dir "runs/1523902663/checkpoints"
Reference
- Seeing stars: Exploiting class relationships for sentiment categorization with respect to rating scales (ACL 2005), B Pong et al. [paper]
- Long short-term memory (Neural Computation 1997), J Schmidhuber et al. [paper]
- Learning Phrase Representations using RNN Encoder–Decoder for Statistical Machine Translation (EMNLP 2014), K Cho et al. [paper]
- Understanding LSTM Networks [blog]
- RECURRENT NEURAL NETWORKS (RNN) – PART 2: TEXT CLASSIFICATION [blog]
[source] https://github.com/roomylee/rnn-text-classification-tf
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
댓글 0
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
|---|---|---|---|---|
| 공지 | 오라클 기본 샘플 데이터베이스 | 졸리운_곰 | 2014.01.02 | 86146 |
| 공지 | [SQL컨셉] 서적 "SQL컨셉"의 샘플 데이타 베이스 SAMPLE DATABASE of ORACLE | 가을의 곰을... | 2013.02.10 | 78646 |
| 공지 | [G_SQL] Sample Database | 가을의 곰을... | 2012.05.20 | 95376 |
| 5 | XML database | 졸리운_곰 | 2016.11.29 | 4390 |
| 4 |
Learn XQuery in 10 Minutes: An XQuery Tutorial
| 졸리운_곰 | 2016.11.29 | 1996 |
| 3 |
xquery-tutorial.pdf
| 졸리운_곰 | 2016.11.29 | 1727 |
| 2 | XML 문서 가져오기 및 XQuery 쿼리 예제 | 졸리운_곰 | 2016.11.29 | 1563 |
| 1 |
[SQL] XQuery로 XML Data에 접근하기
| 졸리운_곰 | 2016.11.29 | 1921 |





