{"id":13454810,"url":"https://github.com/dennybritz/cnn-text-classification-tf","last_synced_at":"2025-05-14T04:07:43.053Z","repository":{"id":48153392,"uuid":"46801369","full_name":"dennybritz/cnn-text-classification-tf","owner":"dennybritz","description":"Convolutional Neural Network for Text Classification in Tensorflow","archived":false,"fork":false,"pushed_at":"2024-04-15T19:15:44.000Z","size":1137,"stargazers_count":5658,"open_issues_count":110,"forks_count":2766,"subscribers_count":280,"default_branch":"master","last_synced_at":"2025-04-10T22:35:04.082Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dennybritz.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-11-24T15:43:25.000Z","updated_at":"2025-04-10T09:53:19.000Z","dependencies_parsed_at":"2024-09-30T12:20:31.245Z","dependency_job_id":null,"html_url":"https://github.com/dennybritz/cnn-text-classification-tf","commit_stats":{"total_commits":63,"total_committers":15,"mean_commits":4.2,"dds":0.3015873015873016,"last_synced_commit":"18762b459e21d9c70e5c242f8d43fc4e6db37a0d"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dennybritz%2Fcnn-text-classification-tf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dennybritz%2Fcnn-text-classification-tf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dennybritz%2Fcnn-text-classification-tf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dennybritz%2Fcnn-text-classification-tf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dennybritz","download_url":"https://codeload.github.com/dennybritz/cnn-text-classification-tf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254069220,"owners_count":22009513,"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":[],"created_at":"2024-07-31T08:00:58.133Z","updated_at":"2025-05-14T04:07:43.020Z","avatar_url":"https://github.com/dennybritz.png","language":"Python","funding_links":[],"categories":["Models/Projects","Python","Uncategorized","模型项目","Repository \u0026 Tool","📚 Project Purpose","📦 Legacy \u0026 Inactive Projects"],"sub_categories":["Uncategorized","微信群","Weakly-supervised \u0026 Semi-supervised Learning","Machine Learning (Entry-Level)"],"readme":"**[This code belongs to the \"Implementing a CNN for Text Classification in Tensorflow\" blog post.](http://www.wildml.com/2015/12/implementing-a-cnn-for-text-classification-in-tensorflow/)**\n\nIt is slightly simplified implementation of Kim's [Convolutional Neural Networks for Sentence Classification](http://arxiv.org/abs/1408.5882) paper in Tensorflow.\n\n## Requirements\n\n- Python 3\n- Tensorflow \u003e 0.12\n- Numpy\n\n## Training\n\nPrint parameters:\n\n```bash\n./train.py --help\n```\n\n```\noptional arguments:\n  -h, --help            show this help message and exit\n  --embedding_dim EMBEDDING_DIM\n                        Dimensionality of character embedding (default: 128)\n  --filter_sizes FILTER_SIZES\n                        Comma-separated filter sizes (default: '3,4,5')\n  --num_filters NUM_FILTERS\n                        Number of filters per filter size (default: 128)\n  --l2_reg_lambda L2_REG_LAMBDA\n                        L2 regularizaion lambda (default: 0.0)\n  --dropout_keep_prob DROPOUT_KEEP_PROB\n                        Dropout keep probability (default: 0.5)\n  --batch_size BATCH_SIZE\n                        Batch Size (default: 64)\n  --num_epochs NUM_EPOCHS\n                        Number of training epochs (default: 100)\n  --evaluate_every EVALUATE_EVERY\n                        Evaluate model on dev set after this many steps\n                        (default: 100)\n  --checkpoint_every CHECKPOINT_EVERY\n                        Save model after this many steps (default: 100)\n  --allow_soft_placement ALLOW_SOFT_PLACEMENT\n                        Allow device soft device placement\n  --noallow_soft_placement\n  --log_device_placement LOG_DEVICE_PLACEMENT\n                        Log placement of ops on devices\n  --nolog_device_placement\n\n```\n\nTrain:\n\n```bash\n./train.py\n```\n\n## Evaluating\n\n```bash\n./eval.py --eval_train --checkpoint_dir=\"./runs/1459637919/checkpoints/\"\n```\n\nReplace the checkpoint dir with the output from the training. To use your own data, change the `eval.py` script to load your data.\n\n\n## References\n\n- [Convolutional Neural Networks for Sentence Classification](http://arxiv.org/abs/1408.5882)\n- [A Sensitivity Analysis of (and Practitioners' Guide to) Convolutional Neural Networks for Sentence Classification](http://arxiv.org/abs/1510.03820)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdennybritz%2Fcnn-text-classification-tf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdennybritz%2Fcnn-text-classification-tf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdennybritz%2Fcnn-text-classification-tf/lists"}