Skip to content

Patients are recommended drugs based on their condition and reviews of the drugs from other patients. They can submit their own review of the drug as well that would help future patients.

License

Notifications You must be signed in to change notification settings

Asha-Gutlapalli/Drug-Recommendation-System-based-on-the-Condition-of-the-Patient-using-BERT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Drug Recommendation System based on the Condition of the Patient using Bidirectional Encoder Representations from Transformers

Patients are recommended drugs based on their condition and reviews of the drugs from other patients. They can submit their own review of the drug as well that would help future patients. A BERT model fine-tuned on text classification was employed for this objective where it identifies whether the reviewer recommends or does not recommend a particular medicine.

BERT

BERT is the Bidirectional Encoder Representations from Transformers developed by Google. It is a attention mechanism that unlike a regular transformer consists only of an encoder network. It learns the correlation between words by ingesting the entire sequence of tokens at once. BERT is pre-trained on two NLP tasks namely Masked Langauge Modelling (MLM) and Next Sentence Prediction (NSP). In simple words, MLM facilitates BERT to understand the relationship between words while NSP facilitates BERT to understand the relationship between sentences. BERT can be used to finetune on a wide range of NLP applications such as classification, Question Answering, and Named Entity Recognition to name a few.

Install Packages

Install required libraries using the following command:

$ pip install -r requirements.txt

Files

  • /notebooks: Notebooks on BERT and MongoDB
  • /assets: All images and GIFs displayed on this README.md
  • utils.py: Consists of helper functions for MongoDB and Streamlit
  • model.py: BERT model
  • run.py: Streamlit app

Train, Evaluate, and Test

Check out the notebook BERT.ipynb to train, evaluate, and test your own model on custom datasets.

MongoDB

Follow the steps below to set up your own collection using MongoDB:

Connect MongoDB to Streamlit

Read this tutorial to connect MongoDB to Streamlit.

Run Streamlit App

Use the following command to run Streamlit App:

$ streamlit run run.py

  You can now view your Streamlit app in your browser.

  Local URL: http://localhost:8501
  Network URL: http://192.168.1.4:8501

Check out the GIFs below for demonstrations!

Home

Patient Reviews

Submit Feedback

About

Patients are recommended drugs based on their condition and reviews of the drugs from other patients. They can submit their own review of the drug as well that would help future patients.

Topics

Resources

License

Stars

Watchers

Forks