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.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Empowering Healthcare Queries: A Chatbot for Converting Text to SQL

  • Nyashadzashe Tamuka,
  • Khulumani Sibanda

摘要

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.