Empowering Healthcare Queries: A Chatbot for Converting Text to SQL
摘要
In the healthcare industry, retrieving accurate patient and medical data in real time is essential for decision-making. However, healthcare providers often lack the technical expertise to query databases. Many chatbots struggle with ambiguous questions from non-SQL users, leading to inaccurate or incomplete SQL queries. Additionally, existing models lack error correction and alternative query formulation. This study presents a text-to-SQL chatbot for healthcare professionals to access medical data using natural language. We compared ‘ChatGPT-4o’ and ‘all-MiniLM-L6-v2’ for handling ambiguous healthcare queries and error correction. Microsoft Azure was used to develop the healthcare database, integrating Named Entity Recognition and context management for improved efficiency. Results showed that ChatGPT-4o outperformed all-MiniLM-L6-v2, achieving 92% execution accuracy and 90% error-handling success, highlighting the chatbot’s effectiveness in assisting non-technical users.