{"id":13454820,"url":"https://github.com/carpedm20/lstm-char-cnn-tensorflow","last_synced_at":"2025-04-04T13:09:16.338Z","repository":{"id":65038989,"uuid":"47773990","full_name":"carpedm20/lstm-char-cnn-tensorflow","owner":"carpedm20","description":"in progress","archived":false,"fork":false,"pushed_at":"2018-07-27T11:04:42.000Z","size":9182,"stargazers_count":768,"open_issues_count":17,"forks_count":241,"subscribers_count":60,"default_branch":"master","last_synced_at":"2025-03-28T12:05:24.173Z","etag":null,"topics":["cnn","lstm","nlp","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/carpedm20.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-10T16:31:03.000Z","updated_at":"2025-03-21T16:05:48.000Z","dependencies_parsed_at":"2023-01-06T20:45:42.149Z","dependency_job_id":null,"html_url":"https://github.com/carpedm20/lstm-char-cnn-tensorflow","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carpedm20%2Flstm-char-cnn-tensorflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carpedm20%2Flstm-char-cnn-tensorflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carpedm20%2Flstm-char-cnn-tensorflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carpedm20%2Flstm-char-cnn-tensorflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/carpedm20","download_url":"https://codeload.github.com/carpedm20/lstm-char-cnn-tensorflow/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247181641,"owners_count":20897370,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cnn","lstm","nlp","tensorflow"],"created_at":"2024-07-31T08:00:58.214Z","updated_at":"2025-04-04T13:09:16.320Z","avatar_url":"https://github.com/carpedm20.png","language":"Python","funding_links":[],"categories":["Models/Projects","模型项目"],"sub_categories":["微信群"],"readme":"Character-Aware Neural Language Models\n======================================\n\nTensorflow implementation of [Character-Aware Neural Language Models](http://arxiv.org/abs/1508.06615). The original code of author can be found [here](https://github.com/yoonkim/lstm-char-cnn).\n\n![model.png](./assets/model.png)\n\nThis implementation contains:\n\n1. Word-level and Character-level Convolutional Neural Network\n2. Highway Network\n3. Recurrent Neural Network Language Model\n\n*The current implementation has a performance issue. See [#3](https://github.com/carpedm20/lstm-char-cnn-tensorflow/issues/3).*\n\n\nPrerequisites\n-------------\n\n- Python 2.7 or Python 3.3+\n- [Tensorflow](https://www.tensorflow.org/)\n\n\nUsage\n-----\n\nTo train a model with `ptb` dataset:\n\n    $ python main.py --dataset ptb\n\nTo test an existing model:\n\n    $ python main.py --dataset ptb --forward_only True\n\nTo see all training options, run:\n\n    $ python main.py --help\n\nwhich will print\n\n    usage: main.py [-h] [--epoch EPOCH] [--word_embed_dim WORD_EMBED_DIM]\n                  [--char_embed_dim CHAR_EMBED_DIM]\n                  [--max_word_length MAX_WORD_LENGTH] [--batch_size BATCH_SIZE]\n                  [--seq_length SEQ_LENGTH] [--learning_rate LEARNING_RATE]\n                  [--decay DECAY] [--dropout_prob DROPOUT_PROB]\n                  [--feature_maps FEATURE_MAPS] [--kernels KERNELS]\n                  [--model MODEL] [--data_dir DATA_DIR] [--dataset DATASET]\n                  [--checkpoint_dir CHECKPOINT_DIR]\n                  [--forward_only [FORWARD_ONLY]] [--noforward_only]\n                  [--use_char [USE_CHAR]] [--nouse_char] [--use_word [USE_WORD]]\n                  [--nouse_word]\n\n    optional arguments:\n      -h, --help            show this help message and exit\n      --epoch EPOCH         Epoch to train [25]\n      --word_embed_dim WORD_EMBED_DIM\n                            The dimension of word embedding matrix [650]\n      --char_embed_dim CHAR_EMBED_DIM\n                            The dimension of char embedding matrix [15]\n      --max_word_length MAX_WORD_LENGTH\n                            The maximum length of word [65]\n      --batch_size BATCH_SIZE\n                            The size of batch images [100]\n      --seq_length SEQ_LENGTH\n                            The # of timesteps to unroll for [35]\n      --learning_rate LEARNING_RATE\n                            Learning rate [1.0]\n      --decay DECAY         Decay of SGD [0.5]\n      --dropout_prob DROPOUT_PROB\n                            Probability of dropout layer [0.5]\n      --feature_maps FEATURE_MAPS\n                            The # of feature maps in CNN\n                            [50,100,150,200,200,200,200]\n      --kernels KERNELS     The width of CNN kernels [1,2,3,4,5,6,7]\n      --model MODEL         The type of model to train and test [LSTM, LSTMTDNN]\n      --data_dir DATA_DIR   The name of data directory [data]\n      --dataset DATASET     The name of dataset [ptb]\n      --checkpoint_dir CHECKPOINT_DIR\n                            Directory name to save the checkpoints [checkpoint]\n      --forward_only [FORWARD_ONLY]\n                            True for forward only, False for training [False]\n      --noforward_only\n      --use_char [USE_CHAR]\n                            Use character-level language model [True]\n      --nouse_char\n      --use_word [USE_WORD]\n                            Use word-level language [False]\n      --nouse_word\n\nbut more options can be found in [models/LSTMTDNN](./models/LSTMTDNN.py) and [models/TDNN](./models/TDNN.py).\n\n\nPerformance\n-----------\n\n**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.\n\n![loss](./assets/performance.png)\n\nThe perplexity on the test sets of Penn Treebank (PTB) corpora.\n\n|       Name      | Character embed | LSTM hidden units | Paper (Y Kim 2016) |  This repo. |\n|:---------------:|:---------------:|:-----------------:|:------------------:|:-----------:|\n| LSTM-Char-Small |        15       |        100        |        92.3        | in progress |\n| LSTM-Char-Large |        15       |        150        |        78.9        | in progress |\n\n\nAuthor\n------\n\nTaehoon Kim / [@carpedm20](http://carpedm20.github.io/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarpedm20%2Flstm-char-cnn-tensorflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarpedm20%2Flstm-char-cnn-tensorflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarpedm20%2Flstm-char-cnn-tensorflow/lists"}