# Chatots for Cultural Venues: A Topic-Based Approach
## 2 Materials and Methods
### Mapping of Structured Information to Google DialogFlow Elements
#### 2.3.2 Automating Mapping of Data to DialogFlow Information Elements
** Algorithm for mapping intents created by the algorithm in Listing 1 to DialogFlow representation. FUNCTION mapToDialogFlow(chatbot) directory = createEmptyDirectory(); FOR EACH intent IN chatbot.getAllIntents() DO // Create and populate a new dialogFlow intent construct dialogFlowIntent = new DialogFlowIntent(); dialogFlowIntent.id = intent.getId().toUUID(); dialogFlowIntent.name = intent.getTitle(); // create the content of the element content = new DialogFlowResponse(); content.messages[0].type = 0; // 0 means that this is the content content.messages[0].title = intent.getTitle(); content.messages[0].speech = intent.getContent(); // add the content to the DialogFlow intent construct dialogFlowIntent.responses.append(content); // map navigation links FOREACH link in intent.getLinks() DO // Create the DialogFlow structure of the link dialogFlowLink = new DialogFlowResponse(); dialogFlowLink.action = link.target(); dialogFlowLink.messages[0].type = \"suggestion chips\"; dialogFlowLink.messages[0].suggestions[0].title = link.getNavigationText(); // add the link to the DialogFlow intent construct dialogFlowIntent.responses.append(dialogFlowLink); END FOR // FOREACH link // add parent link, if present IF (intent.getParentIntent() < NULL) THEN dialogFlowIntent.parentId = intent.getParentIntent().getId().toUUID(); END IF // Create appropriate JSON file filename = directory.path + '/' + dialogFlowIntent.id + '.json'; dialogFlowIntent.saveAsJSON(filename); END FOR // FOR EACH intent // create zip file createZipFile(chatbot.name + \".zip\", directory.path); END FUNCTION // FUNCTION mapToDialogFlow ```
Listing 6 presents an excerpt of a JSON file, corresponding to an exhibit of the museum. ``` { \"id\": \"0e6a460b-3206-4d06-a8d2-9999172f82d4\", \"parentId\": \"778473 fc-857b-4216-a00b-4e2d4d3e8853\", \"name\": \"Appearance Antiohis - more \", \"contexts\": [ \"AntiohisAppearance-followup\" ], \"responses\": [ { \"action\": \"AntiohisAppearance.AntiohisAppearance-more\", \"messages\":{  \"type\": \"suggestion_chips\",  \"suggestions\":[  {  \"title\": \"More...\"  }  },  {  \"type\": \"0\",  \"title\": \"Appearance Antiohis - more\",  \"speech\":[  \"The clothes you are wearing today, did you choose them simply because you liked them or you want to tell something to the world? Ancient societies also found appearance important and clothes often function as a code between the person and the world. Archaeologist use items' appearance to understand what this person was and the society he or she belonged to.\"  ]  ]  ]  ]  ]  ]  ]  ]

## 3 Results

In this section we present the results of the application of the methodology described in Section 2 for the implementation of a chatbot for the Museum of Tripolis, Greece. The chatbot was named 'Pu', after the Greek word 'Tlo\(\acute{o}\)' meaning 'where'. The data used for the chatbot were collected in the context of the CrossCult project [46]. On top of the DialogFlow implementation, the Kommunicate user interface was integrated ([[https://www.kommunicate.io/product/dialogflow-integration](https://www.kommunicate.io/product/dialogflow-integration)]([https://www.kommunicate.io/product/dialogflow-integration](https://www.kommunicate.io/product/dialogflow-integration)), accessed on 13 July 2023), to offer a more interactive and user-friendly environment. ### Implementation of the Chatbot

This chatbot is based on a modeling that uses two distinct approaches for the organization of exhibits. The first one is based on 'Reflective Topics', where the following navigation paths are discerned:

1. Education;
2. Appearance;
3. Daily life;
4. Religion and rituals;
5. Immortality/mortality;
6. Social status;
7. Names/animals/myths. Due to resource constraints, only the first three reflective topics in the list above were implemented in 'Pu'. The second approach is based on the types of the exhibits, where exhibits are classified in the following categories:

1. Status;
2. Bass reliefs;
3. Figurines;
4.