{"id":18833014,"url":"https://github.com/declare-lab/kingdom","last_synced_at":"2025-09-13T19:12:30.982Z","repository":{"id":40962602,"uuid":"260583290","full_name":"declare-lab/kingdom","owner":"declare-lab","description":"Domain Adaptation using External Knowledge for Sentiment Analysis","archived":false,"fork":false,"pushed_at":"2023-07-06T21:50:04.000Z","size":33484,"stargazers_count":54,"open_issues_count":3,"forks_count":14,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-14T04:38:41.227Z","etag":null,"topics":["adversarial-learning","adversarial-networks","deep-learning","deep-neural-networks","domain-adaptation","opinion-mining","sentiment-analysis"],"latest_commit_sha":null,"homepage":"https://arxiv.org/pdf/2005.00791.pdf","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/declare-lab.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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-05-02T00:12:02.000Z","updated_at":"2025-01-17T09:44:47.000Z","dependencies_parsed_at":"2025-04-14T04:42:05.019Z","dependency_job_id":null,"html_url":"https://github.com/declare-lab/kingdom","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/declare-lab/kingdom","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/declare-lab%2Fkingdom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/declare-lab%2Fkingdom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/declare-lab%2Fkingdom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/declare-lab%2Fkingdom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/declare-lab","download_url":"https://codeload.github.com/declare-lab/kingdom/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/declare-lab%2Fkingdom/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275014094,"owners_count":25390622,"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-09-13T02:00:10.085Z","response_time":70,"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":["adversarial-learning","adversarial-networks","deep-learning","deep-neural-networks","domain-adaptation","opinion-mining","sentiment-analysis"],"created_at":"2024-11-08T01:59:55.250Z","updated_at":"2025-09-13T19:12:30.951Z","avatar_url":"https://github.com/declare-lab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KinGDOM: Knowledge-Guided DOMain adaptation for sentiment analysis (ACL 2020)\n\n[_KinGDOM_](https://arxiv.org/abs/2005.00791.pdf) takes a novel perspective on the task of domain adaptation in sentiment analysis by exploring the role of external commonsense knowledge. It utilizes the ConceptNet knowledge graph to enrich the semantics of a document by providing both domain-specific and domain-general background concepts. These concepts are learned by training a graph convolutional autoencoder that leverages inter-domain concepts in a domain-invariant manner. Conditioning a popular domain-adversarial baseline method with these learned concepts helps improve its performance over state-of-the-art approaches, demonstrating the efficacy of the proposed framework.\n\n![Alt text](KinGDOM.jpeg?raw=true \"KinGDOM framework\")\n\n### Requirements\n- scipy==1.3.1\n- gensim==3.8.1\n- torch==1.6.0\n- numpy==1.18.2\n- scikit_learn==0.22.2.post1\n- torch_geometric==1.6.3\n\n### Execution\n\nDownload ConceptNet filtered for English language from [here](https://drive.google.com/file/d/19klcp69OYEf29A_JrBphgkMVPQ9rXe1k/view?usp=sharing) and keep in this root directory.\n\nPreprocess, train and extract graph features:\n\n```bash\npython preprocess_graph.py\npython train_and_extract_graph_features.py\n```\n\nWe provide pretrained graph features in the `graph_features` directory. Note that, executing the above commands will overwrite the provided feature files.\n\nTrain the main domain adaptation model:\n\n```bash\npython train.py\n```\n\nSome of the RGCN functionalities are adapted from https://github.com/JinheonBaek/RGCN\n\n### Citation\n\nPlease cite the following paper if you find this code useful in your work.\n\n```bash\nKinGDOM: Knowledge-Guided DOMain adaptation for sentiment analysis. D. Ghosal, D. Hazarika, N. Majumder, A. Roy, S. Poria, R. Mihalcea. ACL 2020.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeclare-lab%2Fkingdom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeclare-lab%2Fkingdom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeclare-lab%2Fkingdom/lists"}