Skip to content

Local Chapter project

Leveraging NLP in Medical Prescription Administration and Information

ChatbotLarge Language Models (LLMs)API interfaceWeb scraping
Start date
January 30, 2025
Finish date
March 6, 2025
Project status
completed
Leveraging NLP in Medical Prescription Administration and Information

Challenge background

There are numerous commercial caregivers running businesses unethically, without rules, guidelines, or adherence to standards. Therefore, we aim to develop a web app that provides accurate medication information for underlying illnesses in the African sub-region. This app will be easily accessible on social media platforms, helping to educate users on proper medication, especially after purchases from local chemists and pharmacies. Common illnesses include malaria, typhoid, HIV, tuberculosis, and a range of other diseases with easily analyzable symptoms. Using machine learning, the app will classify user input to predict possible illnesses, with or without a medical history. It will then provide a corresponding medication plan with standard dosage and administration recommendations for each drug.

The problem

There are many drug users under prescription without first-hand information on drug administration leading to drug misuse and abuse, and also misconception of some medication for other illnesses, this web app will not only recommend appropriate drugs but give information on dosage and administration.

Goal of the project

  1. Build comprehensive data on pharmaceutical prescriptions 
  2. Develop a good model with smooth accuracy to predict medications based on symptoms.
  3. Use NLP in healthcare and medicine as part of AI for humanity contribution.
  4. Understand principles of machine learning using Natural language processing.
  5. Deploy a web app that is functional and easy to use.

Project timeline

  1. 1

    Week 1

    Data Collection:  

    • Data Sources:  Identify and list all data sources (e.g. public health databases, medical journals, hospital records, and pharmaceutical data).
    • Data Acquisition: Scrape data from online sources using libraries like BeautifulSoup and Scrapy.
    • Collect structured data from APIs using requests or http.client.
    • Data storage: Store raw data in a centralized repository.
  2. 2

    Week 2

    Data Preprocessing:

    • Deduplication: Remove duplicate entries.     
    • Handling Missing Values: Use techniques like imputation or removal of rows/columns with missing data.
    • Normalization: Normalize text data (e.g., converting to lowercase, removing punctuation).
    • Tokenization: Split text into words or phrases using libraries like NLTK or spaCy.
    • Stop Words Removal: Remove common words that do not add significant meaning.
    • Stemming and Lemmatization: Reduce words to their root forms.
  3. 3

    Week 3

    Exploratory Data Analysis (EDA):  

    • Visualization: Use libraries like Matplotlib and seaborn to visualize data distributions and relationships.
    • Statistical Analysis: Perform statistical tests to understand data characteristics.
  4. 4

    Week 4

    Model Building:        

    • Feature Engineering: Create features that can help improve model performance.
    • Model Selection: Choose appropriate models for NLP tasks, such as:
    • Text Classification: Using algorithms like Random Forest, SVM, or deep learning models like RNNs and Transformers (e.g., BERT).
    • Named Entity Recognition (NER): Identify disease names, symptoms, and medications.
    • Training and Validation: Split data into training and validation sets, train models, and tune hyperparameters.
  5. 5

    Week 5

    Web App Creation:

    • API Development: Develop REST APIs using Flask or FastAPI to serve the   model.
    • Build an interactive web application using Streamlit to compose and display prescriptions.
  6. 6

    Week 6

    Deployment deploy web app on Streamlit:

    • Performance Monitoring: Set up monitoring to track model performance and make necessary adjustments.
    • Documentation: Document all processes, code, and decisions made during the project.

What you'll learn

  1. Apply NLP Techniques to Healthcare: Understand how Natural Language Processing (NLP) can be used to analyze medical information, extract relevant insights, and provide practical solutions for healthcare challenges.
  2. Develop End-to-End NLP Applications: Gain practical skills in the complete cycle of developing an NLP application, from data collection to model deployment, and user interface design.
  3. Work with Real-World Healthcare Data: Develop the ability to handle, clean, process, and analyze real-world healthcare data.
  4. Deploy a Web Application: Gain experience in the full lifecycle of deploying a web-based application, including API development, and user-interface creation, testing and deployment

Get involved

What to expect from a Local Chapter project

First project

  • Welcomes beginners and experienced practitioners.
  • Focuses on education and collaborative delivery.
  • Produces open-source project work.

Benefits

  • Address a significant real-world problem with your skills.
  • Build your project portfolio.
  • Demonstrate your work to organizations and project partners.

Requirements

  • Working English communication.
  • A learning mindset.
  • Commitment to collaborative project work.