Skip to content

A powerful web-based application designed for Persian-speaking users to find medical specialists based on their symptoms and preferred city, integrated with https://doctoreto.com.

Notifications You must be signed in to change notification settings

armanjscript/Doctoreto-Assistant-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Doctoreto-Assistant-System

License: MIT Python 3.8+

A powerful web-based application designed for Persian-speaking users to find medical specialists based on their symptoms and preferred city, integrated with doctoreto.com. It leverages advanced AI models for symptom analysis and translation, and uses web automation to search for doctors. The application features a user-friendly interface with right-to-left (RTL) support, making it accessible and intuitive for its target audience.

Features

  • Multilingual Support: Processes Persian (RTL) input and output, with seamless translations to and from English.
  • AI-Powered Analysis: Uses language models to translate symptoms and recommend precise medical specialties.
  • Web Automation: Automates searches on doctoreto.com to find doctors based on the recommended specialty and user-specified city.
  • User-Friendly Interface: Built with Streamlit, offering an interactive and visually appealing experience with Persian font support.

Technologies Used

Technology Description
Python Core programming language for the application.
Streamlit Creates the interactive web-based user interface with RTL support.
LangChain Framework for building applications with language models.
LangChain-Ollama Integrates Ollama for translation and medical analysis tasks.
LangGraph Manages the workflow of translation and processing steps.
Selenium Automates web interactions with doctoreto.com.

Prerequisites

  • Python 3.8 or later: Download from python.org.
  • Ollama: A local AI server for running language models. Install from Ollama.
  • Google Chrome: Required for Selenium WebDriver automation.
  • ChromeDriver: Must match your Chrome version, available via ChromeDriver.
  • Internet Access: Required for accessing doctoreto.com and the font URL for styling.

Installation

  1. Install Python:

    • Ensure Python 3.8 or later is installed. Verify with:
      python --version
  2. Install Ollama:

    • Follow instructions at Ollama.
    • Pull the required models:
      ollama pull qwen2.5:latest
      ollama pull thewindmom/llama3-med42-8b:latest
    • Start the Ollama server:
      ollama serve
  3. Clone the Repository:

    git clone https://github.com/armanjscript/Doctoreto-Assistant-System.git
    cd Doctoreto-Assistant-System
  4. Install Python Libraries:

    pip install streamlit langchain langchain-ollama langgraph selenium python-dotenv
  5. Set Up Chrome and ChromeDriver:

    • Install Google Chrome if not already installed.
    • Download ChromeDriver matching your Chrome version from ChromeDriver.
    • Ensure ChromeDriver is in your system’s PATH or specify its path in the code if needed.
  6. Network Access:

Usage

  1. Run the Application:

    • Navigate to the project directory and start the Streamlit app:
      streamlit run main.py
    • Open your browser and go to http://localhost:8501 to access the application.
  2. Using the Application:

    • In the Streamlit interface, you’ll see the title "سامانه یافتن پزشک متخصص".
    • Enter your medical symptoms in Persian in the text area.
    • Enter your preferred city in the text input.
    • Click the "جستجوی پزشک" (Search Doctor) button.
    • The system will:
      • Translate symptoms to English.
      • Identify the appropriate medical specialty.
      • Translate the specialty back to Persian.
      • Open a browser window with search results from doctoreto.com.
    • A success or error message will appear in the Streamlit app.

How It Works

The Doctoreto-Assistant-System integrates natural language processing and web automation to deliver a seamless experience:

  1. User Input:

    • Users provide symptoms in Persian and a city via the Streamlit interface.
  2. Language Processing:

    • Symptoms are translated to English using the qwen2.5:latest model.
    • The English symptoms are analyzed to determine the medical specialty using the thewindmom/llama3-med42-8b:latest model.
    • The specialty is translated back to Persian.
  3. Web Automation:

    • Selenium WebDriver navigates to doctoreto.com, enters the Persian specialty and city, and submits the search.
    • The browser remains open, displaying the results.
  4. User Feedback:

    • Streamlit displays a success message if the search completes, or an error message if issues arise (e.g., city not found).

The workflow is orchestrated by LangGraph, ensuring efficient sequencing of tasks.

Limitations

  • External Dependencies: Relies on Ollama models and doctoreto.com. Changes or downtime in these services may disrupt functionality.
  • Translation Accuracy: The quality of symptom translation and specialty recommendation depends on the language models.
  • Geographical Scope: Limited to cities supported by doctoreto.com.
  • Browser Dependency: Requires Google Chrome and ChromeDriver; other browsers are not supported.
  • Network Stability: Needs a stable internet connection for web access and font loading.
  • Input Quality: Vague or incomplete symptom descriptions may lead to inaccurate recommendations.

Known Issues

  • Selenium Stability: Dynamic web elements on doctoreto.com may cause occasional failures (e.g., StaleElementReferenceException).
  • Timeouts: Fixed timeouts (10 seconds) may fail on slow networks.
  • Error Handling: Limited handling for edge cases like network interruptions or LLM failures.
  • Font Dependency: The external font URL may be inaccessible, affecting styling.

Future Improvements

  • Enhance error handling and logging for better debugging.
  • Optimize Selenium to reuse browser instances or use headless mode for efficiency.
  • Support additional browsers (e.g., Firefox) and platforms.
  • Improve UI/UX with progress indicators and input validation.
  • Integrate multiple doctor-finding platforms to reduce dependency on doctoreto.com.
  • Add unit tests for reliability.
  • Expand language support and ensure accessibility compliance.
  • Provide detailed documentation with example inputs and outputs.

Contributing

Contributions are welcome! Fork the repository, make changes, and submit a pull request. Ensure your code adheres to the project’s style and includes tests.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Disclaimer

This tool is for informational purposes only and should not be used as a substitute for professional medical advice. Always consult a qualified healthcare provider for medical decisions.

Contact

For questions or feedback, please contact [Arman Daneshdoost] at [armannew73@gmail.com].

About

A powerful web-based application designed for Persian-speaking users to find medical specialists based on their symptoms and preferred city, integrated with https://doctoreto.com.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages