## 4 Results and Discussion
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Tokenizer** & **Average** & **Median** \\ \hline SrBERTa v1 & 1.77 & 1.53 \\ SrBERTa v2 & 1.61 & 1.40 \\ Jerteh-81 & 1.72 & 1.44 \\ XLM-RoBERTa & 1.77 & 1.67 \\ BERTic & 3.73 & 3.65 \\ NER4 Legal\_SRB & 3.73 & 3.65 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Fertility results. Figure 5: Average fertility in relation to the number of words in the examples. Figure 6: Average fertility in relation to the number of words in for the examples up to 100 words. frequencies ranging from 1 to 1000, group 2 containing words with frequencies ranging from 1001 to 2000, and so on, in successive intervals of 1000. The obtained results were averaged by groups and presented in Figure 7. From the presented results it can be concluded that for words with lower frequency, XLM-RoBERTa tokenizer on average used fewer tokens for word representation in comparison to other tokenizers. Further, for lower frequency words SrBERTa v2 and Jerteh-81 tokenizers obtained similar average results, which were better than the results of tokenizers SrBERTa v1, BERTic, and NER4 Legal_SRB. Further, on the average scale for words with higher frequency, all tokenizers had similar performance with occasional spikes for tokenizers Jerteh-81, BERTic, and NER4 Legal_SRB. From the presented results, it can be concluded that the SrBERTa v2 tokenizer outperformed the SrBERTa v1 tokenizer in every performed analysis, showing that applied tokenizer adaptation has a great impact on tokenizer efficiency for a specific domain. Compared to other tokenizers, it should be noted that Jerteh-81 and XLMRoBERTa share the same architecture size as SrBERTa v2 but are trained on larger datasets. In the observed set, Jerteh-81 tokenizer and model were trained using the highest quality datasets for the Serbian language, while XLMRoBERTa used the most extensive datasets and had a larger vocabulary (~250 k). SrBERTa v2 stands out in that it is the only one that uses a mix of data that is used to enhance the domain impact in the training phase of the tokenizer. Despite the advantages that Jerteh-81 and XLMRoBERTa have over the SrBERTa v2 model in the pretraining phase, the SrBERTa v2 tokenizer outperforms these models in the average values of generated tokens per sequence. These results confirm the starting premise of the research--it is possible to create a domain-efficient tokenizer, even in the case of smaller or lower-quality language resources. Further, for sequences containing prevalently general terms, Jerteh-81 and XLMRoBERTa were expected to show slightly better performance. Deeper results analysis reveals tokenizer efficiency to be sequence length dependent. As example lengths increase, so does the probability of occurrence of domain-specific terms. In such cases, domain-specific terms emerge and thus the quality of the SrBERT v2 tokenizer becomes dominant. A similar conclusion could be made for the Jerteh-81 tokenizer, given its pretraining dataset. Consequently, the quality of the domain-adapted tokenizer is more meaningful if it is observed for longer sequences, which is consistent with the nature of the testing domain--legal text. Figure 7: Number of tokens in relation to the word frequency. Low-frequency words are more efficiently represented by the XLMRoBERTa tokenizer, which is a direct consequence of the vocabulary size. A larger vocabulary allows the XLMRoBERTa tokenizer to have a larger number of building elements used to efficiently tokenize out-of-distribution words, e.g., words that were not used during the training of the tokenizer. As word frequency increases, so does the influence of domain adaptation, making SrBERTa v2 equivalent in terms of tokenizer performance. Although developed for a similar group of languages, BERTic and NER4 Legal_SRB demonstrated somewhat lower efficiency in the test.