Skip to content

A Medical Disease Diagnosis Chatbot with NLU, DM, and NLG implemented through RASA frameowork, Rules+ML, and Rules respectively.

License

Notifications You must be signed in to change notification settings

Rioichi03/Heydoc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

A Medical Disease Diagnosis Chatbot where the user first self-reports the symptoms, and then the Chatbots inquire about more symptoms to arrive at the diagnosis result.

Currently, the chatbot supports the following 12 medical diseases Diagnosis:

Asthma, Coronary heart disease, Pneumonia, Traumatic brain injury, Esophagitis, Enteritis, Rhinitis, Thyroiditis, Dermatitis, External otitis, Conjunctivitis, and Mastitis

Note: We implemented our Chatbot in MarkovML software, so this repo would also contain code for using the features like Experiment Tracking and Model Recording.

Demo

  • Self Reported Symptoms are Common

    This implies many diseases contain the symptoms reported in this category. So, the Chatbot would inquire whether other symptoms are observed to narrow down to one or two diseases.

    Demo1.mp4
  • Self Reported Symptoms are Unique and rare

    This implies few contain the symptoms reported in this category. So, the Chatbot would easily figure out the disease.

    Demo2.mp4

Architecture of DaargiBot:

Every Chatbot has three components: NLU, DM, and NLG.

We implemented NLU through RASA Framework,

DM through Rule Based Technique,

and NLG through Template Based Method

Here is the Architecture Describing things Inside each component and the Flow Diagram of DaargiBot:

DaargiBot

Contents of Repo

  • Data: This Folder contains the Data used for our Bot. It consists of CSV files for Disease Description, Symptoms of a particular disease, Severity Scores of each symptom, and Disease Precaution.
  • NLU: contains file for understanding user message. The code here extracts the user intent and entities related to that particular intent. We made the NLU component through RASA framework.
  • DM: This folder contains the file for deciding what action, i.e., whether to predict the Disease or inquire more about the symptoms, etc., should be taken by the bot at a certain state of the Chatbot Flow.
  • NLG: Contains the file to generate a Natural Language Response for the output from DM
  • Interaction: Files in this folder combines all three components of the Bot so the user can interact with it.

Installing the Chatbot

1. Downloading the Repo

  • Go to the Homepage of this Repo. Download the ZIP FILE from the "<> Code" button there.

    tempsnip

  • Extract the ZIP file where you want

  • Rename the Folder according to your wish. Lets rename the Downloaded folder(DaargiBot-main) to be - DaargiBot

2. Setting up virtual environment

pip3 install virtualenv
virtualenv DaargiBot

3. Opening up the Repo

cd DaargiBot

4. Activating Virtual Environment

source bin/activate

5. Downloading the Required Python Packages

pip3 install -r requirements.txt

Hurray, we are all set up!!

Running the Chatbot

Start your terminal and say the current terminal tab(in your mind) to be t1

1. Open up the DaargiBot Repo

cd DaargiBot

2. Activating Virtual Environment

source bin/activate

3. Run the run1.sh file

bash run1.sh

4. Open up another terminal tab and say it to be "t2"

Further Command would be run on this new terminal tab->t2

5. Repeat Steps 1, and 2

6. Run the run2.sh file

bash run2.sh

Hurray! We can Now Interact with the Chatbot but do read the Following-> "Instructions to Use" section

Instructions to Use the Chatbot

Before Reading this, do have a look at the Architecture Section of this Chatbot

There are six stages in our Chatbot DaargiBot - Page 2 (1)

  • S1: Here, the user may enter the Greeting Message.

    example: Hello or Hi. the chatbot then replies with a return greeting message.

    image

  • S2: The user needs to enter at least one symptom which is being observed by them or some other person.

    example: I am(or my child, mom, father etc) experiencing(or suffering, facing, noticing etc) cough in the morning(or any other symptom) and fatigue in the evening(or any other symptom). What could be the issue?

    image

  • S3: This stage follows the self-report or S2. If the symptoms reported in the stage are not strong enough to predict the disease then the chatbot in return, ask whether the patient suffered a particular symptom. This process continues until the chatbot gathers enough information about the symptoms to predict the disease. Here, the user needs to enter whether the patient suffered the symptom asked by the Chatbot

    example:

    for yes: yes, often, sometimes, etc. for no: no, don't, not, not very often, etc.

    image

  • S4: The chatbot predicts the Possible Disease after gaining enough information about symptoms.

    image

    The chatbot then provides suggestions by asking for the number of days symptoms are observed. The user needs to enter the number of days

    image

    Through the Number of days of suffering chatbot calculates the severity score.

    If the condition is less severe, then suggest precautions

    image

    If the condition is severe, then ask for a consultation

    image

  • S5: The user shows gratitude to the chatbot, and the chatbot, in turn, provides a supporting message.

    example: thanks, tq for the help, etc

    image

  • S6: Here, the user enters the leaving message, and the chatbot also replies with the leaving message

    example: Bye

    image

SWOT ANALYSIS

SWOTANALYSIS

Limitation

While the Daargi bot has the potential to enhance healthcare accessibility and ease the burden on healthcare providers, it has certain limitations that need to be considered. One of the major constraints is its limited accuracy due to its reliance on algorithms and natural language processing. The accuracy of its diagnosis is restricted by the quality and quantity of data available, and it can only predict the 41 diseases for which it has been trained. Therefore, there is a possibility that the Daargi bot may provide inaccurate information in some cases.

Another limitation of the Daargi bot is its limited training on 132 symptoms, which may not be sufficient to capture all possible variations in symptoms. An unusual symptom not included in the training dataset might lead to skewed results. Moreover, the Daargi bot is limited to predicting only a small set of diseases, and patients with complex or multiple health conditions may require a more comprehensive evaluation by a healthcare provider.

Future Scope

We plan on improving upon this idea as we see the potential it has to revolutionize the medical market and even the way we understand and tackle healthcare as a whole, despite some glaring issues it has right now. Our first step would be to expand our database, add new symptoms and map them to new diseases currently out of the scope of the DaargiBot. For this, we plan to acquire medical records and databases. The other major step we plan on taking at the earliest is to improve upon our current data storage protocols and integrate better privacy and security measures to uphold privacy and safeguard the sensitive data of our consumers. We would need to get in touch with a team of medical professionals and practicing lawyers to tackle the legal issues and the data acquisition problem. With our team fully assembled and above mentioned concerns dealt with, the DaargiBot shall not be limited to only being a diagnosis system but can also be upgraded to recommend medications and test procedures, thus reducing the workload of medical professionals, cutting down the cost incurred by the patients and streamlining the entire process.

Instructions to Contribution

To contribute towards the improvement of Daargi Bot, please follow the steps below:

  • Fork the repository: This creates a copy of the original repository on your GitHub account that you can work on.
  • Clone the repository: Clone the repository to your local machine by running git clone in your terminal. This will create a local copy of the repository that you can work on.
  • Create a new branch: Before making any changes, create a new branch by running git checkout -b in your terminal. This will create a new branch with the name that you can work on. Always make changes in a new branch rather than the main branch.
  • Make changes: Make changes to the code in your local copy of the repository. Once you are done making changes, save and commit them using the command git add. to add all changed files and git commit -m "your commit message" to commit your changes with a descriptive message.
  • Push changes: Once you have committed your changes locally, push them to your forked repository by running git push origin in your terminal.
  • Open a pull request: Once you have pushed your changes to your forked repository, open a pull request on the original repository. The owner of the original repository will then review your changes and either merge them or request changes.
  • Collaborate: If the owner of the repository requests changes, make the necessary changes in your local copy of the repository and push them to your forked repository. Once you are satisfied with your changes, open a new pull request. Remember to always communicate with your collaborators and follow any specific guidelines or conventions set by the repository owner.

Contributors

About

A Medical Disease Diagnosis Chatbot with NLU, DM, and NLG implemented through RASA frameowork, Rules+ML, and Rules respectively.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 88.7%
  • Python 11.3%