{"id":19467531,"url":"https://github.com/thunlp/cane","last_synced_at":"2025-07-26T19:07:42.733Z","repository":{"id":83080540,"uuid":"88707705","full_name":"thunlp/CANE","owner":"thunlp","description":"Source code and datasets of \"CANE: Context-Aware Network  Embedding for Relation Modeling\"","archived":false,"fork":false,"pushed_at":"2019-03-30T05:35:36.000Z","size":1738,"stargazers_count":192,"open_issues_count":0,"forks_count":79,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-07-04T14:25:09.832Z","etag":null,"topics":["network-embedding"],"latest_commit_sha":null,"homepage":null,"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/thunlp.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}},"created_at":"2017-04-19T06:11:47.000Z","updated_at":"2025-02-23T11:57:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"abebcf1b-07f0-45fd-8fbd-00747b31e805","html_url":"https://github.com/thunlp/CANE","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thunlp/CANE","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thunlp%2FCANE","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thunlp%2FCANE/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thunlp%2FCANE/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thunlp%2FCANE/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thunlp","download_url":"https://codeload.github.com/thunlp/CANE/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thunlp%2FCANE/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267213475,"owners_count":24053912,"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","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["network-embedding"],"created_at":"2024-11-10T18:35:40.676Z","updated_at":"2025-07-26T19:07:42.669Z","avatar_url":"https://github.com/thunlp.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CANE\nSource code and datasets of ACL2017 paper: \"CANE: Context-Aware Network  Embedding for Relation Modeling\"\n\n## Datasets\nThis folder \"datasets\" contains three datasets used in CANE, including Cora, HepTh and Zhihu. In each dataset, there are two files named \"data.txt\" and \"graph.txt\".\n\n* data.txt: Each line represents the text information of a vertex.    \n* graph.txt: The edgelist file of current social network.\n\nBesides, there is an additional \"group.txt\" file in Cora.\n\n* group.txt: Each vertex in Cora has been annotated with a label. This file can be used for vertex classification.\n\n## Run\nRun the following command for training CANE:\n\n    python3 run.py --dataset [cora,HepTh,zhihu] --gpu gpu_id --ratio [0.15,0.25,...] --rho rho_value\n\nFor example, you can train like:\n\n    python3 run.py --dataset zhihu --gpu 0 --ratio 0.55 --rho 1.0,0.3,0.3\n\n## Experimental Results\n\nThe experimental results are generated by the newest version of codes:\n\n|       | 0.15 | 0.25 | 0.35 | 0.45 | 0.55 | 0.65 | 0.75 | 0.85 | 0.95 |\n| ----- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- |\n| cora  | 85.2 | 90.5 | 92.2 | 93.5 | 93.4 | 93.6 | 94.4 | 95   | 92.5 |\n| HepTh | 85   | 89.7 | 91.7 | 95   | 94.4 | 94.2 | 95.1 | 95.8 | 93.1 |\n| zhihu | 64.5 | 67.1 | 69.2 | 69.9 | 72   | 72.2 | 72.5 | 72.8 | 73.3 |\n\n## Dependencies\n\n* Tensorflow == 1.11.0\n* Scipy == 1.1.0\n* Numpy == 1.16.2\n\n## Cite\nIf you use the code, please cite this paper:\n\n_Cunchao Tu, Han Liu, Zhiyuan Liu, Maosong Sun. CANE: Context-Aware Network  Embedding for Relation Modeling. The 55th Annual Meeting of the Association for Computational Linguistics (ACL 2017)._\n\nFor more related works on network representation learning, please refer to my [homepage](http://thunlp.org/~tcc/).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthunlp%2Fcane","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthunlp%2Fcane","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthunlp%2Fcane/lists"}