COVID Question Answering Model
Table of Contents
COVID-19 is a global crisis and has impacted much more than just public health. It has led to an outburst of information, which needs to be organized, validated, and timely made available to the seekers. The research proposes a transformer-based Question Answering (QA) system for COVID-19 questions from the biomedical domain.
- Python – 3.7.11
- TensorFlow – 2.5.0
- PyTorch – 1.9.0+cu102
- Transformer – 4.9.2
- Datasets – 1.11.0
- SpaCy – 2.2.4
- NLTK – 3.2.5
- Textstat – 0.7.2
The work can be replicated well using Google Colab. First of all, we need to mount the google drive. The next important step is to select the patameters carefully (provided in a section in the script). The scripts should be executed in the following sequence:
- Question Classification
- Question Classification Model Training: 1_BERT_Question_Classifier_Classifier.ipynb
- Question Class Prediction: 2_COVID_Question_Type_Prediction.ipynb
- Exploratory Data Analysis
- EDA: 3_Detailed_Exploratory_Data_Analysis.ipynb!
- Finetuing
- GPU: 4_GPU_Second_Stage_Finetuning_roberta-base-squad2.ipynb
- TPU: 5_TPU_Second_Stage_Finetuning_roberta-base-squad2.ipynb
- Model Evaluation
- All Checkpoints: 6_Evaluate_checkpoints_after_model_training.ipynb
- Single model: 7_Evaluate_single_model_roberta-squad2.ipynb
- Improved Model Inferences with score
- Improed model inferences: 8_Improved_inference_with_scores.ipynb
- External Answer Verification Mechanism
- Answer verification: 9_External_Answer_Verification_Model_Training_&_Predictions.ipynb
Please install the above packages in colab before execution of any script. Most of the scripts will have command to install the required packages.
The finetuned model can be downloaded from here It can be used as a backend model to predict answer for any COVID-19 question (given the context).
We are yet to see the impact of the following on the COVID-19 Question Answering Network performance:
- Impact of incremental datasets
- Increase the model vocabulary by adding words from COVID-19 domain
- Finetune (sentence + question) classification with BERT for answer verification module
- Analysis of why some question types are hard to answer
Name - Amar Kumar
Project Link: https://github.com/akbism/COVID-QA
- [Hugging Face] (https://colab.research.google.com/github/huggingface/notebooks/blob/master/examples/question_answering.ipynb)
- [Question Classification] (https://colab.research.google.com/github/amankedia/Question-Classification-using-BERT/blob/master/QuestionClassificationUsingBERT(Coarse).ipynb)
- [PyTorch TPU Implementation] (https://colab.research.google.com/drive/1dVEfoxGvMAKd0GLnrUJSHZycGtyKt9mr#scrollTo=declared-pioneer)
- [Model Evaluation] (https://colab.research.google.com/github/fastforwardlabs/ff14_blog/blob/master/_notebooks/2020-06-09-Evaluating_BERT_on_SQuAD.ipynb)
- [Answer Verfication] (https://colab.research.google.com/github/fastforwardlabs/ff14_blog/blob/master/_notebooks/2020-06-09-Evaluating_BERT_on_SQuAD.ipynb)