{"id":13585140,"url":"https://github.com/richliao/textClassifier","last_synced_at":"2025-04-07T06:32:41.629Z","repository":{"id":47031429,"uuid":"77578028","full_name":"richliao/textClassifier","owner":"richliao","description":"Text classifier for Hierarchical Attention Networks for Document Classification ","archived":false,"fork":false,"pushed_at":"2021-09-16T14:35:50.000Z","size":22,"stargazers_count":1069,"open_issues_count":30,"forks_count":378,"subscribers_count":43,"default_branch":"master","last_synced_at":"2024-11-06T02:38:46.281Z","etag":null,"topics":["attention-mechanism","convolutional-neural-networks","hierarchical-attention-networks","recurrent-neural-networks","text-classification"],"latest_commit_sha":null,"homepage":"","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/richliao.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":"2016-12-29T03:02:44.000Z","updated_at":"2024-08-09T12:52:10.000Z","dependencies_parsed_at":"2022-08-26T10:12:01.893Z","dependency_job_id":null,"html_url":"https://github.com/richliao/textClassifier","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/richliao%2FtextClassifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richliao%2FtextClassifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richliao%2FtextClassifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richliao%2FtextClassifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/richliao","download_url":"https://codeload.github.com/richliao/textClassifier/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247607550,"owners_count":20965942,"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":["attention-mechanism","convolutional-neural-networks","hierarchical-attention-networks","recurrent-neural-networks","text-classification"],"created_at":"2024-08-01T15:04:45.666Z","updated_at":"2025-04-07T06:32:41.622Z","avatar_url":"https://github.com/richliao.png","language":"Python","readme":"# textClassifier\n\ntextClassifierHATT.py has the implementation of [Hierarchical Attention Networks for Document Classification](https://www.cs.cmu.edu/~diyiy/docs/naacl16.pdf). Please see the [my blog](https://richliao.github.io/supervised/classification/2016/12/26/textclassifier-HATN/) for full detail. Also see [Keras Google group discussion](https://groups.google.com/forum/#!topic/keras-users/IWK9opMFavQ)\n\ntextClassifierConv has implemented [Convolutional Neural Networks for Sentence Classification - Yoo Kim](https://www.cs.cmu.edu/~diyiy/docs/naacl16.pdf). Please see the [my blog](https://richliao.github.io/supervised/classification/2016/11/26/textclassifier-convolutional/) for full detail.\n\ntextClassifierRNN has implemented bidirectional LSTM and one level attentional RNN. Please see the [my blog](https://richliao.github.io/supervised/classification/2016/12/26/textclassifier-RNN/) for full detail.\n\n## update on 6/22/2017 ##\nTo derive the attention weight which can be useful to identify important words for the classification. Please see my latest update on the post. All you need to do is run a forward pass right before attention layer output. The result is not very promising. I will update the post once I have further result.\n\n---\nThis repo is forked from [https://github.com/richliao/textClassifier](https://github.com/richliao/textClassifier) and we find some issue [here](https://github.com/richliao/textClassifier/issues/28). So we update the textClassifierHATT with `python 2.7` and `keras 2.0.8`\n\n```\n# clone the repo\ngit clone {repo address}\n\n# install Dependent library\ncd textClassifier\npip install -r req.xt\n\n# download imdb train from Kaggle in the below link and keep the files in the working directory\nhttps://www.kaggle.com/c/word2vec-nlp-tutorial/download/labeledTrainData.tsv\n# download glove word vector\nwget http://nlp.stanford.edu/data/glove.6B.zip\nunzip glove.6B.zip\n\n# install nltk 'punkt' using the following code in python interpretor\n\u003e\u003e\u003eimport nltk\n\u003e\u003e\u003enltk.download('punkt')\n\n# train the model\npython textClassifierHATT.py\n\n# note if in case while installing word2vec, cython error occurs then \npip install --upgrade cython\n```\n\n\n\nEnjoy！\n","funding_links":[],"categories":["Python","📦 Legacy \u0026 Inactive Projects"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frichliao%2FtextClassifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frichliao%2FtextClassifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frichliao%2FtextClassifier/lists"}