BACKGROUND
The current coronavirus disease 2019 (COVID-19) pandemic limits daily activities, even contact between patients and primary care providers. This makes it more difficult to provide adequate primary care services, which include connecting patients to an appropriate medical specialist. A smartphone-compatible AI chatbot that classifies patients’ symptoms and recommends the appropriate medical specialty could provide a valuable solution.
OBJECTIVE
In order to establish a contactless method of recommending the appropriate medical specialty, this study aims to construct a deep learning-based natural language processing (NLP) pipeline and to develop an artificial intelligence (AI) chatbot that can be used on a smartphone.
METHODS
We collected 118,008 sentences containing information on symptoms with labels (medical specialty), conducted data cleansing, and finally constructed a pipeline of 51,134 sentences for this study. Several deep learning models, including four different Long Short-Term Memory (LSTM) models with or without attention and with or without a pretrained FastText embedding layer as well as Bidirectional Encoder Representations from Transformers (BERT) for NLP, were trained and validated using a randomly selected test dataset. The performance of the models was evaluated by the precision, recall, F1 score and area under the receiver operating characteristic curve (AUC). An AI chatbot was also designed to make it easy for patients to use this recommendation system. We used an open-source framework called Alpha to develop our AI chatbot. This takes the form of a web application with a frontend chat interface capable of conversing in text and a backend cloud-based server application to handle data collection, process the data with a deep learning model, and offer the medical specialty recommendation in a responsive web which is compatible with both desktops and smartphones.
RESULTS
The BERT model yielded the best performance, with an AUC of 0.964 and F1 score of 0.768, followed by LSTM with embedding vectors, with an AUC of 0.965 and F1 score of 0.739. Considering the limitations of computing resources and the wide availability of smartphones, the LSTM model with embedding vectors trained on our dataset was adopted for our AI chatbot service. We also deployed an Alpha version of the AI chatbot to be executed on both desktops and smartphones.
CONCLUSIONS
With the increasing need for telemedicine during the current COVID-19 pandemic, an AI chatbot based on a deep learning-based NLP model that can recommend a medical specialty to patients using their smartphones would be exceedingly useful. The chatbot allows patients to quickly and contactlessly identify the proper medical specialist based on their symptoms, and so may support both patients and primary care providers.