Skip to content

DrugDoseFinder: A Python tool that uses fuzzy name matching and RDF graphs to search for drugs and retrieve their dosage information. Designed for accurate querying and easy integration with personalized medical RDF datasets.

License

Notifications You must be signed in to change notification settings

agnivadas/DrugDoseFinder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DrugDoseFinder

GPL License DrugDoseFinder Maintenance Static Badge

An RDF-based tool to search and retrieve drug doses from a personalized knowledge graph.

📋 Description

DrugDoseFinder is a command-line Python application that allows users to search for drug names in an RDF graph and retrieve the associated dosage information. The tool leverages fuzzy string matching to suggest the best matches for user input, making it robust to minor typos or variations in drug names.

This project integrates:

RDF-based data storage using RDFLib Fuzzy matching via FuzzyWuzzy Structured querying to fetch drug details and dosage. This tool is ideal for healthcare professionals and developers managing RDF-based medical datasets.


🚀 Features

  • Multiple RDF File Support: Load and combine data from multiple RDF files
  • Fuzzy Drug Name Search: Automatically suggests the best matches for queried drug names.
  • Dose Information Retrieval: Fetch dosage details (rdf:hasDose) for the matched drug.
  • User-Friendly Interface: Select from suggested results interactively.
  • Extensible RDF Integration: Easily connect with custom RDF files containing drug data.

🛠️ Technologies Used

  • Python 3
  • RDFLib: Library for parsing and querying RDF graphs.
  • FuzzyWuzzy: For fuzzy string matching.

⚙️ Requirements:

1.Ensure you have the following dependencies installed:

  • Python 3.7 or later
  • Rdflib & fuzzywuzzy
pip install rdflib fuzzywuzzy python-Levenshtein
  1. Download or clone this project.

▶️ Usage:

  1. Run the script with:
python search_dose.py

or open the search_dose.py file directly.

  1. Input Drug Name: Enter the name of the drug you want to search. For example:
Enter the drug name to search: Atropine
  1. Select from Suggested Matches If matches are found based on fuzzy search, you'll see a list like:
Matches (choose the drug from below and enter number of it):


1. atropine
2. Atropine PO
3. hydrocodone/homatropine
4. difenoxin/atropine
5. atropine/pralidoxime
6. diphenoxylate/atropine
7. atropine IV/IM

Choose the correct option by entering its number.

  1. View Dose Information The tool fetches the RDF triple for dosage (rdf:hasDose):

  2. No Matches If no relevant matches are found, the system prompts you to raise an issue for updating the RDF data.


⚙️ How It Works:

1 Load RDF Files

  • The script loads all specified RDF files(database1.rdf,database2.rdf) into an RDFLib graph.
  1. Extract Drug Names
  • The drug names are extracted using the predicate hasName.
  1. Fuzzy Search
  • FuzzyWuzzy compares user input to available drug names and ranks matches.
  1. User Selection

-Users can select from suggested matches based on confidence scores.

  1. Dose Retrieval

The RDF graph is queried for the corresponding hasDose triple and the dosage is displayed.


🔗 License

This project is licensed under the GNU License.


🤝 Contributing

Contributions are welcome!

  • Fork the repository
  • Submit a pull request with improvements
  • Any suggestion for modification of database is welcome

Enjoy accurate drug name searches and precise dosage lookups! 🚀

About

DrugDoseFinder: A Python tool that uses fuzzy name matching and RDF graphs to search for drugs and retrieve their dosage information. Designed for accurate querying and easy integration with personalized medical RDF datasets.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages