## 2 Methodology
### Data Collection
#### 2.2.2 The Swahili-Speaking Social Robot Mathematics Tutor  
In light of the findings of the pilot study, we decided to customise an actual, contextualised, Swahili-speaking NAO robot that could teach a mathematics topic. For demonstration purposes, we selected the topic of \"The Place Values of Digits in Whole Numbers\", primarily because it is a foundational topic upon which other key mathematical concepts are built [26; 27]. Moreover, it is a topic taught in many grades at the beginning of the academic year; thus, no matter when the study took place, pupils would be familiar with it. We used OpenAI's GPT-3.5 as our LLM of choice to facilitate comprehension and feedback generation. This decision was motivated by the fact that GPT models have proven successful in generating general knowledge-based and mathematics content even for more complex topics, but more specifically, GPT-3.5 is faster in generating responses, which is important given the slow and unstable Internet connectivity in Tanzania [28]. To enable natural, dialogue-based interaction, we leveraged the Microsoft Azure Speech Services (speech recognition and text-to-speech). These services enabled NAO to listen and speak in both Swahili and English. The selection of the Microsoft Azure Speech Services followed the fact that they support the Tanzanian variant of the Swahili language ([[https://ai.azure.com/explore/models/aiservices/Azure-Al-Speech/version/1/registry/azureml-cogsvc/tryout/texttospecech#voicegallery](https://ai.azure.com/explore/models/aiservices/Azure-Al-Speech/version/1/registry/azureml-cogsvc/tryout/texttospecech#voicegallery)]([https://ai.azure.com/explore/models/aiservices/Azure-Al-Speech/version/1/registry/azureml-cogsvc/tryout/texttospecech#voicegallery](https://ai.azure.com/explore/models/aiservices/Azure-Al-Speech/version/1/registry/azureml-cogsvc/tryout/texttospecech#voicegallery)), accessed on 8 November 2023). Moreover, mathematics is a subject that is best understood through visuals and illustrations. Unfortunately, the NAO robot, unlike Aldebaran's PEPPER robot, does not have a screen attached to its torso. Therefore, we used the Python Kiyy framework v2.2.1 to develop an application linked to the NAO robot, which would display the respective content and examples as the [PERSON] narrates. Furthermore, we installed the application on a laptop with a touchscreen, which enabled pupils to interact with the robot by selecting menu options such as (1) begin session, (2) next question, and (3) end session. The application was also used as a platform for pupils to provide answers to questions posed by [PERSON], to which [PERSON] provided appropriate feedback in the form of either praise or correction (and encouragement). Additionally, to ensure that teachers understood that [PERSON]'s capabilities were not limited to teaching the one math topic, we developed a second system that involved the NAO robot carrying out a conversation based on any topic. The system enabled interactions through voice, which is the natural way for humans to interact. To further personalise  
Figure 1: Teachers watching a video of a NAO robot teaching arithmetic. and contextualise the interactions, we included in the prompts context parameters such as the location (country: Tanzania), the person's name and age, the language of interaction (Swahili or English), purpose of the interaction, the role to be assumed by [PERSON]--who in this scenario plays the character of a teacher--and [PERSON]'s female Swahili name--[PERSON]. We also implemented a conversation history function that stores the utterances of both parties in the ongoing conversation. This enabled GPT-3.5 to provide responses tailored to the conversation and probe relevant topics to keep the conversation going. This approach has proven successful in a similar study [29]. Furthermore, we implemented a function that evaluates the tone of each user's message to detect whether they wish to end the conversation.