# A Context-Aware Conversational Agent in the Rehabilitation Domain
## 5 Language Understanding and Speech Synthesis  
Language understanding is a research field which has enjoyed considerable popularity and found application to a broad variety of consumer tasks (e.g., text categorisation, machine translation, and question answering). It focuses on text processing, and in the case of REA, it serves as a mediator between user input and the dialogue manager. Naturally, in order to proceed to the handling of text, user input first needs to be transcribed from audio to text format. This is where speech recognition, an equally popular task, comes into play, being a step of utmost importance; dependant on its performance is the quality of the transcribed text. Despite the exposure that speech recognition has had in recent times, many challenges have not been overcome yet, with issues like background noise, multi-user simultaneous input, homophones, and regional accents proving to be too much of an impediment to be tackled correctly, even by recent platforms. The same applies, though to a lesser extent, to the speech synthesis task, where even small amounts of latency or alterations in voice quality may disgruntle users, since people are sensitive to audio inadequacy. When examining the prospects of the available platforms that would compose REA's candidate list, the aforementioned issues where considered and the choices were narrowed down to Google, Acapela, and Innoetics for the speech recognition [37] task and to Snips, CMUSphinx, and Nuance for the text-to-speech one. The final criteria were language support, cost, and service quality. It was imperative that the platform of choice would support both English and Greek natively while also offer competitive subscription rates. Certainly, of paramount importance was the quality of the results that each service offered, since having to process a not well-crafted output which lacks in quality does not do justice to the system no matter how sophisticated and well organised it is. After careful consideration of all heuristics, Google's speech recognition services stood out, largely due to excellent support for Greek, while, concerning the text-to-speech services, Nuance's suite was the most suitable. **Language understanding**: In REA, the Google Cloud Speech-to-Text API converts user requests into text form. To process this input and to extract meaningful, system-exploitable information, raw text needs to be processed and augmented by specific NLP techniques that will also disambiguate probable semantic discrepancies. Text processing is handled by Stanford's CoreNLP suite [38], which performs linguistic analysis utilising tools like part-of-speech (POS) parsers, tokenisers, and chunkers to extract dependencies between sentence words, concepts, the underlying relations, named entities, etc. The produced output receives supplementary processing in order to retrieve probable disease/treatment-related relations in user queries by applying a hybrid relation extraction tool [39]. Properly linking the entities and concepts with the appropriate relations is a significant issue for interpreting the semantics of information and confronting complex information requirements. To achieve this goal, a process that connects entities according to their semantics is needed. The process disambiguates the concepts based on their context and links the entities with ontologies and semantic networks such as BabelNet and WordNet.