# An Algorithm for the Detection of Hidden Propaganda in Mixed-Code Text over the Internet +
## 4 Propaganda Detection in Mixed-Code Text
### A Mixed Code Text Normalisation Algorithm
A classifier for character recognition has been trained by using the dataset provided in [50], which consists of a collection of character images of the alphabet belonging to the 26 English characters both handwritten and typed through a computer. Furthermore, other additional characters of other languages (such as \(i\), \(U\), \(u\), \(A\), \(A\), \(B\), \(O\), \(B\), \(O\), \(B\) and so on) have been further created in order to extend and enrich the initial dataset. To create such images, the use of python and the drawing library of Pillow [51] was used for creating the images. It aimed to incorporate certain non-English characters belonging to other languages. The images are made by using a dimension of 200 \(\times\) 200 px for the width and height. They were generated in a gray scale, because for the character identification purpose RGB, the colour does not provide any additional information. The best performance for the character recognition have been achieved by using a Convolutional Neural Network (CNN). A training and testing set with a ratio of 80:20 and number of epochs equal to 15, were used to configure the CNN. Its performance, in terms of Evaluation Metrics, Confusion Matrix as well as training vs. testing loss, is depicted in Figure 4. \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline \multirow{2}{*}{**Combination**} & **Group** & **Group** & **Group** & **Group** & **Group** & **Group** & **Group** & **Group** \\  & **1** & **2** & **3** & **4** & **5** & **6** & **7** & **M** \\ \hline
**1** & & & & F & \{\} & \{\} & T & & \\ \hline
**2** & & & F & \{\} & & & \{\}T & & \\ \hline
**3** & & F\{ & & & & & & \\ \hline \hline \end{tabular}
\end{table} 
Table 3: An example of segregation with Art Form Word (AFW) = “F[][]T”. Figure 3: An example of a recognition rule. Table 4 shows an example of character transformation by applying the above mentioned rules. For example, only the letters of the groups 3, 6 and M have been used as they are, whereas the rest of the groups generated from the segregation process have been first transformed into images and then mapped with single letters. _Word Selection step_: this part of the algorithm aims to derive candidate words that can replace the related _AFW_. First, for each _Combination_ generated during the _Text Segregation step_, each group of symbols is replaced with its related _Transformed Character_ obtained within the _Character Transformation step_. As it is shown in Table 5, a set of words which are syntactically written only with letters of the alphabet are built. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Group** & **Character(s)** & **Recognition Rule** & **Transformed Character** \\ \hline
**1** & F[][] & Rule-2/OCR & X \\
**2** & F[ & Rule-2/OCR & A \\
**3** & F & Rule-1 & F \\
**4** & [] & Rule-2/OCR & O \\
**5** & [] & Rule-2/OCR & O \\
**6** & T & Rule-1 & T \\
**7** & []T & Rule-2/OCR & E \\ “... & ][] & Rule-2/OCR & L \\
**M** & T & Rule-1 & T \\ \hline \hline \end{tabular}
\end{table} 
Table 4: An example of Character Transformation. Figure 4: Performances in the recognition of single characters. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Combination** & **Group** & **Transformed Character** & **Derived Word** \\ \hline
**1** & F, [], T & F, O, O, T & FOOT \\ \hline
**2** & F, [], []T & F, O, E & FOE \\ \hline
**3** & F, [], T & A, L, T & ALT \\ \hline
**—** &... &... &... \\ \hline
**N** & F[], T & X, T & XT \\ \hline \hline \end{tabular}
\end{table} 
Table 5: An example on derived words. The existence of such derived words is then checked against an English dictionary. Through this step, only the words that are part of the standard English language are selected and, as a consequence, used for further analysis. Figure 5 shows graphically an example of word selection, on the basis of their existence in the English dictionary.