Create a doctor chatbot that carries out conversation regarding COVID-19
We present a Seq2Seq based conversational agent (chatbot) that can answer queries from patients regarding topics related to COVID-19.
The model uses patients’ COVID related questions and previous replies of the certified doctors scraped from the internet as input [1]. The model is trained with the attention based Transformer [2] architectures like GPT [3] and BART [4] to ensure it pays attention to important part of the input sequence when decoding.
Short user query | Long user query |
---|---|
See output.zip
for all outputs on test data.
python3 -m venv venv
source venv/bin/activate
pip3 install -r requirements.txt
Notebooks/Project_Notebook_BART.ipynb
for fine-tuning BART model on covid dataset
Notebooks/Project_Notebook_GPT2.ipynb
for fine-tuning GPT2 model on covid dataset
Notebooks/Project_Notebook_Transformer.ipynb
for training Transformer model on covid dataset
python3 evaluate.py --o output/transformer_output.txt
python3 evaluate.py --o output/gpt2_output.txt
python3 evaluate.py --o output/Bart_output.txt
Some of the Transformer outputs generated based on previous conversation and print as new samples, so the number of samples would be larger than others. For example:
--------------------example 53--------------------
Patient: is it safe to get care for my other medical conditions during this time ?
Reference: yes , it is important to continue taking care of your health and wellness . continue your medications , and do not change your treatment plan without talking to your healthcare provider . continue to manage your disease the way your healthcare provider has told you .
Predict: hello , your question on healthcare magic . in the of get cause as yes pneumonia .
--------------------example 54--------------------
Patient: is it safe to get care for my other medical conditions during this time ? [SEP] yes , it is important to continue taking care of your health and wellness . continue your medications , and do not change your treatment plan without talking to your healthcare provider . continue to manage your disease the way your healthcare provider has told you . [SEP] thanks a lot doctor .
Reference: no problem , let us know if you come across anything else .
Predict: brief opinion : ? covid - 19 in have from you like to - 19 . yes should if your . your in you like to covid - do with me ?
- [1] Covid MedDialog Dataset from UCSD-AI4H
- [2] Transformer adapted from this implementation
- [3] GPT2 implementation adapted from DialoGPT
- [4] BART implementation adapted from this blog
- Philip Cho
- Chenhao Wang
- Azmarie Wang