Intelligent library book intelligent recommendation system

By using a combination of interactive data vector embedding, generalized matrix factorization, nonlinear mapping and multi-head attention filtering modules in the book recommendation system, the deficiencies of the existing system in user similarity definition and literature content exploration are solved, and more accurate results are achieved. User interest capture and book recommendation.

CN119357466APending Publication Date: 2025-01-24YUANWANGGU (NINGBO) CULTURE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411379432.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

The existing book recommendation system has shortcomings in user similarity definition and literature content exploration, resulting in inconsistent user research goals and recommendation results, and ignore the ambiguity of terms and ambiguousness of keywords, creating the problem of 'keyword barrier' .

Method used

A smart library book intelligent recommendation system is adopted, including an interactive data vector embedding module, a generalized matrix decomposition module, a nonlinear mapping module and a multi-head attention filtering module. User and book data are processed through these modules to generate user dense vectors and book dense vectors. vector, and perform collaborative filtering through a multi-head attention mechanism to improve the accuracy of recommendations.

Benefits of technology

The improvement of more accurate capture and book recommendations for users' interests has been achieved, the situation of user research goals and recommendation results is inconsistent, and the matching between users and resources is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119357466A_ABST
    Figure CN119357466A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of library management, and particularly relates to a smart library book intelligent recommendation system, which is characterized in that data are coded into dilution vectors through one-hot, and the dilution vectors are embedded into an interaction data vector embedding module to generate dense vectors; the generalized matrix decomposition module performs dot product operation on dense vectors output by the interactive data vector embedding module, then uses MLP to process a dot product result, and enables the module to be degraded into vector dot products; the nonlinear mapping module performs splicing operation on dense vectors output by the interactive data vector embedding module, and then adopts MLP to perform nonlinear mapping on the spliced vectors; the multi-head attention filtering module takes collaborative filtering operation as query and matching operation execution consideration of an output vector of the nonlinear mapping module and an output vector of the generalized matrix decomposition module, adopts a QKV attention model for modeling and performs a query and matching operation process in a fitting manner; according to the method, the recommendation accuracy and the matching degree between the user and the resource are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of library management, and in particular relates to an intelligent book recommendation system for a smart library. Background Art

[0002] The personalized book recommendation system mainly collects reader data and retrieval data recorded in the library log for book retrieval and recommendation, evaluates readers' reading interests, and provides readers with personalized book recommendations. At present, there are some methods that can use the library's borrowing records to determine the reading relevance of a book, use the correlation between book categories, propose user-personalized pattern expression methods, and provide personalized book recommendation services for users with long-term and short-term interests.

[0003] Traditional literature recommendation algorithms are mainly divided into collaborative filtering algorithms and content-based recommendation algorithms. Collaborative filtering algorithms are mainly divided into two categories: ① Item-based collaborative filtering algorithms refer to recommending items similar to items that users have liked before; ② User-based collaborative filtering algorithms refer to recommending items that users like with similar interests to users. The collaborative filtering recommendation algorithm classifies users with similar research fields and recommends literature that meets the interests of similar users. The problem with this recommendation method is that there is no clear definition of user similarity and no exploration of the content of the literature, which can easily lead to inconsistencies between the goals of user research and the results of recommendations, amplifying the long-tail effect of user interests. The content-based recommendation method establishes a user's interest model mainly based on analyzing the user's historical behavior and reading data. By comparing the similarity between the user interest model and the literature model, it recommends literature with higher similarity to the user.

[0004] The existing personalized recommendation method based on literature retrieval of brain informatics (BI) mainly uses the interest retention model to establish a user model based on Data-Brain and BI, and then calculates the semantic similarity between the literature model and the user model to obtain the final recommendation target. The user model and literature model of this recommendation method are mainly established using the vector space model. It simply collects and stacks keywords to discover high-frequency words corresponding to user interests. This method ignores the ambiguity of terms and the ambiguity of keywords, and also creates the problem of "keyword barrier".

[0005] In recent years, personalized document recommendation methods based on hybrid recommendation have gradually gained attention. In 2014, a bookmark-triggered document sharing system was proposed. The system classifies documents by using latent Dirichlet allocation (LDA) as a topic model, and uses collaborative filtering technology to analyze user feedback. The least squares matrix factorization (ALS) is used to finally recommend TOP-N documents. In addition, a RS (Recommendation System) model based on a hybrid recommendation method determines the keywords used in the document and obtains the weight of the keywords. Then the keyword similarity coefficient is used to determine the similarity between users. Subsequently, a rating matrix is ​​created using a rating opinion table, and sentiment ratings are added. Finally, the TOP-N document recommendations are generated. Although the above work takes into account the semantic characteristics of document keywords, it only considers the form matching problem for keyword weights and does not pay attention to user emotions. It is also limited to static analysis of user emotions. For this reason, a personalized document recommendation model based on three dimensions: expert dimension, user dimension, and context perception dimension is proposed. In order to overcome the long-tail effect caused by the ambiguity of the definition of similarity among researchers, this model uses the probability distribution of document topics to calculate the similarity between users. At the same time, considering that user preferences will change over time, the time factor is added to the user sentiment analysis model to significantly improve the accuracy of literature recommendation. At present, a collaborative filtering recommendation system based on convolutional neural network is proposed. The overall architecture of the recommendation system includes data collection layer, data analysis layer and book recommendation layer; the data collection layer mainly collects reader information, reading status, survey data on readers and information about electronic books; the data analysis layer is mainly responsible for determining the identity of the reader. If the reader is a new reader, a questionnaire window will pop up to collect interests and hobbies, and then recommend books; if the reader is not a new reader, the convolutional neural network algorithm will be used to evaluate the content the reader has read, and other books that meet his interests will be output to the book recommendation layer for recommendation. Summary of the invention

[0006] The purpose of the present invention is to overcome the deficiencies in the prior art and provide an intelligent book recommendation system for a smart library.

[0007] In order to achieve the purpose of the present invention, we will adopt the following technical solution to implement it:

[0008] A smart library book intelligent recommendation system includes an interactive data vector embedding module, a generalized matrix decomposition module, a nonlinear mapping module and a generalized collaborative filtering module, wherein:

[0009] The interactive data vector embedding module embeds the user diluted vector and the book diluted vector obtained by one-hot encoding the user data and the book data into the interactive data vector embedding module to generate the user dense vector and the book dense vector; wherein the model of the interactive data vector embedding module is:

[0010]

[0011] Where, X i and X u They represent the user sparse vector and book sparse vector obtained by one-hot encoding respectively. Respectively represent the MLP weight matrices used to process user sparse vectors and book sparse vectors, They represent the MLP bias vectors used to process user sparse vectors and book sparse vectors, respectively. f represents the nonlinear activation function. They represent the user dense vector and book dense vector obtained after the embedding operation respectively;

[0012] The generalized matrix decomposition module performs a dot product operation on the user dense vector output by the interactive data vector embedding module and the book dense vector, and then uses a single-layer MLP to process the dot product result, and degenerates the generalized matrix decomposition module into a vector dot product. The model of the generalized matrix decomposition module is:

[0013]

[0014] In the formula, φ GMF represents the output of the generalized matrix decomposition module, ⊙ represents the vector dot product operation;

[0015] The nonlinear mapping module concatenates the user dense vector and the book dense vector output by the interaction data vector embedding module, and then uses MLP to perform nonlinear mapping on the concatenated vector to capture the potential relationship between the input vector and the output vector. The model of the nonlinear mapping module is:

[0016]

[0017] φ MLP =f L (W L (f L-1 (...f1(W1p M +b1)...))+b L )

[0018] In the formula, p M represents the MLP input vector obtained after vector concatenation, f i , W i , b iRespectively represent the activation function, weight matrix and bias vector of each layer of MLP, φ MLP Represents the output of the nonlinear mapping module;

[0019] Multi-head attention filtering module, which uses collaborative filtering operations as the output vector φ based on the nonlinear mapping module MLP The output vector φ of the generalized matrix factorization module GMF Considering the query and matching operations, a cross-multi-head QKV attention model is used to model and fit the query and matching operation process. The cross-multi-head QKV attention model is composed of k layers of multi-head QKV attention mechanisms. The first layer of attention mechanism uses the output of the nonlinear mapping module and the output of the generalized matrix decomposition module as input. The subsequent layer of attention mechanism uses the output of the previous attention mechanism layer as input, and divides the query vector, key vector, and value vector input by each attention mechanism layer into multiple segments, called multi-heads, and multiplies them by weight matrices respectively. After performing the Attn operation respectively, they are spliced ​​according to the segmented dimensions, expressed as:

[0020] Output=Attn(Q,K,V)·W F

[0021] Output represents the output of the QKV attention model, Q, K, and V represent the query vector, key vector, and value vector respectively, and W F represents the forward weight matrix.

[0022] As a preferred solution of the present invention, the interactive data vector embedding module is implemented by 4 MLPs to embed user data and book data.

[0023] As a preferred solution of the present invention, the condition for the generalized matrix decomposition module to degenerate into a vector dot product is that the generalized matrix decomposition module uses a single-layer MLP with all weights 1 and all biases 0 for processing, while not updating the parameters of the single-layer MLP.

[0024] As a preferred solution of the present invention, the MLP in the nonlinear mapping module includes at least three layers.

[0025] A method for building a smart library book intelligent recommendation system includes the following steps:

[0026] S1. Obtain data for book recommendation, randomly select data to form a training set and a test set, and convert the data in the training set and the test set into a data frame;

[0027] S2. Use the model of the interactive data vector embedding module, the model of the generalized matrix decomposition module, the model of the nonlinear mapping module and the model of the multi-head attention filtering module to build a book intelligent recommendation model, where:

[0028] The model of the interaction data vector embedding module is:

[0029]

[0030] Among them, X i and X u They represent the user vector and book vector obtained by one-hot encoding respectively. Respectively represent the MLP weight matrices used to process user vectors and book vectors, They represent the MLP bias vectors used to process user vectors and book vectors, respectively. f represents the nonlinear activation function. They represent the user dense vector and book dense vector obtained after the embedding operation respectively;

[0031] The model of the generalized matrix factorization module is:

[0032]

[0033] where φ GMF represents the output of the generalized matrix decomposition module, ⊙ represents the vector dot product operation;

[0034] The model of the nonlinear mapping module is:

[0035]

[0036] φ MLP =f L (W L (f L-1 (...f1(W1p M +b1)..))+b L )

[0037] where p M represents the MLP input vector obtained after vector concatenation, f i ,W i ,b i Respectively represent the activation function, weight matrix and bias vector of each layer of MLP, φ MLP Represents the output of the nonlinear mapping module;

[0038] The model of the multi-head attention filtering module is:

[0039] Output=Attn(Q,K,)·W F

[0040] Output represents the output of the QKV attention model, Q, K, and V represent the query vector, key vector, and value vector, respectively. F represents the forward weight matrix;

[0041] S3, inputting the labeled data in the training set into the book intelligent recommendation model for training, using the binary cross entropy loss function to calculate the loss between the predicted value and the label, and saving the loss value in a list for calculating the average loss to find the optimal weight; wherein the labeled data is the interaction data between the user and the book after onehot encoding;

[0042] S4. When testing the book intelligent recommendation model, a separate sample is generated for each user, including the last book the user interacted with and multiple random books that the user has not yet interacted with. The model performance is evaluated by counting the number of recommendation hits for all users and the total number of users in the test, and calculating the value of hits@10 during the test.

[0043] As a preferred solution of the present invention, during the training process, each round of iteration generates positive samples and negative samples for each user, wherein the positive samples are books that the user has interacted with in the interaction data, and the negative samples are books that the user has not interacted with.

[0044] As a preferred solution of the present invention, the hits@10 index is used to measure the frequency with which the intelligent book recommendation model correctly predicts the user's ratings for the top 20 books with the highest ratings in the data set. The larger the index is, the better the model prediction effect is.

[0045] As a preferred solution of the present invention, the specific operation process of the multi-head attention filtering module is as follows:

[0046] Q=X Q ·W Q

[0047] K=X K ·W K

[0048] V=X V ·W V

[0049]

[0050] Output = Attn(Q, K, V)·W F

[0051] Output represents the output of the QKV attention model, Q, K, and V represent the query vector, key vector, and value vector respectively. Q , X K , X V Represents the input vector W corresponding to Q, K, and V respectively Q , W K , W V Respectively represent the learnable weight matrices corresponding to Q, K, and V, W Frepresents the forward weight matrix, d k Represents the dimension of vector K, and ⊙ represent matrix multiplication and matrix element-by-element multiplication operations respectively. The softmax operation performs the following operations element-by-element:

[0052]

[0053] Where X represents the input vector of the softmax operation, k means that the softmax operation is performed on the kth element, and sum(·) represents the sum of all elements of the vector.

[0054] As a preferred solution of the present invention, the specific operation process of the Attn operation is as follows:

[0055] Q i n =X Qi [n*L:n*L+L-1]·W Qi n , n=0,…,n′-1

[0056] K i n =X Ki [n*L:n*L+L-1]·W Ki n , n = 0, ..., n′ - 1

[0057] V i n =X Vi [n*L:n*L+L-1]·W Vi n ,n=0,…,n'-1

[0058]

[0059] in represents the model evaluation result, i represents the current attention layer, n represents the number of heads in the attention layer, n′ represents the total number of attention heads, φ MLP represents the output of the nonlinear mapping module, φ GMF Represents the output of the generalized matrix decomposition module, X[n1, n2] means taking elements n1 to n2 of X, and cat represents the concatenation operation.

[0060] Beneficial Effects

[0061] 1. The present invention is based on the construction of electronic libraries. Based on the user-book interaction records in the real world, it can automatically and accurately provide readers with reading recommendation services, thereby adapting to the development of electronic libraries and realizing personalized recommendations of digital library resources;

[0062] 2. This paper uses 10,000 books and 53,424 users with about 6M interaction records in the public data set Goodbooks-10k. It uses NCF model, matrix decomposition, nonlinear mapping, collaborative filtering and other algorithms to construct an intelligent recommendation technology and establish an accurate and stable book recommendation system, which improves the accuracy of recommendation and the matching degree between users and resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] Figure 1 It is a framework diagram of the construction method described in the present invention. DETAILED DESCRIPTION

[0064] The present invention will be further described below in conjunction with specific embodiments and drawings.

[0065] As an embodiment of the present invention, Figure 1 As shown, the present invention integrates a multi-layer perceptron and a generalized matrix decomposition algorithm to construct an intelligent recommendation technology, establish an accurate and stable book recommendation system, improve the matching degree between users and resources, so as to adapt to the development of electronic libraries and realize personalized recommendation of digital library resources. First, let the model read the training data, then initialize the training and verification data sets according to different modes, and create data loaders for the training and verification data sets respectively, and then input the training data set into the algorithm model, and perform a training cycle for the specified number of durations. In each duration, iterate the training data batches, calculate the output of the model, calculate the loss, back-propagate the gradient, and update the parameters of the model, and save the trained model parameters. Then input the verification data set into the algorithm model, verify the model, and obtain the value of the model's evaluation index hits@10. Read the test data set, input the user data to be predicted into the algorithm model, traverse each user in the test data set, exclude the items that the user has interacted with, use the trained model to predict the scores of the remaining items, and sort the scores, select the top 10 recommended items, and finally output the predicted recommendation results. Refer to Figure 1 As shown, the implementation of the recommendation system method mainly includes the following steps:

[0066] Step 1: A dataset for book recommendation is used. The data comes from the goodreads website and contains 6 million ratings of 10,000 most popular books. The data applied to the algorithm model after the dataset is processed includes training set and test set. The interaction information between users and books is stored in the training set. For example, the first line: (User_id=0,Item_id=257) means that the user with id 0 has read the book with id 257; in the test set, there is only the user's id. Preprocess the dataset. The preprocessing of the training set is mainly to initialize the dataset by obtaining the data frame df and mode. The data frame contains user manual interactions, and the mode can be training or verification. In training mode, it generates positive and negative samples for each user, where positive samples are books that the user has interacted with, and negative samples are books that the user has not interacted with. In verification mode, it generates a separate sample for each user, including the last book that the user interacted with and 99 random books that the user has not interacted with.

[0067] Step 2: Model building. Build the recommendation model according to the following interactive data vector embedding module, generalized matrix decomposition module, nonlinear mapping module, and multi-head attention filtering module.

[0068] (2.1) Construction of interactive data vector embedding module: The input data is a diluted vector obtained by one-hot encoding the user interactive data. A corresponding dense vector is generated by constructing an interactive data vector embedding module that specifically processes the sparse vector to solve the problem of high vector dimension and semantic confusion after one-hot encoding. In the present invention, the interactive data vector embedding module uses four MLPs to embed user data and book data to obtain four dense vectors. The expression of the interactive data vector embedding module is:

[0069]

[0070] Among them, X i and X u They represent the user vector and book vector obtained by one-hot encoding respectively. Respectively represent the MLP weight matrices used to process user vectors and book vectors, They represent the MLP bias vectors used to process user vectors and book vectors, respectively. f represents the nonlinear activation function. They represent the user dense vector and book dense vector obtained after the embedding operation respectively;

[0071] (2.2) Generalized matrix decomposition module: This module first performs a dot product operation on the user dense vector obtained in (2.1) and the book dense vector, and then uses a single-layer MLP to process the dot product result. In the present invention, in order to enhance the linearity of the model, an MLP with all weights 1 and all biases 0 is used for processing, and the MLP parameters are not updated. In this case, the generalized matrix decomposition module degenerates into a vector dot product, and the expression is:

[0072]

[0073] where φ GMF represents the output of the generalized matrix decomposition module, ⊙ represents the vector dot product operation;

[0074] (2.3) Nonlinear mapping module: In this module, the dense vectors obtained in (2.1) are first concatenated, and then several MLPs are used to perform nonlinear mapping on the concatenated vectors. This series of operations captures the potential relationship between the input vector and the output vector, which is expressed as follows:

[0075]

[0076] φ MLP =f L (W L (f L-1 (...f1(W1p M +b1)...))+b L )

[0077] where p M represents the MLP input vector obtained after vector concatenation, f i ,W i ,b i Respectively represent the activation function, weight matrix and bias vector of each layer of MLP, φ MLP Represents the output of the nonlinear mapping module;

[0078] (2.4) Multi-head attention filtering module: In the classic neural network collaborative filtering model, the MLP layer is often used to achieve feature integration and generate recommendation results, but this approach is too simple to obtain accurate recommendation results. In the present invention, the collaborative filtering operation is considered as a query and matching operation based on the output vector of the nonlinear mapping module and the output vector of the generalized matrix decomposition module, and the cross-multi-head QKV attention model is used to model and fit the above process. QKV attention is a special attention mechanism that only uses the attention algorithm. The specific operation process is as follows:

[0079] Q=X Q ·W Q

[0080] K=X K·W K

[0081] V=X V ·W V

[0082]

[0083] Output = Attn(Q, K, V)·W F

[0084] Output represents the output of the QKV attention model, Q, K, and V represent the query vector, key vector, and value vector respectively. Q , X K , X V Represents the input vector W corresponding to Q, K, and V respectively Q , W K , W V Respectively represent the learnable weight matrices corresponding to Q, K, and V, W F represents the forward weight matrix, d k Represents the dimension of vector K, and ⊙ represent matrix multiplication and matrix element-by-element multiplication operations respectively. The softmax operation performs the following operations element-by-element:

[0085]

[0086] Where X represents the input vector of the softmax operation, k means that the softmax operation is performed on the kth element, and sum(·) represents the sum of all elements of the vector.

[0087] The cross-multi-head QKV attention model in the present invention is composed of k layers of multi-head QKV attention mechanisms. The first layer of attention mechanism uses the output of the aforementioned nonlinear mapping module and the output of the generalized matrix decomposition module as input, and the subsequent layer of attention mechanism uses the output of the previous attention layer as input. When inputting each attention layer, the three input vectors are divided into multiple segments, called multi-heads, and multiplied by the weight matrix respectively. After performing the Attn operation respectively, they are spliced ​​according to the segmented dimension. The specific operation process is as follows

[0088] Q i n =X Qi [n*L:n*L+L-1]·W Qi n , n=0,…,n′-1

[0089] K i n =X Ki [n*L:n*L+L-1]·W Ki n, n=0,…,n′-1

[0090] V i n =X Vi [n*L:n*L+L-1]·W Vi n , n = 0, ..., n′ - 1

[0091]

[0092] in represents the model evaluation result, i represents the current attention layer, n represents the number of heads in the attention layer, n′ represents the total number of attention heads, L represents the length of each head vector, φ MLP represents the output of the nonlinear mapping module, φ GMF Represents the output of the generalized matrix decomposition module, X[n1, n2] means taking elements n1 to n2 of X, and cat represents the concatenation operation.

[0093] Step 3: Training model. The experimental platform used in the present invention is Pytorch, a deep network learning framework based on Python. The Adam optimizer is used, and the initial learning rate is set to 0.001 to control the speed at which the optimizer adjusts the weights of the neural network during training; the weight decay regularization parameter (weight_decay) is set to 1e-5 to help prevent overfitting during training by adding a penalty term to the loss function that encourages smaller weights. Train multiple epochs on the training set until Ioss converges and no longer decreases. The batch size ((Batch size) of the training neural network is set to 200, that is, the number of samples processed at a time during each training iteration, to speed up the training of the network. The hardware configuration used in the present invention is an eight-core CPU of AMD Ryzen 76800H with Radeon Graphics 3.20GHz and an NVIDIA GeForceRTX3060 Laptop GPU. The software integrated development environment is PyCharm 2022.2.1, the Python version is 3.10, and the deep learning framework is Pytorch'2.0.0+cu118' version.

[0094] Step 4: Model testing. The trained model is used to test the data in the test set, and the evaluation index hits@10 value reaches 62%. Other recommendation systems found in the experiment, such as the Paddle scoring model, have a hits@10 value of about 46%, and the accuracy of the deep learning embedded model design is 59%. By comparing the results, it can be seen that when the same data set is used for recommendation, the method used in the present invention is better than the currently known general level to a certain extent. By analyzing the results after increasing the number of iterative training times, it can be seen that there are still positive samples 0 set in the experiment in the results, which proves that these experimental data are valid and can be used to recommend to users. Result data. And with the continuous adjustment of the model parameters, it can be analyzed that the number of hits of the user's prediction results continues to increase, which means that under the current circumstances, increasing the number of iterative training times is beneficial to optimizing the model.

[0095] The technical solution of the present invention is described in detail above in conjunction with the embodiments / drawings, but the present invention is not limited to the above technical solution. For ordinary technicians in this technical field, after knowing the contents recorded in the present invention, they can make several equivalent changes and substitutions without departing from the principle of the present invention. These equivalent changes and substitutions should also be regarded as belonging to the protection scope of the present invention.

Claims

1. A smart library book intelligent recommendation system, characterized in that: It includes interactive data vector embedding module, generalized matrix decomposition module, nonlinear mapping module and generalized collaborative filtering module, among which: The interactive data vector embedding module embeds the user diluted vector and the book diluted vector obtained by one-hot encoding the user data and the book data into the interactive data vector embedding module to generate the user dense vector and the book dense vector; wherein the model of the interactive data vector embedding module is: Where, X i and X u They represent the user sparse vector and book sparse vector obtained by one-hot encoding respectively. Respectively represent the MLP weight matrices used to process user sparse vectors and book sparse vectors, They represent the MLP bias vectors used to process user sparse vectors and book sparse vectors, respectively. f represents the nonlinear activation function. They represent the user dense vector and book dense vector obtained after the embedding operation respectively; The generalized matrix decomposition module performs a dot product operation on the user dense vector output by the interactive data vector embedding module and the book dense vector, and then uses a single-layer MLP to process the dot product result, and degenerates the generalized matrix decomposition module into a vector dot product. The model of the generalized matrix decomposition module is: In the formula, φ GMF represents the output of the generalized matrix decomposition module, ⊙ represents the vector dot product operation; The nonlinear mapping module concatenates the user dense vector and the book dense vector output by the interaction data vector embedding module, and then uses MLP to perform nonlinear mapping on the concatenated vector to capture the potential relationship between the input vector and the output vector. The model of the nonlinear mapping module is: f MLP =f L (W L (f L-1 (..f1(W1p M +b1)...))+b L ) In the formula, p M represents the MLP input vector obtained after vector concatenation, f i ,W i ,b i Respectively represent the activation function, weight matrix and bias vector of each layer of MLP, φ MLP Represents the output of the nonlinear mapping module; The multi-head attention filtering module uses the collaborative filtering operation as the output vector φ based on the nonlinear mapping module MLP The output vector φ of the generalized matrix factorization module GMF Considering the query and matching operations, a cross-multi-head QKV attention model is used to model and fit the query and matching operation process. The cross-multi-head QKV attention model is composed of k layers of multi-head QKV attention mechanisms. The first layer of attention mechanism uses the output of the nonlinear mapping module and the output of the generalized matrix decomposition module as input. The subsequent layer of attention mechanism uses the output of the previous attention mechanism layer as input, and divides the query vector, key vector, and value vector input by each attention mechanism layer into multiple segments, called multi-heads, and multiplies them by weight matrices respectively. After performing the Attn operation respectively, they are spliced ​​according to the segmented dimensions, expressed as: Output=Attn(Q,K,V)·W F Output represents the output of the QKV attention model, Q, K, and V represent the query vector, key vector, and value vector respectively, and W F represents the forward weight matrix.

2. According to claim 1, the intelligent library book intelligent recommendation system is characterized by: The interactive data vector embedding module is implemented by 4 MLPs to embed user data and book data.

3. According to claim 1, the intelligent library book intelligent recommendation system is characterized by: The condition for the generalized matrix decomposition module to degenerate into a vector dot product is that the generalized matrix decomposition module uses a single-layer MLP with all weights 1 and all biases 0 for processing, and does not update the parameters of the single-layer MLP.

4. The intelligent library book recommendation system according to claim 1, characterized in that: The MLP in the nonlinear mapping module includes at least three layers.

5. A method for building a smart library book intelligent recommendation system, characterized in that: The following steps are involved: S1. Obtain data for book recommendation, randomly select data to form a training set and a test set, and convert the data in the training set and the test set into a data frame; S2. Use the model of the interactive data vector embedding module, the model of the generalized matrix decomposition module, the model of the nonlinear mapping module and the model of the multi-head attention filtering module to build a book intelligent recommendation model, where: The model of the interaction data vector embedding module is: Among them, X i and X u They represent the user vector and book vector obtained by one-hot encoding respectively. Respectively represent the MLP weight matrices used to process user vectors and book vectors, They represent the MLP bias vectors used to process user vectors and book vectors, respectively. f represents the nonlinear activation function. They represent the user dense vector and book dense vector obtained after the embedding operation respectively; The model of the generalized matrix factorization module is: where φ GMF represents the output of the generalized matrix decomposition module, ⊙ represents the vector dot product operation; The model of the nonlinear mapping module is: f MLP =f L (W L (f L-1 (...f1(W1p M +b1)...))+b L ) where p M represents the MLP input vector obtained after vector concatenation, f i , W i , b i Respectively represent the activation function, weight matrix and bias vector of each layer of MLP, φ MLP Represents the output of the nonlinear mapping module; The model of the multi-head attention filtering module is: Output=Attnn((Q,K,V)·W F Output represents the output of the QKV attention model, Q, K, and V represent the query vector, key vector, and value vector, respectively. F represents the forward weight matrix; S3, inputting the labeled data in the training set into the book intelligent recommendation model for training, using the binary cross entropy loss function to calculate the loss between the predicted value and the label, and saving the loss value in a list for calculating the average loss to find the optimal weight; S4. When testing the book intelligent recommendation model, a separate sample is generated for each user, including the last book the user interacted with and multiple random books that the user has not yet interacted with. The model performance is evaluated by counting the number of recommendation hits for all users and the total number of users in the test, and calculating the value of hits@10 during the test.

6. The method for building a smart library book intelligent recommendation system according to claim 5, characterized in that: During the training process, each iteration generates positive samples and negative samples for each user, where the positive samples are books that the user has interacted with in the interaction data, and the negative samples are books that the user has not interacted with.

7. The method for building a smart library book intelligent recommendation system according to claim 5, characterized in that: The hits@10 indicator is used to measure the frequency with which the book intelligent recommendation model correctly predicts the user's ratings for the top 20 books with the highest ratings in the data set. The larger the indicator is, the better the model prediction effect is.

8. The method for building a smart library book intelligent recommendation system according to claim 5, characterized in that: The specific operation process of the multi-head attention filtering module is as follows: Q=X Q ·W Q K=X K ·W K V=X V ·W V Output=Attn(Q,K,V)·W F Output represents the output of the QKV attention model, Q, K, and V represent the query vector, key vector, and value vector respectively. Q , X K , X V Represents the input vector W corresponding to Q, K, and V respectively Q , W K , W V Respectively represent the learnable weight matrices corresponding to Q, K, and V, W F represents the forward weight matrix, d k Represents the dimension of vector K, and ⊙ represent matrix multiplication and matrix element-by-element multiplication operations respectively. The softmax operation performs the following operations element-by-element: Where X represents the input vector of the softmax operation, k means that the softmax operation is performed on the kth element, and sum(·) represents the sum of all elements of the vector.

9. The method for building a smart library book intelligent recommendation system according to claim 5, characterized in that: The specific operation process of the Attn operation is as follows: Q i n =X Qi [n*L:n*L+L-1]·W Qi n ,n=0,…,n'-1 K i n =X Ki [n*L:n*L+L-1]·W Ki n ,n=0,…,n'-1 V i n =X Vi [n*L:n*L+L-1]·W Vi n ,n=0,…,n'-1 in represents the model evaluation result, i represents the current attention layer, n represents the number of heads in the attention layer, n′ represents the total number of attention heads, φ MLP represents the output of the nonlinear mapping module, φ GMF Represents the output of the generalized matrix decomposition module, X[n1, n2] means taking elements n1 to n2 of X, and cat represents the concatenation operation.