{"id":16778387,"url":"https://github.com/snexus/nlp-question-answering-system","last_synced_at":"2025-04-10T20:42:40.090Z","repository":{"id":162641788,"uuid":"303691224","full_name":"snexus/nlp-question-answering-system","owner":"snexus","description":"Question answering system with transformers","archived":false,"fork":false,"pushed_at":"2020-10-25T12:11:27.000Z","size":195,"stargazers_count":7,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T18:12:48.629Z","etag":null,"topics":["data-science","huggingface-transformers","nlp-machine-learning","transformers"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/snexus.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":"2020-10-13T12:11:28.000Z","updated_at":"2023-10-13T14:58:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"bf89d60b-1702-4770-b0d4-8f5bf97c7add","html_url":"https://github.com/snexus/nlp-question-answering-system","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/snexus%2Fnlp-question-answering-system","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snexus%2Fnlp-question-answering-system/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snexus%2Fnlp-question-answering-system/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snexus%2Fnlp-question-answering-system/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/snexus","download_url":"https://codeload.github.com/snexus/nlp-question-answering-system/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248293432,"owners_count":21079649,"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":["data-science","huggingface-transformers","nlp-machine-learning","transformers"],"created_at":"2024-10-13T07:27:35.408Z","updated_at":"2025-04-10T20:42:40.081Z","avatar_url":"https://github.com/snexus.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Question Answering System\n\nThis repository contains an implementation of the question-answering system. The main goal of the project is to learn working\nwith 🤗 transformers architecture by replacing the default head with a custom head suitable for the task, and fine-tuning using custom data.\nIn addition, the project tries to improve on the ability to recognise tricky (impossible) questions which are part of SQuAD 2.0 dataset.\nThis project **doesn't use** QA task head coming with HuggingFace transformers but creates the head architecture from scratch.\nThe same architecture is used to fine-tune 2 models, as described below. \n\nThe QA system is built using several sub-components:\n* HuggingFace's DistilBERT transformer with custom head, fine-tuned on SQuAD v2.0, using only possible questions.\n* HuggingFace's DistilBERT transformer with custom head, fine-tuned on SQuAD v2.0, using both - possible and non-possible questions.\n* Inference component, combining the output of both models.\n\nThe logic behind training two models - the former is a conditional model, trained only on correct question/answers pairs, \nwhile the latter additionally includes tricky questions with answers that can't be found in the context. \nThe idea is that combining the output of both models will improve the discrimination ability on impossible questions.\n\n## Web application \n\nExplore the QA system using application hosted on Streamlit Sharing:\nhttps://share.streamlit.io/snexus/nlp-question-answering-system/main\n\n## Installation and running\n\n*  Clone the repository.\n\n*  Create and activate conda environment:\n```shell script\nconda env create -f environment.yml\nconda activate nlp-question-answering-system\n```\n\n* Download the trained models:\nTODO - store on publicly available service.\n\n\n### Training\n\nDownload the SQuAD 2.0 dataset for training\n\n```shell script\ncd nlp-question-answering-system\n./get_data.sh\n```\n\n#### Training locally\n\n```shell script\npython train.py\n```\n\n\n#### Training on Google Colab\nGC allows using GPU accelerated training by using GPU enabled runtime. To change runtime type, use Runtime-\u003e Change runtime type.\n\nTo train with GC, use `google_colab_train.ipynb` from the notebooks folder.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnexus%2Fnlp-question-answering-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnexus%2Fnlp-question-answering-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnexus%2Fnlp-question-answering-system/lists"}