English text intelligent clustering scoring method and device based on XGBOOST algorithm
By combining the XGBOOST algorithm and the particle swarm optimization module, the high-dimensional sparsity and synonym problems in English text clustering are solved, fast and efficient text clustering is achieved, and clustering accuracy and efficiency are improved.
Patent Information
- Application Number
- CN202410200118.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-23
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2044-02-23
AI Technical Summary
Existing English text clustering algorithms have an imbalance between accuracy and efficiency when dealing with high-dimensional sparsity, synonyms and near-synonyms. Traditional algorithm optimization leads to high time complexity, making it difficult to cluster quickly and accurately.
The XGBOOST algorithm is combined with the particle swarm optimization module. The TF-IDF algorithm is used to screen feature words. The improved particle swarm optimization module is used to iteratively calculate the fitness value of feature words. The autoregressive conditional expected value clustering module is constructed to form a low-dimensional feature subset for clustering.
It improves the speed and accuracy of English text clustering, reduces time consumption, and improves the accuracy of clustering analysis and evaluation.
Smart Images

Figure CN118093869B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of artificial intelligence, and in particular relates to an English text intelligent clustering scoring method and device based on the XGBOOST algorithm. Background Art
[0002] A great deal of theoretical and applied research has been conducted in the field of English text clustering, applying text clustering to language processing, text mining, intelligent scoring, and information retrieval. The PEG system (Project Essay Grade, PEG) is the earliest automatic essay scoring system that uses shallow linguistic features of the text for analysis and scoring. The Intelligent Essay Assessor (IEA) is developed based on Latent Semantic Analysis (LSA) technology, a complex statistical technique for text indexing and information extraction. The Electronic Essay Rater (E-rater) uses statistical natural language processing technology to extract linguistic features to classify and score articles. The Bayesian Essay Test Scoring System (BETSY) is a system that uses probability theory to classify text based on training corpus.
[0003] However, due to the complexity of text, there are still several problems: First, the high dimensionality and sparsity of text objects are difficult to handle. Due to the large number of feature words and the fact that the text to be processed is often at the level of big data, the matrix after representing the document collection with the vector space model is high-dimensional and sparse, which makes processing difficult and reduces the accuracy of similarity calculation. Second, the problem of synonyms and near-synonyms. If the connection between synonyms or near-synonyms is ignored and they are treated as independent feature items, feature redundancy will occur and the clustering accuracy will decrease. Third, the balance between efficiency and accuracy: Many researchers seek to combine classical algorithms with other algorithms to achieve higher accuracy, such as using genetic algorithms to optimize the initial center point of the cluster, but at the same time, this increases the time complexity of the algorithm and reduces efficiency. Summary of the Invention
[0004] The main purpose of the present invention is to overcome the shortcomings and deficiencies of the existing technology and provide an English text intelligent clustering scoring method and device based on the XGBOOST algorithm. By utilizing the particle swarm optimization algorithm to adjust the global and local feature search capabilities across domains, further screening the feature words according to the weights, a feature subset with smaller dimensions is obtained, thereby improving the system's global search capability and convergence speed, and greatly accelerating the speed of text clustering.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions:
[0006] In a first aspect, the present invention provides an English text intelligent clustering scoring method based on the XGBOOST algorithm, comprising the following steps:
[0007] Perform word segmentation on the original English text data, filter out stop words, and obtain the text feature word set;
[0008] Calculate the document frequency of the text feature word set, perform rough selection according to the set ratio and document frequency, and form a feature word subset;
[0009] An XGBOOST-based intelligent clustering scoring model for English text was constructed. The model includes a TF-IDF algorithm module, an improved particle swarm optimization module, and a clustering module. The TF-IDF algorithm module is used to convert feature word subsets into text vectors. The required feature words are selected, and feature value weights are calculated. Each text vector is traversed and encoded according to the selected feature words. The improved particle swarm optimization module is used to iteratively calculate the fitness values of feature words. Feature words are selected based on their feature value weights, and the feature words with the best fitness value and the global optimality are selected. After decoding, the final feature subset is obtained.
[0010] Use the clustering module to cluster the final feature subset, select clusters based on the autoregressive conditional expectation value, and output the clustering results when the specified number of clusters is reached; after multiple training sessions, obtain the trained XGBOOST-based English text intelligent clustering scoring model;
[0011] Input the text to be scored into the trained XGBOOST-based English text intelligent clustering scoring model, and evaluate the input text according to the clustering results.
[0012] As a preferred technical solution, the word segmentation process includes the following steps:
[0013] Set the string to be divided S=c1,c2,…,c n , where c i is a single word, i=1,2,…,n, n is the length of the string, n≥1;
[0014] Create a segmented directed acyclic graph G with n+1 nodes, and the nodes are numbered V0, V1, ..., V n , where the adjacent nodes V k-1 ,V k Directed edges between <V k-1 ,V k >, the length of the side is L k , the word corresponding to the edge defaults to c k ,k=1,2,…,n;
[0015] If w=c i c i+1 …c j Is a word, then create node V i-1 ,V j Directed edges between <V i-1 ,V j >, the length of the side is L w , the word corresponding to the edge is w, 0<i<j≤n.
[0016] As a preferred technical solution, the rough selection specifically includes: deleting feature words within a specific range of text frequency according to a certain ratio.
[0017] As a preferred technical solution, the calculation of the eigenvalue weight includes the following steps:
[0018] Calculate the inverse document frequency (IDF) of a word in a text as follows:
[0019]
[0020] The eigenvalue weight is as follows:
[0021] w ij =tf ij ×idf i
[0022] Where N is the total number of texts in the collection, tf ij Characteristic t i In the text j The number of occurrences in df i The feature t appears in the text collection i The number of texts.
[0023] As a preferred technical solution, the fitness value of the feature word is calculated as follows:
[0024]
[0025] Where m represents the number of random texts drawn from each generation, |P| represents the population size, and d i (j) represents the i-th text represented by the j-th individual, i represents the i-th text, j represents the j-th individual, and Ind represents the Ind-th individual.
[0026] As a preferred technical solution, the improved particle swarm optimization module is used to iteratively calculate the fitness value of the feature words, and the feature words are selected by calculating the feature value weights to select the feature words with the best fitness value and the global optimal value, specifically:
[0027] Calculate the fitness value of each feature word and initialize the optimal solution within the group and the global optimal position according to the feature value weight;
[0028] Update the speed and position of each feature word according to the set method;
[0029] Continue to calculate the fitness value of each feature word, compare the current fitness value with the optimal solution in each word group, and update the current fitness value to the new optimal solution in the group if the current fitness value is better;
[0030] Compare the new optimal solutions within each word group to obtain a new global optimal solution; compare the new global optimal solution with the global optimal position; if the new global optimal solution is better, update the global optimal position;
[0031] According to the set accuracy condition or the number of iterations, the iteration is terminated, and the feature word with the best fitness value and the global optimality is output in the global optimal position.
[0032] As a preferred technical solution, the speed and position of each feature word are updated according to a set method, specifically:
[0033] When the accuracy or number of iterations is less than the set value, the speed and location Update as follows:
[0034]
[0035]
[0036] When speed If it is greater than the set threshold, then:
[0037]
[0038] When the speed If it is less than the set threshold, then:
[0039]
[0040] Where ω represents the inertia weight, represents the speed of particle id at iteration number t, c1 and c2 represent learning factors, r1 represents a random number between 0 and 1, and r2 represents a random number between 0 and 1. represents the position of particle id at iteration number t, represents the set of optimal solutions within the group, represents the set of global optimal positions, Indicates the velocity of particle id at iteration number t+1;
[0041] When the accuracy or number of iterations are different, the formula is as follows:
[0042]
[0043]
[0044] when hour,
[0045] when hour,
[0046] in, The sigmoid value representing the particle id update speed, Indicates the velocity of particle id at iteration number t+1, x id Indicates the position of the particle id.
[0047] As a preferred technical solution, the clustering module is used to cluster the final feature subset, select clusters according to the autoregressive conditional expected value, and output the clustering results when the number of clusters reaches the specified number, specifically:
[0048] S41, standardize all sample vectors so that the vector modulus is 1, and initialize a cluster table, which includes clusters composed of sample points;
[0049] S42. Take the cluster with the largest autoregressive conditional expected value from the cluster table;
[0050] S43, clustering the selected clusters using the SKM method to obtain clustering results;
[0051] S44. Filter out the cluster with the smallest regression conditional expected value in the clustering results;
[0052] S45. Add the above two clusters to the cluster table;
[0053] S46, determine whether the clusters in the cluster table have reached the specified number, if so, output the result, otherwise repeat steps S41-S45;
[0054] The autoregressive conditional expected value SCE is as follows:
[0055]
[0056] Among them, x represents the sample vector of the final feature subset, Represents the transposed vector of the j-th cluster center vector.
[0057] In a second aspect, the present invention provides an English text intelligent clustering scoring system based on the XGBOOST algorithm, which is applied to the English text intelligent clustering scoring method based on the XGBOOST algorithm, including a feature engineering module, a rough selection module, a reselection module, a model training module and a cluster scoring module;
[0058] Feature engineering module, used to perform word segmentation on original English text data, filter stop words, and obtain text feature word sets;
[0059] The coarse selection module is used to calculate the document frequency of the text feature word set, and perform coarse selection according to the set ratio and document frequency to form a feature word subset;
[0060] Then, a module is selected to build an XGBOOST-based English text intelligent clustering scoring model. The model includes a TF-IDF algorithm module, an improved particle swarm optimization module, and a clustering module. The TF-IDF algorithm module is used to convert the feature word subset into a text vector. The required feature words are selected, the feature value weights are calculated, each text vector is traversed, and encoding is performed according to the selected feature words. The improved particle swarm optimization module is used to iteratively calculate the fitness value of the feature words. The feature words are selected according to the feature value weights, and the feature words with the best fitness value and the global optimality are selected. After decoding, the final feature subset is obtained.
[0061] The model training module is used to cluster the final feature subset using the clustering module, select clusters based on the autoregressive conditional expectation value, and output the clustering results when the specified number of clusters is reached. After multiple training sessions, the trained XGBOOST-based English text intelligent clustering scoring model is obtained.
[0062] The clustering scoring module is used to input the text to be scored into the trained XGBOOST-based English text intelligent clustering scoring model and evaluate the input text according to the clustering results.
[0063] In a third aspect, the present invention provides an electronic device, comprising:
[0064] at least one processor; and,
[0065] a memory communicatively connected to the at least one processor; wherein,
[0066] The memory stores computer program instructions that can be executed by the at least one processor, and the computer program instructions are executed by the at least one processor to enable the at least one processor to execute the English text intelligent clustering scoring method based on the XGBOOST algorithm.
[0067] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0068] (1) The present invention utilizes an improved particle swarm optimization module to iteratively calculate the fitness of feature words, selects the feature words according to the feature value weights, selects the feature words with the best fitness value and the global best, and adjusts the global and local search capabilities, so that it can be easily applied to various practical problems; in addition, the formed feature set has low dimensionality, which can greatly accelerate the speed and accuracy of text clustering.
[0069] (2) The present invention uses a clustering module to cluster low-dimensional feature subsets, selects clusters based on the autoregressive conditional expectation value, and outputs clustering results when the number of clusters reaches a specified number, thereby improving the accuracy of English text clustering analysis and evaluation while reducing time overhead. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0071] Figure 1 This is a flowchart of an English text intelligent clustering scoring method based on the XGBOOST algorithm according to an embodiment of the present invention;
[0072] Figure 2 Flowchart of the improved particle swarm optimization algorithm according to the embodiment of the present invention;
[0073] Figure 3 This is a schematic diagram of the structure of an English text intelligent clustering scoring system based on the XGBOOST algorithm according to an embodiment of the present invention;
[0074] Figure 4 2 is a structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0075] In order to enable those skilled in the art to better understand the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0076] References to "embodiments" in this application mean that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described in this application may be combined with other embodiments.
[0077] See also Figure 1 The present embodiment provides an English text intelligent clustering scoring method based on the XGBOOST algorithm, comprising the following steps:
[0078] S1. Perform word segmentation on the original English text data, filter out stop words, and obtain a text feature word set;
[0079] In step S1, the N-shortest path algorithm is used to segment the original English text data into words. The process is as follows:
[0080] S11. Let the character string to be divided S=c1,c2,…,c n , where c i For a single word, i=1,2,…,n, n is the length of the string, n≥1, and a segmented directed acyclic graph G with n+1 nodes is established. The nodes are numbered V0, V1,…, V n .
[0081] S12, adjacent node V k-1 ,V k Directed edges between <V k-1 ,V k >, the length of the side is L k , the word corresponding to the edge defaults to c k ,k=1,2,…,n. If w=c i c i+1 …c j is a word, then node V i-1 ,V j Directed edges between <V i-1 ,V j >, the length of the side is L w , the word corresponding to the edge is w, 0<i<j≤n, so all the words contained in the string to be divided S correspond one to one to the edges in the segmented directed acyclic graph G.
[0082] After word segmentation, the currently stopped words or phrases need to be filtered and deleted, and the text obtained after filtering and deletion is used as the text feature word set of this embodiment. The stop words can refer to the Harbin Institute of Technology stop word list.
[0083] S2. Calculate the document frequency of the text feature word set, perform rough selection according to the set ratio and document frequency, and form a feature word subset;
[0084] To avoid potential errors or outliers, this embodiment removes extreme values from the text feature word set. First, the document frequency of each candidate feature word in each data set is calculated. Then, based on a certain ratio k, feature words with a document frequency below 0.02% and above 15% of the total text in each set are removed to obtain the roughly selected feature subset D'.
[0085] S3. Construct an intelligent clustering scoring model for English text based on XGBOOST. The model includes a TF-IDF algorithm module, an improved particle swarm optimization module, and a clustering module. Use the TF-IDF algorithm module to convert the feature word subset into a text vector, select the required feature words, calculate the feature value weights, traverse each text vector, and encode according to the selected feature words. Use the improved particle swarm optimization module to iteratively calculate the fitness value of the feature words, select the feature words according to the feature value weights, select the feature words with the best fitness value and the global optimality, and obtain the final feature subset after decoding.
[0086] The TF-IDF algorithm module uses the TF-IDF algorithm (term frequency–inverse document frequency) to calculate the weight of the text vector formed by D', and then selects the feature words based on the weight.
[0087] Specifically, a specific example can be used for explanation.
[0088] Before encoding, the weight of the text features in the text needs to be calculated. There are only two possibilities for screening a feature: one is to be selected, and the other is to be discarded. Therefore, feature selection can be regarded as a discrete optimization problem, and the values "1" and "0" are used to represent these two states respectively.
[0089] Specifically, the process of calculating the eigenvalue weight includes the following steps:
[0090] Calculate the inverse document frequency (IDF) of a word in a text as follows:
[0091]
[0092] The eigenvalue weight is as follows:
[0093] w ij =tf ij ×idf i
[0094] Where N is the total number of texts in the collection, tf ij Characteristic t iIn the text j The number of occurrences in df i The feature t appears in the text collection i The number of texts.
[0095] Assume that after pre-selection of text features, there are 10 feature words left. Assume that the particle swarm population size is 5. Then the initial population is a matrix with 5 rows and 10 columns. Each position in the matrix randomly generates "0" or "1":
[0096] Taking the first row as an example, This means that in this solution, the 1st, 4th, 5th, 6th, 8th, and 10th feature words are selected, while the remaining feature words are discarded. After processing, the English text vector is encoded.
[0097] After initialization, the particles are iteratively updated according to the algorithm process, and finally the global optimal individual with the best fitness value is selected as the final solution. Assuming that after 100 iterations, the algorithm terminates, and at this time gbest = {1,0,1,1,0,1,0,0,0,1}, the text begins to be decoded, and the algorithm selects the 1st, 3rd, 4th, 6th and 10th feature words as the final feature subset, and the remaining features are discarded. Specifically, this embodiment utilizes the improved binary particle swarm optimization algorithm (GSBPSO) for feature reselection, so that decoding can be achieved and feature dimensionality can be reduced to obtain a feature subset with a smaller dimension. For details, see the description of the improved particle swarm optimization module.
[0098] The improved particle swarm optimization module is used to reselect feature words based on the improved binary particle swarm optimization algorithm (GSBPSO) and obtain the final feature subset after decoding.
[0099] To enhance the algorithm's optimization capabilities, we strengthened its global search capabilities in the initial stages and improved its local search capabilities in subsequent stages. This is because global search helps the algorithm find potential high-quality solutions in a wider search space, while local search helps the algorithm gradually approach the optimal solution within a finer spatial structure. Based on the PSO algorithm, we made a series of improvements to it to enhance its capabilities in the global search phase. Specifically, we introduced a position update method based on the Sigmoid function. By adjusting the formula for particle position updates, the algorithm is able to better explore potential high-quality solutions in the global search phase. The Sigmoid function is a function with linear growth and saturation characteristics. Applying it to the particle position update formula can gradually reduce the particle speed during the search process, thereby better balancing the exploration and exploitation strategies in the global search phase. With this improvement, our algorithm can more comprehensively search for potential high-quality solutions in the global search phase, improving the overall optimization capabilities of the algorithm.
[0100] The Particle Swarm Optimization (PSO) algorithm was originally inspired by the collaborative search for solutions to problems by individuals within groups of animals, such as flocks of birds or schools of fish, through interactive behaviors like information sharing. It is a biomimetic stochastic optimization algorithm. PSO is relatively simple to operate, lacking crossover or mutation operations. Particles are updated solely by velocity. Its memory allows for the efficient retention of high-quality particles. Furthermore, its easily adjustable parameters allow for the optimization of both global and local search capabilities, making it easily applicable to a variety of practical problems. In this project, PSO was used to further screen feature words, resulting in a smaller feature subset.
[0101] The advantage of the improved binary particle swarm optimization algorithm (GSBPSO) used in this embodiment is that the calculation of the fitness function is improved. The fitness function calculation can better adjust the global and local search capabilities, so that it can be easily applied to various practical problems. Figure 2 As shown in the figure, the improved binary particle swarm optimization algorithm (GSBPSO) has the following specific steps:
[0102] S31, determine the parameters; the parameters include population size N, speed range [-v max ,v max ], inertia weight ω, learning factors c1, c2, maximum number of iterations MaxIter and thresholds θ, γ;
[0103] S32, initialization. Assume that the current number of iterations is t = 0. According to the range of the solution, randomly generate N individuals As the initial position. According to the speed range, the speed of each particle is randomly generated Initialize the historical optimal position of each particle
[0104] S33, updating the speed and position of each feature word according to the set method;
[0105] S331, when t<γ*MaxIter, the speed and location Update as follows:
[0106]
[0107]
[0108] When the speed If it is greater than the set threshold, then:
[0109]
[0110] When the speed If it is less than the set threshold, then:
[0111]
[0112] Where ω represents the inertia weight, represents the speed of particle id at iteration number t, c1 and c2 represent learning factors, r1 represents a random number between 0 and 1, and r2 represents a random number between 0 and 1. represents the position of particle id at iteration number t, represents the set of optimal solutions within the group, represents the set of global optimal positions, Indicates the velocity of particle id at iteration number t+1;
[0113] S332. When the accuracy or number of iterations have other situations, the following formula is used:
[0114]
[0115]
[0116] when hour,
[0117] when hour,
[0118] in, The sigmoid value representing the particle update speed, Indicates the velocity of particle id at iteration number t+1, x idIndicates the position of the particle id.
[0119] S34, continue to calculate the fitness value of each feature word, compare the current fitness value with the optimal solution in each word group, if the current fitness value is better, update the current fitness value to the new optimal solution in the group
[0120] S35, comparing the new optimal solutions within each word group to obtain a new global optimal solution; comparing the new global optimal solution with the global optimal position, and if the new global optimal solution is better, updating the global optimal position;
[0121] S36. The iteration is terminated according to the set accuracy condition or the number of iterations, and the feature word with the best fitness value and the global optimality is output in the global optimal position.
[0122] S4. Use the clustering module to cluster the final feature subset, select clusters based on the autoregressive conditional expectation value, and output the clustering results when the specified number of clusters is reached; repeat the above steps, and after multiple trainings, obtain the trained XGBOOST-based English text intelligent clustering scoring model;
[0123] After the feature words with the best fitness value and the best global value are obtained, the final feature subset output needs to be clustered. In this embodiment, a binary seed k-means clustering algorithm is used for text clustering.
[0124] K-means is a classic partition-based unsupervised clustering algorithm. It is simple, efficient, and easy to implement, and has applications in a wide range of fields. The algorithm begins by randomly initializing a set of cluster centers. It then repeatedly uses these centers to partition the dataset and updates the centers within each partitioned cluster until the centers converge and remain stable. The K-means algorithm is very sensitive to cluster centers, and the resulting clustering results from different cluster centers can vary significantly, resulting in poor algorithm stability and the risk of premature convergence and local optima. The K-means algorithm performs well when the data feature dimension is small and the differences between clusters are significant. While the K-means algorithm is relatively simple to implement, the most primitive method for determining cluster centers is to randomly select K points within the data range as the initial cluster centers. However, the randomness of the initial cluster center selection significantly affects the quality of the clustering.
[0125] Therefore, this embodiment improves the K-means algorithm by calculating the autoregressive conditional expectation function SCE, as follows:
[0126] S41, standardize all sample vectors so that the vector modulus is 1, and initialize a cluster table, which includes clusters composed of sample points;
[0127] S42. Take the cluster with the largest autoregressive conditional expected value from the cluster table;
[0128] S43, clustering the selected clusters using the SKM method to obtain clustering results; step S43 needs to be executed multiple times in a loop;
[0129] S44, filter out the cluster with the smallest regression conditional expected value in the clustering results;
[0130] S45. Add the above two clusters to the cluster table;
[0131] S46, determine whether the number of clusters in the cluster table reaches the specified number, if the number of clusters reaches 2, output the result, otherwise repeat steps S41-S45;
[0132] The autoregressive conditional expected value SCE is as follows:
[0133]
[0134] Among them, x represents the sample vector of the final feature subset, Represents the transposed vector of the j-th cluster center vector.
[0135] It's important to note that the SKM method is an unsupervised learning algorithm used to partition a dataset into clusters. It leverages the high ability to distinguish between good and bad object groups, dividing all objects into two clusters. Objects within the same cluster are highly similar, while objects between different clusters are less similar. Clusters with fewer objects are selected as outliers. The distance from each outlier to the center of the cluster containing normal objects is used as the object's anomaly score, with higher scores indicating increased anomaly.
[0136] S5. Input the text to be scored into the trained XGBOOST-based English text intelligent clustering scoring model, and evaluate the input text according to the clustering results.
[0137] It should be noted that, for the sake of convenience, the aforementioned method embodiments are all expressed as a series of action combinations, but those skilled in the art should know that the present invention is not limited to the described order of actions, because according to the present invention, certain steps can be performed in other orders or simultaneously.
[0138] Based on the same idea as the English text intelligent clustering scoring method based on the XGBOOST algorithm in the above embodiment, the present invention also provides an English text intelligent clustering scoring system based on the XGBOOST algorithm, which can be used to execute the above-mentioned English text intelligent clustering scoring method based on the XGBOOST algorithm. For ease of explanation, the structural diagram of the embodiment of the English text intelligent clustering scoring system based on the XGBOOST algorithm only shows the parts related to the embodiment of the present invention. Those skilled in the art will understand that the illustrated structure does not constitute a limitation of the device, and may include more or fewer components than shown, or combine certain components, or arrange the components differently.
[0139] See also Figure 3 In another embodiment of the present application, an English text intelligent clustering scoring system 10 based on the XGBOOST algorithm is provided, which includes a feature engineering module 11, a rough selection module 12, a reselection module 13, a model training module 14 and a cluster scoring module 15;
[0140] Feature engineering module 11, used to perform word segmentation processing on the original English text data, filter stop words, and obtain a text feature word set;
[0141] A rough selection module 12 is used to calculate the document frequency of the text feature word set, and perform rough selection according to a set ratio and document frequency to form a feature word subset;
[0142] Then, module 13 is selected to construct an XGBOOST-based English text intelligent clustering scoring model, which includes a TF-IDF algorithm module, an improved particle swarm optimization module, and a clustering module; the TF-IDF algorithm module is used to convert the feature word subset into a text vector, the required feature words are selected, the feature value weights are calculated, each text vector is traversed, and encoding is performed according to the selected feature words; the improved particle swarm optimization module is used to iteratively calculate the fitness value of the feature words, the feature words are selected according to the feature value weights, the feature words with the best fitness value and the global optimality are selected, and the final feature subset is obtained after decoding;
[0143] The model training module 14 is used to cluster the final feature subset using the clustering module, select clusters according to the autoregressive conditional expectation value, and output the clustering results when the number of clusters reaches the specified number; repeat the above steps, and after multiple trainings, obtain the trained XGBOOST-based English text intelligent clustering scoring model;
[0144] The cluster scoring module 15 is used to input the text to be scored into the trained XGBOOST-based English text intelligent clustering scoring model and evaluate the input text according to the clustering results.
[0145] It should be noted that the English text intelligent clustering scoring system based on the XGBOOST algorithm of the present invention corresponds one-to-one to the English text intelligent clustering scoring method based on the XGBOOST algorithm of the present invention. The technical features and beneficial effects described in the embodiment of the above-mentioned English text intelligent clustering scoring method based on the XGBOOST algorithm are applicable to the embodiment of the English text intelligent clustering scoring method based on the XGBOOST algorithm. For specific contents, please refer to the description in the embodiment of the method of the present invention, which will not be repeated here. This is hereby declared.
[0146] In addition, in the implementation of the English text intelligent clustering scoring system based on the XGBOOST algorithm in the above embodiment, the logical division of each program module is only an example. In actual application, the above functions can be assigned to different program modules as needed, for example, for the convenience of corresponding hardware configuration requirements or software implementation. That is, the internal structure of the English text intelligent clustering scoring system based on the XGBOOST algorithm is divided into different program modules to complete all or part of the functions described above.
[0147] See also Figure 4 In one embodiment, an electronic device for implementing an English text intelligent clustering scoring method based on the XGBOOST algorithm is provided. The electronic device 20 may include a first processor 21, a first memory 22 and a bus, and may also include a computer program stored in the first memory 22 and executable on the first processor 21, such as an English text intelligent clustering scoring program 23 based on the XGBOOST algorithm.
[0148] Among them, the first memory 22 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (for example, SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the first memory 22 can be an internal storage unit of the electronic device 20, such as a mobile hard disk of the electronic device 20. In other embodiments, the first memory 22 can also be an external storage device of the electronic device 20, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 20. Furthermore, the first memory 22 can also include both an internal storage unit of the electronic device 20 and an external storage device. The first memory 22 can not only be used to store application software and various types of data installed on the electronic device 20, such as the code of the English text intelligent clustering scoring program 23 based on the XGBOOST algorithm, but can also be used to temporarily store data that has been output or is to be output.
[0149] In some embodiments, the first processor 21 may be composed of an integrated circuit, such as a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and a combination of various control chips. The first processor 21 is the control core (Control Unit) of the electronic device, connecting the various components of the entire electronic device using various interfaces and lines, and executing or executing programs or modules stored in the first memory 22, as well as calling data stored in the first memory 22, to perform various functions of the electronic device 20 and process data.
[0150] Figure 4 Only the electronic device with components is shown, and it can be understood by those skilled in the art that Figure 4 The structure shown does not constitute a limitation on the electronic device 20 , and the electronic device 20 may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.
[0151] The English text intelligent clustering scoring program 23 based on the XGBOOST algorithm stored in the first memory 22 of the electronic device 20 is a combination of multiple instructions. When running in the first processor 21, it can achieve the following:
[0152] Perform text segmentation on the original English text data, filter out stop words, and obtain the text feature word set;
[0153] Calculate the document frequency of the text feature word set, perform rough selection according to the set ratio and document frequency, and form a feature word subset;
[0154] An XGBOOST-based intelligent clustering scoring model for English text was constructed. The model includes a TF-IDF algorithm module, an improved particle swarm optimization module, and a clustering module. The TF-IDF algorithm module is used to convert feature word subsets into text vectors. The required feature words are selected, and feature value weights are calculated. Each text vector is traversed and encoded according to the selected feature words. The improved particle swarm optimization module is used to iteratively calculate the fitness values of feature words. Feature words are selected based on their feature value weights, and the feature words with the best fitness value and the global optimality are selected. After decoding, the final feature subset is obtained.
[0155] Use the clustering module to cluster the final feature subset, select clusters based on the autoregressive conditional expectation value, and output the clustering results when the specified number of clusters is reached; repeat the above steps, and after multiple trainings, obtain the trained XGBOOST-based English text intelligent clustering scoring model;
[0156] Input the text to be scored into the trained XGBOOST-based English text intelligent clustering scoring model, and evaluate the input text according to the clustering results.
[0157] Furthermore, if the modules / units integrated in the electronic device 20 are implemented as software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium. The computer-readable medium may include any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard drive, a magnetic disk, an optical disk, a computer memory, or a read-only memory (ROM).
[0158] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0159] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0160] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be considered as equivalent replacement methods and are included in the scope of protection of the present invention.
Claims
1. English text intelligent clustering scoring method based on XGBOOST algorithm, characterized by: The steps include: Perform word segmentation on the original English text data, filter out stop words, and obtain the text feature word set; Calculate the document frequency of the text feature word set, perform rough selection according to the set ratio and document frequency, and form a feature word subset; Build an XGBOOST-based intelligent clustering and scoring model for English text, which includes a TF-IDF algorithm module, an improved particle swarm optimization module, and a clustering module. Use the TF-IDF algorithm module to convert feature word subsets into text vectors, select the required feature words, calculate the feature value weights, traverse each text vector, and encode according to the selected feature words. The improved particle swarm optimization module is used to iteratively calculate the fitness value of the feature words, and the feature words are selected according to the feature value weights. The feature words with the best fitness value and the global optimal are selected, and the final feature subset is obtained after decoding; Use the clustering module to cluster the final feature subset, select clusters based on the autoregressive conditional expectation value, and output the clustering results when the specified number of clusters is reached; after multiple training sessions, obtain the trained XGBOOST-based English text intelligent clustering scoring model; Input the text to be scored into the trained XGBOOST-based English text intelligent clustering scoring model, and evaluate the input text according to the clustering results.
2. The English text intelligent clustering scoring method based on the XGBOOST algorithm according to claim 1 is characterized in that: The word segmentation process comprises the following steps: Set the string to be divided S=c1,c2,…,c n , where c i is a single word, i=1,2,…,n, n is the length of the string, n≥1; Create a segmented directed acyclic graph G with n+1 nodes, and the nodes are numbered V0, V1, ..., V n , where the adjacent nodes V k-1 ,V k Directed edges between <V k-1 ,V k >, the length of the side is L k , the word corresponding to the edge defaults to c k ,k=1,2,…,n; If w=c i c i+1 …c j Is a word, then create node V i-1 ,V j Directed edges between <V i-1 ,V j >, the length of the side is L w , the word corresponding to the edge is w, 0<i<j≤n.
3. The English text intelligent clustering scoring method based on the XGBOOST algorithm according to claim 1 is characterized in that: The rough selection specifically includes: deleting feature words within a specific range of text frequency according to a certain ratio.
4. The English text intelligent clustering scoring method based on the XGBOOST algorithm according to claim 1 is characterized in that: The calculation of the eigenvalue weights comprises the following steps: Calculate the inverse document frequency (IDF) of a word in a text as follows: The eigenvalue weight is as follows: w ij =tf ij ×idf i Where N is the total number of texts in the collection, tf ij Characteristic t i In the text j The number of occurrences in df i The feature t appears in the text collection i The number of texts.
5. The English text intelligent clustering scoring method based on the XGBOOST algorithm according to claim 1 is characterized in that: The fitness value of the feature word is calculated as follows: Where m represents the number of random texts drawn from each generation, |P| represents the population size, and d i (j) represents the i-th text represented by the j-th individual, i represents the i-th text, j represents the j-th individual, and Ind represents the Ind-th individual.
6. The English text intelligent clustering scoring method based on the XGBOOST algorithm according to claim 1 is characterized in that: The improved particle swarm optimization module is used to iteratively calculate the fitness value of the feature words, and the feature words are selected by calculating the feature value weights to select the feature words with the best fitness value and the global optimal value. Specifically: Calculate the fitness value of each feature word and initialize the optimal solution within the group and the global optimal position according to the feature value weight; Update the speed and position of each feature word according to the set method; Continue to calculate the fitness value of each feature word, compare the current fitness value with the optimal solution in each word group, and update the current fitness value to the new optimal solution in the group if the current fitness value is better; Compare the new optimal solutions within each word group to obtain a new global optimal solution; compare the new global optimal solution with the global optimal position; if the new global optimal solution is better, update the global optimal position; According to the set accuracy condition or the number of iterations, the iteration is terminated, and the feature word with the best fitness value and the global optimality is output in the global optimal position.
7. The English text intelligent clustering scoring method based on the XGBOOST algorithm according to claim 6 is characterized in that: The speed and position of each feature word are updated in a set manner, specifically: When the accuracy or number of iterations is less than the set value, the speed and location Update as follows: When the speed If it is greater than the set threshold, then: When the speed If it is less than the set threshold, then: Where ω represents the inertia weight, represents the speed of particle id at iteration number t, c1 and c2 represent learning factors, r1 represents a random number between 0 and 1, and r2 represents a random number between 0 and 1. represents the position of particle id at iteration number t, represents the set of optimal solutions within the group, represents the set of global optimal positions, Indicates the velocity of particle id at iteration number t+1; When the accuracy or number of iterations are different, the formula is as follows: when hour, when hour, in, The sigmoid value representing the particle id update speed, Indicates the velocity of particle id at iteration number t+1, x id Indicates the position of the particle id.
8. The English text intelligent clustering scoring method based on the XGBOOST algorithm according to claim 1 is characterized in that: The clustering module is used to cluster the final feature subset, select clusters according to the autoregressive conditional expected value, and output the clustering results when the specified number of clusters is reached. Specifically: S41, standardize all sample vectors so that the vector modulus is 1, and initialize a cluster table, which includes clusters composed of sample points; S42. Take the cluster with the largest autoregressive conditional expected value from the cluster table; S43, clustering the selected clusters using the SKM method to obtain clustering results; S44. Filter out the cluster with the smallest regression conditional expected value in the clustering results; S45. Add the above two clusters to the cluster table; S46, determine whether the clusters in the cluster table have reached the specified number, if so, output the result, otherwise repeat steps S41-S45; The autoregressive conditional expected value SCE is as follows: Among them, x represents the sample vector of the final feature subset, Represents the transposed vector of the j-th cluster center vector.
9. English text intelligent clustering scoring system based on XGBOOST algorithm, characterized by: An English text intelligent clustering scoring method based on the XGBOOST algorithm applied to any one of claims 1-8, comprising a feature engineering module, a rough selection module, a reselection module, a model training module, and a cluster scoring module; Feature engineering module, used to perform word segmentation on original English text data, filter stop words, and obtain text feature word sets; The coarse selection module is used to calculate the document frequency of the text feature word set, and perform coarse selection according to the set ratio and document frequency to form a feature word subset; Then, we select a module to build an XGBOOST-based English text intelligent clustering scoring model. The model includes a TF-IDF algorithm module, an improved particle swarm optimization module, and a clustering module. We use the TF-IDF algorithm module to convert the feature word subset into a text vector, select the required feature words, calculate the feature value weights, traverse each text vector, and encode according to the selected feature words. The improved particle swarm optimization module is used to iteratively calculate the fitness value of the feature words, and the feature words are selected according to the feature value weights. The feature words with the best fitness value and the global optimal are selected, and the final feature subset is obtained after decoding; The model training module is used to cluster the final feature subset using the clustering module, select clusters based on the autoregressive conditional expectation value, and output the clustering results when the specified number of clusters is reached. After multiple training sessions, the trained XGBOOST-based English text intelligent clustering scoring model is obtained. The clustering scoring module is used to input the text to be scored into the trained XGBOOST-based English text intelligent clustering scoring model and evaluate the input text according to the clustering results.
10. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores computer program instructions that can be executed by the at least one processor, and the computer program instructions are executed by the at least one processor so that the at least one processor can execute the English text intelligent clustering scoring method based on the XGBOOST algorithm as described in any one of claims 1 to 8.