## 2 Materials and Methods
### Feature Selection
Obtain the number of occurrences \(Nd\) of keyword \(i\) in text \(k\) of category \(j\). 15. Calculate the parameter \(E\) of keyword \(i\) for category \(j\). 16. Calculate parameter \(D\) of keyword \(i\). 17. Go through each category \(j\). 18. Calculate the weight of keyword \(i\) to class \(j\). 19. Construct a feature vector function of the target text. 20. The text vector space is initialized according to the size of the keywords. 21. Find the keywords for the target text based on the keyword list. 22. Go through keywords in the target text. 23. Obtain the index and weight vector of the _i_th keyword. 24. Construct feature vector for text. Among the many feature selection algorithms, _tf-OR_ (term frequency and odds ratio) and _tf-rf_ (term frequency and relevance frequency) are excellent algorithms. The weight representation of _tf-OR_ is shown in Equation (7) and the weight representation of _tf-rf_ is shown in Equation (8), where we use \(C_{i}\) to represent the category in which keyword \(t\) occurs currently, \(\overline{C_{i}}\) to represent all other categories, _tp_ to represent the number of documents that contain keyword \(t\) in category \(C_{i}\), _fp_ to represent the number of documents that do not contain keyword \(t\) in category \(C_{i}\), _fn_ to represent the number of documents that contain keyword \(t\) in category \(\overline{C_{i}}\), and _tn_ to represent the number of documents that do not contain keyword \(t\) in category \(\overline{C_{i}}\)[28]. In Section 4.4, feature selection algorithms _tf-DE, tf-idf, tf-OR_, and _tf-rf_ are selected for comparative testing. \[w_{ij}=tf_{ij}\cdot\log\frac{tp\cdot tn}{fp\cdot fn} \tag{7}\]

\[w_{ij}=tf_{ij}\cdot\log\left(2+\frac{tp}{fn}\right) \tag{8}\]

### The kNN Classification Algorithm

The guiding idea of kNN is that if most of the \(k\) sample points nearest to the sample point belong to this certain category, then the sample point should also belong to that category, which means kNN is used in the selection of the distance function. The commonly used distance functions include Euclidean distance, Chebyshev distance, and Canberra distance [38]. In this paper, Euclidean distance is selected as the distance function to calculate the similarity between samples, which is shown in the following. \[d(x,y)=\sqrt{\sum_{i=1}^{d}(x_{i}-y_{i})^{2}} \tag{9}\]

## 3 Text Classification Algorithm Optimization Based on AVX-256

### Proposed Text Classification Process

Given an unlabeled text \(d\), the classification system searches for \(k\) adjacent labeled documents that are closest to it in the training set, and then determines the category of text \(d\) according to the classification labels of the adjacent texts. The kNN classification implementation process is as follows. 1. Transform the training set into a vector space model representation and calculate the weight of each feature. 2. Convert the unlabeled text \(d\) in a similar way as in step (1) and calculate the weight of the corresponding phrase element. 3. Calculate the distance between text \(d\) and each text in the training set. 4. Identify the \(k\) training documents with the smallest distance from text \(d\). 5. According to the category attributes of the first \(k\) training documents, text \(d\) is generally classified as the most frequent sample category in the \(k\) training documents. In essence, the kNN classification model has no specific training and learning process, and its classification process only calculates the similarity between the unlabeled text and each training set sample. Therefore, the time and space complexity of the kNN algorithm is high. With the increase in the number of training samples, the storage resource consumption of classification is large and the time cost is high.