{"id":18816141,"url":"https://github.com/orionw/followir","last_synced_at":"2025-04-13T22:21:33.851Z","repository":{"id":228796532,"uuid":"774926923","full_name":"orionw/FollowIR","owner":"orionw","description":"FollowIR: Evaluating and Teaching Information Retrieval Models to Follow Instructions","archived":false,"fork":false,"pushed_at":"2024-07-03T01:57:34.000Z","size":85182,"stargazers_count":42,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T12:39:12.532Z","etag":null,"topics":["information","instructions","llm","retrieval","search"],"latest_commit_sha":null,"homepage":"https://arxiv.org/abs/2403.15246","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/orionw.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}},"created_at":"2024-03-20T13:02:54.000Z","updated_at":"2025-03-20T14:19:30.000Z","dependencies_parsed_at":"2024-04-08T21:25:11.615Z","dependency_job_id":"98a461d1-9a1a-4435-aa4b-8a636e53383d","html_url":"https://github.com/orionw/FollowIR","commit_stats":null,"previous_names":["orionw/mteb-instruct","orionw/followir"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orionw%2FFollowIR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orionw%2FFollowIR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orionw%2FFollowIR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orionw%2FFollowIR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orionw","download_url":"https://codeload.github.com/orionw/FollowIR/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248789752,"owners_count":21161887,"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":["information","instructions","llm","retrieval","search"],"created_at":"2024-11-07T23:52:36.278Z","updated_at":"2025-04-13T22:21:33.765Z","avatar_url":"https://github.com/orionw.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eFollowIR: Evaluating and Teaching Information\nRetrieval Models to Follow Instructions\u003c/b\u003e\u003c/h1\u003e\n\n\u003ch4 align=\"center\"\u003e\n    \u003cp\u003e\n        \u003ca href=\"#links\"\u003eModel/Data Links\u003c/a\u003e |\n        \u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e |\n        \u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e |\n        \u003ca href=\"https://huggingface.co/spaces/mteb/leaderboard?task=instructionretrieval\"\u003eLeaderboard\u003c/a\u003e |\n        \u003ca href=\"#citing\"\u003eCiting\u003c/a\u003e |\n    \u003cp\u003e\n\u003c/h4\u003e\n\nOfficial repository for the paper [FollowIR: Evaluating and Teaching Information Retrieval Models to Follow Instructions](https://arxiv.org/abs/2403.15246). Official evaluation can be done by installing the `mteb` library and evaluating your MTEB compatible model with zero (or only a few) lines of code changes!\n\n## Links\n| Binary |                                                                 Description                                                                |\n|:------|:-------------------------------------------------------------------------------------------------------------------------------------------|\n| [FollowIR-7B](https://huggingface.co/jhu-clsp/FollowIR-7B) |   7B parameter model that does document reranking given a query and instructions. It is finetuned from Mistral-7B on the datasets below  | \n| [FollowIR-train](https://huggingface.co/datasets/jhu-clsp/FollowIR-train) | The dataset used to train FollowIR-7B. It consists of TREC instructions and queries, and GPT generated synthetic documents that have been filtered. |\n| [FollowIR-train-raw](https://huggingface.co/datasets/jhu-clsp/FollowIR-train-raw) |  The pre-filtered version of the train set above. This was not used in model training as some GPT generated data is incorrect. |              \n\nYou can also find the individual annotated test data ([Robust04](https://huggingface.co/datasets/jhu-clsp/robust04-instructions), [Core17](https://huggingface.co/datasets/jhu-clsp/core17-instructions), and [News21](https://huggingface.co/datasets/jhu-clsp/news21-instructions)) although the format is best used with MTEB's evaluation code.\n\n## Installation \nIf you wish to reproduce the experiments in the paper you can use the following code:\n\n```bash\ngit clone https://github.com/orionw/FollowIR.git\ncd FollowIR/\nconda create -n followir python=3.9 -y\nconda activate followir\npip install -r requirements.txt\nbash launch_all_jobs.sh\n```\n\n## Usage \nIf your model is `SentenceTransformer` compatible and requires no special tokens for concatenating the query and instructions, you can simply use the following one line command: \n```bash\nmteb -m $MODEL_NAME -t $DATASET\n```\nfor each of the datasets in `{Robust04InstructionRetrieval, Core17InstructionRetrieval, News21InstructionRetrieval}`\n\nIf you have a bi-encoder model but want to do something different than simply appending the instruction to the query with a space, you can extend `DenseRetrievalExactSearch` and check for `instructions` in kwargs. See (see [models/base_sentence_transformers/](https://github.com/orionw/mteb-instruct/tree/master/models/base_sentence_transformers) as a starting place for small modifiations and [models/e5/](https://github.com/orionw/mteb-instruct/tree/master/models/e5/evaluate_e5.py) for an example with larger modifications).\n\n### Reranker Usage\n\nRerankers have now been added to MTEB! If you are using a reranker model, you will need to extend the `DenseRetrievalExactSearch` class and define an `__init__` and `predict` function (see [models/rerankers section](https://github.com/orionw/mteb-instruct/tree/master/models/rerankers/reranker_models.py) for a variety of reranker examples). Your predict function should take in `input_to_rerank` which will be a tuple of the form:\n```python\n# if there are no instructions, instructions will be a list of Nones\n# Instructions will be present for all of the FollowIR datasets\nqueries, passages, instructions = list(zip(*input_to_rerank))\n```\n\nYour `predict` function should use these and return a list containing a score for each tuple item.\n\n\n## Citing\n\nIf you found the code, data or model useful, free to cite:\n\n```bibtex\n@misc{weller2024followir,\n      title={FollowIR: Evaluating and Teaching Information Retrieval Models to Follow Instructions}, \n      author={Orion Weller and Benjamin Chang and Sean MacAvaney and Kyle Lo and Arman Cohan and Benjamin Van Durme and Dawn Lawrie and Luca Soldaini},\n      year={2024},\n      eprint={2403.15246},\n      archivePrefix={arXiv},\n      primaryClass={cs.IR}\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forionw%2Ffollowir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forionw%2Ffollowir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forionw%2Ffollowir/lists"}