Personalized government affair service recommendation method and system based on artificial intelligence

Through the clustering model based on optimization algorithm, the government service recommendation is recommended through the clustering model based on the optimization algorithm and the improved transformer model of the two-way gated cycle unit, the traditional government service recommendation method is solved in terms of accuracy and personalization degree, and a more efficient government service recommendation effect is achieved.

CN119557518AActive Publication Date: 2025-03-04王敏敏

Patent Information

Application Number
CN202510113384.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-24
Publication Date
2025-03-04
Estimated Expiration
2045-01-24

AI Technical Summary

Technical Problem

Traditional government service recommendation methods are difficult to capture potential laws among users, resulting in low accuracy and personalization of recommendations, and high-dimensional user demand data can easily lead to increased information redundancy and noise, and low computing efficiency.

Method used

The clustering model based on optimization algorithm is used for user classification, which improves the interpretability and structure of data and reduces the redundancy of input data; combined with the improved transformer model of the bidirectional gated cycle unit, the timing characteristics of user information and government service data are extracted, and the long-term dependency relationship is captured.

Benefits of technology

It improves the accuracy and accuracy of the recommended results, enhances the effect of personalized recommendations, reduces information redundancy and noise, and improves computing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119557518A_ABST
    Figure CN119557518A_ABST
Patent Text Reader

Abstract

The invention discloses a personalized government affair service recommendation method and system based on artificial intelligence. The method comprises the steps of data collection, data preprocessing, user classification model construction, service recommendation model construction and personalized service recommendation. The invention relates to the technical field of intelligent government affair services, in particular to a personalized government affair service recommendation method and system based on artificial intelligence. A data preprocessing method of data cleaning, data coding, data normalization and data set segmentation is adopted; the clustering model based on the optimization algorithm is adopted for user classification, complex user data can be effectively grouped, and the interpretability and the structuring degree of the data are improved; government affair service recommendation is carried out by adopting an improved transformer model combined with a bidirectional gating circulation unit, so that time sequence characteristics of user information and government affair service data can be effectively extracted, a long-term dependency relationship is captured, and the precision of personalized recommendation is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of intelligent government service, and specifically to a personalized government service recommendation method and system based on artificial intelligence. Background Art

[0002] Personalized government service recommendations use technologies such as artificial intelligence, big data analysis, and machine learning to accurately recommend suitable government services to users based on their behaviors, needs, and preferences. This technology improves the efficiency and accuracy of government services by predicting demand and adjusting recommendations in real time, greatly improving the convenience and personalization of government services.

[0003] However, traditional government service recommendation methods have the problem of facing diverse user information data with complex data distribution, and it is difficult to capture the potential rules between users, resulting in low accuracy and personalization of recommendations. At the same time, high-dimensional user demand data easily leads to information redundancy and increased noise. Traditional government service recommendation methods have the problem of using traditional recommendation algorithms that are difficult to handle complex user behavior patterns and multi-dimensional features, lack of in-depth modeling of temporal, contextual information and user behavior details, resulting in the recommendation effect being unable to dynamically adapt to changes in user needs, and low computational efficiency. Summary of the invention

[0004] In view of the above situation, in order to overcome the defects of the prior art, the present invention provides a personalized government service recommendation method and system based on artificial intelligence. In view of the fact that the traditional government service recommendation method has the problem of facing diverse and complex user information data, it is difficult to capture the potential rules between users, resulting in low accuracy and personalization of recommendations, and high-dimensional user demand data easily leads to information redundancy and increased noise. This solution creatively adopts a clustering model based on an optimization algorithm for user classification, which can effectively group complex user data, improve the interpretability and structured degree of data, and reduce the redundancy of input data, so that the deep learning model can more efficiently learn the personalized needs and preferences of users, and improve the accuracy and precision of recommendation results; in view of the fact that the traditional recommendation algorithm used in the traditional government service recommendation method is difficult to handle complex user behavior patterns and multi-dimensional features, lacks in-depth modeling of temporal sequence, contextual information and user behavior details, resulting in the recommendation effect cannot dynamically adapt to changes in user needs, and the computational efficiency is low, this solution creatively adopts an improved transformer model combined with a bidirectional gated recurrent unit for government service recommendation, which can effectively extract the temporal features of user information and government service data, capture long-term dependencies, and improve the accuracy and precision of personalized recommendations.

[0005] The technical solution adopted by the present invention is as follows: The personalized government service recommendation method based on artificial intelligence provided by the present invention comprises the following steps:

[0006] Step S1: data collection;

[0007] Step S2: data preprocessing;

[0008] Step S3: User classification model construction;

[0009] Step S4: service recommendation model construction;

[0010] Step S5: Personalized service recommendation.

[0011] Furthermore, in step S1, the data collection is used to collect data required for personalized government service recommendation, specifically, to obtain an original personalized recommendation data set through data collection;

[0012] The original personalized recommendation data set specifically includes a historical recommendation original data set and a current recommendation original data set. The historical recommendation original data set and the current recommendation original data set specifically include user basic information data, user behavior data and government service data. The historical recommendation original data set also includes historical service record data, historical user preference data and government service type label data. The user basic information data specifically includes user name, user gender, user age, user occupation, user family status, user income status and user address. The user behavior data specifically includes user browsing record data and user government affairs interaction data. The government service data specifically includes government service directory data and government affairs update data.

[0013] Furthermore, in step S2, the data preprocessing is used to preprocess the collected raw data, and specifically includes the following steps:

[0014] Step S21: data cleaning, which is used to clean the original data, specifically to remove missing values ​​and duplicate values ​​in the historical recommended original data set and the current recommended original data set to obtain a historical roughly processed data set and a current roughly processed data set;

[0015] Step S22: data encoding, which is used to encode the roughly processed data, specifically, using a one-hot encoding method to encode the historical roughly processed data set and the current roughly processed data set to obtain a historical encoded data set and a current encoded data set;

[0016] Step S23: data normalization, which is used to normalize the coded data, specifically, using a minimum-maximum normalization method to normalize the historical coded data set and the current coded data set to obtain a historical normalized data set and a preliminary data set to be processed;

[0017] Step S24: data set segmentation, for segmenting the data set, specifically segmenting the historical normalized data set to obtain a preliminary recommended training set and a recommended test set;

[0018] Step S25: performing preprocessing, specifically, preprocessing the current recommended original data set through the data cleaning, the data encoding and the data normalization to obtain a preliminary data set to be processed, and preprocessing the historical recommended original data set through the data cleaning, the data encoding, the data normalization and the data set segmentation to obtain a preliminary recommended training set and a recommended test set.

[0019] Furthermore, in step S3, the user classification model is constructed to construct a model required for user classification, specifically by constructing a clustering model based on an optimization algorithm to obtain a user classification model. The user classification model construction specifically includes the following steps:

[0020] Step S31: Generate an initial solution, specifically generate an initial solution of the optimization algorithm based on the tent chaos map, and the formula used is as follows:

[0021] ;

[0022] In the formula, represents the initial value of the tent chaos map, which is a random value in the range [0,1], r represents the chaos control parameter, represents the chaotic value of the j+1th dimension, represents the chaos value of the jth dimension, represents the position of the i-th individual unit in the j-th dimension, represents the upper limit of the j-th dimension, represents the lower limit of the j-th dimension, the individual unit is used to represent the combination of cluster centers to be optimized, and the position of its dimension represents the dimension of the cluster center;

[0023] Step S32: determine the fitness function, specifically select the intra-cluster square error function as the individual unit fitness function, the intra-cluster square error function, the formula used is as follows:

[0024] ;

[0025] In the formula, represents the fitness function, represents the i-th individual unit, I represents the total number of cluster centers, represents the kth data point in the i-th cluster;

[0026] Step S33: Individual unit position update, the steps include:

[0027] Step S331: Update the dynamic evolution factor, the formula used is as follows:

[0028] ;

[0029] In the formula, represents the dynamic evolution factor at the dtth iteration, represents a random number in the range [-1,1], dt represents the current number of iterations, represents the maximum number of iterations of the optimization algorithm, Represents random numbers that satisfy the standard normal distribution;

[0030] Step S332: Calculate the percentage difference between the current position and the optimal position, using the following formula:

[0031] ;

[0032] In the formula, Indicates the percentage difference between the current position and the best position. represents the dimension mean of the i-th individual unit, J represents the total number of individual unit dimensions, represents the position of the jth dimension of the best position;

[0033] Step S333: Calculate the reduction factor using the following formula:

[0034] ;

[0035] In the formula, represents the reduction factor of the position of the i-th individual unit in the j-th dimension, represents the position of a random individual unit in the jth dimension;

[0036] Step S334: Location update, the formula used is as follows:

[0037] ;

[0038] In the formula, represents the position of the i-th individual unit in the j-th dimension at the dt+1-th iteration, represents the exploration control factor, Represents a random number in the range [0,1]. represents a random number that satisfies the standard normal distribution. represents the position of the i-th individual unit in the j-th dimension at the dt-th iteration, Represents a random number in the range [0,1]. represents the development control factor, Represents a random number in the range [0,1];

[0039] Step S34: iterative update, specifically iterative update of the optimization algorithm until the optimization algorithm iteration termination condition is reached, thereby obtaining the final global optimal position, the final global optimal position, specifically the optimal cluster center combination, the optimization algorithm iteration termination condition, specifically reaching the maximum number of iterations of the optimization algorithm or the individual unit fitness function value is less than a preset threshold;

[0040] Step S35: constructing a clustering model, specifically, obtaining the optimal clustering center combination through the generating of the initial solution, the determining of the fitness function, the updating of the individual unit positions and the iterative updating, and constructing a clustering model based on the optimal clustering center combination to obtain a user classification model;

[0041] Step S36: user classification, specifically, using the user classification model to perform clustering processing on the user basic information data and user behavior data in the preliminary recommended training set to obtain historical user category data, and using the historical user category data to replace the user basic information data and user behavior data to obtain the recommended training set;

[0042] The user classification model is used to cluster the user basic information data and user behavior data in the preliminary data set to be processed to obtain current user category data, and the current user category data is used to replace the user basic information data and user behavior data to obtain the data set to be processed.

[0043] Further, in step S4, the service recommendation model is constructed to construct a model required for government service recommendation, specifically to construct an improved transformer model combined with a bidirectional gated cyclic unit, and used as the service recommendation model, wherein the improved transformer model combined with a bidirectional gated cyclic unit specifically includes a feature extraction module, a transformer module, a feature fusion module and an output module;

[0044] The service recommendation model construction specifically includes the following steps:

[0045] Step S41: constructing a feature extraction module, specifically constructing a bidirectional gated recurrent unit for extracting features from input data, and the formula used is as follows:

[0046] ;

[0047] In the formula, represents the forward hidden state, represents the forward function of the bidirectional gated recurrent unit, represents the input data of the feature extraction module, represents the backward hidden state, represents the backward function of the bidirectional gated recurrent unit, represents the output features of the feature extraction module, Represents a splicing operation;

[0048] Step S42: Transformer module construction, which is used to construct a transformer module for further processing the output features of the feature extraction module, specifically, to construct a transformer module using a dynamic sparse multi-head self-attention mechanism, and the steps include:

[0049] Step S421: Calculate the query, key and value of each header using the following formula:

[0050] ;

[0051] In the formula, represents the query of the hth head, represents the key of the hth head, Represents the value of the hth head, represents the input features of the dynamic sparse multi-head self-attention mechanism, represents the query transformation matrix of the hth head, represents the key transformation matrix of the hth head, Represents the value transformation matrix of the hth head;

[0052] Step S422: Calculate the similarity between each query vector and the key in each header, using the following formula:

[0053] ;

[0054] In the formula, represents the similarity calculation function, The hth head query vector, represents the maximum value function, The hth head key vectors, T represents the transpose operation, represents the dimension of the key vector of the hth head, The total number of key vectors representing the keys of the h-th head;

[0055] Step S423: Calculate the dynamic sparse self-attention of each head, the steps include:

[0056] Step S4231: extracting query vectors, specifically, sorting the query vectors from high to low according to the similarity with the key, extracting the first Qn query vectors in the sorting to form a sampled query, and the remaining query vectors to form a remaining query;

[0057] Step S4232: Calculate self-attention based on the sampled query, using the following formula:

[0058] ;

[0059] In the formula, represents the self-attention of the h-th head calculated based on the sampled query, represents the softmax function, represents the sampling query of the hth head;

[0060] Step S4233: Calculate self-attention based on the remaining queries. The formula used is as follows:

[0061] ;

[0062] In the formula, represents the self-attention of the h-th head calculated based on the remaining queries, The total number of value vectors representing the value of the h-th head, The hth head A vector of values;

[0063] Step S4234: Calculate the dynamic sparse self-attention of the head, the formula used is as follows:

[0064] ;

[0065] In the formula, represents the dynamic sparse self-attention of the h-th head;

[0066] Step S424: Calculate the output of the dynamic sparse multi-head self-attention mechanism. The formula used is as follows:

[0067] ;

[0068] In the formula, represents the output features of the dynamic sparse multi-head self-attention mechanism, represents the connection function, represents the dynamic sparse self-attention of the first head, represents the dynamic sparse self-attention of the second head, represents the self-attention linear transformation weight matrix;

[0069] Step S425: constructing a transformer module, specifically, designing the dynamic sparse multi-head self-attention mechanism by calculating the query, key and value of each head, calculating the similarity between each query vector and the key in each head, calculating the dynamic sparse self-attention of each head and calculating the output of the dynamic sparse multi-head self-attention mechanism, and constructing a transformer module based on the dynamic sparse multi-head self-attention mechanism;

[0070] Step S43: constructing a feature fusion module, which is used to construct a feature fusion module that fuses the output features of the feature extraction module and the output features of the transformer module. Specifically, the feature fusion module is constructed based on a cross attention mechanism and a gating mechanism. The steps include:

[0071] Step S431: Design a cross attention mechanism. The formula used is as follows:

[0072] ;

[0073] Where Cq represents the cross-attention query, Ck represents the cross-attention key, and Cv represents the cross-attention value. represents the cross-attention query transformation matrix, represents the cross-attention key transformation matrix, represents the cross attention value transformation matrix, represents the output characteristics of the transformer module, represents the output features of the cross-attention mechanism, represents the dimension of the cross-attention key;

[0074] Step S432: Designing a gating mechanism, the steps include:

[0075] Step S4321: Calculate and select the gate value, using the following formula:

[0076] ;

[0077] In the formula, Indicates the selection of the gate value, represents the sigmoid function, represents the learnable matrix in the gate value calculation, Indicates the bias term in selecting the gate value calculation, represents element-wise addition;

[0078] Step S4322: Calculate the intensity gate value, using the following formula:

[0079] ;

[0080] In the formula, represents the intensity gate value, represents the hyperbolic tangent function, represents the learnable matrix in the intensity gate value calculation, Represents the bias term in the calculation of the intensity gate value;

[0081] Step S433: Calculate the feature fusion module output, the formula used is as follows:

[0082] ;

[0083] In the formula, Fu represents the fusion feature output by the feature fusion module;

[0084] Step S44: constructing an output module, which is used to construct an output module for processing the fusion features output by the feature fusion module and obtaining the model output. Specifically, it is to construct an output module based on the softmax classification function. The formula used is as follows:

[0085] ;

[0086] In the formula, Represents the recommended prediction results output by the model, represents the model output weight, represents the fully connected function, which is used to map the fused features output by the feature fusion module to the output space. Represents the model output bias term;

[0087] Step S45: constructing a model and training it, specifically, constructing an improved transformer model combined with a bidirectional gated recurrent unit based on the feature extraction module, the transformer module, the feature fusion module and the output module, training the model based on the recommended training set, verifying the model performance based on the recommended test set, selecting a cross entropy loss function as the model loss function, and obtaining an improved transformer model combined with a bidirectional gated recurrent unit as a service recommendation model.

[0088] Furthermore, in step S5, the personalized service recommendation is specifically to process the data set to be processed using the service recommendation model to obtain personalized service recommendation reference data, and recommend government services to users based on the personalized service recommendation reference data.

[0089] The personalized government service recommendation system based on artificial intelligence provided by the present invention includes a data collection module, a data preprocessing module, a user classification model construction module, a service recommendation model construction module and a personalized service recommendation module;

[0090] The data collection module is used for data collection, obtains an original personalized recommendation data set through data collection, and sends the original personalized recommendation data set to the data preprocessing module;

[0091] The data preprocessing module is used for data preprocessing. Through data preprocessing, a preliminary data set to be processed, a preliminary recommended training set and a recommended test set are obtained, and the preliminary data set to be processed and the preliminary recommended training set are sent to the user classification model construction module, and the recommended test set is sent to the service recommendation model construction module;

[0092] The user classification model construction module is used for user classification model construction, and obtains the user classification model, the data set to be processed and the recommended training set by constructing a clustering model based on an optimization algorithm, and sends the data set to be processed to the personalized service recommendation module, and sends the recommended training set to the service recommendation model construction module;

[0093] The service recommendation model construction module is used for service recommendation model construction, obtains the service recommendation model by constructing an improved transformer model combined with a bidirectional gated recurrent unit, and sends the service recommendation model to the personalized service recommendation module;

[0094] The personalized service recommendation module is used for personalized service recommendation, and obtains personalized service recommendation reference data by using the service recommendation model to perform personalized service recommendation.

[0095] The beneficial effects achieved by the present invention using the above scheme are as follows:

[0096] (1) Traditional government service recommendation methods have the problem of facing diverse and complex user information data, making it difficult to capture the underlying patterns between users, resulting in low accuracy and personalization of recommendations. At the same time, high-dimensional user demand data easily leads to information redundancy and increased noise. This solution creatively uses a clustering model based on an optimization algorithm to classify users. It can effectively group complex user data, improve the interpretability and structure of the data, and reduce the redundancy of input data, so that the deep learning model can more efficiently learn users' personalized needs and preferences, thereby improving the accuracy and precision of the recommendation results.

[0097] (2) In order to address the technical problems that the traditional recommendation algorithms used in traditional government service recommendation methods are difficult to handle complex user behavior patterns and multi-dimensional features, lack in-depth modeling of temporal, contextual information and user behavior details, resulting in the recommendation effect being unable to dynamically adapt to changes in user needs and low computational efficiency, this solution creatively adopts an improved transformer model combined with a bidirectional gated recurrent unit for government service recommendation. It can effectively extract the temporal characteristics of user information and government service data, capture long-term dependencies, and improve the accuracy and precision of personalized recommendations. BRIEF DESCRIPTION OF THE DRAWINGS

[0098] Figure 1 A flowchart of the personalized government service recommendation method based on artificial intelligence provided by the present invention;

[0099] Figure 2 A schematic diagram of the modules of the personalized government service recommendation system based on artificial intelligence provided by the present invention;

[0100] Figure 3This is a schematic diagram of the process of data preprocessing in step S2;

[0101] Figure 4 A schematic diagram of the process of constructing a user classification model in step S3;

[0102] Figure 5 Schematic diagram of the process of building a service recommendation model in step S4.

[0103] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention. DETAILED DESCRIPTION

[0104] 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, rather than all the embodiments; based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0105] In the description of the present invention, it should be understood that terms such as “upper”, “lower”, “front”, “back”, “left”, “right”, “top”, “bottom”, “inside” and “outside” indicating directions or positional relationships are based on the directions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore should not be understood as limiting the present invention.

[0106] Example 1, see Figure 1 The technical solution adopted by the present invention is as follows: The personalized government service recommendation method based on artificial intelligence provided by the present invention comprises the following steps:

[0107] Step S1: data collection;

[0108] Step S2: data preprocessing;

[0109] Step S3: User classification model construction;

[0110] Step S4: service recommendation model construction;

[0111] Step S5: Personalized service recommendation.

[0112] Example 2, see Figure 1 and Figure 2 In step S1, the data collection is used to collect data required for personalized government service recommendation, specifically, to obtain an original personalized recommendation data set through data collection;

[0113] The original personalized recommendation data set specifically includes a historical recommendation original data set and a current recommendation original data set. The historical recommendation original data set and the current recommendation original data set specifically include user basic information data, user behavior data and government service data. The historical recommendation original data set also includes historical service record data, historical user preference data and government service type label data. The user basic information data specifically includes user name, user gender, user age, user occupation, user family status, user income status and user address. The user behavior data specifically includes user browsing record data and user government affairs interaction data. The government service data specifically includes government service directory data and government affairs update data.

[0114] Example 3, see Figure 1 , Figure 2 and Figure 3 This embodiment is based on the above embodiment. In step S2, the data preprocessing is used to preprocess the collected raw data, and specifically includes the following steps:

[0115] Step S21: data cleaning, which is used to clean the original data, specifically to remove missing values ​​and duplicate values ​​in the historical recommended original data set and the current recommended original data set to obtain a historical roughly processed data set and a current roughly processed data set;

[0116] Step S22: data encoding, which is used to encode the roughly processed data, specifically, using a one-hot encoding method to encode the historical roughly processed data set and the current roughly processed data set to obtain a historical encoded data set and a current encoded data set;

[0117] Step S23: data normalization, which is used to normalize the coded data, specifically, using a minimum-maximum normalization method to normalize the historical coded data set and the current coded data set to obtain a historical normalized data set and a preliminary data set to be processed;

[0118] Step S24: data set segmentation, for segmenting the data set, specifically segmenting the historical normalized data set to obtain a preliminary recommended training set and a recommended test set;

[0119] Step S25: performing preprocessing, specifically, preprocessing the current recommended original data set through the data cleaning, the data encoding and the data normalization to obtain a preliminary data set to be processed, and preprocessing the historical recommended original data set through the data cleaning, the data encoding, the data normalization and the data set segmentation to obtain a preliminary recommended training set and a recommended test set.

[0120] Example 4, see Figure 1, Figure 2 and Figure 4 This embodiment is based on the above embodiment. In step S3, the user classification model is constructed to construct a model required for user classification. Specifically, the user classification model is obtained by constructing a clustering model based on an optimization algorithm. The user classification model construction specifically includes the following steps:

[0121] Step S31: Generate an initial solution, specifically generate an initial solution of the optimization algorithm based on the tent chaos map, and the formula used is as follows:

[0122] ;

[0123] In the formula, represents the initial value of the tent chaos map, which is a random value in the range [0,1], r represents the chaos control parameter, represents the chaotic value of the j+1th dimension, represents the chaos value of the jth dimension, represents the position of the i-th individual unit in the j-th dimension, represents the upper limit of the j-th dimension, represents the lower limit of the j-th dimension, the individual unit is used to represent the combination of cluster centers to be optimized, and the position of its dimension represents the dimension of the cluster center;

[0124] Step S32: determine the fitness function, specifically select the intra-cluster square error function as the individual unit fitness function, the intra-cluster square error function, the formula used is as follows:

[0125] ;

[0126] In the formula, represents the fitness function, represents the i-th individual unit, I represents the total number of cluster centers, represents the kth data point in the i-th cluster;

[0127] Step S33: Individual unit position update, the steps include:

[0128] Step S331: Update the dynamic evolution factor, the formula used is as follows:

[0129] ;

[0130] In the formula, represents the dynamic evolution factor at the dtth iteration, represents a random number in the range [-1,1], dt represents the current number of iterations, represents the maximum number of iterations of the optimization algorithm, Represents random numbers that satisfy the standard normal distribution;

[0131] Step S332: Calculate the percentage difference between the current position and the optimal position, using the following formula:

[0132] ;

[0133] In the formula, Indicates the percentage difference between the current position and the best position. represents the dimension mean of the i-th individual unit, J represents the total number of individual unit dimensions, represents the position of the jth dimension of the best position;

[0134] Step S333: Calculate the reduction factor using the following formula:

[0135] ;

[0136] In the formula, represents the reduction factor of the position of the i-th individual unit in the j-th dimension, represents the position of a random individual unit in the jth dimension;

[0137] Step S334: Location update, the formula used is as follows:

[0138] ;

[0139] In the formula, represents the position of the i-th individual unit in the j-th dimension at the dt+1-th iteration, represents the exploration control factor, Represents a random number in the range [0,1]. represents a random number that satisfies the standard normal distribution. represents the position of the i-th individual unit in the j-th dimension at the dt-th iteration, Represents a random number in the range [0,1]. represents the development control factor, Represents a random number in the range [0,1];

[0140] Step S34: iterative update, specifically iterative update of the optimization algorithm until the optimization algorithm iteration termination condition is reached, thereby obtaining the final global optimal position, the final global optimal position, specifically the optimal cluster center combination, the optimization algorithm iteration termination condition, specifically reaching the maximum number of iterations of the optimization algorithm or the individual unit fitness function value is less than a preset threshold;

[0141] Step S35: constructing a clustering model, specifically, obtaining the optimal clustering center combination through the generating of the initial solution, the determining of the fitness function, the updating of the individual unit positions and the iterative updating, and constructing a clustering model based on the optimal clustering center combination to obtain a user classification model;

[0142] Step S36: user classification, specifically, using the user classification model to perform clustering processing on the user basic information data and user behavior data in the preliminary recommended training set to obtain historical user category data, and using the historical user category data to replace the user basic information data and user behavior data to obtain the recommended training set;

[0143] The user classification model is used to cluster the user basic information data and user behavior data in the preliminary data set to be processed to obtain current user category data, and the current user category data is used to replace the user basic information data and user behavior data to obtain the data set to be processed.

[0144] By performing the above operations, this solution creatively adopts a clustering model based on an optimization algorithm to classify users, which can effectively group complex user data, improve the interpretability and structured degree of data, and reduce the redundancy of input data, so that the deep learning model can more efficiently learn users' personalized needs and preferences, and improve the accuracy and precision of recommendation results.

[0145] Example 5, see Figure 1 , Figure 2 and Figure 5 , This embodiment is based on the above embodiment. In step S4, the service recommendation model is constructed to construct a model required for government service recommendation, specifically to construct an improved transformer model combined with a bidirectional gated cyclic unit and used as the service recommendation model. The improved transformer model combined with a bidirectional gated cyclic unit specifically includes a feature extraction module, a transformer module, a feature fusion module and an output module;

[0146] The service recommendation model construction specifically includes the following steps:

[0147] Step S41: constructing a feature extraction module, specifically constructing a bidirectional gated recurrent unit for extracting features from input data, and the formula used is as follows:

[0148] ;

[0149] In the formula, represents the forward hidden state, represents the forward function of the bidirectional gated recurrent unit, represents the input data of the feature extraction module, represents the backward hidden state, represents the backward function of the bidirectional gated recurrent unit, represents the output features of the feature extraction module, Represents a splicing operation;

[0150] Step S42: Transformer module construction, which is used to construct a transformer module for further processing the output features of the feature extraction module, specifically, to construct a transformer module using a dynamic sparse multi-head self-attention mechanism, and the steps include:

[0151] Step S421: Calculate the query, key and value of each header using the following formula:

[0152] ;

[0153] In the formula, represents the query of the hth head, represents the key of the hth head, Represents the value of the hth head, represents the input features of the dynamic sparse multi-head self-attention mechanism, represents the query transformation matrix of the hth head, represents the key transformation matrix of the hth head, Represents the value transformation matrix of the hth head;

[0154] Step S422: Calculate the similarity between each query vector and the key in each header, using the following formula:

[0155] ;

[0156] In the formula, represents the similarity calculation function, The hth head query vector, represents the maximum value function, The hth head key vectors, T represents the transpose operation, represents the dimension of the key vector of the hth head, The total number of key vectors representing the keys of the h-th head;

[0157] Step S423: Calculate the dynamic sparse self-attention of each head, the steps include:

[0158] Step S4231: extracting query vectors, specifically, sorting the query vectors from high to low according to the similarity with the key, extracting the first Qn query vectors in the sorting to form a sampled query, and the remaining query vectors to form a remaining query;

[0159] Step S4232: Calculate self-attention based on the sampled query, using the following formula:

[0160] ;

[0161] In the formula, represents the self-attention of the h-th head calculated based on the sampled query, represents the softmax function, represents the sampling query of the hth head;

[0162] Step S4233: Calculate self-attention based on the remaining queries. The formula used is as follows:

[0163] ;

[0164] In the formula, represents the self-attention of the h-th head calculated based on the remaining queries, The total number of value vectors representing the value of the h-th head, The hth head A vector of values;

[0165] Step S4234: Calculate the dynamic sparse self-attention of the head, the formula used is as follows:

[0166] ;

[0167] In the formula, represents the dynamic sparse self-attention of the h-th head;

[0168] Step S424: Calculate the output of the dynamic sparse multi-head self-attention mechanism. The formula used is as follows:

[0169] ;

[0170] In the formula, represents the output features of the dynamic sparse multi-head self-attention mechanism, represents the connection function, represents the dynamic sparse self-attention of the first head, represents the dynamic sparse self-attention of the second head, represents the self-attention linear transformation weight matrix;

[0171] Step S425: constructing a transformer module, specifically, designing the dynamic sparse multi-head self-attention mechanism by calculating the query, key and value of each head, calculating the similarity between each query vector and the key in each head, calculating the dynamic sparse self-attention of each head and calculating the output of the dynamic sparse multi-head self-attention mechanism, and constructing a transformer module based on the dynamic sparse multi-head self-attention mechanism;

[0172] Step S43: constructing a feature fusion module, which is used to construct a feature fusion module that fuses the output features of the feature extraction module and the output features of the transformer module. Specifically, the feature fusion module is constructed based on a cross attention mechanism and a gating mechanism. The steps include:

[0173] Step S431: Design a cross attention mechanism. The formula used is as follows:

[0174] ;

[0175] Where Cq represents the cross-attention query, Ck represents the cross-attention key, and Cv represents the cross-attention value. represents the cross-attention query transformation matrix, represents the cross-attention key transformation matrix, represents the cross attention value transformation matrix, represents the output characteristics of the transformer module, represents the output features of the cross-attention mechanism, represents the dimension of the cross-attention key;

[0176] Step S432: Designing a gating mechanism, the steps include:

[0177] Step S4321: Calculate and select the gate value, using the following formula:

[0178] ;

[0179] In the formula, Indicates the selection of the gate value, represents the sigmoid function, represents the learnable matrix in the gate value calculation, Indicates the bias term in selecting the gate value calculation, represents element-wise addition;

[0180] Step S4322: Calculate the intensity gate value, using the following formula:

[0181] ;

[0182] In the formula, represents the intensity gate value, represents the hyperbolic tangent function, represents the learnable matrix in the intensity gate value calculation, Represents the bias term in the calculation of the intensity gate value;

[0183] Step S433: Calculate the feature fusion module output, the formula used is as follows:

[0184] ;

[0185] In the formula, Fu represents the fusion feature output by the feature fusion module;

[0186] Step S44: constructing an output module, which is used to construct an output module for processing the fusion features output by the feature fusion module and obtaining the model output. Specifically, it is to construct an output module based on the softmax classification function. The formula used is as follows:

[0187] ;

[0188] In the formula, Represents the recommended prediction results output by the model, represents the model output weight, represents the fully connected function, which is used to map the fused features output by the feature fusion module to the output space. Represents the model output bias term;

[0189] Step S45: constructing a model and training it, specifically, constructing an improved transformer model combined with a bidirectional gated recurrent unit based on the feature extraction module, the transformer module, the feature fusion module and the output module, training the model based on the recommended training set, verifying the model performance based on the recommended test set, selecting a cross entropy loss function as the model loss function, and obtaining an improved transformer model combined with a bidirectional gated recurrent unit as a service recommendation model.

[0190] By performing the above operations, this solution creatively adopts an improved transformer model combined with a bidirectional gated recurrent unit for government service recommendation, which can effectively extract the temporal characteristics of user information and government service data, capture long-term dependencies, and improve the accuracy and precision of personalized recommendations.

[0191] Example 6, see Figure 1 and Figure 2This embodiment is based on the above embodiment. In step S5, the personalized service recommendation is specifically to process the data set to be processed using the service recommendation model to obtain personalized service recommendation reference data, and recommend government services to users based on the personalized service recommendation reference data.

[0192] Embodiment 7, see Figure 1 and Figure 2 , this embodiment is based on the above embodiment, and the personalized government service recommendation system based on artificial intelligence provided by the present invention includes a data collection module, a data preprocessing module, a user classification model construction module, a service recommendation model construction module and a personalized service recommendation module;

[0193] The data collection module is used for data collection, obtains an original personalized recommendation data set through data collection, and sends the original personalized recommendation data set to the data preprocessing module;

[0194] The data preprocessing module is used for data preprocessing. Through data preprocessing, a preliminary data set to be processed, a preliminary recommended training set and a recommended test set are obtained, and the preliminary data set to be processed and the preliminary recommended training set are sent to the user classification model construction module, and the recommended test set is sent to the service recommendation model construction module;

[0195] The user classification model construction module is used for user classification model construction, and obtains the user classification model, the data set to be processed and the recommended training set by constructing a clustering model based on an optimization algorithm, and sends the data set to be processed to the personalized service recommendation module, and sends the recommended training set to the service recommendation model construction module;

[0196] The service recommendation model construction module is used for service recommendation model construction, obtains the service recommendation model by constructing an improved transformer model combined with a bidirectional gated recurrent unit, and sends the service recommendation model to the personalized service recommendation module;

[0197] The personalized service recommendation module is used for personalized service recommendation, and obtains personalized service recommendation reference data by using the service recommendation model to perform personalized service recommendation.

[0198] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.

[0199] While the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that many changes, modifications, substitutions and variations can be made to the embodiments without departing from the principles and spirit of the invention.

[0200] The present invention and its embodiments are described above, and such description is not restrictive. The drawings show only one embodiment of the present invention, and the actual structure is not limited thereto. In short, if ordinary technicians in the field are inspired by it, without departing from the purpose of the invention, they can design a structure and embodiment similar to the technical solution without creativity, which should belong to the protection scope of the present invention.

Claims

1. A personalized government service recommendation method based on artificial intelligence, characterized by: The method comprises the following steps: Step S1: Data collection: obtaining an original personalized recommendation data set through data collection. The original personalized recommendation data set specifically includes a historical recommendation original data set and a current recommendation original data set. The historical recommendation original data set and the current recommendation original data set specifically include user basic information data, user behavior data and government service data. The historical recommendation original data set also includes historical service record data, historical user preference data and government service type label data. Step S2: Data preprocessing, preprocessing the collected raw data to obtain a preliminary data set to be processed, a preliminary recommended training set, and a recommended test set; Step S3: constructing a user classification model, which is used to construct a model required for user classification, specifically by constructing a clustering model based on an optimization algorithm to obtain a user classification model, and using the user classification model to process the preliminary data set to be processed and the preliminary recommended training set to obtain a data set to be processed and a recommended training set; Step S4: constructing a service recommendation model, which is a model required for government service recommendation, specifically by constructing an improved transformer model combined with a bidirectional gated recurrent unit and using it as a service recommendation model. The improved transformer model combined with a bidirectional gated recurrent unit specifically includes a feature extraction module, a transformer module, a feature fusion module and an output module. Step S5: personalized service recommendation, specifically, performing personalized service recommendation through the service recommendation model to obtain personalized service recommendation reference data.

2. The method for recommending personalized government services based on artificial intelligence according to claim 1, characterized in that: In step S4, the service recommendation model is constructed, specifically including the following steps: Step S41: constructing a feature extraction module, specifically constructing a bidirectional gated recurrent unit for extracting features from input data, and the formula used is as follows: ; In the formula, represents the forward hidden state, represents the forward function of the bidirectional gated recurrent unit, represents the input data of the feature extraction module, represents the backward hidden state, represents the backward function of the bidirectional gated recurrent unit, represents the output features of the feature extraction module, Represents a splicing operation; Step S42: Transformer module construction, which is used to construct a transformer module for further processing the output features of the feature extraction module, specifically, to construct a transformer module using a dynamic sparse multi-head self-attention mechanism, and the steps include: Step S421: Calculate the query, key and value of each header using the following formula: ; In the formula, represents the query of the hth head, represents the key of the hth head, Represents the value of the hth head, represents the input features of the dynamic sparse multi-head self-attention mechanism, represents the query transformation matrix of the hth head, represents the key transformation matrix of the hth head, Represents the value transformation matrix of the hth head; Step S422: Calculate the similarity between each query vector and the key in each header, using the following formula: ; In the formula, represents the similarity calculation function, The hth head query vector, represents the maximum value function, The hth head key vectors, T represents the transpose operation, represents the dimension of the key vector of the hth head, The total number of key vectors representing the keys of the h-th head; Step S423: Calculate the dynamic sparse self-attention of each head, the steps include: Step S4231: extracting query vectors, specifically, sorting the query vectors from high to low according to the similarity with the key, extracting the first Qn query vectors in the sorting to form a sampled query, and the remaining query vectors to form a remaining query; Step S4232: Calculate self-attention based on the sampled query, using the following formula: ; In the formula, represents the self-attention of the h-th head calculated based on the sampled query, represents the softmax function, represents the sampling query of the hth head; Step S4233: Calculate self-attention based on the remaining queries. The formula used is as follows: ; In the formula, represents the self-attention of the h-th head calculated based on the remaining queries, The total number of value vectors representing the value of the h-th head, The hth head A vector of values; Step S4234: Calculate the dynamic sparse self-attention of the head, the formula used is as follows: ; In the formula, represents the dynamic sparse self-attention of the h-th head; Step S424: Calculate the output of the dynamic sparse multi-head self-attention mechanism. The formula used is as follows: ; In the formula, represents the output features of the dynamic sparse multi-head self-attention mechanism, represents the connection function, represents the dynamic sparse self-attention of the first head, represents the dynamic sparse self-attention of the second head, represents the self-attention linear transformation weight matrix; Step S425: constructing a transformer module, specifically, designing the dynamic sparse multi-head self-attention mechanism by calculating the query, key and value of each head, calculating the similarity between each query vector and the key in each head, calculating the dynamic sparse self-attention of each head and calculating the output of the dynamic sparse multi-head self-attention mechanism, and constructing a transformer module based on the dynamic sparse multi-head self-attention mechanism; Step S43: constructing a feature fusion module, which is used to construct a feature fusion module that fuses the output features of the feature extraction module and the output features of the transformer module. Specifically, the feature fusion module is constructed based on a cross attention mechanism and a gating mechanism. The steps include: Step S431: Design a cross attention mechanism. The formula used is as follows: ; Where Cq represents the cross-attention query, Ck represents the cross-attention key, and Cv represents the cross-attention value. represents the cross-attention query transformation matrix, represents the cross-attention key transformation matrix, represents the cross attention value transformation matrix, represents the output characteristics of the transformer module, represents the output features of the cross-attention mechanism, represents the dimension of the cross-attention key; Step S432: Designing a gating mechanism, the steps include: Step S4321: Calculate and select the gate value, using the following formula: ; In the formula, Indicates the selection of the gate value, represents the sigmoid function, represents the learnable matrix in the gate value calculation, Indicates the bias term in selecting the gate value calculation, represents element-wise addition; Step S4322: Calculate the intensity gate value, using the following formula: ; In the formula, represents the intensity gate value, represents the hyperbolic tangent function, represents the learnable matrix in the intensity gate value calculation, Represents the bias term in the calculation of the intensity gate value; Step S433: Calculate the feature fusion module output, the formula used is as follows: ; In the formula, Fu represents the fusion feature output by the feature fusion module; Step S44: constructing an output module, which is used to construct an output module for processing the fusion features output by the feature fusion module and obtaining the model output. Specifically, it is to construct an output module based on the softmax classification function. The formula used is as follows: ; In the formula, Represents the recommended prediction results output by the model, represents the model output weight, represents the fully connected function, which is used to map the fused features output by the feature fusion module to the output space. Represents the model output bias term; Step S45: constructing a model and training it, specifically, constructing an improved transformer model combined with a bidirectional gated recurrent unit based on the feature extraction module, the transformer module, the feature fusion module and the output module, training the model based on the recommended training set, verifying the model performance based on the recommended test set, selecting a cross entropy loss function as the model loss function, and obtaining an improved transformer model combined with a bidirectional gated recurrent unit as a service recommendation model.

3. The method for recommending personalized government services based on artificial intelligence according to claim 1, characterized in that: In step S3, the user classification model is constructed, specifically including the following steps: Step S31: Generate an initial solution, specifically generate an initial solution of the optimization algorithm based on the tent chaos map, and the formula used is as follows: ; In the formula, represents the initial value of the tent chaos map, which is a random value in the range [0,1], r represents the chaos control parameter, represents the chaotic value of the j+1th dimension, represents the chaos value of the jth dimension, represents the position of the i-th individual unit in the j-th dimension, represents the upper limit of the j-th dimension, represents the lower limit of the j-th dimension, the individual unit is used to represent the combination of cluster centers to be optimized, and the position of its dimension represents the dimension of the cluster center; Step S32: determine the fitness function, specifically select the intra-cluster square error function as the individual unit fitness function, the intra-cluster square error function, the formula used is as follows: ; In the formula, represents the fitness function, represents the i-th individual unit, I represents the total number of cluster centers, represents the kth data point in the i-th cluster; Step S33: Individual unit position update, the steps include: Step S331: Update the dynamic evolution factor, the formula used is as follows: ; In the formula, represents the dynamic evolution factor at the dtth iteration, represents a random number in the range [-1,1], dt represents the current number of iterations, represents the maximum number of iterations of the optimization algorithm, Represents random numbers that satisfy the standard normal distribution; Step S332: Calculate the percentage difference between the current position and the optimal position, using the following formula: ; In the formula, Indicates the percentage difference between the current position and the best position. represents the dimension mean of the i-th individual unit, J represents the total number of individual unit dimensions, represents the position of the jth dimension of the best position; Step S333: Calculate the reduction factor using the following formula: ; In the formula, represents the reduction factor of the position of the i-th individual unit in the j-th dimension, represents the position of a random individual unit in the jth dimension; Step S334: Location update, the formula used is as follows: ; In the formula, represents the position of the i-th individual unit in the j-th dimension at the dt+1-th iteration, represents the exploration control factor, Represents a random number in the range [0,1]. represents a random number that satisfies the standard normal distribution. represents the position of the i-th individual unit in the j-th dimension at the dt-th iteration, Represents a random number in the range [0,1]. represents the development control factor, Represents a random number in the range [0,1]; Step S34: iterative update, specifically iterative update of the optimization algorithm until the optimization algorithm iteration termination condition is reached, thereby obtaining the final global optimal position, the final global optimal position, specifically the optimal cluster center combination, the optimization algorithm iteration termination condition, specifically reaching the maximum number of iterations of the optimization algorithm or the individual unit fitness function value is less than a preset threshold; Step S35: constructing a clustering model, specifically, obtaining the optimal clustering center combination through the generating of the initial solution, the determining of the fitness function, the updating of the individual unit positions and the iterative updating, and constructing a clustering model based on the optimal clustering center combination to obtain a user classification model; Step S36: user classification, specifically, using the user classification model to perform clustering processing on the user basic information data and user behavior data in the preliminary recommended training set to obtain historical user category data, and using the historical user category data to replace the user basic information data and user behavior data to obtain the recommended training set; The user classification model is used to cluster the user basic information data and user behavior data in the preliminary data set to be processed to obtain current user category data, and the current user category data is used to replace the user basic information data and user behavior data to obtain the data set to be processed.

4. The method for recommending personalized government services based on artificial intelligence according to claim 1, characterized in that: In step S1, the data collection is used to collect data required for personalized government service recommendation, specifically, to obtain an original personalized recommendation data set through data collection; The original personalized recommendation data set specifically includes a historical recommendation original data set and a current recommendation original data set. The historical recommendation original data set and the current recommendation original data set specifically include user basic information data, user behavior data and government service data. The historical recommendation original data set also includes historical service record data, historical user preference data and government service type label data. The user basic information data specifically includes user name, user gender, user age, user occupation, user family status, user income status and user address. The user behavior data specifically includes user browsing record data and user government affairs interaction data. The government service data specifically includes government service directory data and government affairs update data.

5. The method for recommending personalized government services based on artificial intelligence according to claim 1, characterized in that: In step S2, the data preprocessing is used to preprocess the collected raw data, and specifically includes the following steps: Step S21: data cleaning, which is used to clean the original data, specifically to remove missing values ​​and duplicate values ​​in the historical recommended original data set and the current recommended original data set to obtain a historical roughly processed data set and a current roughly processed data set; Step S22: data encoding, which is used to encode the roughly processed data, specifically, using a one-hot encoding method to encode the historical roughly processed data set and the current roughly processed data set to obtain a historical encoded data set and a current encoded data set; Step S23: data normalization, which is used to normalize the coded data, specifically, using a minimum-maximum normalization method to normalize the historical coded data set and the current coded data set to obtain a historical normalized data set and a preliminary data set to be processed; Step S24: data set segmentation, for segmenting the data set, specifically segmenting the historical normalized data set to obtain a preliminary recommended training set and a recommended test set; Step S25: performing preprocessing, specifically, preprocessing the current recommended original data set through the data cleaning, the data encoding and the data normalization to obtain a preliminary data set to be processed, and preprocessing the historical recommended original data set through the data cleaning, the data encoding, the data normalization and the data set segmentation to obtain a preliminary recommended training set and a recommended test set.

6. The method for recommending personalized government services based on artificial intelligence according to claim 1, characterized in that: In step S5, the personalized service recommendation is specifically to process the to-be-processed data set using the service recommendation model to obtain personalized service recommendation reference data, and recommend government services to the user based on the personalized service recommendation reference data.

7. A personalized government service recommendation system based on artificial intelligence, used to implement the personalized government service recommendation method based on artificial intelligence as described in any one of claims 1 to 6, characterized in that: It includes data collection module, data preprocessing module, user classification model building module, service recommendation model building module and personalized service recommendation module.

8. The personalized government service recommendation system based on artificial intelligence according to claim 7 is characterized by: The data collection module is used for data collection, obtains an original personalized recommendation data set through data collection, and sends the original personalized recommendation data set to the data preprocessing module; The data preprocessing module is used for data preprocessing. Through data preprocessing, a preliminary data set to be processed, a preliminary recommended training set and a recommended test set are obtained, and the preliminary data set to be processed and the preliminary recommended training set are sent to the user classification model construction module, and the recommended test set is sent to the service recommendation model construction module; The user classification model construction module is used for user classification model construction, and obtains the user classification model, the data set to be processed and the recommended training set by constructing a clustering model based on an optimization algorithm, and sends the data set to be processed to the personalized service recommendation module, and sends the recommended training set to the service recommendation model construction module; The service recommendation model construction module is used for service recommendation model construction, obtains the service recommendation model by constructing an improved transformer model combined with a bidirectional gated recurrent unit, and sends the service recommendation model to the personalized service recommendation module; The personalized service recommendation module is used for personalized service recommendation, and obtains personalized service recommendation reference data by using the service recommendation model to perform personalized service recommendation.

Citation Information

Patent Citations

  • False message propagation inhibition method based on influence maximization

    CN110990716A

  • Keyword recommendation system and method based on multi-modal content

    CN114491258A

  • Extra-high voltage converter transformer state monitoring method and system

    CN116680623A

  • Service recommendation method, system and equipment based on user preference and storage medium

    CN118134606A

  • Power marketing recommendation method and system based on big data

    CN118967211A

Cited By

  • Intelligent film and television content recommendation method and system based on artificial intelligence

    CN120763360A

  • Intelligent movie content recommendation method and system based on artificial intelligence

    CN120763360B