# Context-Based Model for Browsing the Web Through Voice
## 5 Model Functionalities for Voice-Based Web Browsing
### User Context Generation
#### 5.1.1 User Profile
The User Context Manager starts the process by invoking the LoadSurvey- WelcomeScreen() and ReproduceWelcome() methods from the Multi-modal User Interface, which display a welcome message and play the audio instructions;  
The User Context Manager sets the variable i = 1, which indicates the current question number;  
A loop then controls the repetition of the steps required for the 12 questions that make up the survey:  
The User Context Manager invokes the Load&PlayQuestion() method from the Multi-modal User Interface to present the current question (\(Q_{i}\)) and the related images (\(Img_{i}\)), and play the associated instruction (\(I_{i}\));The user responds to the question by voice;
6. The User Context Manager invokes the Speech2 Text() method from the Natural Language Translator that converts voice response to text;
7. The Natural Language Translator returns the user's response converted to text;
8. The User Context Manager validates the answer according to the question, which results in the alternative block (ALT) with the following options: * If the response is invalid, a loop is started and terminated upon receipt of a valid response. At each iteration, the User Context Manager prompts the Multi-modal User Interface to display a notification explaining the reason for the invalidity (9a). The Multi-modal User Interface then presents the current question again and plays its instruction (10a). The user provides their answer (11a), then the Natural Language Translator converts it from speech to text (12a and 13a), and the User Context Manager validates the answer again (14a); * If the answer is valid, the User Context Manager processes the corresponding text to extract the data (9b), updates the User Context table with the obtained data (10b) and increments the question counter (_i_) by one to advance to the next question (11b). When \(i>12\), the main loop is terminated, indicating that the survey is complete. Figure 4: Sequence diagram for obtaining user profile data. Processing Survey ResponsesAs mentioned above, user responses are processed (see step 9b in Figure 4) according to the specific characteristics of each question. Two types of responses are considered:  
* Answers to closed-ended questions: these responses are usually limited to a set of options, and they are short or have a specific data type. Therefore, response processing and data extraction take into account the particular situations of each question. For example, in the question \"How old are you?\", it is desired to extract an integer numeric value that falls within a range representing a valid age. The value is extracted from the text string, considering that age can be represented by numeric symbols, such as \"8\", or through words, such as \"eight\";
* Answers to open-ended questions: these responses are not limited to a fixed set of options and may vary in length and content. Therefore, they are analyzed using natural language processing techniques such as text preprocessing, syntactic analysis, and dependency parsing. To perform these tasks, we use Stanford CoreNLP [39] server, a widely adopted natural language processing toolkit that provides robust linguistic analysis, including the aforementioned techniques. The steps to process these responses and generate terms that are descriptive of the user's context are detailed below: 1. Preprocessing: the user's response in text format is processed by converting it to lowercase. The text is then split into words. Irrelevant words such as articles, fillers, and conjunctions, are removed;
2. Syntactic analysis: the text resulting from the preprocessing step is used as input. The words are labeled according to their grammatical category, such as nouns, verbs, adjectives, or adverbs. In addition, an analysis of the dependency relationships between words is performed. As a result, a dataset is generated containing the words with their corresponding grammatical category and the labels of the dependency relations between words;
3.