## 3 Automatic Explainer Video Generation
### A Software Architecture to Build AVG Based On CTP  
We propose a software architecture based on the previously presented methodology. Four modules form the architecture: declarative log, frame generation/local NLG, global NLG/storyelling and video generation.  
1. **Declarative log.** As is well known, traceability of neural network training is a very complex task because it employs so many neurons, connections and weights what it implies so many iterations. This module aims to capture the values of the data structures generated during an HNN execution and generate a declarative log from them that the next modules can use. Information about neurons, connections and weights will store using an ontology [58]. The reason for using a declarative log is double: first, we have a formal knowledge representation of the execution process, and second, it can help users to interpret the captured in the next phases, for example, when the system perform the content determination and planning phases. More formally, we define a symbolic video frame using a fact with the following form frame(id, action,[data_structures]); where action indicates the action performed in that instant of time identified by id and [data_structures] are the values of each data structure associate to a particular action. Therefore, the complete execution of an HNN is as follows: frame(1,action_1,[data_a1]). frame(2,action_2,[data_a2]).  
frame(n,action_n,[data_an]). We explain the transformation of this set of symbolic frames to visual ones in Section 4. Additionally, we describe technical details about the implementation in Section 6.
2. **Frames generation and local NLG.** This paper adopts the classical architecture of NLG systems, but we adapt it for automatic frames generation. An essential feature of our approach is that the system generates NL descriptions from internal representations of variables and data structures. It consists of the following steps: the content determination subsystem computes an explainer model of the result of the execution of HNNs. It employs two kinds of visual explanations: first-order representations for visually representing internal variables and data structures; and second-order ones for more abstract models of them. The system creates second-order ones from the first ones. It is fed to a planning system and identifies which parts of these representations must be explained and in what order.
3. **Global NLG--Storytelling.** This module implements the \"voice\" of the expert or teacher. The aim is to find the perfect combination of narrative and data. The idea is to employ storytelling as it is used in other disciplines as training and education contexts: to motivate and to illustrate. The standard approach to incorporating storytelling into a computational intelligent system are the well-known scripts. We employ a script based on classical presentations, i.e., we define the first frame with a little explanation about the presentation's context. Next, we put an index about the main items that we will explain during the video. Finally, we define a slide for the last remarks. On the other hand, we need to be capable of defining extra explainer slides on groups of local slides. This process can be seen as a global NLG system which takes as input a set frames (texts and visual explanations) and automatically create slides. Each extra slide is putting before them with an explanation about that group of slides. For example, an extra explainer slide for the training phase is the one created from the explanations of a group of slides generated to explain the training process. The same process could be performed for the pattern recognition phase (see Section 5).
4. **Video Generation.** This module aims to generate a video from a set of frames automatically. In this work, we do not address the automatic selection of the type of letters, colors, discourse, etc.