# DisBot: A Portuguese Disater Support Dynamic Knowledge Chatbot
## 4 DisBot Framework  
The conceived artifact, DisBot, receives messages and sends replies accordingly. In between these happenings, it needs to preprocess the messages it receives, which is done by tokenizing and extracting relevant features from these messages. Both of these actions are done using SpaCy ([[https://spacy.io/](https://spacy.io/)]([https://spacy.io/](https://spacy.io/))). After the messages have been preprocessed, the chatbot needs to retrieve relevant information from them. This step is called Natural Language Understanding (NLU), and it implies both the extraction of named entities and the classification of the user's intent, that is, the intention behind the user's message. Afterward, the Dialogue Management component consolidates the user's message with the previous steps of the conversation they have had, if any. This consists in understanding if this message is a dialogue turn of a previous story and mapping this message to its appropriate action. The last step on the Digital Assistant's pipeline consists in generating a response, which can go from simple tasks such as asking for clarification or replying with a predefined message, to custom and more complex actions, such as generating a new response based on the knowledge that is in the Dynamic Knowledge Base (DKB). The chatbot pipeline is illustrated in Figure 2.  
One of the main tools used in building our disaster support chatbot was RASA ([[https://rasa.com/](https://rasa.com/)]([https://rasa.com/](https://rasa.com/))). RASA is a machine learning framework for the automation of text- and voice-based assistants that allows for a higher level of abstraction when creating chatbots. We have specifically used RASA Open Source, the free version of the solution, which, although limited, has enough tools for the development of an effective chatbot. The reasons \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Capability** & **Dimension** & **Criteria** & **Objective Statement** \\ \hline SA \& IF & Goal & Efficacy & Effectively leveraging local disaster intelligence to improve citizen and first-responded Situational Awareness and Intelligence Fusion \\ SA \& IF & Environment & Consistency with people/Utility & Enabling information on existing disasters, as well as advice on emergency contacts and procedures \\ SA \& IF & Environment & Consistency with people/Understandability & Providing fluid and understandable human-like conversations (this criterion was only added on the 3 rd iteration of the DSRM process) \\ SA \& IF & Environment & Consistency with organization/Utility & Providing disaster management authorities with an alternative and automatic way of informing citizens \\ SA \& IF & Structure & Level of detail & Providing citizens with integrated local knowledge \\ SA \& IF & Evolution & Learning capability & Automatically learning about disaster intelligence and updating that knowledge mid disaster \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Objective statements to be used in the DSRM evaluation. Figure 2: DisBot framework. we have decided to use RASA over similar and more well-known tools, such as Google's Dialogflow ([[https://cloud.google.com/dialogflow](https://cloud.google.com/dialogflow)]([https://cloud.google.com/dialogflow](https://cloud.google.com/dialogflow))) or Facebook's Wit.ai ([[https://wit.ai/](https://wit.ai/)]([https://wit.ai/](https://wit.ai/))), were its very transparent development and its large open source community, which is responsible for giving this framework a very sophisticated NLU engine, as well as the capability of easily integrating external tools.