{"id":13589459,"url":"https://github.com/HKUST-KnowComp/TransOMCS","last_synced_at":"2025-04-08T09:32:54.632Z","repository":{"id":101129378,"uuid":"258070934","full_name":"HKUST-KnowComp/TransOMCS","owner":"HKUST-KnowComp","description":"TransOMCS is a commonsense knowledge resource transferred from ASER. It is in the format of OMCS but two orders of magnitude larger.","archived":false,"fork":false,"pushed_at":"2020-08-25T18:58:40.000Z","size":1106,"stargazers_count":69,"open_issues_count":0,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-06T09:39:44.683Z","etag":null,"topics":["aser","commonsense","knowledge-base","knowledge-graph","omcs","semantic-networks"],"latest_commit_sha":null,"homepage":"","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/HKUST-KnowComp.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}},"created_at":"2020-04-23T02:14:17.000Z","updated_at":"2024-09-07T19:06:47.000Z","dependencies_parsed_at":"2023-09-09T04:45:21.108Z","dependency_job_id":null,"html_url":"https://github.com/HKUST-KnowComp/TransOMCS","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/HKUST-KnowComp%2FTransOMCS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HKUST-KnowComp%2FTransOMCS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HKUST-KnowComp%2FTransOMCS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HKUST-KnowComp%2FTransOMCS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HKUST-KnowComp","download_url":"https://codeload.github.com/HKUST-KnowComp/TransOMCS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247814220,"owners_count":21000522,"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":["aser","commonsense","knowledge-base","knowledge-graph","omcs","semantic-networks"],"created_at":"2024-08-01T16:00:30.444Z","updated_at":"2025-04-08T09:32:53.799Z","avatar_url":"https://github.com/HKUST-KnowComp.png","language":"Python","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# TransOMCS\n\n\nThis is the github repo for IJCAI 2020 paper [\"TransOMCS: From Linguistic Graphs to Commonsense Knowledge\"](https://arxiv.org/abs/2005.00206).\n\n## Dependency\n\nPython 3.6, Pytorch 1.0\n\n\n## Introduction of TransOMCS\n\nIf you only want to use TransOMCS, you can **download** it from [TransOMCS](https://hkustconnect-my.sharepoint.com/:u:/g/personal/hzhangal_connect_ust_hk/EVeNd_qvealEiTi7gs0Xu6sBbPIZI5ncD7Z1MBMdOz5CXw?e=VWCAbg).\n\nWithout any further filtering, TransOMCS contains 20 commonsense relations, 101 thousand unique words, and 18.48 million triplets.\n\nHere are the statistics and examples of different commonsense relations.\n\n| Relation Name | Number of triplets | Reasonable Ratio | Example|\n| :---: | :---: | :---: | :---:|\n| CapableOf | 6,145,829 | 58.4% | (government, CapableOf, protect) |\n| UsedFor | 3,475,254 | 50.8% | (kitchen, UsedFor, eat in) |\n| HasProperty | 2,127,824 | 59.1% | (account, HasProperty, established) |\n| AtLocation | 1,969,298 | 51.3% | (dryer, AtLocation, dishwasher) |\n| HasA | 1,562,961 | 68.9% | (forest, HasA, pool) |\n| ReceivesAction | 1,492,915 | 53.7% | (news, ReceivesAction, misattribute) |\n| InstanceOf | 777,688 | 52.2% | (atlanta, InstanceOf, city) |\n| PartOf | 357,486 | 62.8% | (player, PartOf, team) |\n| CausesDesire | 249,755 | 52.0% | (music, CausesDesire, listen) |\n| MadeOf | 114,111 | 55.3% | (world, MadeOf, country) |\n| CreatedBy | 52,957 | 64.6% | (film, CreatedBy, director) |\n| Causes | 50,439 | 53.4% | (misinterpret, Causes, apologize) |\n| HasPrerequisite | 43,141 | 62.7% | (doubt, HasPrerequisite, bring proof) |\n| HasSubevent | 18,904 | 56.1% | (be sure, HasSubevent, ask) |\n| MotivatedByGoal | 15,322 | 55.8% | (come, MotivatedByGoal, fun) |\n| HasLastSubevent | 14,048 | 58.9% | (hungry, HasLastSubevent, eat) |\n| Desires | 10,668 | 56.4% | (dog, Desires, play) |\n| HasFirstSubevent | 2,962 | 58.4% | (talk to, HasFirstSubevent, call) |\n| DefinedAs | 36 | 37.5% | (door, DefinedAs, entrance) |\n| LocatedNear | 19 | 85.7% | (shoe, LocatedNear, foot) |\n\nThe reasonable ratio scores are annotated on the random sample over all of the extracted knowledge (no knowledge ranking). \n\nIn general, TransOMCS is still quite noisy because TransOMCS is extracted from raw data with patterns. \nHowever, as shown in the paper, a careful use of the data in the downstream applications helps.\nWe will keep working on improving its quality.\n\n## Construction of TransOMCS\n\nIf you want to repeat the process of creating TransOMCS with OMCS and ASER, please follow the following steps.\n\n1. Download the core version of ASER from [ASER Homepage](https://hkust-knowcomp.github.io/ASER/) and install ASER 0.1 following [the guideline](https://github.com/HKUST-KnowComp/ASER/blob/master/ASER.ipynb).\n2. Download the selected Commonsense OMCS Tuples and associated ASER graphs from [OMCS and ASER matches](https://hkustconnect-my.sharepoint.com/:u:/g/personal/hzhangal_connect_ust_hk/EfFZFamzsmdKozyrU0-TtXsBDbStkt_FmPyeFM2kT-K9FQ?e=noAb7u).\n3. Download the randomly split knowledge ranking dataset from [Ranking Dataset](https://hkustconnect-my.sharepoint.com/:u:/g/personal/hzhangal_connect_ust_hk/Efc7NeRYSVpHqcGuflDU3uoBRPaks4Mz1kG_R9OUwviPLw?e=oJB3yA).\n4. Unzip the downloaded matched OMCS tuple and ASER graphs in the same folder.\n5. Extract patterns: `python Pattern_Extraction.py`.\n6. Apply the extracted patterns to extract knowledge from ASER (You need to modify the location of your .db file): `python Knowledge_Extraction.py`.\n7. Train a ranking model to rank extracted knowledge: `python Train_and_Predict.py`.\n\n\n## Application of TransOMCS\n\n\n#### Reading Comprehension\nPlease use the code in [reading comprehension model](https://github.com/intfloat/commonsense-rc) and replace the external knowledge with different subsets of TransOMCS based on your need.\n\n#### Dialog Generation\nPlease use the code in [dialog model](https://github.com/HKUST-KnowComp/ASER/tree/master/experiment/Dialogue) and replace the external knowledge with different subsets of TransOMCS based on your need.\n\n## TODO\n\n1. Filter the current TransOMCS to further improve the quality (e.g., merge pronouns like 'he' and 'she' to human).\n\n## Citation\n\n    @inproceedings{zhang2020TransOMCS,\n      author    = {Hongming Zhang and Daniel Khashabi and Yangqiu Song and Dan Roth},\n      title     = {TransOMCS: From Linguistic Graphs to Commonsense Knowledge},\n      booktitle = {Proceedings of International Joint Conference on Artificial Intelligence (IJCAI) 2020},\n      year      = {2020}\n    }\n\n## Others\nIf you have any other questions about this repo, you are welcome to open an issue or send me an [email](mailto:hzhangal@cse.ust.hk), I will respond to that as soon as possible.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHKUST-KnowComp%2FTransOMCS","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FHKUST-KnowComp%2FTransOMCS","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHKUST-KnowComp%2FTransOMCS/lists"}