{"id":13535501,"url":"https://github.com/luoyuanlab/text_gcn_tutorial","last_synced_at":"2025-04-02T01:31:01.094Z","repository":{"id":118401445,"uuid":"177482572","full_name":"luoyuanlab/text_gcn_tutorial","owner":"luoyuanlab","description":"A tutorial \u0026 minimal example (8min on CPU) for Graph Convolutional Networks for Text Classification. AAAI 2019","archived":false,"fork":false,"pushed_at":"2020-10-04T15:40:44.000Z","size":4851,"stargazers_count":26,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-08-22T03:01:56.612Z","etag":null,"topics":["deep-learning","graph-convolutional-networks","nlp","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luoyuanlab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-03-24T23:36:32.000Z","updated_at":"2024-08-22T03:01:56.613Z","dependencies_parsed_at":null,"dependency_job_id":"567899ed-4c4f-4bb0-beff-b12fba8bae83","html_url":"https://github.com/luoyuanlab/text_gcn_tutorial","commit_stats":null,"previous_names":["yuanluo/text_gcn_tutorial"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luoyuanlab%2Ftext_gcn_tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luoyuanlab%2Ftext_gcn_tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luoyuanlab%2Ftext_gcn_tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luoyuanlab%2Ftext_gcn_tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luoyuanlab","download_url":"https://codeload.github.com/luoyuanlab/text_gcn_tutorial/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222788514,"owners_count":17037777,"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":["deep-learning","graph-convolutional-networks","nlp","text-classification"],"created_at":"2024-08-01T08:00:57.417Z","updated_at":"2024-11-02T23:31:27.153Z","avatar_url":"https://github.com/luoyuanlab.png","language":"Python","funding_links":[],"categories":["Text Classification:"],"sub_categories":[],"readme":"# Text GCN Tutorial\n\nThis tutorial (currently under improvement) is based on the implementation of Text GCN in our paper:\n\nLiang Yao, Chengsheng Mao, Yuan Luo. \"Graph Convolutional Networks for Text Classification.\" In 33rd AAAI Conference on Artificial Intelligence (AAAI-19)\n\n\u003cimg src=\"./figure/TextGCN.svg\"\u003e\n\n# Require\n\nPython 2.7 or 3.6\n\nTensorflow \u003e= 1.4.0\n\n# Example input data\nThe \u003ca href=\"http://disi.unitn.it/moschitti/corpora.htm\"\u003eOhsumed corpus\u003c/a\u003e is from the MEDLINE database, which is a bibliographic database of important medical literature maintained by the National Library of Medicine\n\nIn this tutorial, we created a subsample of the 2,762 unique diseases abstracts from 3 categories\n* C04: Neoplasms\n* C10: Nervous System Diseases\n* C14: Cardiovascular Diseases\n\nAs we focus on single-label text classification, the documents belonging to multiple categories are excluded\n\n1230 train (use 10% as validation), 1532 test\n\n1. `/data/ohsumed_3.txt` indicates document names, training/test split, document labels. Each line is for a document.\n\n2. `/data/corpus/ohsumed_3.txt` contains raw text of each document, each line is for the corresponding line in `/data/ohsumed_3.txt`\n\n# Reproduing Results\n\n1. Run `python remove_words.py ohsumed_3`\n\n2. Run `python build_graph.py ohsumed_3`\n\n3. Run `python train.py ohsumed_3`\n\n# Example output\n```\n2019-04-04 22:58:26.244395: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA\nEpoch: 0001 train_loss= 1.09856 train_acc= 0.41463 val_loss= 1.08209 val_acc= 0.48780 time= 29.13731\nEpoch: 0002 train_loss= 1.08044 train_acc= 0.49865 val_loss= 1.05469 val_acc= 0.47967 time= 23.00088\nEpoch: 0003 train_loss= 1.05075 train_acc= 0.49865 val_loss= 1.02113 val_acc= 0.47967 time= 21.82401\nEpoch: 0004 train_loss= 1.01430 train_acc= 0.49955 val_loss= 0.98582 val_acc= 0.48780 time= 21.42816\nEpoch: 0005 train_loss= 0.97174 train_acc= 0.50678 val_loss= 0.95375 val_acc= 0.51220 time= 21.44958\nEpoch: 0006 train_loss= 0.93406 train_acc= 0.51220 val_loss= 0.92789 val_acc= 0.55285 time= 24.01502\n......\nEpoch: 0074 train_loss= 0.01921 train_acc= 0.99819 val_loss= 0.09674 val_acc= 0.96748 time= 24.01229\nEpoch: 0075 train_loss= 0.02093 train_acc= 0.99909 val_loss= 0.09715 val_acc= 0.96748 time= 24.08436\nEarly stopping...\nOptimization Finished!\nTest set results: cost= 0.24295 accuracy= 0.92167 time= 7.60145\n10456\nTest Precision, Recall and F1-Score...\n             precision    recall  f1-score   support\n\n          0     0.8882    0.8363    0.8614       342\n          1     0.9438    0.9517    0.9477       600\n          2     0.9174    0.9407    0.9289       590\n\navg / total     0.9212    0.9217    0.9212      1532\n\n```\n# Visualizing Documents\nRun `python tsne.py`\n\n# Example Visualization\n\u003c!--- ![Image of Ohsumed3 Tsne](/figure/ohsumed3_tsne.png | width=500) ---\u003e\n\u003cimg src=\"./figure/ohsumed3_tsne.png\" width=\"411\" height=\"303\"\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluoyuanlab%2Ftext_gcn_tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluoyuanlab%2Ftext_gcn_tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluoyuanlab%2Ftext_gcn_tutorial/lists"}