• Stars
    star
    756
  • Rank 59,791 (Top 2 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 9 years ago
  • Updated about 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

in progress

Character-Aware Neural Language Models

Tensorflow implementation of Character-Aware Neural Language Models. The original code of author can be found here.

model.png

This implementation contains:

  1. Word-level and Character-level Convolutional Neural Network
  2. Highway Network
  3. Recurrent Neural Network Language Model

The current implementation has a performance issue. See #3.

Prerequisites

Usage

To train a model with ptb dataset:

$ python main.py --dataset ptb

To test an existing model:

$ python main.py --dataset ptb --forward_only True

To see all training options, run:

$ python main.py --help

which will print

usage: main.py [-h] [--epoch EPOCH] [--word_embed_dim WORD_EMBED_DIM]
              [--char_embed_dim CHAR_EMBED_DIM]
              [--max_word_length MAX_WORD_LENGTH] [--batch_size BATCH_SIZE]
              [--seq_length SEQ_LENGTH] [--learning_rate LEARNING_RATE]
              [--decay DECAY] [--dropout_prob DROPOUT_PROB]
              [--feature_maps FEATURE_MAPS] [--kernels KERNELS]
              [--model MODEL] [--data_dir DATA_DIR] [--dataset DATASET]
              [--checkpoint_dir CHECKPOINT_DIR]
              [--forward_only [FORWARD_ONLY]] [--noforward_only]
              [--use_char [USE_CHAR]] [--nouse_char] [--use_word [USE_WORD]]
              [--nouse_word]

optional arguments:
  -h, --help            show this help message and exit
  --epoch EPOCH         Epoch to train [25]
  --word_embed_dim WORD_EMBED_DIM
                        The dimension of word embedding matrix [650]
  --char_embed_dim CHAR_EMBED_DIM
                        The dimension of char embedding matrix [15]
  --max_word_length MAX_WORD_LENGTH
                        The maximum length of word [65]
  --batch_size BATCH_SIZE
                        The size of batch images [100]
  --seq_length SEQ_LENGTH
                        The # of timesteps to unroll for [35]
  --learning_rate LEARNING_RATE
                        Learning rate [1.0]
  --decay DECAY         Decay of SGD [0.5]
  --dropout_prob DROPOUT_PROB
                        Probability of dropout layer [0.5]
  --feature_maps FEATURE_MAPS
                        The # of feature maps in CNN
                        [50,100,150,200,200,200,200]
  --kernels KERNELS     The width of CNN kernels [1,2,3,4,5,6,7]
  --model MODEL         The type of model to train and test [LSTM, LSTMTDNN]
  --data_dir DATA_DIR   The name of data directory [data]
  --dataset DATASET     The name of dataset [ptb]
  --checkpoint_dir CHECKPOINT_DIR
                        Directory name to save the checkpoints [checkpoint]
  --forward_only [FORWARD_ONLY]
                        True for forward only, False for training [False]
  --noforward_only
  --use_char [USE_CHAR]
                        Use character-level language model [True]
  --nouse_char
  --use_word [USE_WORD]
                        Use word-level language [False]
  --nouse_word

but more options can be found in models/LSTMTDNN and models/TDNN.

Performance

Failed to reproduce the results of paper (2016.02.12). If you are looking for a code that reproduced the paper's result, see https://github.com/mkroutikov/tf-lstm-char-cnn.

loss

The perplexity on the test sets of Penn Treebank (PTB) corpora.

Name Character embed LSTM hidden units Paper (Y Kim 2016) This repo.
LSTM-Char-Small 15 100 92.3 in progress
LSTM-Char-Large 15 150 78.9 in progress

Author

Taehoon Kim / @carpedm20

More Repositories

1

awesome-hacking

A curated list of awesome Hacking tutorials, tools and resources
12,576
star
2

DCGAN-tensorflow

A tensorflow implementation of "Deep Convolutional Generative Adversarial Networks"
JavaScript
7,111
star
3

ENAS-pytorch

PyTorch implementation of "Efficient Neural Architecture Search via Parameters Sharing"
Python
2,626
star
4

emoji

emoji terminal output for Python
Python
1,877
star
5

deep-rl-tensorflow

TensorFlow implementation of Deep Reinforcement Learning papers
Python
1,578
star
6

DiscoGAN-pytorch

PyTorch implementation of "Learning to Discover Cross-Domain Relations with Generative Adversarial Networks"
Jupyter Notebook
1,048
star
7

NTM-tensorflow

"Neural Turing Machine" in Tensorflow
Jupyter Notebook
1,045
star
8

BEGAN-tensorflow

Tensorflow implementation of "BEGAN: Boundary Equilibrium Generative Adversarial Networks"
Python
920
star
9

MemN2N-tensorflow

"End-To-End Memory Networks" in Tensorflow
Python
826
star
10

LINE

May the LINE be with you...
Python
811
star
11

awesome-torch

A curated list of awesome Torch tutorials, projects and communities
616
star
12

simulated-unsupervised-tensorflow

TensorFlow implementation of "Learning from Simulated and Unsupervised Images through Adversarial Training"
Python
573
star
13

variational-text-tensorflow

TensorFlow implementation of Neural Variational Inference for Text Processing
Python
545
star
14

pixel-rnn-tensorflow

in progress
Python
495
star
15

visual-analogy-tensorflow

Tensorflow implementation of "Deep Visual Analogy-Making"
Python
289
star
16

BEGAN-pytorch

in progress
Python
262
star
17

NAF-tensorflow

"Continuous Deep Q-Learning with Model-based Acceleration" in TensorFlow
Python
193
star
18

attentive-reader-tensorflow

in progress
Python
189
star
19

korail2

Korail (www.letskorail.com) wrapper for Python.
Python
149
star
20

SPIRAL-tensorflow

in progress
Python
116
star
21

deep-learning-study

Study of HeXA@UNIST in Preparation for Submission
108
star
22

poet-neural

인곡지λŠ₯ μ‹œνŒ”μ΄, μ‹œμΈ λ‰΄λŸ΄
CSS
76
star
23

karel

Karel dataset for program synthesis and program induction
Python
76
star
24

program-synthesis-rl-tensorflow

in progress
Python
72
star
25

text-based-game-rl-tensorflow

in progress
Python
61
star
26

paper-notes

personal notes
56
star
27

word2vec-tensorflow

in progress
Python
46
star
28

between

Between of VCNC for Python
Python
38
star
29

a3c-tensorflow

Python
33
star
30

hali

A neural network for question answering model
Lua
32
star
31

ndrive

Python wrapper for NAVER Ndrive
Python
31
star
32

RCMN

Recurrent Convolutional Memory Network (in progress)
Python
29
star
33

board

25
star
34

FoodClassifier

Food image classifier
Python
25
star
35

practice-tensorflow

Jupyter Notebook
20
star
36

reviewduk

Korean Sentiment Analyzer in Morphologically Rich Languages
JavaScript
19
star
37

voxoffice

A Data Visualization of Box Office History.
JavaScript
18
star
38

gornn

Deep Recurrent Neural Networks and Long Short Term Memory in Golang
Go
18
star
39

personal-blog-powered-by-flask

website powered by flask
Python
16
star
40

movieduk

Record the movie list and share it!
Python
15
star
41

movietag

Search movie with tag
CSS
12
star
42

HeXA-Bot

KakaoTalk robot which automatically answer to your command
Python
11
star
43

fraktur

convert the latin alphabet to fraktur unicode characters
Python
11
star
44

comgong-job

A robot for future computer science students
Python
9
star
45

carpedm20

7
star
46

naverdic

NAVER dictionary wrapper for Python
Python
7
star
47

neural-networks-and-deep-learning-ko

Translation of Neural Networks and Deep Learning by Michael Nielsen
6
star
48

ausung

A Data Visualization of Media Sentiments
JavaScript
6
star
49

Easily-written-Django

Easily learn Django to newbies of computer world
Python
6
star
50

Bias

Character-level Bidirectional LSTM for auto spacing (text segmentation)
Lua
5
star
51

quotes

JavaScript
5
star
52

nn-study

Lua
4
star
53

140min-python

140λΆ„μ˜ Python
JavaScript
4
star
54

i-crawl-news

i crawler news
Python
4
star
55

Run-Length-Prediction-of-Change-Point-by-Text-Features

Reading documents for bayesian Online Change Point Detection
HTML
4
star
56

ggomggom-email

Chrome extension for Korean grammer checker
JavaScript
4
star
57

korean-japanese-translator

Korean-Japanese translator using word2vec
Python
3
star
58

all-about-critics

A Data Visualization of Korean movie critics.
Python
3
star
59

jsSolar

Javascript solar system simulator
JavaScript
3
star
60

blog

CSS
3
star
61

UNIST-portal-bot

Facebook bot that uploads portal announcements automatically
Python
2
star
62

2014-study

2014-study
2
star
63

BufferTest_v2

Java
2
star
64

UNIST-FedEx

μœ λ‹ˆμŠ€νŠΈ λ‚΄κ°€ μ „ν•΄μ£ΌκΉŒ
Python
2
star
65

bap-15min-before

λ°₯λ¨ΉκΈ° μ‹­μ˜€λΆ„μ „ - μœ λ‹ˆμŠ€νŠΈ
Python
2
star
66

coursera-downloader

course material downloader from coursera
2
star
67

babo

바보 (사전)
Python
2
star
68

movie-parser

movie parser
Python
2
star
69

random-wall

A jQuery plugin that randomly changes background-image of an element
JavaScript
2
star
70

basehangul

BaseHangul for GoLang
Go
2
star
71

vec2movie

Python
1
star
72

agora

Cloud commenting system.
Python
1
star
73

FoodDuk

Big data analysis for restaurant recommendation
JavaScript
1
star
74

Study-of-Computer-Vision

Study of Computer Vision
Python
1
star
75

UNIST-auction

UNIST auction
Python
1
star
76

UNIST-robot

easy to access UNIST portal, black board, library
C#
1
star
77

blackbot

blackbot
Python
1
star
78

comgong-abroad

A robot for future computer science students
Python
1
star
79

machine-learning

Study of Machine learning
Python
1
star
80

samantha

Python
1
star
81

FoodClassifier-matlab

Food image classifier written by Matlab
MATLAB
1
star