IndexDataset generationCreate deep learning modelInput formQuestion formMemory formResponse formNowadays instant messaging applications like Whatsapp, Instagram etc. they are becoming the trend in communication. If Chatbots follows the simplicity of an instant messaging application, it will truly succeed. The hospital booking system is a text-based application, so the user can interact with the bot easily. Below are the steps to build the system: Say no to plagiarism. Get a tailor-made essay on "Why Violent Video Games Shouldn't Be Banned"? Get an original essay Generate dataset with human-bot dialogues to get a doctor's appointment Build the deep learning model and train the model with the dataset Build a simple real-time chat system and integrate the model into the new chat system. Generating Datasets Datasets are generated using the random() function in the Python language. Various patterns with the same meaning are listed together, for example "can you make an appointment", "I want an appointment", "I would like to book an appointment", "can I have an appointment", and each sentence is randomly selected using the random() function . The conversation is based on facts such as specialty, doctor's name, appointment day, and patient profile that contain characteristics such as the patient's gender and age. An example knowledge base of the proposed system is shown in Table 3.1. Based on the facts provided by the user, an API call with these specifications will be issued and a token number will be generated. User can change the features as per his wish. API calls are also updated as the specifications change. From this information, a set of thousands of samples is generated as training datasets, another thousand as test datasets and finally a thousand as validation datasets. These three are mutually exclusive datasets. During model fitting, the train dataset can produce higher accuracies in each epoch, which shows signs of overfitting. Then the validation dataset can be used for early stopping regularization. Build a deep learning model Two variations of memory networks are used to build the system: end-to-end memory networks and gated end-to-end memory networks. Both models are similar in architecture except for the memory upgrade. The architecture can be divided into four modules: input module, question module, memory module and response module. Input form Each conversation includes a user utterance and a bot response. Here an embedding matrix A is used to embed the sentence in a continuous space and obtain the vector representation. So, at time t, the user's previous expression (c_1^u,…,c_(t-1)^u) and the bot's responses (c_1^r,…c_(t-1)^r) are added to memory. m=(AΦ(c_1^u ),AΦ(c_1^r ),…,AΦ(c_(t-1)^u ),AΦ(c_(t-1)^r )) where Φ(.) is a mapping function that associates each statement with a set of words of size V and A which is the embedding matrix. Question formAlso the user's last statement c_t^u is embedded using the same matrix A which givesq=AΦ(c_t^u) which serves as the initial state of the controller. Memory Module The memory module runs an attention mechanism on memory to find the salient parts of the previous conversation that are relevant to producing a response. The controller defined in the questions module will perform the attention process. The mach between the user expression q and the memory m already defined in the input form is calculated by taking the product.
tags