{"id":13510692,"url":"https://github.com/primeqa/primeqa","last_synced_at":"2025-05-14T14:08:30.672Z","repository":{"id":37076156,"uuid":"503584900","full_name":"primeqa/primeqa","owner":"primeqa","description":"The prime repository for state-of-the-art Multilingual Question Answering research and development.","archived":false,"fork":false,"pushed_at":"2025-01-08T21:04:52.000Z","size":53454,"stargazers_count":732,"open_issues_count":24,"forks_count":57,"subscribers_count":28,"default_branch":"main","last_synced_at":"2025-05-01T00:42:14.101Z","etag":null,"topics":["ai","bert","dpr","ibm","ibm-research-ai","language-model","machine-learning","natural-language-processing","neural-information-retrieval","neural-search","nlp","python","pytorch","question-answering","semantic-search","squad","transfer-learning"],"latest_commit_sha":null,"homepage":"https://primeqa.github.io/primeqa","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/primeqa.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":"2022-06-15T02:15:41.000Z","updated_at":"2025-04-15T01:37:03.000Z","dependencies_parsed_at":"2023-09-26T19:49:19.742Z","dependency_job_id":"52f594f6-1ea5-45fc-98de-c9c04e540362","html_url":"https://github.com/primeqa/primeqa","commit_stats":{"total_commits":2149,"total_committers":58,"mean_commits":37.05172413793103,"dds":0.8510935318752908,"last_synced_commit":"a1e46325d60569b145326fcb6d29c0adc8a81c07"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primeqa%2Fprimeqa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primeqa%2Fprimeqa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primeqa%2Fprimeqa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primeqa%2Fprimeqa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/primeqa","download_url":"https://codeload.github.com/primeqa/primeqa/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254159804,"owners_count":22024564,"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":["ai","bert","dpr","ibm","ibm-research-ai","language-model","machine-learning","natural-language-processing","neural-information-retrieval","neural-search","nlp","python","pytorch","question-answering","semantic-search","squad","transfer-learning"],"created_at":"2024-08-01T02:01:50.294Z","updated_at":"2025-05-14T14:08:30.653Z","avatar_url":"https://github.com/primeqa.png","language":"Python","readme":"\u003c!---\nCopyright 2022 IBM Corp.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n--\u003e\n\n\u003ch3 align=\"center\"\u003e\n    \u003cimg width=\"350\" alt=\"primeqa\" src=\"docs/_static/img/PrimeQA.png\"\u003e\n    \u003cp\u003eThe Prime Repository for State-of-the-Art Multilingual Question Answering Research and Development.\u003c/p\u003e\n\u003c/h3\u003e\n\n![Build Status](https://github.com/primeqa/primeqa/actions/workflows/primeqa-ci.yml/badge.svg)\n[![LICENSE|Apache2.0](https://img.shields.io/github/license/saltstack/salt?color=blue)](https://www.apache.org/licenses/LICENSE-2.0.txt)\n[![sphinx-doc-build](https://github.com/primeqa/primeqa/actions/workflows/sphinx-doc-build.yml/badge.svg)](https://github.com/primeqa/primeqa/actions/workflows/sphinx-doc-build.yml)   \n\nPrimeQA is a public open source repository that enables researchers and developers to train state-of-the-art models for question answering (QA). By using PrimeQA, a researcher can replicate the experiments outlined in a paper published in the latest NLP conference while also enjoying the capability to download pre-trained models (from an online repository) and run them on their own custom data. PrimeQA is built on top of the [Transformers](https://github.com/huggingface/transformers) toolkit and uses [datasets](https://huggingface.co/datasets/viewer/) and [models](https://huggingface.co/PrimeQA) that are directly downloadable.\n\n\nThe models within PrimeQA supports End-to-end Question Answering. PrimeQA answers questions via \n- [Information Retrieval](https://github.com/primeqa/primeqa/tree/main/primeqa/ir): Retrieving documents and passages using both traditional (e.g. BM25) and neural (e.g. ColBERT) models\n- [Multilingual Machine Reading Comprehension](https://huggingface.co/ibm/tydiqa-primary-task-xlm-roberta-large): Extract and/ or generate answers given the source document or passage.\n- [Multilingual Question Generation](https://huggingface.co/PrimeQA/mt5-base-tydi-question-generator): Supports generation of questions for effective domain adaptation over [tables](https://huggingface.co/PrimeQA/t5-base-table-question-generator) and [multilingual text](https://huggingface.co/PrimeQA/mt5-base-tydi-question-generator).\n- [Retrieval Augmented Generation](https://github.com/primeqa/primeqa/blob/main/notebooks/retriever-reader-pipelines/prompt_reader_with_GPT.ipynb): Generate answers using the GPT-3/ChatGPT pretrained models, conditioned on retrieved passages. \n\nSome examples of models (applicable on benchmark datasets) supported are :\n- [Traditional IR with BM25](https://github.com/primeqa/primeqa/tree/main/primeqa/ir/) Pyserini\n- [Neural IR with ColBERT, DPR](https://github.com/primeqa/primeqa/tree/main/primeqa/ir) (collaboration with [Stanford NLP](https://nlp.stanford.edu/) IR led by [Chris Potts](https://web.stanford.edu/~cgpotts/) \u0026 [Matei Zaharia](https://cs.stanford.edu/~matei/)).\nReplicating the experiments that [Dr. Decr](https://huggingface.co/ibm/DrDecr_XOR-TyDi_whitebox) (Li et. al, 2022) performed to reach the top of the XOR TyDI leaderboard.\n- [Machine Reading Comprehension with XLM-R](https://github.com/primeqa/primeqa/tree/main/primeqa/mrc): to replicate the experiments to get to the top of the TyDI leaderboard similar to the performance of the IBM GAAMA system. Coming soon: code to replicate GAAMA's performance on Natural Questions. \n\n## 🏅 Top of the Leaderboard\n\nPrimeQA is at the top of several leaderboards: XOR-TyDi, TyDiQA-main, OTT-QA and HybridQA.\n\n### [XOR-TyDi](https://nlp.cs.washington.edu/xorqa/)\n\u003cimg src=\"docs/_static/img/xor-tydi.png\" width=\"50%\"\u003e\n\n### [TyDiQA-main](https://ai.google.com/research/tydiqa)\n\u003cimg src=\"docs/_static/img/tydi-main.png\" width=\"50%\"\u003e\n\n### [OTT-QA](https://codalab.lisn.upsaclay.fr/competitions/7967)\n\u003cimg src=\"docs/_static/img/ott-qa.png\" width=\"50%\"\u003e\n\n### [HybridQA](https://codalab.lisn.upsaclay.fr/competitions/7979)\n\u003cimg src=\"docs/_static/img/hybridqa.png\" width=\"50%\"\u003e\n\n## ✔️ Getting Started\n\n### Installation\n[Installation doc](https://primeqa.github.io/primeqa/installation.html)       \n\n```shell\n# cd to project root\n\n# If you want to run on GPU make sure to install torch appropriately\n\n# E.g. for torch 1.11 + CUDA 11.3:\npip install 'torch~=1.11.0' --extra-index-url https://download.pytorch.org/whl/cu113\n\n# Install as editable (-e) or non-editable using pip, with extras (e.g. tests) as desired\n# Example installation commands:\n\n# Minimal install (non-editable)\npip install .\n\n# GPU support\npip install .[gpu]\n\n# Full install (editable)\npip install -e .[all]\n```\n\nPlease note that dependencies (specified in [setup.py](./setup.py)) are pinned to provide a stable experience.\nWhen installing from source these can be modified, however this is not officially supported.\n\n**Note:** in many environments, conda-forge based faiss libraries perform substantially better than the default ones installed with pip. To install faiss libraries from conda-forge, use the following steps:\n\n- Create and activate a conda environment\n- Install faiss libraries, using a command\n\n```conda install -c conda-forge faiss=1.7.0 faiss-gpu=1.7.0```\n\n- In `setup.py`, remove the faiss-related lines:\n\n```commandline\n\"faiss-cpu~=1.7.2\": [\"install\", \"gpu\"],\n\"faiss-gpu~=1.7.2\": [\"gpu\"],\n```\n\n- Continue with the `pip install` commands as desctibed above.\n\n\n### JAVA requirements\nJava 11 is required for BM25 retrieval. Install java as follows:\n\n```shell\nconda install -c conda-forge openjdk=11\n```\n## :speech_balloon: Blog Posts\nThere're several blog posts by members of the open source community on how they've been using PrimeQA for their needs. Read some of them:\n1. [PrimeQA and GPT 3](https://www.marktechpost.com/2023/03/03/with-just-20-lines-of-python-code-you-can-do-retrieval-augmented-gpt-based-qa-using-this-open-source-repository-called-primeqa/)\n2. [Enterprise search with PrimeQA](https://heidloff.net/article/introduction-neural-information-retrieval/)\n3. [A search engine for Trivia geeks](https://www.deleeuw.me.uk/posts/Using-PrimeQA-For-NLP-Question-Answering/)\n\n\n## 🧪 Unit Tests\n[Testing doc](https://primeqa.github.io/primeqa/testing.html)       \n\nTo run the unit tests you first need to [install PrimeQA](#Installation).\nMake sure to install with the `[tests]` or `[all]` extras from pip.\n\nFrom there you can run the tests via pytest, for example:\n```shell\npytest --cov PrimeQA --cov-config .coveragerc tests/\n```\n\nFor more information, see:\n- Our [tox.ini](./tox.ini)\n- The [pytest](https://docs.pytest.org) and [tox](https://tox.wiki/en/latest/) documentation    \n\n## 🔭 Learn more\n\n| Section | Description |\n|-|-|\n| 📒 [Documentation](https://primeqa.github.io/primeqa) | Full API documentation and tutorials |\n| 🏁 [Quick tour: Entry Points for PrimeQA](https://github.com/primeqa/primeqa/tree/main/primeqa) | Different entry points for PrimeQA: Information Retrieval, Reading Comprehension, TableQA and Question Generation |\n| 📓 [Tutorials: Jupyter Notebooks](https://github.com/primeqa/primeqa/tree/main/notebooks) | Notebooks to get started on QA tasks |\n| 📓 [GPT-3/ChatGPT Reader Notebooks](https://github.com/primeqa/primeqa/tree/main/notebooks/mrc/LLM_reader_predict_mode.ipynb) | Notebooks to get started with the GPT-3/ChatGPT reader components|\n| 💻 [Examples: Applying PrimeQA on various QA tasks](https://github.com/primeqa/primeqa/tree/main/examples) | Example scripts for fine-tuning PrimeQA models on a range of QA tasks |\n| 🤗 [Model sharing and uploading](https://huggingface.co/docs/transformers/model_sharing) | Upload and share your fine-tuned models with the community |\n| ✅ [Pull Request](https://primeqa.github.io/primeqa/pull_request_template.html) | PrimeQA Pull Request |\n| 📄 [Generate Documentation](https://primeqa.github.io/primeqa/README.html) | How Documentation works |        \n| 🛠 [Orchestrator Service REST Microservice](https://primeqa.github.io/primeqa/orchestrator.html) | Proof-of-concept code for PrimeQA Orchestrator microservice |        \n| 📖 [Tooling UI](https://primeqa.github.io/primeqa/tooling_ui.html) | Demo UI |        \n\n## ❤️ PrimeQA collaborators include       \n\n| | | | |\n|:-------------------------:|:-------------------------:|:-------------------------:|:-------------------------:|\n|\u003cimg width=\"75\" alt=\"stanford\" src=\"docs/_static/img/collab-stanford-circle.png\"\u003e| Stanford NLP |\u003cimg width=\"75\" alt=\"i\" src=\"docs/_static/img/collab-i-circle.png\"\u003e| University of Illinois |\n|\u003cimg width=\"75\" alt=\"stuttgart\" src=\"docs/_static/img/collab-stuttgart-circle.png\"\u003e| University of Stuttgart | \u003cimg width=\"75\" alt=\"notredame\" src=\"docs/_static/img/collab-notredame-circle.png\"\u003e| University of Notre Dame |\n|\u003cimg width=\"75\" alt=\"ohio\" src=\"docs/_static/img/collab-ohio-circle.png\"\u003e| Ohio State University |\u003cimg width=\"75\" alt=\"carnegie\" src=\"docs/_static/img/collab-carnegie-circle.png\"\u003e| Carnegie Mellon University |\n|\u003cimg width=\"75\" alt=\"massachusetts\" src=\"docs/_static/img/collab-massachusetts-circle.png\"\u003e| University of Massachusetts |\u003cimg width=\"75\" height=\"75\" alt=\"ibm\" src=\"docs/_static/img/collab-ibm-circle.png\"\u003e| IBM Research |\n| | | | |\n\n\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cdiv align=\"center\"\u003e\n    \u003cimg width=\"30\" alt=\"primeqa\" src=\"docs/_static/primeqa_logo.png\"\u003e\n\u003c/div\u003e\n","funding_links":[],"categories":["Python","ai"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprimeqa%2Fprimeqa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprimeqa%2Fprimeqa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprimeqa%2Fprimeqa/lists"}