## 2 Materials and Methods
### Feature Selection
The results of text classification feature value and distance are represented by 64-bit wide numbers, using one AVX instruction to realize the operation of four feature value distances at the same time. The kNN algorithm with AVX-256 acceleration is implemented as follows. 1. Initialize the distance vector vec_sum and temporary vector vec_d, using _mm256_setzero_pd, which includes four 64-bit data elements to record the distances of four feature values. 2. Construct the feature vector using instruction _mm256_loadu_pd. Use the instruction _mm256_loadu_pd to copy four feature values to construct the feature vector vec_a for training text and vec_b for text to be classified. The four elements of vector vec_a are represented by _a_\({}_{1}\), _a_\({}_{2}\), _a_\({}_{3}\) and _a_\({}_{4}\), at the same time, the four elements of vector vec_b are represented by _b_\({}_{1}\), _b_\({}_{2}\), _b_\({}_{3}\) and _b_\({}_{4}\). Each vector's composition structure is shown in Figure 3.

3. Process the sum of squares using an AVX instruction to complete multiple feature value operations, which means using the instruction _mm256_sub_pd to achieve vector subtraction, and using instruction _mm256_fimadd_pd to achieve multiplication of the difference vector and addition of the distance vector. Each operation completes the calculation of four feature value distances, thus improving the performance of kNN. \[ \begin{array}{c}\text{diff\_v}=\text{\_mm256\_sub\_pd(a\_v,b\_v)}\\ \text{sum\_v}=\text{\_mm256\_fimadd\_pd(diff\_v,diff\_v,sum\_v)}\end{array} \] (10) (4) Count distance, and sum the four distance results in the distance vector to obtain the sum of squares of all feature differences, and then obtain the Euclidean distance between the text to be classified and the samples. ## 4 Analysis of Experiments and Results

### Experimental Setup

For the text classification algorithm described in Section 3, experiments using Windows 11 Professional Edition operating system, 11 th Gen Intel(r) CoreTM i9-11950 H @ 2.60 GHz processor, Visual Studio 2022 development platform, and C++ programming language were set up to inspect the accuracy and efficiency of the text classification algorithm with AVX-256 acceleration. Two implementation methods of the text classification were designed. In the first method, the feature selection algorithm and kNN classification algorithm were realized with a traditional Single-Instruction-Single-Data (SISD) stream, whereas in the comparison method, SIMD instructions were used to complete the operations of multiple feature parameters and multiple feature value distances at once. Under the same training set, the two versions of the algorithm have the same classification results for the same target text. Since our research is mainly expected to be applied to the classification of Chinese texts, we choose THUCNews as the experimental dataset [40], which contains 740,000 news documents from 2005 to 2011, by filtering the historical data of the Sina news RSS subscription channel. Five categories were selected to classify text and inspect the comparison method in terms of improving the performance and efficiency of text classification, including finance, education, sports, technology, and entertainment. Figure 3: The composition structure of each vector. ### Criteria for Evaluating Statistical Results

The evaluation algorithm F1-measure is adopted to evaluate the statistical results [41]. Firstly, four parameters representing the number of documents of a class are defined, and the specific meaning is as follows. _A_: The kNN classification algorithm marks these texts as a category, and they belong to that category exactly. _B_: The kNN classification algorithm marks these texts as not belonging to a category, whereas, in fact, they should belong to that category. C: The kNN classification algorithm marks these texts as a category that they do not actually belong to. _D_: The kNN classification algorithm marks these texts as not belonging to a category, and they do not belong to that category exactly.