<?xml version="1.0" encoding="UTF-8"?>
<TEI xml:space="preserve" xmlns="http://www.tei-c.org/ns/1.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.tei-c.org/ns/1.0 https://raw.githubusercontent.com/kermitt2/grobid/master/grobid-home/schemas/xsd/Grobid.xsd"
 xmlns:xlink="http://www.w3.org/1999/xlink">
	<teiHeader xml:lang="en">
		<fileDesc>
			<titleStmt>
				<title level="a" type="main">Language recognition implemented into machine learning algorithms *</title>
			</titleStmt>
			<publicationStmt>
				<publisher/>
				<availability status="unknown"><licence/></availability>
			</publicationStmt>
			<sourceDesc>
				<biblStruct>
					<analytic>
						<author>
							<persName><forename type="first">Żaneta</forename><surname>Pawelec</surname></persName>
							<affiliation key="aff0">
								<orgName type="department">Faculty of Applied Mathematics</orgName>
								<orgName type="institution">Silesian University of Technology</orgName>
								<address>
									<addrLine>Kaszubska 23</addrLine>
									<postCode>44100</postCode>
									<settlement>Gliwice</settlement>
									<country key="PL">POLAND</country>
								</address>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Grzegorz</forename><surname>Grochowski</surname></persName>
							<affiliation key="aff0">
								<orgName type="department">Faculty of Applied Mathematics</orgName>
								<orgName type="institution">Silesian University of Technology</orgName>
								<address>
									<addrLine>Kaszubska 23</addrLine>
									<postCode>44100</postCode>
									<settlement>Gliwice</settlement>
									<country key="PL">POLAND</country>
								</address>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Aleksandra</forename><surname>Starowicz</surname></persName>
							<affiliation key="aff0">
								<orgName type="department">Faculty of Applied Mathematics</orgName>
								<orgName type="institution">Silesian University of Technology</orgName>
								<address>
									<addrLine>Kaszubska 23</addrLine>
									<postCode>44100</postCode>
									<settlement>Gliwice</settlement>
									<country key="PL">POLAND</country>
								</address>
							</affiliation>
						</author>
						<author>
							<affiliation key="aff1">
								<orgName type="department">Information Society</orgName>
								<orgName type="institution">University Studies</orgName>
								<address>
									<addrLine>2024, May 17</addrLine>
									<settlement>Kaunas</settlement>
									<country key="LT">Lithuania</country>
								</address>
							</affiliation>
						</author>
						<title level="a" type="main">Language recognition implemented into machine learning algorithms *</title>
					</analytic>
					<monogr>
						<idno type="ISSN">1613-0073</idno>
					</monogr>
					<idno type="MD5">753DCF424E58961EF267800D3112A49D</idno>
				</biblStruct>
			</sourceDesc>
		</fileDesc>
		<encodingDesc>
			<appInfo>
				<application version="0.7.2" ident="GROBID" when="2025-04-23T16:28+0000">
					<desc>GROBID - A machine learning software for extracting information from scholarly documents</desc>
					<ref target="https://github.com/kermitt2/grobid"/>
				</application>
			</appInfo>
		</encodingDesc>
		<profileDesc>
			<textClass>
				<keywords>
					<term>language recognition</term>
					<term>knn</term>
					<term>clustering</term>
					<term>artificial intelligence</term>
					<term>Bayesian classifier</term>
					<term>K-Nearest Neighbors</term>
				</keywords>
			</textClass>
			<abstract>
<div xmlns="http://www.tei-c.org/ns/1.0"><p>Language recognition algorithms play a pivotal role in various domains, offering applications ranging from automatically detecting the language of textual data to powering multilingual customer support systems. As the foundation of modern technologies like Artificial Intelligence, these algorithms enable content localization, facilitate language translation services, and drive personalized marketing strategies by analyzing linguistic patterns in customer feedback and social media interactions. This project compares five machine learning algorithms for language recognition, focusing on Bayesian classifiers and K-Nearest Neighbors (KNN). Through experimentation with different variations of these algorithms, including custom implementations, the project evaluates their effectiveness in recognizing 17 foreign languages. Methodologically, the project explores the nuances of each algorithm, discussing their underlying principles and implementation details. Experimental results reveal insights into the performance of each algorithm, providing valuable considerations for practical applications. Additionally, the project discusses the significance of precision, recall, F1-score, and accuracy metrics in assessing algorithm performance. Overall, this study contributes to advancing language recognition technology, offering valuable insights into algorithmic approaches and their real-world implications.</p></div>
			</abstract>
		</profileDesc>
	</teiHeader>
	<text xml:lang="en">
		<body>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1.">Introduction</head><p>Language recognition algorithms offer numerous applications across various domains <ref type="bibr" target="#b0">[1,</ref><ref type="bibr" target="#b1">2,</ref><ref type="bibr" target="#b2">3,</ref><ref type="bibr" target="#b3">4]</ref>. From automatically detecting the language of textual data to increasing performance of spam filtering and powering multilingual customer support systems. The importance of these algorithms enhances every day and becomes the crucial foundation for developing modern technologies such as Artificial Intelligence. Furthermore, they enable content localization, facilitate language translation services, and drive personalized marketing strategies <ref type="bibr" target="#b4">[5]</ref> by analyzing linguistic patterns in customer feedback and social media interactions. We can easily spot them in our daily lives, using social media, web browsers and so on, that is why their accuracy and efficiency need to be constantly improved in order to make things easier. Moreover, language recognition algorithms underpin voice assistants and speech recognition systems, contributing to seamless user experiences. With their ability to discern linguistic nuances and patterns, language recognition algorithms continue to fuel innovation and efficiency across a wide array of real-life problems.</p><p>Our program aims to compare five machine learning algorithms. All algorithms calculate the effectiveness of recognizing 17 foreign languages using different variations of the Bayesian classifier <ref type="bibr" target="#b5">[6]</ref> and K-Nearest Neighbours classifier <ref type="bibr" target="#b6">[7,</ref><ref type="bibr" target="#b7">8]</ref>. The calculations are based on a longer or shorter sentence retrieved from a database.</p><p>To get a closer look into the applied classifiers, the following paragraphs will briefly describe them to illustrate how different these calculation methods are from each other.</p><p>The Naive Bayes classifier is a probabilistic machine learning model based on Bayes' theorem, which calculates the probability of a certain class given a set of features. It assumes that the features are conditionally independent, hence "naive." It's widely used for classification tasks, especially in text classification and spam filtering.</p><p>K-Nearest Neighbors (KNN) is a non-parametric supervised learning algorithm used for classification and regression tasks. In KNN, the class of a new data point is determined by the majority class among its k nearest neighbors in the feature space. It's simple to implement and understand but can be computationally expensive for large datasets (like the one we are using), as it requires storing all training data and computing distances for each prediction.</p><p>Both algorithms have varying time consumption, with KNN being more computationally expensive due to its need to calculate distances for each prediction. Now, let's delve into a brief explanation of each of the applied algorithms and the underlying thought process behind their selection. The first classifier is the Bayesian classifier from the library, which provides the most effective results and thus serves as the main benchmark that we tried to achieve in the other algorithms. Next, we independently create a second Bayesian classifier aiming to mimic the version from the library. The third classifier is also a modified Bayesian classifier, determining the language by the probability of neighboring letters. In executing this algorithm, we assumed that each language has recurring sequences of letters that can enable assigning a given sentence to the language in which this sequence most commonly occurs. We derived an appropriate formula that allowed us to implement our idea into the program. The fourth classifier is a K-Nearest Neighbours from the library, but with implemented different distance calculation methods which we adjusted to our specific database. The fifth classifier is also the K-Nearest Neighbours algorithm but in this instance written by us. It was created following open-access models with an intent to achieve as high accuracy as the one from the imported KNN classifier. In order to achieve a satisfying outcome it required us to apply many adjustments in the distance calculating method. After performing the calculations, each algorithm displays a table with the results of the effectiveness of defining each language.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.">Methodology</head><p>Data from the set is divided into subsets X, containing texts in various languages, and Y containing the language classes of the texts from set X. The initial two Bayes classifiers and both KNN algorithms operate on a dataset converted into a matrix of token counts using the CountVectorizer class from the sklearn library. This is a one-dimensional matrix of the length of the dictionary containing all the words from the dataset. Each text sequence from set X is represented by such a matrix, where the words occurring in this sequence are represented by the number of their occurrences in the appropriate matrix position and the rest are filled with zeros.</p><p>First, we used the MultinomialNB class contained in the sklearn library. For calculations, it uses the formula:</p><p>where: 𝜃 𝑦𝑖 is the probability P(𝑥 𝑖 | 𝑦) of feature 𝑥 𝑖 appearing in a sample belonging to class 𝑦.</p><p>is the count of occurrences of parameter 𝑖 in class 𝑦 in the training set, while is the number of all parameters in set 𝑦. 𝛼 is the smoothing prior, which in this case is Laplace smoothing -𝛼 = 1. 𝑛 is the number of classes in set Y.</p><p>Next, we attempted to replicate the function contained in the library, aiming to obtain similar results. However, in our version of the algorithm, we did not consider the smoothing parameter. In the third Bayes classifier, we changed the approach to the dataset. We utilized individual dependencies on the construction of each language -the probability of one letter occurring after another. The formula in this case takes the form: This time, the methods are given raw training sets X and Y, and a test set X. The 'fit' method is responsible for creating a 'neighborhood table' of all the letters present in the training set X divided by language classes. They contain the probabilities of the occurrence of a given pair of letters one after the other. The 'predict' method for the test set determines membership in a class based on the probabilities from the 'neighborhood tables'. In K-Nearest Neighbors from the library, we use scalar vector multiplication to calculate distances. We multiply this value by -1 to avoid the need to compute the k-farthest neighbors further.</p><p>where a,b are vectors</p><p>In our k-NN, we used the same formula for calculating distances as in the library algorithm, but additionally, we incorporated weighted computation of the 𝑘 nearest neighbors.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.">Experiments</head><p>To compare the different performance parameters of the used algorithms, we utilized the metrics module from the sklearn library. To improve the accuracy of the results, each algorithm was executed 10 times, and the final value is the average of all trials. The dataset containing texts in 17 languages with a total length of 10,337 records was divided into training and testing sets in a 70:30 ratio. For each algorithm, we compared parameters such as:</p><p>• precision -it is a measure that determines the ratio of correctly predicted class elements to all those marked as the given class</p><p>• recall -a measure informing how many elements from a given class were correctly recognized</p><p>• f1-score -it is the harmonic mean between precision and recall</p><p>• support-a measure of the occurrences of each class in the dataset • accuracy -it is the ratio of correctly classified samples to all cases in the test set Meaning of labels:</p><p>• TP -true positive -cases that were correctly classified as positive by the classifier • TN -true negative -cases that were correctly classified as negative by the classifier • FP -false positive -an error where the test result incorrectly indicates the presence of a condition when it is not present • FN -false negative -an error where the test result incorrectly indicates the absence of a condition when it is actually present</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.1.">The Bayesian algorithm from the sklearn library</head><p>Analyzing the results shown in the above table, we can observe that the algorithm matches most languages with an accuracy ranging from 98-100% (see Tab. 1). The exception is the English language, which has an accuracy of only 89%, which may be due to the fact that English words are borrowed from other languages. The method for the entire dataset has an accuracy of 98%, making it the most accurate of all the solutions we have used (Fig. <ref type="figure" target="#fig_4">1a</ref>).   </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.2.">Self-implemented Bayesian algorithm</head><p>During the construction of this algorithm, our goal was to achieve results similar to the algorithm from the sklearn library. As observed, our algorithm performs worse with languages that use specific alphabets (e.g., Arabic, Hindi) and struggles more with recognizing languages belonging to the same family due to similarities in words stemming from the shared ancestry of these languages. This is particularly evident in Germanic languages: Dutch -German, Danish -Swedish, and Romance languages: Spanish, French, and Portuguese. However, the issues with languages using specific alphabets and the overall decrease in accuracy of other languages result from the lack of a smoothing parameter in the computational algorithm. Ultimately, though, in general terms, we achieved an algorithm accuracy of approximately 93%. It's the slowest among all algorithms but has average accuracy (see Tab. 2 and Fig. <ref type="figure" target="#fig_4">1b</ref>).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.3.">Custom Bayesian algorithm for letter proximity</head><p>The algorithm, thanks to a completely different approach to the dataset, achieved results different from the rest. As the measurements show, unlike the previous one, it performs best with languages using specific alphabets. However, it struggles more with languages belonging to the same families. For example, with Germanic languages (Danish, Swedish, and Dutch) and some Romance languages (Italian, Spanish, and Portuguese). This is due to the similar structure of these languages associated with their common ancestry. If more than one language had the same probability (taking into account the rounding error of floating-point numbers), the algorithm chose the first one in alphabetical order, hence the lower accuracy of Danish compared to Dutch, and Dutch compared to Swedish. Similarly for Romance languages. Ultimately, this algorithm has the lowest overall accuracy of the tested trio, at around 89% (Tab. 3 and Fig. <ref type="figure" target="#fig_4">1c</ref>). However, this result exceeded our initial expectations for the algorithm.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.4.">KNN algoritms</head><p>The first test we conducted for the KNN algorithm was to assess its effectiveness for different values of k ranging from 1 to 9. As shown in Tab. 4, the algorithm exhibited different effectiveness across the different values of k. Therefore, we choose k=9, for the algorithm from the library and k=10 for our algorithm. As we can also observe, for small values of k, our algorithm has higher effectiveness, which may be related to the use of a weighting table. As k increases, the difference in effectiveness decreases, until eventually, the algorithm from the library starts to exhibit greater effectiveness.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.5.">KNN without library</head><p>To shorten the execution time of the algorithm and increase its effectiveness from around 60% using the Euclidean metric, we decided to calculate the distance as the dot product of vectors. This allowed us to save some time and increase the effectiveness to 90%. The results</p></div><figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_0"><head>Algorithm 1 : 5 𝑉Algorithm 2 : 6 Append</head><label>1526</label><figDesc>Method 'OwnMNB.fit' training the algorithm Data: sets x_train and y_train Result: None 1 𝑐𝑙𝑎𝑠𝑠𝑒𝑠 := set of values of 𝑦_𝑡𝑟𝑎𝑖𝑛; 2 𝑡𝑜𝑘𝑒𝑛𝑠 := empty dictionary; 3 foreach 𝑐 ∈ 𝑐𝑙𝑎𝑠𝑠𝑒𝑠 do 4 𝑥 𝑐 := 𝑥_𝑡𝑟𝑎𝑖𝑛 ∈ 𝑐; _𝑆𝑢𝑚 := sum of vectors in 𝑥 𝑐 ; 6 𝑡𝑜𝑘𝑒𝑛𝑠[𝑐] := VSum / length of 𝑥 𝑐 ; Method 'OwnMNB.predict' performing calculations Data: 𝑥_𝑡𝑒𝑠𝑡 Result: list 𝑦_𝑝𝑟𝑒𝑑 1 𝑦_𝑝𝑟𝑒𝑑 := empty list; 2 foreach 𝑥_𝑟𝑜𝑤 ∈ 𝑥_𝑡𝑒𝑠𝑡 do 3 𝑝𝑟𝑜𝑏 := empty dictionary; 4 foreach 𝑐 ∈ 𝑐𝑙𝑎𝑠𝑠𝑒𝑠 do 5 𝑝𝑟𝑎𝑤𝑑 := vector sum of 𝑥 * 𝑡𝑜𝑘𝑒𝑛𝑠[𝑐] ; 𝑝𝑟𝑎𝑤𝑑 to 𝑝𝑟𝑜𝑏[𝑐]; 7 Append to 𝑦_𝑝𝑟𝑒𝑑 class with the biggest value from dictionary 𝑝𝑟𝑜𝑏;</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_1"><head></head><label></label><figDesc>where: 𝜃 𝑦𝑗 is the probability P(𝑥 𝑗 | 𝑦) for 𝑥 𝑗 contained in the same class 𝑦 𝑗 . 𝑃 (𝑥 , 𝑗𝑖−1 𝑥 , 𝑗𝑖 | 𝑦) is the probability of the occurrence of letter 𝑥 𝑖 after 𝑥 𝑖−1 in class 𝑦 𝑗 . 𝑛 is the number of letters in the considered text sequence.</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_2"><head>Algorithm 3 :</head><label>3</label><figDesc>Method 'LetterProb.fit' training the algorithm Data: Sets 𝑥_𝑡𝑟𝑎𝑖𝑛 and 𝑦_𝑡𝑟𝑎𝑖𝑛 Result: None 1 𝑑𝑖𝑐𝑡𝑖𝑜𝑛𝑎𝑟𝑖𝑒𝑠 := empty dictionary; 2 𝑐𝑙𝑎𝑠𝑠𝑒𝑠 := set of values of 𝑦_𝑡𝑟𝑎𝑖𝑛; 3 foreach 𝑐 ∈ 𝑐𝑙𝑎𝑠𝑠𝑒𝑠 do := 𝑥_𝑡𝑟𝑎𝑖𝑛 ∈ 𝑐; 𝑙𝑒𝑡𝑡𝑒𝑟𝐶𝑜𝑢𝑛𝑡 := 0; 𝑙𝑎𝑠𝑡 = ' '; 𝑑𝑖𝑐𝑡𝑖𝑜𝑛𝑎𝑟𝑖𝑒𝑠[𝑐] := empty dictionary; foreach 𝑟𝑜𝑤 ∈ 𝑥 𝑐 do foreach 𝑙𝑒𝑡𝑡𝑒𝑟 ∈ 𝑟𝑜𝑤 do 𝑙𝑒𝑡𝑡𝑒𝑟𝐶𝑜𝑢𝑛𝑡+ = 1; if 𝑙𝑎𝑠𝑡 + 𝑙𝑒𝑡𝑡𝑒𝑟 ∈ 𝑑𝑖 𝑐 𝑡 𝑖 𝑜𝑛𝑎𝑟 𝑖 𝑒 𝑠[𝑐] then 𝑑𝑖𝑐𝑡𝑖𝑜𝑛𝑎𝑟𝑖𝑒𝑠[𝑐][𝑙𝑎𝑠𝑡 + 𝑙 𝑒 𝑡 𝑡 𝑒 𝑟]+ = 1; end else 𝑑𝑖𝑐𝑡𝑖𝑜𝑛𝑎𝑟𝑖𝑒𝑠[𝑐][ 𝑙𝑎𝑠𝑡 + 𝑙 𝑒 𝑡 𝑡 𝑒 𝑟] := 1; end 𝑙𝑎𝑠𝑡 := 𝑙𝑒𝑡𝑡𝑒𝑟; end end foreach 𝑧 ∈ Keys 𝑑𝑖𝑐𝑡𝑖𝑜𝑛𝑎𝑟𝑖𝑒𝑠[𝑐] do 𝑑𝑖𝑐𝑡𝑖𝑜𝑛𝑎𝑟𝑖𝑒𝑠[𝑐][𝑧] = 𝑑𝑖𝑐𝑡𝑖𝑜𝑛𝑎𝑟𝑖𝑒𝑠[𝑐][𝑧]/𝑙𝑒𝑡𝑡𝑒𝑟𝐶𝑜𝑢𝑛𝑡; end</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_3"><head></head><label></label><figDesc>(a) The effectiveness results for the Bayesian algorithm from the sklearn library (c) The effectiveness results for a customwritten Bayesian algorithm for letter proximity (b) The effectiveness results for the selfimplemented Bayesian algorithm (d) The effectiveness results for our k-nearest neighbors (kNN) (e) The effectiveness results for k-nearest neigh-bors (kNN) from the library</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_4"><head>Figure 1 :</head><label>1</label><figDesc>Figure 1: Comparison of effectiveness results for different algorithms</figDesc><graphic coords="6,205.35,483.10,185.45,160.05" type="bitmap" /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" type="table" xml:id="tab_0"><head>Table 1</head><label>1</label><figDesc>The effectiveness results for the Bayesian algorithm from the sklearn library</figDesc><table><row><cell></cell><cell cols="4">precision recall f1-score support</cell></row><row><cell>Arabic</cell><cell>1.0</cell><cell>0.97</cell><cell>0.98</cell><cell>774.0</cell></row><row><cell>Danish</cell><cell>0.99</cell><cell>0.94</cell><cell>0.97</cell><cell>621.0</cell></row><row><cell>Dutch</cell><cell>1.0</cell><cell>0.97</cell><cell>0.99</cell><cell>832.0</cell></row><row><cell>English</cell><cell>0.89</cell><cell>1.0</cell><cell>0.94</cell><cell>2131.0</cell></row><row><cell>French</cell><cell>0.98</cell><cell>0.99</cell><cell>0.98</cell><cell>1503.0</cell></row><row><cell>German</cell><cell>1.0</cell><cell>0.98</cell><cell>0.99</cell><cell>692.0</cell></row><row><cell>Greek</cell><cell>1.0</cell><cell>0.99</cell><cell>0.99</cell><cell>556.0</cell></row><row><cell>Hindi</cell><cell>1.0</cell><cell>0.97</cell><cell>0.99</cell><cell>113.0</cell></row><row><cell>Italian</cell><cell>1.0</cell><cell>0.98</cell><cell>0.99</cell><cell>1052.0</cell></row><row><cell>Kannada</cell><cell>1.0</cell><cell>0.96</cell><cell>0.98</cell><cell>551.0</cell></row><row><cell>Malayalam</cell><cell>0.99</cell><cell>0.98</cell><cell>0.99</cell><cell>881.0</cell></row><row><cell>Portuguese</cell><cell>0.99</cell><cell>0.99</cell><cell>0.99</cell><cell>1078.0</cell></row><row><cell>Russian</cell><cell>1.0</cell><cell>0.97</cell><cell>0.98</cell><cell>1054.0</cell></row><row><cell>Spanish</cell><cell>0.99</cell><cell>0.98</cell><cell>0.98</cell><cell>1248.0</cell></row><row><cell>Sweedish</cell><cell>0.99</cell><cell>0.98</cell><cell>0.98</cell><cell>1016.0</cell></row><row><cell>Tamil</cell><cell>1.0</cell><cell>0.98</cell><cell>0.99</cell><cell>670.0</cell></row><row><cell>Turkish</cell><cell>1.0</cell><cell>0.92</cell><cell>0.96</cell><cell>738.0</cell></row><row><cell>accuracy</cell><cell></cell><cell></cell><cell>0.98</cell><cell>15510.0</cell></row><row><cell>macro avg</cell><cell>0.99</cell><cell>0.97</cell><cell>0.98</cell><cell>15510.0</cell></row><row><cell>weighted avg</cell><cell>0.98</cell><cell>0.98</cell><cell>0.98</cell><cell>15510.0</cell></row></table></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" type="table" xml:id="tab_1"><head>Table 2</head><label>2</label><figDesc>The effectiveness results for the self-implemented Bayesian algorithm</figDesc><table><row><cell></cell><cell cols="4">precision recall f1-score support</cell></row><row><cell>Arabic</cell><cell>0.79</cell><cell>1.0</cell><cell>0.88</cell><cell>774.0</cell></row><row><cell>Danish</cell><cell>0.8</cell><cell>0.91</cell><cell>0.85</cell><cell>621.0</cell></row><row><cell>Dutch</cell><cell>0.91</cell><cell>0.84</cell><cell>0.87</cell><cell>832.0</cell></row><row><cell>English</cell><cell>0.97</cell><cell>0.98</cell><cell>0.98</cell><cell>2131.0</cell></row><row><cell>French</cell><cell>0.96</cell><cell>0.9</cell><cell>0.93</cell><cell>1503.0</cell></row><row><cell>German</cell><cell>0.99</cell><cell>0.88</cell><cell>0.93</cell><cell>692.0</cell></row><row><cell>Greek</cell><cell>1.0</cell><cell>0.99</cell><cell>0.99</cell><cell>556.0</cell></row><row><cell>Hindi</cell><cell>0.73</cell><cell>0.98</cell><cell>0.84</cell><cell>113.0</cell></row><row><cell>Italian</cell><cell>0.99</cell><cell>0.95</cell><cell>0.97</cell><cell>1052.0</cell></row><row><cell>Kannada</cell><cell>1.0</cell><cell>0.96</cell><cell>0.98</cell><cell>551.0</cell></row><row><cell>Malayalam</cell><cell>1.0</cell><cell>0.98</cell><cell>0.99</cell><cell>881.0</cell></row><row><cell>Portugeese</cell><cell>0.97</cell><cell>0.91</cell><cell>0.94</cell><cell>1078.0</cell></row><row><cell>Russian</cell><cell>1.0</cell><cell>0.93</cell><cell>0.96</cell><cell>1054.0</cell></row><row><cell>Spanish</cell><cell>0.73</cell><cell>0.95</cell><cell>0.83</cell><cell>1248.0</cell></row><row><cell>Sweedish</cell><cell>0.98</cell><cell>0.88</cell><cell>0.93</cell><cell>1016.0</cell></row><row><cell>Tamil</cell><cell>1.0</cell><cell>0.98</cell><cell>0.99</cell><cell>670.0</cell></row><row><cell>Turkish</cell><cell>0.99</cell><cell>0.8</cell><cell>0.89</cell><cell>738.0</cell></row><row><cell>accuracy</cell><cell></cell><cell></cell><cell>0.93</cell><cell>15510.0</cell></row><row><cell>macro avg</cell><cell>0.93</cell><cell>0.93</cell><cell>0.93</cell><cell>15510.0</cell></row><row><cell>weighted avg</cell><cell>0.94</cell><cell>0.93</cell><cell>0.93</cell><cell>15510.0</cell></row></table></figure>
		</body>
		<back>
			<div type="annex">
<div xmlns="http://www.tei-c.org/ns/1.0"><p>indicate a strong performance of the algorithm across multiple languages. High precision and recall in languages like Arabic, Greek, Kannada, and Tamil show that the algorithm is particularly effective for these languages, achieving near-perfect scores. However, there are areas for improvement, notably in Spanish, which has a lower precision (0.61) and F1 score (0.72), indicating potential difficulties in accurately classifying this language (Tab. 5 and Fig. <ref type="figure">1d</ref>. </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.6.">KNN with library</head><p>The algorithm from the library shows similar results for individual languages. Some of them achieved higher scores, while others had lower ones. However, the overall accuracy remained unchanged at 90%. The Spanish language, which our algorithm struggled with, still has a much weaker performance compared to the rest, but this result has slightly improved (Tab. 6 and Fig. <ref type="figure">1e</ref>).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.">Conclusion</head><p>Based on our results, the Bayes algorithm from the sklearn library performs the best, achieving 98% accuracy. Our version of this algorithm ranks second with 93% accuracy. However, both KNNbased algorithms and our Bayes classifier based on letter pair probabilities performed the worst among all, still achieving relatively high scores of 90% and 89% accuracy, respectively. Although KNN algorithms handle language classification tasks well, their use in this form is not optimal in terms of both time or memory efficiency. Achieving results similar to our Bayes algorithms, they require almost two orders of magnitude more time. Similarly, in the case of the computational resources of the test platform, difference between both types of algorithms is significant. The KNN classifier from the library performs calculations faster than the one we created, thanks to the use of multi-threaded processing, while our KNN classifier performs calculations using only a single CPU core. However, this impacts memory usage. During tests, the KNN from the library used over 9.5GB of available RAM on the test platform, while our KNN algorithm required approximately 5GB of memory. In contrast, the Bayes algorithms did not require more than 1GB of RAM and, despite running on a single CPU thread, did not fully load it. None of our developed algorithms came up close to 100%. One of the possible future improvements would be to combine together both our Bayes classifiers, to eliminate their separate weak points. An algorithm created this way would be much closer to 100% accuracy with only slightly lower time efficiency.</p></div>			</div>
			<div type="references">

				<listBibl>

<biblStruct xml:id="b0">
	<analytic>
		<title level="a" type="main">Sign language recognition system for communicating to people with disabilities</title>
		<author>
			<persName><forename type="first">Y</forename><surname>Obi</surname></persName>
		</author>
		<author>
			<persName><forename type="first">K</forename><forename type="middle">S</forename><surname>Claudio</surname></persName>
		</author>
		<author>
			<persName><forename type="first">V</forename><forename type="middle">M</forename><surname>Budiman</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Achmad</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Kurniawan</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Procedia Computer Science</title>
		<imprint>
			<biblScope unit="volume">216</biblScope>
			<biblScope unit="page" from="13" to="20" />
			<date type="published" when="2023">2023</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b1">
	<analytic>
		<title level="a" type="main">Developing named entity recognition algorithms for uzbek: Dataset insights and implementation</title>
		<author>
			<persName><forename type="first">D</forename><surname>Mengliev</surname></persName>
		</author>
		<author>
			<persName><forename type="first">V</forename><surname>Barakhnin</surname></persName>
		</author>
		<author>
			<persName><forename type="first">N</forename><surname>Abdurakhmonova</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Eshkulov</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Data in Brief</title>
		<imprint>
			<biblScope unit="page">110413</biblScope>
			<date type="published" when="2024">2024</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b2">
	<analytic>
		<title level="a" type="main">Recognition of american sign language gestures in a virtual reality using leap motion</title>
		<author>
			<persName><forename type="first">A</forename><surname>Vaitkevičius</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Taroza</surname></persName>
		</author>
		<author>
			<persName><forename type="first">T</forename><surname>Blažauskas</surname></persName>
		</author>
		<author>
			<persName><forename type="first">R</forename><surname>Damaševičius</surname></persName>
		</author>
		<author>
			<persName><forename type="first">R</forename><surname>Maskeliu¯nas</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Woźniak</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Applied Sciences</title>
		<imprint>
			<biblScope unit="volume">9</biblScope>
			<biblScope unit="page">445</biblScope>
			<date type="published" when="2019">2019</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b3">
	<analytic>
		<title level="a" type="main">Child tracking and prediction of violence on children in social media using natural language processing and machine learning</title>
		<author>
			<persName><forename type="first">M</forename><surname>Nallakaruppan</surname></persName>
		</author>
		<author>
			<persName><forename type="first">G</forename><surname>Srivastava</surname></persName>
		</author>
		<author>
			<persName><forename type="first">T</forename><forename type="middle">R</forename><surname>Gadekallu</surname></persName>
		</author>
		<author>
			<persName><forename type="first">P</forename><forename type="middle">K</forename><surname>Reddy</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Krishnan</surname></persName>
		</author>
		<author>
			<persName><forename type="first">D</forename><surname>Polap</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">International Conference on Artificial Intelligence and Soft Computing</title>
				<imprint>
			<publisher>Springer</publisher>
			<date type="published" when="2023">2023</date>
			<biblScope unit="page" from="560" to="569" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b4">
	<analytic>
		<title level="a" type="main">Sustainable marketing and the role of social media: an experimental study using natural language processing (nlp)</title>
		<author>
			<persName><forename type="first">G</forename><surname>Dash</surname></persName>
		</author>
		<author>
			<persName><forename type="first">C</forename><surname>Sharma</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Sharma</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Sustainability</title>
		<imprint>
			<biblScope unit="volume">15</biblScope>
			<biblScope unit="page">5443</biblScope>
			<date type="published" when="2023">2023</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b5">
	<analytic>
		<title level="a" type="main">An analysis of bayesian classifiers</title>
		<author>
			<persName><forename type="first">P</forename><surname>Langley</surname></persName>
		</author>
		<author>
			<persName><forename type="first">W</forename><surname>Iba</surname></persName>
		</author>
		<author>
			<persName><forename type="first">K</forename><surname>Thompson</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Aaai</title>
		<imprint>
			<biblScope unit="volume">90</biblScope>
			<biblScope unit="page" from="223" to="228" />
			<date type="published" when="1992">1992</date>
			<publisher>Citeseer</publisher>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b6">
	<analytic>
		<title level="a" type="main">Grey wolf optimizer combined with k-nn algorithm for clustering problem</title>
		<author>
			<persName><forename type="first">K</forename><surname>Prokop</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">IVUS 2022: 27th International Conference on Information Technology</title>
				<imprint>
			<date type="published" when="2022">2022</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b7">
	<analytic>
		<title level="a" type="main">Knn model-based approach in classification</title>
		<author>
			<persName><forename type="first">G</forename><surname>Guo</surname></persName>
		</author>
		<author>
			<persName><forename type="first">H</forename><surname>Wang</surname></persName>
		</author>
		<author>
			<persName><forename type="first">D</forename><surname>Bell</surname></persName>
		</author>
		<author>
			<persName><forename type="first">Y</forename><surname>Bi</surname></persName>
		</author>
		<author>
			<persName><forename type="first">K</forename><surname>Greer</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">On The Move to Meaningful Internet Systems 2003: CoopIS, DOA, and ODBASE: OTM Confederated International Conferences, CoopIS, DOA, and ODBASE 2003</title>
				<meeting><address><addrLine>Catania, Sicily, Italy</addrLine></address></meeting>
		<imprint>
			<publisher>Springer</publisher>
			<date type="published" when="2003">November 3-7, 2003. 2003</date>
			<biblScope unit="page" from="986" to="996" />
		</imprint>
	</monogr>
</biblStruct>

				</listBibl>
			</div>
		</back>
	</text>
</TEI>
