{"id":18401709,"url":"https://github.com/borealisai/cross_domain_coherence","last_synced_at":"2025-08-17T05:07:07.658Z","repository":{"id":81377602,"uuid":"192009708","full_name":"BorealisAI/cross_domain_coherence","owner":"BorealisAI","description":"A Cross-Domain Transferable Neural Coherence Model https://arxiv.org/abs/1905.11912","archived":false,"fork":false,"pushed_at":"2020-07-08T15:19:08.000Z","size":33,"stargazers_count":24,"open_issues_count":0,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-07-09T03:07:28.997Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BorealisAI.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":"2019-06-14T21:55:37.000Z","updated_at":"2023-04-20T14:27:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"47502076-f5e1-4ba8-885f-83d6b9693691","html_url":"https://github.com/BorealisAI/cross_domain_coherence","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BorealisAI/cross_domain_coherence","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BorealisAI%2Fcross_domain_coherence","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BorealisAI%2Fcross_domain_coherence/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BorealisAI%2Fcross_domain_coherence/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BorealisAI%2Fcross_domain_coherence/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BorealisAI","download_url":"https://codeload.github.com/BorealisAI/cross_domain_coherence/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BorealisAI%2Fcross_domain_coherence/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270807934,"owners_count":24649346,"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-08-17T02:00:09.016Z","response_time":129,"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":[],"created_at":"2024-11-06T02:39:42.336Z","updated_at":"2025-08-17T05:07:07.635Z","avatar_url":"https://github.com/BorealisAI.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cross-Domain Coherence Modeling \n\nA Cross-Domain Transferable Neural Coherence Model\n\nPaper published in ACL 2019: [arxiv.org/abs/1905.11912](https://arxiv.org/abs/1905.11912)\n\nThis implementation is based on PyTorch 0.4.1.\n\n### Dataset\n\nTo download the dataset:\n\n```\npython prepare_data.py\n```\n\nwhich includes WikiCoherence dataset we construct, 300-dim GloVe embeddings and pre-trained Infersent model.\n\nFor WikiCoherence, it contains:\n\n- 7 categories under **Person**\n    - Artist\n    - Athlete\n    - Politician\n    - Writer\n    - MilitaryPerson\n    - OfficeHolder\n    - Scientist\n- 3 categories from different irrelevant domains:\n    - Plant\n    - EducationalInstitution\n    - CelestialBody\n- parsed\\_wsj: original split for Wall Street Journal (WSJ)\n- parsed\\_random: randomly split all paragraphs of the seven categories under **Person** into training part and testing part\n\nCheck `config.py` for the data\\_name for each setting.\n\n### Preprocessing\n\nPremute the original documents or paragraphs to obtain the negative samples for evaluation:\n\n```\npython preprocess.py --data_name \u003cdata_name\u003e\n```\n\n### LM Pre-training\n\nTrain the LM with the following command:\n\n```\npython train_lm.py --data_name \u003cdata_name\u003e\npython train_lm.py --data_name \u003cdata_name\u003e --reverse\n```\n\nThe pre-trained models will be saved in `./checkpoint`.\n\n### Training and Evaluation\n\nTo evaluate our proposed models:\n\n```\npython run_bigram_coherence.py --data_name \u003cdata_name\u003e --sent_encoder \u003csent_encoder\u003e [--bidirectional]\n```\n\nwhere `sent_encoder` can be average\\_glove, infersent or lm\\_hidden.\n\n```\npython eval.py --data_name \u003cdata_name\u003e --sent_encoder \u003csent_encoder\u003e [--bidirectional]\n```\n\nRun the above script will run the experiment multiple times and report the mean and std statistics.\nThe log will be saved in `./log`.\n\n### Cite\n\nIf you found this codebase or our work useful, please cite:\n\n```\n@InProceedings{xu2019cross,\n    author = {Xu, Peng and Saghir, Hamidreza and Kang, Jin Sung and Long, Teng and Bose, Avishek Joey and Cao, Yanshuai and Cheung, Jackie Chi Kit},\n    title = {A Cross-Domain Transferable Neural Coherence Model}\n    booktitle = {The 57th Annual Meeting of the Association for Computational Linguistics (ACL 2019)},\n    month = {July},\n    year = {2019},\n    publisher = {ACL}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborealisai%2Fcross_domain_coherence","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fborealisai%2Fcross_domain_coherence","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborealisai%2Fcross_domain_coherence/lists"}