# Chatots for Cultural Venues: A Topic-Based Approach
## 2 Materials and Methods
### Mapping of Structured Information to Google DialogFlow Elements
Figure 3:2 Modeling of a reflective topic as an intent, registering related exhibits as follow-up intents. Another type of content that the chatbot should be able to offer is information about the museum itself, its opening hours, the museum administration, etc. This content is organized under a top-level intent 'About the museum', which is linked under the default welcome intent as a follow-up intent. Listing 1 presents the algorithm for creating the chatbot using the information model presented in Section 2.1. ```
startingPoint=createDefaultWelcomeIntent(); museumInfo=createMuseumInfoIntent(); startingPoint.addFollowUpIntent(museumInfo); FOREACHnavigationPathINgetAllNavigationPaths()DO itineraryEntryIntent=createEntryIntent(infoPresentationPath); exhibitsInItinerary=navigationPath.getNavigationPathElements(); //the'previous'variablewillbeusedtoprovidefornext/previousnavigation style previous=itineraryEntryIntent; FOREACHexhibitINexhibitsInItineraryDO content=exhibit.getInformation(); IF(content.length<PRESENTATIONLENGTHTHRESHOLD)THEN exhibitIntent=content.createIntent(); ELSE //Splitthecontenttochunks contentChunks=content.splitToChunks(); //theentrypointfortheexhibitisthefirstinformationchunk exhibitIntent=contentChunks[0].createIntent(); previousChunk=exhibitIntent; //iterateoverremainingchunks FOREACHchunkINcontentChunks[1:]DO chunkIntent=chunk.createIntent(); //add'previous/next'buttons IF(previousChunk<>contentChunks[0])THEN previousChunk.addNavigation(chunkIntentIntent,'Next'); chunkIntent.addNavigation(previousChunk,'Previous'); chunkIntent.addNavigation(exhibitIntent,'Returntoexhibit'); ENDIF ENDFOR//FOREACHchunk ENDIF //linktoitineraryentrypoint exhibitIntent.addNavigation(itineraryEntryIntent,'Returntoreflective point'); itineraryEntryIntent.addFollowUpIntent(exhibitIntent); //add'previous/next'buttons IF(previous<>itineraryEntryIntent)THEN previous.addNavigation(exhibitIntent,'Next'); exhibitIntent.addNavigation(previous,'Previous'); //Ifthepreviousexhibitissplitintochunks,addnavigationtochunks,//allowingtheusertoskipdetailchunks,movingtothenextexhibit IF(previous.IsChunked())THEN FOREACHchunkINprevious.getChunks()DO chunk.addNavigation(exhibitIntent,'Nextexhibit'); ENDFOR//FOREACHchunk ENDIF ENDIF previous=exhibitIntent; ENDFOR//FOREACHexhibit//Linktheitinerarytothewelcomeintent startingPoint.addFollowUpIntent(itineraryEntryIntent); ENDFOR//FOREACHinfoPresentationPath//publishtheathototpublishChatbotpublishChatbot(startingPoint);

### Automating the Creation of Chatbots

The procedure described in Section 2.2 prescribes a method for utilizing the data from an appropriately modeled information repository and working through the interactive environment of Google DialogFlow to create the chatbot. This work is tedious and error-prone, especially when working with repositories with large number of exhibits and/or multiple navigation paths, as it necessitates additional work when exhibit content is updated to mirror these updates to the chatbot. To this end, we have explored methods for automating the chatbot creation process presented in this section and we provide the following details:

1. describing how the necessary data can be extracted from the repository hosting the information model presented in Section 2.1;
2. detailing how the data can be mapped to appropriate representations that can be directly imported to the Google DialogFlow engine. At this point, it is worth noting that chatbots running on top of the Google DialogFlow engine automatically utilize the advanced features of the Google DialogFlow platform for user interaction with the chatbot, including natural language processing for input, text-to-speech for output, and so forth. Therefore, in the following paragraphs we do not address issues related to the user interaction with the chatbot, including NLP features, but only focus on the mapping of the chatbot model to the structures of the Google DialogFlow engine.