Skip to content

Repository files navigation

Ayurvedic and Pharmaceutical Recommendations System

Note

This project was created for a college student during freelance work. It is not intended for commercial use or production environments, and is maintained solely for educational and portfolio demonstration purposes.

Overview

An intelligent web platform that leverages machine learning to recommend Ayurvedic remedies and pharmaceutical medicines based on user queries. Users can enter natural language descriptions of their symptoms to predict the underlying disease and get recommended Ayurvedic remedies, dosage instructions, and recovery times. Alternatively, users can search for specific diseases to get pharmaceutical drug recommendations.

Key Features

  • AI-Powered Symptom Analysis: Input natural language symptoms to classify the underlying disease using a Support Vector Machine (SVM) classifier.
  • Dual Treatment Paradigm: Offers both traditional Ayurvedic home remedies and modern pharmaceutical drug prescriptions.
  • Intelligent Query Matching: Fuzzy-string matching to map user queries to known medical conditions.
  • Secure Session-Based User Registration & Login: Simple authentication for personalized greeting and dashboard access.

Dataset Distribution Graph

Disease Class Distribution


Architecture

The project follows the standard Model-View-Template (MVT) architecture pattern of Django:

  • Machine Learning Backend: Integrated SVM classifier (predict.py) trained on a symptoms-to-disease corpus with TF-IDF vectorization.
  • Fuzzy Matching Logic: Built-in similarity metrics to translate imprecise user search terms into clean dataset lookups.
  • Database Layer: SQLite database containing user records.

Folder Structure

PharmaRecommendation/
├── PharmaReccomenddation/      # Django project configuration settings & URLs
│   ├── settings.py
│   └── urls.py
├── main/                       # Main Django web application logic
│   ├── templates/              # HTML frontend templates
│   ├── predict.py              # ML classifier & Text cleaning logic
│   ├── views.py                # Dashboard & API endpoint views
│   └── models.py               # User details schema
├── dataset/                    # Reference CSV files for disease recommendations
│   ├── Disease2Symptoms.csv
│   ├── Disease2ayurvedic.csv
│   ├── Disease2medicine.csv
│   └── Symptom2Disease.csv
├── models/                     # Saved ML model checkpoint folder
├── requirements.txt            # Python dependencies
└── manage.py                   # Django CLI entry point

Technologies

  • Backend: Django, Python
  • Machine Learning & NLP: Scikit-Learn, Pandas, NLTK
  • Database: SQLite3
  • Frontend: HTML, CSS, JavaScript (Vanilla, Montserrat & Open Sans web typography)

Installation

Prerequisites

  • Python 3.8+
  • Pip (Python package manager)

Local Setup

  1. Clone the Repository:

    git clone https://github.com/harshidkoladara/PharmaRecommendation.git
    cd PharmaRecommendation
  2. Create a Virtual Environment:

    python -m venv venv
    source venv/bin/activate  # On Windows use: venv\Scripts\activate
  3. Install Dependencies:

    pip install -r requirements.txt
  4. Configure Environment Variables: Create a .env file in the root directory and copy the contents from .env.example:

    cp .env.example .env
  5. Apply Database Migrations:

    python manage.py makemigrations
    python manage.py migrate
  6. Run the Development Server:

    python manage.py runserver

    Open your browser and navigate to http://127.0.0.1:8000/.


Usage

1. Registration and Authentication

  • Create a new user profile using the signup screen (/regi/).
  • Log in with your email address to access the dashboard.

2. Get Ayurvedic Remedies for Symptoms

  • Navigate to the Classification tab.
  • Enter a sentence describing how you feel (e.g., I have high fever, chills, and muscle aches).
  • Click Predict to view the classified disease and its corresponding Ayurvedic treatment.

3. Get Pharmaceutical Medicine recommendations

  • Navigate to the Classification tab.
  • In the second input area, enter a disease name (e.g., Malaria or Typhoid).
  • Click Predict to query suggested pharmaceutical drug treatments.

Troubleshooting

  • NLTK Data Lookup Errors: The application automatically checks and downloads required NLTK resources (punkt and stopwords) at runtime. If network restrictions prevent this, download them manually via terminal:
    import nltk
    nltk.download('punkt')
    nltk.download('stopwords')
  • Database Lock / Constraint Issues: Run python manage.py migrate to ensure the sqlite schema matches the updated model structures.

About

An intelligent Django web application combining SVM-based symptom classification and fuzzy query matching to recommend Ayurvedic and pharmaceutical treatments.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages