Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PubMed Query Optimizer

This project is a tool to optimize complex PubMed search queries by automatically removing redundant OR keywords. It uses a combination of query parsing and Selenium automation to streamline searches and ensure the query returns the desired results.

Overview

The tool:

  • Parses a PubMed search query into its nested components.
  • Identifies minimal operator groups (those containing AND/OR).
  • Reconstructs the query by wrapping each keyword in parentheses.
  • Uses Selenium to automate the PubMed search and verify result counts.
  • Iteratively removes redundant keywords to optimize the query.

Requirements

Installation

  1. Clone the Repository:

    git clone https://github.com/yourusername/pubmed-query-optimizer.git
    cd pubmed-query-optimizer
  2. Create a Virtual Environment (Optional but Recommended):

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

    pip install selenium
  4. Download ChromeDriver:

    • Visit ChromeDriver Downloads and download the version that matches your Chrome browser.
    • Make sure the chromedriver executable is in your PATH or in the project directory.

Usage

Run the main script with your PubMed query as a command-line argument:

python main.py --query "YOUR_QUERY_HERE"

About

A Python tool that automates optimization of complex PubMed search queries. It parses nested logical expressions, identifies and removes redundant OR keywords, and uses Selenium to verify search results on PubMed's Advanced Search page.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Used by

Contributors

Languages