# _Pat-in-the-Loop_: Declarative Knowledge for Controlling Neural Networks
## 4 Pilot Experiment
### Results and Discussion  
Results of our pilot experiment show important facts that we will examine in the following, focusing also on the limitations of this analysis. _Distributed tree encoders_ positively introduce syntactic information in neural networks: 0.84 to 0.93 of improvement in f-measure from _BoW_ to _PureNN_ (Table 3). This confirms a general trend observed in a similar experiment carried out in other classification tasks observed in [40]. The analysis of the errors in the training set produced very reasonable rules for two specific classes: Abbreviation (ABBR) and Numerical (NUM) (Table 4). For what concerns the abbreviation class, [PERSON] selected very reasonable rules such as a question asks for the explanation of abbreviation if it contains parse subtrees representing the verbal phrases _\"stand for\"_, _\"mean\"_ or the noun phrases containing the adjective _\"full\"_ or the noun _\"abbreviation\"_. For what concerns the NUM class, rules are fairly more specific or definitely more general. Important indicators that a question is asking for a numerical answer are, respectively, that the question contains WH-noun-phrases _\"What debts\"_ or contains noun phrases which are a sequence of two proper nouns, a possessive ending, and another noun, that is, _(NP (NP (NNP)(NNP)(POS))(NN))_. This latter is a very general rule. These rules are then used to build up the matrix \(\mathbf{W_{H}}\) used in the model with human knowledge (_HumNN_). [PERSON] could change positively the behavior of the system although global results of the model with human knowledge (_HumNN_) are similar and even slightly higher than those of _PureNN_. On the general results, the effect on the results of the system are small. In fact, the micro-average is 0.93 for both models is 0.93 and macro average is 0.92 for _HumNN_ with respect to 0.91 of _PureNN_. Looking more specifically on the confusion matrix (Table 5 and 6), we may observe that [PERSON] has changed the behavior of the system where he wanted. Since [PERSON] aimed to manipulate the behavior of the system in favor of the classes _ABBR_ and _NUM_, s/he focused the attention to examples where _PlainNN_ fails. [PERSON]'s rules coded in \(\mathbf{W_{H}}\). After learning the new model _HumNN disturbed_ by human declarative knowledge, results on the test set are encouraging. In fact, although the overall performance is unchanged, target classes have had positive improvement. Both _ABBR_ and _NUM_ have an additional positively classified example (Table 6). This tiny improvement suggests that the model can positively use declarative human knowledge. Finally, heat parse trees are informative. In fact, [PERSON] could understand why some specific cases were misclassified and could select declarative rules to change the behavior of the system. \begin{table}
\begin{tabular}{l l} \hline \hline
**Class** & **Rule** \\ \hline _ABBR_ & _(NP (NP (DT) (J f full) (NN)) (PP (IN)))_ \\ _ABBR_ & _(SQ (VBZ) (NP) (VP (VB stand) (PP (IN for))))_ \\ _ABBR_ & _(NN abbreviation)_ \\ _ABBR_ & _(VP (VB mean))_ \\ _NUM_ & _(WHNP (WDT What) (NNS debts))_ \\ _NUM_ & _(NP (NP (NNP)(NNP)(POS))(NN))_ \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Rules manually extracted for the question classification dataset. \begin{table}
\begin{tabular}{l c c} \hline \hline  & \multicolumn{2}{c}{**f-measure**} \\  & _micro avg_ & _macro avg_ \\ \hline _BoW_ & 0.84 & 0.84 \\ _PureNN_ & 0.93 & 0.91 \\ _HumNN_ & 0.93 & 0.92 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Pat-in-the-Loop’s f-measureBeing a pilot study, the experiment has some intrinsic limitations. Clearly, the first limitation is the fact that the model has been experimented in a single and small dataset. However, this first pilot experiment is confirming our hypothesis. The second limitation is that we have not performed an ablation test on rules in Table 4. When adding external knowledge, introducing rules and consequently manipulating NNs processes could have negative impact on the system depending on the introduced rules to the system.