# A Deep Fusion Matching Network Semantic Reasoning Model
## 3 Methods
### Design of Reasoning Model Based on Deep Fusion Matching Network
#### 3.2.2 Local Reasoning Based on Improved AF-DMN  
The matching layer of the deep fusion matching network model refers to the chain structure of the AF-DMN model. It then passes through T identical matching modules to collect the local interactive reasoning information based on the sequence. The reasoning information specifically includes the internal context information of sentences \(p\) and \(q\), and the interaction information between sentences \(p\) and \(q\). As shown in Figure 2, each matching module is divided into four sub-layers: interaction layer, interaction fusion layer, self-focus layer, and self-focus fusion layer. The interaction layer obtains the interactive information between sentences \(p\) and \(q\). The interaction fusion layer enhances the extraction process of interactive information. The self-focus layer obtains the context information within the sentence to solve the long-term dependence problem. Finally, the self-focus fusion layer enhances the effect of content extraction. Figure 1: SCF-DMN network structure. Before obtaining the interactive information between the premise statement and the hypothetical statement, it is necessary to obtain the alignment information of the relevant sub-components between the sentences, namely, the interactive attention matrix. Alignment information acquisition methods are divided into hard alignment and soft alignment. Hard alignment [5] requires one-to-one correspondence between words, while soft alignment [22] is closer to semantic information alignment. Words or phrases with consistent semantics have a higher weight on the attention matrix. For example, \"near\" is aligned with \"be close to\". Therefore, the interaction layer of the semantic fusion depth matching network uses the soft alignment proposed by [PERSON] [23] and calculates the inner product between sentences \(p\) and \(q\) to obtain the correlation between sentences. Firstly, the correlation sub-component weight \(e^{t}\) between sentences in the \(i\)th matching module is calculated, and \(e^{t}_{ij}\) represents the correlation between the \(i\)th word in sentence \(p\) and the \(i\)th word in sentence \(q\). The calculation method is shown in formula (3). \[e^{t}_{ij}=f(W^{t}[p_{i},q_{j}]+b)=h^{t-1}_{p_{i}}W^{t}h^{t-1}_{q_{j}}+\langle U ^{t}_{I},h^{t-1}_{p_{i}}\rangle+\langle U^{t}_{r},h^{t-1}_{q_{j}}\rangle. \tag{3}\]  
where \(W^{t}\in R^{2h\times 2h}\), \(U^{t}_{I}\in R^{2h}\), \(U^{t}_{r}\in R^{2h}\) represents the parameter of the \(t\)th matching module and represents the point multiplication operation. Then, the weight of relevant sub-components \(e^{t}_{ij}\) is replaced into Formulas (4) and (5) to calculate the correlation matrix \(a^{t}_{p_{i}}\) of the premise sentence \(q\) on the hypothetical sentence \(q\) and the correlation matrix \(a^{t}_{q_{j}}\) of the hypothetical sentence \(p\) on the premise sentence. \[a^{t}_{p_{i}}=\sum_{j=1}^{n}\frac{exp(e^{t}_{ij})}{\sum_{k=1}^{n}exp(e^{t}_{ik })},\forall i\in[1,\dots,m] \tag{4}\]  
\[a^{t}_{q_{j}}=\sum_{i=1}^{m}\frac{exp(e^{t}_{ij})}{\sum_{k=1}^{m}exp(e^{t}_{kj })},\forall i\in[1,\dots,n] \tag{5}\]  
where \(m\) and \(n\) denote the participles number of sentences \(p\) and \(q\) respectively, and \(exp(\cdot)\) denotes the exponential function with natural constant \(e\) as the base. The interaction information \(\widetilde{h}_{p_{i}}\) between the \(i\)th word in the sentence \(p\) and the sentence, \(q\) is obtained by solving the correlation matrix \(a^{t}_{p_{i}}\) and the previous matching module \(H^{t-1}_{p}\), as shown in Formula (6). \[\widetilde{h}^{t}_{p_{i}}=H^{t-1}_{p_{i}}\cdot a^{t}_{p_{i}} \tag{6}\]  
where \(H^{t-1}_{p}=(H^{t-1}_{p_{1}},H^{t-1}_{p_{i}},\dots,H^{t-1}_{p_{m}})\) is the sentence embedding representation of the \(t\)th matching module connected to the \(t-1\)th matching module. Similarly, the interactive  
Figure 2: The network structure of the matching layer.