{"id":18401681,"url":"https://github.com/borealisai/autocast-plus-plus","last_synced_at":"2025-04-14T12:12:01.574Z","repository":{"id":248647347,"uuid":"784899655","full_name":"BorealisAI/autocast-plus-plus","owner":"BorealisAI","description":"[ICLR'24] AutoCast++: Enhancing World Event Prediction with Zero-shot Ranking-based Context Retrieval","archived":false,"fork":false,"pushed_at":"2024-07-16T06:42:55.000Z","size":200,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-14T12:11:54.882Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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":"2024-04-10T19:30:05.000Z","updated_at":"2025-03-29T06:09:27.000Z","dependencies_parsed_at":"2024-07-16T09:14:04.636Z","dependency_job_id":null,"html_url":"https://github.com/BorealisAI/autocast-plus-plus","commit_stats":null,"previous_names":["borealisai/autocast-plus-plus"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BorealisAI%2Fautocast-plus-plus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BorealisAI%2Fautocast-plus-plus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BorealisAI%2Fautocast-plus-plus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BorealisAI%2Fautocast-plus-plus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BorealisAI","download_url":"https://codeload.github.com/BorealisAI/autocast-plus-plus/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248877959,"owners_count":21176244,"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":[],"created_at":"2024-11-06T02:39:38.367Z","updated_at":"2025-04-14T12:12:01.554Z","avatar_url":"https://github.com/BorealisAI.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# AutoCast++: Enhancing World Event Prediction with Zero-shot Ranking-based Context Retrieval\nThis repository contains the code for the ICLR'24 paper [AutoCast++: Enhancing World Event Prediction with Zero-shot Ranking-based Context Retrieval](https://arxiv.org/abs/2310.01880).\n\n![model](assets/autocastpp.png)\n\n## Get Started\n* Setup python environment\n```bash\nconda create -n autocastpp python=3.8\nconda activate autocastpp\npip install -r requirements.txt\n```\n* Download datasets\n```bash\n# download autocast dataset\nmkdir -p datasets/source\n\nwget -P datasets/source https://people.eecs.berkeley.edu/~hendrycks/autocast.tar.gz \n\ntar -xvf datasets/source/autocast.tar.gz -C datasets\n\nln -s $(pwd)/datasets/autocast/autocast_questions.json competition/autocast_questions.json\nln -s $(pwd)/datasets/autocast/autocast_questions.json autocast_experiments/data/autocast_questions.json\n\nln -s $(pwd)/datasets/autocast/negated_tf_questions.json autocast_experiments/data/negated_tf_questions.json\nln -s $(pwd)/datasets/autocast_cc_news_retrieved.json autocast_experiments/data/autocast_cc_news_retrieved.json\n\n# download CC news corpus\n# use the source data shared by the author, link: https://github.com/andyzoujm/autocast/issues/2\ngdown https://drive.google.com/uc?id=1-9bK_3fl41GyCeMrzfneItu5VT0Qx0rZ -O datasets/source/cc_news.tar.gz\n# a more stable way to download from google drive: https://stackoverflow.com/a/67550427/8683446\n# export ACCESS_TOKEN=XXX\n# export FILE_ID=19xbJYuIbzNuKus8vkvQ2GzRJ52U9mAY2\n# export FILE_NAME=cc_news.tar.gz\n# curl -H \"Authorization: Bearer $ACCESS_TOKEN\" https://www.googleapis.com/drive/v3/files/$FILE_ID?alt=media -o $FILE_NAME \n\ntar -xvf datasets/source/cc_news.tar.gz -C datasets\n```\n* Structure of the `datasets` folder\n```\ndatasets\n├── autocast\n│   ├── autocast_questions.json\n│   ├── negated_tf_questions.json\n│   └── README.md\n├── cc_news\n│   ├── dataset.arrow\n│   ├── dataset_info.json\n│   └── state.json\n└── source\n    ├── autocast.tar.gz\n    └── cc_news.tar.gz\n```\n\n* Processing the CC news corpus\n```bash\n# step 1: information retrieval\nbash retrieve_cc_news_bm25+ce.sh\n\n# step 2: creating training data\npython autocast_experiments/data/process.py --static_only\n# see retriever_utils/recency_rerank.py and retriever_utils/data_reorg.py for obtaining recency and relevance scores\n```\n\n* Download huggingface t5 models\n\nPlease do `cd autocast_experiments` before running the following commands.\n```python\nimport transformers\ntokenizer = transformers.T5Tokenizer.from_pretrained('t5-small', model_max_length=1e6, cache_dir='huggingface_cache')\ntokenizer = transformers.T5Tokenizer.from_pretrained('t5-base', model_max_length=1e6, cache_dir='huggingface_cache')\ntokenizer = transformers.T5Tokenizer.from_pretrained('t5-large', model_max_length=1e6, cache_dir='huggingface_cache')\ntokenizer = transformers.T5Tokenizer.from_pretrained('t5-3b', model_max_length=1e6, cache_dir='huggingface_cache')\nt5 = transformers.T5ForConditionalGeneration.from_pretrained('t5-small', cache_dir='huggingface_cache')\nt5 = transformers.T5ForConditionalGeneration.from_pretrained('t5-base', cache_dir='huggingface_cache')\nt5 = transformers.T5ForConditionalGeneration.from_pretrained('t5-large', cache_dir='huggingface_cache')\nt5 = transformers.T5ForConditionalGeneration.from_pretrained('t5-3b', cache_dir='huggingface_cache')\n```\n\n* Training of vanilla baseline models\n```bash\nbash train.sh large 10 0.0 4 30 6 cosine 1e-4 0.01 0.10\n# see train.sh for more details\n```\n\n## Citation\n\nIf you find our work useful in your project, please consider citing:\n\n    @article{yan2023autocast++,\n    title={Autocast++: Enhancing world event prediction with zero-shot ranking-based context retrieval},\n    author={Yan, Qi and Seraj, Raihan and He, Jiawei and Meng, Lili and Sylvain, Tristan},\n    journal={arXiv preprint arXiv:2310.01880},\n    year={2023}\n    }\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborealisai%2Fautocast-plus-plus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fborealisai%2Fautocast-plus-plus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborealisai%2Fautocast-plus-plus/lists"}