## 4 Methodology
### Post-OCR  
Our post-processing approach aimed to extract information from the OCR output and transform it into a structured and organized format. To achieve this, we adopted a key value format for the fields that needed to be returned, as demonstrated in Table 1. This allowed us to effectively organize the data and facilitate further analysis. Moreover, we also implemented error correction methods to address any inaccuracies that may have arisen during the OCR process. It is crucial to note that the keys employed in this experiment were specifically adapted to correspond to the needs of the company we were serving. However, this approach is inherently generalizable. If the same method were to be adopted in a different context, it would likely necessitate the use of unique keys and values tailored to that specific situation. The input for the Post-OCR is the result of the previous step, which is a list containing each of the text segments detected and converted into characters as well as the position of the segment inside the image, given by another list containing the coordinates (x, y) of the bounding boxes (BB). For modem stickers, the fields of interest are already specified by the producer company, and the number of characters of each field is fix. Furthermore, depending on the field, the value only receives specific types of characters, such as numerical, alphanumeric, and hexadecimal. This information was used to model the key value processing step. To process and retrieve the relevant information from the OCR, a template was implemented in the key value JSON structure. The keys in the template represent the fields in the sticker that should be returned at the end of the visual inspection process, while the values are a set of rules that model the structure of the values of each field. Since different sticker models have different fields, a template is used for each label type. The template format used for the Sticker C pattern is shown in Table 1.  
The rules used for the values are based on representations and literals. Representations are alphabet characters indicating the types of characters that can appear in the position of the value. For example, \"D\" represents decimal numbers, and \"H\" represents hexadecimal \begin{table}
\begin{tabular}{c c c} \hline \hline
**Key** & **Format** & **Value** \\ \hline P/N & DDDDDDDDDD & 253951842 \\ IP & DDDS\$DDDS\$DS\$D & 192.168.01 \\ Usuario & \$CLAROS\$BBBBBB & CLAROS\_FDBBBD5 \\ Senha & FEFFFFFFFF & glykmTC\$827 zvA \\ S/N & DDDDDDDDDDDDDD & 92240013008 \\ CM MAC & HHHHHHHHHHHH & B0 FC88 FDBD5 \\ EMTA MAC & HHHHHHHHHHHH & B0 FC88 FDBD8 \\ REDE Wi-Fi & \$CLAROS\$BBBBBB & CLAROS\_FDBBBD5 \\ SENHA Wi-Fi & FEFFFFFFFFFF & jNyYUUnJtg \\ MODEL & \$F@ST3895 Claro DOCIS 3.15 & F@ST3896 Claro DOCIS 3.1 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Post-OCR output in key value format for Sticker C subset. Figure 3: OCR process overview. numbers. The literal texts are indicated by the symbol \"%\" and signify that all text contained between the literal symbols will be reproduced as it is. The key processing is performed first. This step aims to detect and extract the text segments that contain the keys of the predetermined fields and divide them into key and value. These keys are those specified in the template shown in Table 1 for the Sticker C pattern. For that, three rules were created: the colon rule, the space rule, and the size rule. The colon rule is applied when an item in the results list contains at least one colon character. The method tries to find a match between the OCR key value and the template value, using the colon character's position as a hint to find the corresponding key. The space rule is applied when the colon rule does not result in a key match. In this case, the method tries to find a key match by splitting the item value into words and testing each word as a possible key. Finally, the size rule is applied when none of the previous rules result in a key match.