├── .gitignore ├── README.md ├── configs ├── inferencer.yaml ├── ppl_inferencer.yaml ├── prerank.yaml └── retriever.yaml ├── env.yaml ├── inferencer.py ├── ppl_inferencer.py ├── prerank.py ├── requirements.txt ├── retriever.py ├── scripts ├── run_mdl.sh └── sst2 │ ├── run_local_e.sh │ ├── run_mdl.sh │ ├── run_prompting.sh │ ├── run_random.sh │ └── run_topk.sh └── src ├── __init__.py ├── dataset_readers ├── __init__.py ├── base_dsr.py ├── dataset_wrappers │ ├── __init__.py │ ├── ag_news.py │ ├── base.py │ ├── boolq.py │ ├── commonsense_qa.py │ ├── mnli.py │ ├── qnli.py │ ├── rte.py │ ├── snli.py │ ├── squad.py │ ├── sst2.py │ ├── sst5.py │ └── trec.py ├── inference_dsr.py ├── ppl_inference_cls_dsr.py ├── prerank_dsr.py └── retriever_dsr.py ├── datasets ├── __init__.py ├── instructions.py └── labels.py ├── metrics ├── __init__.py └── eval_datasets.py ├── models └── model.py └── utils ├── __init__.py ├── app.py ├── cache_util.py ├── calculate.py ├── collators.py ├── dpp_map.py ├── misc.py └── model_util.py /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/.gitignore -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/README.md -------------------------------------------------------------------------------- /configs/inferencer.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/configs/inferencer.yaml -------------------------------------------------------------------------------- /configs/ppl_inferencer.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/configs/ppl_inferencer.yaml -------------------------------------------------------------------------------- /configs/prerank.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/configs/prerank.yaml -------------------------------------------------------------------------------- /configs/retriever.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/configs/retriever.yaml -------------------------------------------------------------------------------- /env.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/env.yaml -------------------------------------------------------------------------------- /inferencer.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/inferencer.py -------------------------------------------------------------------------------- /ppl_inferencer.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/ppl_inferencer.py -------------------------------------------------------------------------------- /prerank.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/prerank.py -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/requirements.txt -------------------------------------------------------------------------------- /retriever.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/retriever.py -------------------------------------------------------------------------------- /scripts/run_mdl.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/scripts/run_mdl.sh -------------------------------------------------------------------------------- /scripts/sst2/run_local_e.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/scripts/sst2/run_local_e.sh -------------------------------------------------------------------------------- /scripts/sst2/run_mdl.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/scripts/sst2/run_mdl.sh -------------------------------------------------------------------------------- /scripts/sst2/run_prompting.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/scripts/sst2/run_prompting.sh -------------------------------------------------------------------------------- /scripts/sst2/run_random.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/scripts/sst2/run_random.sh -------------------------------------------------------------------------------- /scripts/sst2/run_topk.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/scripts/sst2/run_topk.sh -------------------------------------------------------------------------------- /src/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- -------------------------------------------------------------------------------- /src/dataset_readers/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/dataset_readers/base_dsr.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/src/dataset_readers/base_dsr.py -------------------------------------------------------------------------------- /src/dataset_readers/dataset_wrappers/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/src/dataset_readers/dataset_wrappers/__init__.py -------------------------------------------------------------------------------- /src/dataset_readers/dataset_wrappers/ag_news.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/src/dataset_readers/dataset_wrappers/ag_news.py -------------------------------------------------------------------------------- /src/dataset_readers/dataset_wrappers/base.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/src/dataset_readers/dataset_wrappers/base.py -------------------------------------------------------------------------------- /src/dataset_readers/dataset_wrappers/boolq.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/src/dataset_readers/dataset_wrappers/boolq.py -------------------------------------------------------------------------------- /src/dataset_readers/dataset_wrappers/commonsense_qa.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/src/dataset_readers/dataset_wrappers/commonsense_qa.py -------------------------------------------------------------------------------- /src/dataset_readers/dataset_wrappers/mnli.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/src/dataset_readers/dataset_wrappers/mnli.py -------------------------------------------------------------------------------- /src/dataset_readers/dataset_wrappers/qnli.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/src/dataset_readers/dataset_wrappers/qnli.py -------------------------------------------------------------------------------- /src/dataset_readers/dataset_wrappers/rte.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/src/dataset_readers/dataset_wrappers/rte.py -------------------------------------------------------------------------------- /src/dataset_readers/dataset_wrappers/snli.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/src/dataset_readers/dataset_wrappers/snli.py -------------------------------------------------------------------------------- /src/dataset_readers/dataset_wrappers/squad.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/src/dataset_readers/dataset_wrappers/squad.py -------------------------------------------------------------------------------- /src/dataset_readers/dataset_wrappers/sst2.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/src/dataset_readers/dataset_wrappers/sst2.py -------------------------------------------------------------------------------- /src/dataset_readers/dataset_wrappers/sst5.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/src/dataset_readers/dataset_wrappers/sst5.py -------------------------------------------------------------------------------- /src/dataset_readers/dataset_wrappers/trec.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/src/dataset_readers/dataset_wrappers/trec.py -------------------------------------------------------------------------------- /src/dataset_readers/inference_dsr.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/src/dataset_readers/inference_dsr.py -------------------------------------------------------------------------------- /src/dataset_readers/ppl_inference_cls_dsr.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/src/dataset_readers/ppl_inference_cls_dsr.py -------------------------------------------------------------------------------- /src/dataset_readers/prerank_dsr.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/src/dataset_readers/prerank_dsr.py -------------------------------------------------------------------------------- /src/dataset_readers/retriever_dsr.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/src/dataset_readers/retriever_dsr.py -------------------------------------------------------------------------------- /src/datasets/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/src/datasets/__init__.py -------------------------------------------------------------------------------- /src/datasets/instructions.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/src/datasets/instructions.py -------------------------------------------------------------------------------- /src/datasets/labels.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/src/datasets/labels.py -------------------------------------------------------------------------------- /src/metrics/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/metrics/eval_datasets.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/src/metrics/eval_datasets.py -------------------------------------------------------------------------------- /src/models/model.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/src/models/model.py -------------------------------------------------------------------------------- /src/utils/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- -------------------------------------------------------------------------------- /src/utils/app.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/src/utils/app.py -------------------------------------------------------------------------------- /src/utils/cache_util.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/src/utils/cache_util.py -------------------------------------------------------------------------------- /src/utils/calculate.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/src/utils/calculate.py -------------------------------------------------------------------------------- /src/utils/collators.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/src/utils/collators.py -------------------------------------------------------------------------------- /src/utils/dpp_map.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/src/utils/dpp_map.py -------------------------------------------------------------------------------- /src/utils/misc.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/src/utils/misc.py -------------------------------------------------------------------------------- /src/utils/model_util.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shark-NLP/self-adaptive-ICL/HEAD/src/utils/model_util.py --------------------------------------------------------------------------------