# Hybridization of Intelligent Solutions Architecture for Text Understanding and Text Generation
## 4 Implementation  
The proposed approach can be implemented in the form of specifically designed patterns or as a part of the logic of a multi-agent system. The second option provides automatic generation of expounders and organization of their interaction in the process of text understanding. Both solutions require unified software architecture capable of supporting the process of expounder hybridization at the software level.  
Figure 1: Expounder hybridization scheme.  
Below, a logical model of software architecture is introduced for intelligent solutions of text understanding and text generation based on the concept of expounders' hybridization, presented in the form of UML class diagrams.  
The basic object that is analyzed in the system is a document (see Figure 2, where 1.-* and 0.-* identify cardinality in UML notation). The document can be uploaded to the system in scanned form (.pdf,.jpeg), as well as in the form of text (.doc). Depending on the type of corporate documentation, the content of the document is usually structured by sections. For example, such legal documents as contracts, protocols and explanatory notes contain the sections: title, preamble, introduction, subject of the contract, etc.  
Each section of the document, as a rule, contains a text typical for a given type of documentation and a set of attributes that are unique for a particular document. For example, the attributes include the date of the contract, the name of the customer, the name of the contractor and the cost of work.  
* The problem of text understanding is solved by the following stages:
* Optical document recognition,
* Classification,
* Markup,
* Data extraction.  
If the original document is presented as an image, it becomes necessary to extract  
In order to provide the dynamical process of expounders' collaboration, task understanding is not performed in real-time. For each new job, there is a new instance of Command created, which is assigned to a corresponding Expounder. Expounder, in turn, generates a Solution that involves a neural network trained by a specific Dataset. In case the Solution does not cover the requirements of the initial Command, a new Command is generated and assigned to a new Expounder.  
The logic of expounder hybridization is implemented by the builder presented in Figure 4. The expounder can act as a classifier or recognizer. While the process of document analysis proceeds, efficient expounders remain active in the system while those worked out are reduced.  
The problem of text generating is solved using content analysis. Documents are generated based on templates consisting of a set of working units. Each work unit in the system has a status. The following relationships apply between the templates:  
* Inheritance--templates can inherit each other.
* Implementation--a document can implement several templates in different sections.  
Figure 3: Expounder pattern implementation.  
The logical model supporting text generation is presented in Figure 5. The aggregator is a component that implements the creation of new documents based on existing templates.  
A new document can be generated either based on another document (by equivalent) in the system or using the selected template (by template).  
When generating by equivalent, the same rules are applied to the new document as to the parent one: design, sections and attributes will match. When generating a new document, you can specify data sources (for example, other documents), from which information will be pulled into a new document to fill in the attributes. When generating by template, sections and styles from different templates are aggregated into a new document.  
Under this process, paraphrasing techniques are applied to enhance the originality of the text.  
Figure 4: Expounder hybridization patterns.