Personalized book recommendation method and system based on reader behavior data analysis
By acquiring readers' borrowing content and behavior data, performing dynamic feature extraction and fusion, and using machine learning and deep learning models to analyze readers' interests and preferences, the problem of low accuracy and conversion rate in traditional book recommendation methods has been solved, realizing personalized and intelligent book recommendations.
Patent Information
- Application Number
- CN202411461462.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-18
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2044-10-18
AI Technical Summary
Traditional book recommendation methods are unable to accurately capture the dynamic changes and internal patterns of readers' borrowing behavior, resulting in limited recommendation accuracy and conversion rate, and unable to meet readers' demand for personalized and intelligent recommendation services.
By acquiring data on readers' book borrowing content and borrowing behavior, dynamic feature extraction and feature fusion are performed. Machine learning and deep learning models are then used to analyze readers' interests and preferences, generating personalized borrowing recommendations.
It improved the accuracy and conversion rate of book recommendations, enhanced the user experience, and met readers' needs for personalized recommendations.
Smart Images

Figure CN119493885B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and more specifically, to a personalized book recommendation method and system based on reader behavior data analysis. Background Art
[0002] With the rapid development of information technology and the advent of the digital age, library management systems and digital library platforms are playing an increasingly important role in book lending services. These systems not only greatly improve the efficiency of library management but also provide users with a more convenient and personalized borrowing experience. However, while enjoying the convenience brought by digitalization, how to better understand and analyze readers' borrowing behavior to provide more accurate book recommendations has become a key issue that needs to be addressed in the library field.
[0003] Traditional book recommendation methods often rely on simple statistical information or rule-based recommendation algorithms. While these methods can improve the relevance of recommendations to a certain extent, they struggle to accurately capture the dynamic changes and inherent patterns in readers' borrowing behavior, resulting in limited recommendation accuracy and conversion rate. Especially when faced with massive book resources and diverse reader needs, traditional methods are unable to meet readers' demand for personalized, intelligent recommendation services. In recent years, the rapid development of big data, machine learning, and deep learning technologies has opened up new possibilities for optimizing book recommendation systems. By mining and analyzing the implicit information in readers' borrowing content and borrowing behavior data, we can gain a deeper understanding of readers' interests, preferences, and borrowing habits, thereby generating more accurate recommendation lists. Although some machine learning-based book recommendation methods have been proposed, most of these methods focus on analyzing and processing static features, ignoring the temporal and dynamic nature of borrowing content data. Summary of the Invention
[0004] The purpose of the present invention is to provide a personalized book recommendation method and system based on reader behavior data analysis. This application is implemented as follows:
[0005] In the first aspect, the present application provides a personalized book recommendation method based on reader behavior data analysis, including: obtaining reader book borrowing content data and borrowing behavior data corresponding to the reader book borrowing content data, wherein the reader book borrowing content data includes book borrowing content data collected at multiple time nodes; obtaining a content feature vector corresponding to the reader book borrowing content data, and obtaining a behavior feature vector corresponding to the borrowing behavior data; performing dynamic feature extraction on the content feature vector to obtain a content data dynamic feature vector corresponding to the reader book borrowing content data, fusing the content data dynamic feature vector and the behavior feature vector to obtain a multi-source feature vector; performing feature embedding on the multi-source feature vector to obtain a multi-source integrated embedding vector, performing borrowing recommendation restoration mapping on the multi-source integrated embedding vector, and obtaining borrowing recommendation information matching the reader book borrowing content data.
[0006] In a second aspect, the present application provides a computer system comprising: one or more processors; a memory; and one or more computer programs; wherein the one or more computer programs are stored in the memory and configured to be executed by the one or more processors, and when the one or more computer programs are executed by the processors, the method described above is implemented.
[0007] The beneficial effects of the present application include at least the following: based on obtaining the content feature vector corresponding to the reader's book borrowing content data and the behavior feature vector corresponding to the borrowing behavior data of the reader's book borrowing content data, the present application can perform dynamic feature extraction on the content feature vector to obtain the dynamic and continuous borrowing content features in the reader's book borrowing content data, thereby increasing the representation effect of the dynamic feature vector of the content data. The behavior feature vector and the dynamic feature vector of the content data are fused to obtain a multi-source feature vector, and the multi-source feature vector is feature-embedded to obtain a multi-source integrated embedding vector. Then, based on the borrowing recommendation reduction mapping of the multi-source integrated embedding vector, the borrowing recommendation information corresponding to the reader's book borrowing content data is inferred, which can increase the accuracy of the recommendation, increase the conversion rate, and improve the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for describing the embodiments of the present application.
[0009] Figure 1 This is a flowchart of a personalized book recommendation method based on reader behavior data analysis provided in an embodiment of the present application.
[0010] Figure 2 This is a schematic diagram of the composition of a computer system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0011] The execution subject of the personalized book recommendation method based on reader behavior data analysis in this application is a computer system, including but not limited to servers, personal computers, laptops, tablet computers, smart phones, etc. Figure 1 As shown, the method includes:
[0012] Step S100: obtaining reader book borrowing content data and borrowing behavior data corresponding to the reader book borrowing content data, wherein the reader book borrowing content data includes book borrowing content data collected at multiple time points.
[0013] In step S100, the computer system can automatically capture the reader's book borrowing records through an integrated library management system (LMS) or digital library platform. These records are usually stored in a database and contain the reader's unique identifier (such as student ID, membership ID, etc.), borrowed book information (such as ISBN, title, author, etc.), and specific timestamps of borrowing and returning.
[0014] In a sample data table structure, a reader information table and a borrowing record table may be included. For details, please refer to the following example:
[0015] Reader information table (readers):
[0016] reader_id (INT, primary key): reader's unique identifier; name (VARCHAR): reader's name; email (VARCHAR): reader's email address...
[0017] Borrowing record table (borrow_records):
[0018] record_id (INT, primary key): unique identifier of the borrowing record; reader_id (INT, foreign key): unique identifier of the reader; book_isbn (VARCHAR): ISBN code of the book; borrow_date (DATETIME): borrowing date; return_date (DATETIME, nullable): return date...
[0019] In step S100, the computer system traverses the borrowing record table and extracts the book borrowing content data of each reader. This data is not limited to a single borrowing event, but includes all borrowing records of the reader at different time points, forming a time series data set.
[0020] In a sample borrowing content data, assume that the borrowing record of reader A (reader_id is 1) is as follows:
[0021] Borrowing record 1: ISBN = '978-3-16-148410-0', title = 'Machine Learning', borrowing date = '2023-01-01', return date = '2023-01-15';
[0022] Borrowing record 2: ISBN = '978-0-321-62836-4', Title = 'Deep Learning', Borrowing date = '2023-02-01', Return date = '2023-02-10';
[0023] ...(More borrowing records)
[0024] These records reflect reader A's reading interests and preferences at different points in time and serve as an important foundation for subsequent analysis. In addition to the borrowed content itself, the computer system also focuses on behavioral data related to borrowing activities, which helps us gain a deeper understanding of readers' borrowing habits and behavioral patterns.
[0025] In an example of borrowing behavior data, for example, the following contents may be included:
[0026] Borrowing frequency: This counts the number of times each reader borrows books within a certain period of time. For example, reader A borrowed 5 books in the first quarter of 2023, an average of approximately 1.67 books per month.
[0027] Borrowing duration: Calculates the borrowing duration of each book. For example, in the example above, the borrowing duration for the book "Machine Learning" is 15 days, and for "Deep Learning" it is 10 days.
[0028] Borrowing time preference: Analyzing the time distribution of borrowing behavior, such as the comparison of borrowing volume on weekdays and weekends, can reveal whether readers' reading habits are affected by their work / study schedules.
[0029] Timeliness of return: Assess whether readers tend to return books on time, which may be related to readers' sense of responsibility, reading speed, or urgency of book needs.
[0030] Since borrowed content data changes dynamically over time, the computer system needs to pay special attention to the time attribute of the data. In step S100, the system will organize the borrowing records in chronological order and divide the borrowing content data into multiple time nodes, each of which represents a specific time period (such as a month, quarter, year, etc.).
[0031] For example, as an example of time node division, the following division method can be used:
[0032] Monthly division: Divide readers' borrowing records by month and generate a snapshot of borrowing content data every month.
[0033] Quarter division: Taking into account the cyclical nature of academic activities, the system can also be divided into quarters to better match the semester system.
[0034] For example, for reader A, the system can generate the following time node dataset:
[0035] First quarter of 2023: Contains all borrowing data within this quarter, including the above-mentioned borrowing record 1 and borrowing record 2.
[0036] Second quarter of 2023: Contains data on all books borrowed by reader A in the second quarter.
[0037] After collecting the raw borrowing content and behavior data, the computer system must perform data cleaning and preprocessing to ensure the effectiveness and accuracy of subsequent analysis. This may include removing duplicate records, filling in missing values, and converting data types.
[0038] Step S200: Obtaining a content feature vector corresponding to the reader's book borrowing content data, and obtaining a behavior feature vector corresponding to the borrowing behavior data.
[0039] In step S200, the computer system extracts meaningful content feature vectors and behavior feature vectors from the reader's book borrowing content data and borrowing behavior data collected in step S100. The content feature vectors are intended to capture key information from the book borrowing content data for subsequent analysis of the reader's reading interests and preferences. The computer system can implement this process using text processing, natural language processing (NLP) techniques, and possibly machine learning models.
[0040] First, the computer system pre-processes the borrowed book title, author, and even abstract (if available). This includes steps such as removing stop words, stemming, and lemmatization to reduce vocabulary diversity while retaining sufficient semantic information.
[0041] Next, the system uses NLP techniques or machine learning models to convert text data into numerical features. Common approaches include bag-of-words models, TF-IDF weighting, and word embedding.
[0042] Bag of Words model example: Treat each book as a document and build a vocabulary containing all unique words. For each book, generate a vector where each element corresponds to the number of occurrences of a word in the vocabulary (or the number of occurrences after TF-IDF weighting).
[0043] For example, if the vocabulary is ["machine learning", "deep learning", "mathematics", "physics"], the bag-of-words model vector of a book may be [1,1,0,0], indicating that the words "machine learning" and "deep learning" appear in the book, but "mathematics" and "physics" do not appear.
[0044] Word embedding example: Use a pre-trained word embedding model (such as Word2Vec, GloVe) to convert each word into a vector of fixed dimension. Then, the vectors of all words in a book can be converted into a feature vector of the book content through averaging, summing, or more complex aggregation methods (such as attention mechanism).
[0045] Assuming a 300-dimensional word embedding model is used, the content feature vector of each book will be a point in this 300-dimensional space, obtained by some aggregation of all the word vectors in the book.
[0046] For more advanced content feature extraction, computer systems can also use topic modeling techniques such as Latent Dirichlet Allocation (LDA) to identify latent topics in documents. Each topic can be viewed as a probability distribution over a set of related words, and each book can be represented as a mixture distribution of these topics. Suppose three topics are identified using the LDA model: Topic 1 (about machine learning), Topic 2 (about deep learning), and Topic 3 (about physics). Each book is represented as a probability distribution over these three topics, such as [0.6, 0.3, 0.1], indicating that 60% of the book's content is related to machine learning, 30% to deep learning, and 10% to physics.
[0047] Behavioral feature vectors are used to capture patterns and regularities in readers' borrowing behavior, such as borrowing frequency, borrowing duration, preferred time periods, etc. These features not only help us understand readers' reading behavior but also reveal their underlying needs and preferences.
[0048] Borrowing frequency: Calculates the number of times a reader borrows books within a certain time window and uses this as an element in the behavior feature vector. For example, if reader A borrowed 5 books in the past month, the borrowing frequency feature value is 5.
[0049] Borrowing duration: Count the borrowing duration of each book and possibly calculate statistics such as the mean and median as features. For example, if reader A's borrowing duration is an average of 14 days and a median of 10 days, both values can be used as elements in the feature vector.
[0050] Borrowing Time Analysis: Analyze readers' borrowing behavior during different time periods (e.g., morning, afternoon, and evening) to identify peak borrowing times. By counting the number of borrowings within each time period, a time period preference feature vector is constructed.
[0051] For example, reader A borrows books significantly more often in the evening than in other time periods, so his behavioral feature vector may contain a high value indicating a preference for borrowing books in the evening.
[0052] For more complex behavioral pattern recognition, computer systems can utilize machine learning models (such as recurrent neural networks (RNNs) and long short-term memory (LSTMs)) to analyze borrowing sequence data and capture temporal dependencies and long-term trends in borrowing behavior. Using an LSTM network to model a reader's borrowing record sequence, the network output can be a fixed-length vector representing the overall characteristics of the reader's borrowing behavior. This vector captures the temporal dynamics and underlying patterns in the borrowing sequence.
[0053] After extracting content and behavior feature vectors, the computer system may need to normalize these vectors to ensure comparability between different features. Standardization methods include normalization and standardization (Z-score), and the specific choice depends on the nature of the features and the needs of subsequent analysis.
[0054] Step S300: Dynamic feature extraction is performed on the content feature vector to obtain the content data dynamic feature vector corresponding to the reader's book borrowing content data, and the content data dynamic feature vector is merged with the behavior feature vector to obtain a multi-source feature vector.
[0055] In step S300, the computer system mines deeper dynamic features from the content feature vector to capture trends and patterns in how readers borrow content over time. These dynamic features not only reflect the evolution of readers' reading interests but also provide a richer information foundation for subsequent personalized recommendations. The system also integrates these dynamic features with the behavioral feature vector to form a multi-source feature vector that more comprehensively captures readers' reading behavior and preferences.
[0056] First, the computer system performs time series analysis on the content feature vector. Because borrowed content data is collected chronologically, the content feature vector inherently contains time series characteristics. The system can use time series analysis methods such as ARIMA (Autoregressive Integrated Moving Average) and seasonal decomposition to extract trend, seasonal, and random terms from the feature vector.
[0057] In the book recommendation scenario, deep learning models can also be used to process time series data, such as recurrent neural networks (RNNs) and their variants (such as LSTMs and GRUs). These models can capture long-term dependencies in sequence data and are very suitable for handling dynamic changes in borrowed content.
[0058] Assume that the feature vectors of each reader's borrowed content are arranged in chronological order into a sequence, where the feature vector for each time step is aggregated from the word embedding vectors of the borrowed books at that time step. The system constructs an LSTM network that takes the sequence data as input and passes information through the network's hidden states, thereby capturing the changing trends of borrowed content over time. The output of the LSTM network can be a fixed-length vector representing the dynamic characteristics of the entire borrowed content sequence. This vector not only contains the subject information of the borrowed content but also reflects how these themes evolve over time.
[0059] In actual operation, the extraction of dynamic features involves the following steps:
[0060] Data preprocessing: Standardize or normalize the content feature vector sequence to ensure the stability and convergence of model training.
[0061] Model building: Choose an appropriate deep learning framework (such as TensorFlow, PyTorch) and LSTM network structure. Set hyperparameters such as the number of network layers, number of hidden units, and activation function.
[0062] Training process: Use historical borrowing data as a training set, optimize network weights through the back-propagation algorithm, and minimize the prediction error (such as mean square error MSE).
[0063] Feature extraction: After training is completed, the new borrowing content feature vector sequence is input into the LSTM network, and the output vector is obtained as the dynamic feature.
[0064] After extracting the dynamic features, the computer system needs to fuse them with the behavioral feature vector extracted in step S200. Since the two feature vectors may have different dimensions and scales, feature scaling or dimensionality reduction is usually required before fusion.
[0065] Feature Scaling Example: Use methods such as min-max normalization or Z-score normalization to scale the dynamic feature vector and the behavioral feature vector to the same scale.
[0066] Feature fusion methods include concatenation, weighted sum, and dot product. In book recommendation scenarios, concatenation is the most direct and commonly used method. It simply concatenates the dynamic feature vector and the behavioral feature vector to form a longer feature vector.
[0067] Through the above steps, the computer system obtains the dynamic feature vector and behavioral feature vector of the reader's borrowed content. Next, the system fuses these two feature vectors to form a multi-source feature vector.
[0068] Assuming the dimension of the dynamic feature vector is d1 and the dimension of the behavioral feature vector is d2, after concatenation and fusion, the dimension of the multi-source feature vector will be d1+d2.
[0069] Dynamic feature vector example: [0.2, 0.3, -0.1, ...] (output of the LSTM network, representing the dynamic changes in borrowed content)
[0070] Example of a behavioral feature vector: [5, 14, 0.6] (representing borrowing frequency, average borrowing duration, and evening borrowing preference score, respectively)
[0071] The fused multi-source feature vector is: [0.2, 0.3, -0.1, ..., 5, 14, 0.6].
[0072] This multi-source feature vector not only contains the dynamic changes in readers' borrowing content (such as switching from science fiction novels to economics books), but also reflects the readers' borrowing behavior characteristics (such as high borrowing frequency, preference for long-term borrowing, and preference for evening reading).
[0073] By applying time series analysis and deep learning models, the computer system can extract dynamic features from borrowed content data and capture the evolving trends of readers' reading interests. Furthermore, by integrating behavioral feature vectors, the system generates multi-source feature vectors, providing more comprehensive and in-depth data support for subsequent recommendation algorithms.
[0074] Step S400: performing feature embedding on the multi-source feature vectors to obtain a multi-source integrated embedding vector, performing borrowing recommendation restoration mapping on the multi-source integrated embedding vector, and obtaining borrowing recommendation information that matches the reader's book borrowing content data.
[0075] In step S400, the computer system further processes the multi-source feature vector generated in step S300, and finally generates borrowing recommendation information that is highly matched with the reader's book borrowing content data through two key steps: feature embedding and borrowing recommendation restoration mapping.
[0076] Feature embedding is a technique that converts high-dimensional, sparse input features into low-dimensional, dense representations, helping to improve the performance and efficiency of machine learning models. In the book recommendation scenario, the computer system uses feature embedding to convert multi-source feature vectors into a more compact and expressive multi-source integrated embedding vector.
[0077] The computer system first designs an embedding layer, which contains multiple learnable embedding matrices. Each matrix corresponds to a feature domain (such as a dynamic feature domain or a behavioral feature domain) in the multi-source feature vector. The dimension and initialization method of the embedding matrix are determined according to the specific task and data characteristics.
[0078] For each feature in the multi-source feature vector, the computer system indexes it into the corresponding embedding matrix and extracts the corresponding embedding vector. These embedding vectors not only reduce the dimensionality of the original features but also capture the complex relationships between features through the learning process of the embedding layer.
[0079] After acquiring the embedding vectors for all features, the computer system uses concatenation, weighted summing, or other aggregation strategies to combine these vectors into a multi-source integrated embedding vector. This vector integrates the reader's dynamic borrowing content characteristics and behavioral characteristics, providing a rich information foundation for subsequent recommendations.
[0080] For example, suppose the multi-source feature vector is composed of the dynamic feature vector [0.2, 0.3, -0.1] and the behavioral feature vector [5, 14, 0.6], that is, [0.2, 0.3, -0.1, 5, 14, 0.6]. The computer system designs two embedding matrices, one for dynamic features (3×4) and the other for behavioral features (3×2). Through the mapping of the embedding layer, two embedding vectors are obtained, such as the dynamic feature embedding vector [0.5, -0.2, 0.1, 0.3] and the behavioral feature embedding vector [0.8, -0.1]. After concatenating these two vectors, the multi-source integrated embedding vector [0.5, -0.2, 0.1, 0.3, 0.8, -0.1] is obtained.
[0081] After obtaining the multi-source integrated embedding vector, the computer system maps it to specific borrowing recommendation information. This process usually involves one or more machine learning models that can predict the list of books that readers may be interested in based on their feature embedding vectors.
[0082] Depending on specific needs and data characteristics, the computer system can select different recommendation models, such as collaborative filtering, content-based recommendation, and deep neural networks. In complex scenarios, combining multiple models often achieves better recommendation results. The recommendation model is trained using historical borrowing data as a training set. During training, the computer system optimizes model parameters by minimizing a loss function (such as cross-entropy loss or mean squared error) to enable the model to accurately predict readers' borrowing preferences. After training, the multi-source integrated embedding vector is input into the recommendation model, which outputs a series of recommended book IDs or titles. These recommendations are generated based on the reader's personalized characteristics and are designed to meet their potential borrowing needs. For example, suppose the computer system uses a recommendation model based on a deep neural network. This model consists of multiple fully connected layers and a softmax output layer, which generates a probability distribution for the book recommendation list. The multi-source integrated embedding vector [0.5, -0.2, 0.1, 0.3, 0.8, -0.1] is input into the model. After multiple layers of nonlinear transformations, the softmax layer outputs a probability vector, such as [0.1, 0.3, 0.5, 0.1]. This vector represents the probability of readers borrowing the four popular books in the current library. Based on this probability vector, the computer system can select the book with the highest probability as the recommendation result, which is the third book.
[0083] As an implementation method, step S200, obtaining a content feature vector corresponding to the reader's book borrowing content data, may include:
[0084] Step S210: Split the reader's book borrowing content data into time periods to obtain a borrowing content time series set, decompose the borrowing content data of each sub-book in the borrowing content time series set into multiple data units corresponding to a uniform time length, and obtain a data unit set corresponding to each sub-book borrowing content data in the borrowing content time series set.
[0085] Step S210 is intended to organize the reader's book borrowing content data in an orderly manner according to the time dimension, so as to facilitate the subsequent analysis of the trends and patterns of readers' borrowing behavior over time. The specific operations performed by the computer system in this step can be described in detail as follows:
[0086] First, the computer system retrieves the reader's book borrowing data from a database or data warehouse. This data typically contains detailed information about each borrowing, such as the borrowing date, return date, and book information. This data is arranged in chronological order, reflecting the reader's borrowing activities at different points in time. Next, the computer system divides the borrowing data into time periods based on preset time period division rules. The choice of time period depends on the specific needs of the analysis and the availability of data. For example, if the analysis goal is to observe changes in readers' borrowing preferences across seasons, a quarterly time period might be selected; if the focus is on short-term fluctuations in borrowing behavior, a monthly or weekly time period might be selected.
[0087] After determining the time period division, the computer system traverses the entire borrowing content data set and assigns it to the corresponding time period based on the borrowing record date information. In this way, the borrowing records in each time period constitute a sub-book borrowing content data set, which is an element in the borrowing content time series set.
[0088] To further refine the analysis granularity, the computer system then further segments each sub-book borrowing data set into multiple data units of uniform time length. The length of these data units depends on the analysis requirements and data characteristics. For example, if the selected time period is month, and the analysis needs to be refined to the weekly level, each month's borrowing records can be segmented into four data units of equal length (assuming that each month can be approximated to four days).
[0089] During the segmentation process, the computer system may need to convert and calculate the dates of the borrowing records to determine the data unit to which each record belongs. For records that span data units (e.g., borrowed from one data unit and returned in the next), the system may need to assign them to the corresponding data unit based on specific rules (e.g., allocation by borrowing date or return date).
[0090] Ultimately, after splitting the time periods and dividing the data into units, the computer system obtained a time series of borrowed content and a data unit set corresponding to each sub-book's borrowed content data. These data unit sets, with a uniform time length as the unit, systematically record readers' borrowing activities at different time points, providing a structured data foundation for subsequent feature extraction and analysis.
[0091] For example, suppose that the analysis is about reader A's borrowing behavior in the first quarter of 2023. Select month as the time period division rule, and further divide the borrowing records of each month into four-week data units (assuming that each month is about four weeks). The computer system first retrieves all borrowing records of reader A from January to March 2023, and classifies them into the three months of the first quarter, forming three sub-book borrowing content data sets. Then, for each monthly subset, the computer system divides it into weeks. For example, for the borrowing records in January, the system assigns them to the data units of weeks 1 to 4 according to the borrowing date. If the borrowing date of a borrowing record is between January 1 and January 7, it is classified into the data unit of week 1; if it is between January 8 and January 14, it is classified into week 2, and so on.
[0092] Through this processing, the computer system finally obtained an ordered time series set of borrowing content, in which the borrowing records in each time period (month) were further subdivided into four data units (weeks), preparing for subsequent feature extraction and borrowing behavior analysis.
[0093] Step S220: Based on the data unit set corresponding to the sub-book borrowing content data X contained in the borrowing content time series set, obtain the to-be-processed content feature vector corresponding to the sub-book borrowing content data X, and load the to-be-processed content feature vector into the content embedding layer in the target recommendation information determination network; wherein X is not greater than the number of sub-book borrowing content data corresponding to the borrowing content time series set.
[0094] In step S220, the computer system first focuses on each sub-book borrowing content data X in the borrowing content time series. X represents a collection of reader borrowing records within a specific time period. These records may include information such as the borrowed book title, author, publication year, borrowing date, and return date. Based on this information, the system needs to extract features that characterize the reader's borrowing behavior and content preferences during that time period.
[0095] To obtain feature vectors of content to be processed, the computer system can use a variety of methods, including but not limited to text processing, statistical analysis, topic modeling, etc. The specific method used depends on the characteristics of the data, the purpose of the analysis, and the requirements of the subsequent recommendation algorithm.
[0096] For example, suppose the system uses a text processing-based approach to extract features. First, the system performs word segmentation on the book title of each borrowing record in X, breaking the title into several lexical units. The system can then use methods such as the bag-of-words model or TF-IDF weighting to calculate the frequency or importance of each word in X.
[0097] The system constructs a vocabulary for all unique terms in the time series of borrowed content and generates a word frequency vector for each borrowing record in X. For example, if the vocabulary contains ["machine learning", "deep learning", "science fiction", "history books"], and a borrowing record in X is "machine learning and deep learning", the corresponding word frequency vector is [1,1,0,0], indicating that "machine learning" and "deep learning" each appear once, while "science fiction" and "history books" do not appear.
[0098] In order to more accurately reflect the importance of the vocabulary in X, the system can use TF-IDF weighting. TF (term frequency) measures the frequency of a vocabulary in a single borrowing record, while IDF (inverse document frequency) measures the general importance of a vocabulary in a time series set of borrowing content. By calculating the product of TF and IDF, the system can obtain the TF-IDF value of each vocabulary and generate a weighted vocabulary frequency vector based on this. After extracting the vocabulary frequency vectors of all borrowing records, the system can aggregate them to form the content feature vector to be processed corresponding to the sub-book borrowing content data X. The aggregation method can be a simple summation or averaging, or a more complex weighted aggregation (such as giving different weights according to the freshness of the borrowing time or the borrowing frequency).
[0099] Finally, the computer system loads the feature vectors of the content to be processed into the content embedding layer of the target recommendation information determination network. The content embedding layer is typically a pretrained neural network layer that maps high-dimensional, sparse text feature vectors into a low-dimensional, dense vector space while preserving the semantic relationships between the original features. This process helps improve the efficiency and accuracy of subsequent recommendation algorithms.
[0100] Step S230: performing feature embedding on the content feature vector to be processed based on the content embedding layer to obtain a sub-content feature vector corresponding to the sub-book borrowing content data X.
[0101] In step S230, the computer system inputs the unprocessed content feature vector generated in step S220 into the content embedding layer of the target recommendation information determination network. The content embedding layer is typically a pre-trained neural network layer that can map high-dimensional, sparse text feature vectors into a low-dimensional, dense vector space by learning semantic relationships from large amounts of text data, while preserving the key information between the original features.
[0102] The content embedding layer may contain multiple neurons, each corresponding to a dimension in the embedding space. When the content feature vector to be processed is input into the embedding layer, it undergoes matrix multiplication with the weight matrix in the embedding layer and may undergo nonlinear transformation through activation functions (such as ReLU and Tanh) to produce a new feature representation.
[0103] For example, suppose the feature vector of the content to be processed is a sparse vector of length N, represented as v = [v1, v2, ..., v N ], where v i Represents the occurrence of the i-th word in the vocabulary in the sub-book borrowing content data X (such as TF-IDF value). The weight matrix of the content embedding layer is W∈R D×N , where D is the target dimension of the embedding vector, which is usually much smaller than N to achieve dimensionality reduction and compression of features.
[0104] When the content feature vector v to be processed is input into the content embedding layer, the system performs the following calculations:
[0105] e=Wv;where, is the calculated sub-content feature vector. This vector is the embedding representation of the original content feature vector v in the low-dimensional space, which captures the core semantic information of the borrowed content in X. To further introduce nonlinearity, the system may pass e through an activation function, such as ReLU: relu =max0,e. It should be noted that not all content embedding layers use activation functions, which depends on the specific model design and training objectives. Through this step, the computer system successfully converts the feature vector of the content to be processed into a sub-content feature vector. The sub-content feature vector not only has a lower dimension, which is convenient for subsequent processing, but also can more effectively capture the semantic information of the borrowed content, providing a more accurate feature representation for personalized book recommendations. It is worth noting that the weight matrix W in the content embedding layer is usually pre-trained on a large-scale text dataset to ensure that it can capture the common semantic patterns in the text data. However, in some cases, these pre-trained weights can also be fine-tuned as part of the overall training process of the recommendation system to adapt to the specific needs of a specific field (such as book recommendations).
[0106] Step S240: The sub-content feature vectors corresponding to the borrowing content data of each sub-book in the borrowing content time series set are merged into a content feature vector corresponding to the reader's book borrowing content data.
[0107] In step S240, the computer system has generated corresponding sub-content feature vectors for each sub-book borrowing content data X through the previous steps (particularly step S230). These sub-content feature vectors each capture the semantic information of the reader's borrowed content during different time periods. To form a comprehensive reader reading feature representation, the system needs to fuse these sub-feature vectors into an overall content feature vector.
[0108] The fusion process can employ a variety of strategies, depending on the nature of the feature vectors, the analysis requirements, and the requirements of the subsequent recommendation algorithm. Common fusion methods include weighted averaging, concatenation, and attention mechanisms. Each method has its own applicable scenarios and advantages and disadvantages.
[0109] For example, suppose the borrowing content time series set contains T sub-book borrowing content data, each data corresponds to a sub-content feature vector e t , where t=1,2,…,T. The system first assigns a weight w to each sub-feature vector t ,These weights can be determined based on various factors such as the importance of the time period, borrowing frequency, reading time, etc. Then, the system calculates the weighted average vector as the final content feature vector:
[0110]
[0111] Here, f is the fused content feature vector, which integrates the information of all sub-feature vectors and adjusts them based on weights. If the system determines that recent borrowing behavior better reflects the reader's current interests, it can assign higher weights to recent sub-feature vectors. Another strategy is to assign weights based on borrowing frequency or reading time, that is, sub-feature vectors with more borrowing times or longer reading time receive higher weights.
[0112] For example, if the subsequent recommendation algorithm is capable of processing high-dimensional feature vectors, or the system hopes to retain as much original information as possible, a splicing fusion method can be used. That is, simply splice all sub-content feature vectors into a longer vector in sequence. In actual applications, the computer system will select an appropriate fusion method based on specific needs and scenarios. Regardless of which method is used, the purpose is to generate a comprehensive, compact and expressive content feature vector for subsequent personalized book recommendations. Through the fusion operation of step S240, the computer system successfully integrates multiple sub-content feature vectors in the borrowing content time series set into a single content feature vector, providing strong data support for the subsequent recommendation algorithm.
[0113] As an implementation manner, step S230, performing feature embedding on the content feature vector to be processed based on the content embedding layer to obtain the sub-content feature vector corresponding to the sub-book borrowing content data X, may include:
[0114] Step S231: Based on the information focusing unit in the content embedding layer outputting the information focusing feature vector corresponding to the to-be-processed content feature vector, the to-be-processed content feature vector and the information focusing feature vector are merged into a content merging feature vector;
[0115] Step S232: Obtain the transformation matrix and displacement array corresponding to the feedforward neural network in the content embedding layer, determine the content transformation feature vector corresponding to the sub-book borrowing content data X based on the displacement array and the scalar product between the transformation matrix and the content merge feature vector, and fuse the content merge feature vector and the content transformation feature vector into the sub-content feature vector corresponding to the sub-book borrowing content data X.
[0116] In step S231, the computer system first uses the information focusing unit in the content embedding layer (such as the self-attention mechanism or the attention layer in the Transformer structure) to process the feature vector of the content to be processed to output an information focusing feature vector. This feature vector can capture the most important or relevant information part of the feature vector of the content to be processed. Subsequently, the system fuses the original feature vector of the content to be processed with the information focusing feature vector to generate a content merged feature vector. This process aims to enhance the expression of key information in the feature vector while retaining the integrity of the original feature vector. The information focusing unit is usually implemented based on the attention mechanism, which allows the model to dynamically adjust the weights of different parts to pay more attention to the important information in the input feature vector. In the Transformer model, the self-attention mechanism is a typical example. It calculates the similarity score (i.e., attention weight) between each element in the input sequence and other elements, and then performs a weighted summation of the elements in the sequence according to these weights to generate a new feature representation.
[0117] For example, suppose the feature vector of the content to be processed is v = [v1, v2, ..., v N ], where N is the dimension of the feature vector. The information focusing unit first calculates an attention weight matrix A∈R N×N , where each element a ij Represents the attention weight of the i-th feature element to the j-th feature element. These weights can be calculated by dot product, scaled dot product or other similarity functions.
[0118] Then, the information focusing unit uses the attention weight matrix to perform weighted summation on the original feature vectors to generate the information focusing feature vector f attn :f attn =Av. Finally, the system combines the original feature vector v with the information focused feature vector f attn Fusion is performed to generate a content merge feature vector c. The fusion method can be a simple weighted sum or splicing, depending on the needs of subsequent processing. For example, if the weighted sum method is used, then: fc = αv + 1 - αf attn , where α is a hyperparameter or a learnable weight used to balance the contributions of the original feature vector and the information-focused feature vector.
[0119] In step S232, the computer system uses the feedforward neural network (FNN) in the content embedding layer to further transform and compress the content merge feature vector. The feedforward neural network maps the input features into a new feature space through a series of linear transformations and nonlinear activation functions to generate a content transformation feature vector. The system then fuses the content merge feature vector and the content transformation feature vector to generate the final sub-content feature vector. This process aims to enhance the expressive power of the feature vector by adding nonlinear transformations and reduce computational complexity and overfitting risk through feature compression.
[0120] A feedforward neural network usually contains multiple hidden layers, each of which consists of multiple neurons. Each neuron receives the output of the previous layer as input and generates output through weighted summation and activation function. In the content embedding layer, the role of the feedforward neural network is to deeply process the content merge feature vector and extract higher-level feature representations. The weights (transformation matrix) and biases (displacement array) of the feedforward neural network are learned through the training process. During the training process, the system calculates the difference between the predicted results and the actual results based on the loss function (such as cross entropy loss, mean square error, etc.), and updates the network weights and biases through the backpropagation algorithm to minimize the loss function value. For example, suppose the content merge feature vector is c = [c1, c2, ..., c M ], where M is the dimension of the feature vector (which may be different from the dimension N of the original feature vector). The feedforward neural network first transforms c through the first linear layer (fully connected layer): fz = W1c + b1; where, is the weight matrix (transformation matrix) of the first linear layer, is the corresponding bias vector (displacement array), and z is the transformed intermediate feature vector with dimension P. The system then activates z through a nonlinear activation function (such as ReLU). Next, if the feedforward neural network contains multiple hidden layers, the above linear transformation and nonlinear activation process is repeated until the required feature dimension or complexity is reached. Finally, the system maps the output of the hidden layer to the target dimension through the last linear layer to generate the content transformation feature vector f ffn =W L a L +b L ; Among them, L is the last layer of the feedforward neural network, is the weight matrix of this layer, is the bias vector, a L is the activation output of the last hidden layer, f ffn is the content transformation feature vector, whose dimension is K. The system combines the content merging feature vector c and the content transformation feature vector f ffnPerform fusion to generate sub-content feature vector e x The fusion method can be weighted sum, concatenation or other customized fusion strategies. For example, if the weighted sum method is used and it is assumed that the dimensions of the two are the same (or the dimensions can be matched in some way), then: x =βc+(1-β)f ffn Where β is a hyperparameter or learnable weight used to balance the contributions of the content merging feature vector and the content transformation feature vector. Through the above two steps (S231 and S232), the computer system successfully transforms the feature vector of the content to be processed into a more compact and information-rich sub-content feature vector. This feature vector not only captures the important information in the original features, but also enhances its expressive power through nonlinear transformation and feature compression, providing strong data support for subsequent personalized book recommendations.
[0121] As an implementation manner, step S231, outputting an information focusing feature vector corresponding to the feature vector of the content to be processed based on the information focusing unit in the content embedding layer, includes:
[0122] Step S2311: Obtain a mapping weight matrix corresponding to the information focusing unit in the content embedding layer, and based on the mapping weight matrix of the information focusing unit, map the feature vector of the content to be processed into a first search array, a first anchor array, and a first result array;
[0123] Step S2312: performing a scalar product calculation on the flipped array of the first search array and the first anchor array to obtain an intermediate weighted matrix and the number of array columns corresponding to the first search array;
[0124] Step S2313: Normalize the ratio between the intermediate weighting matrix and the square root of the number of array columns to obtain a first focusing weighting matrix, and determine the information focusing feature vector corresponding to the content feature vector to be processed based on the scalar product between the first focusing weighting matrix and the first result array.
[0125] In step S2311, the computer system first obtains the mapping weight matrix corresponding to the information focusing unit in the content embedding layer. This matrix is the core component of the information focusing unit. It contains the weight information for mapping the input feature vector to three different spaces: query, anchor (key), and result (value). These spaces correspond to the three key components of the self-attention mechanism, which work together on the input feature vector to achieve information focusing and weighting. For example, assuming that the feature vector of the content to be processed is v = [v1, v2, ..., V N ], where N is the dimension of the feature vector. The information focusing unit in the content embedding layer has three mapping weight matrices: W q 、W k、W v , which are used to generate query vector, anchor vector and result vector respectively. In practical applications, these mapping weight matrices W q 、W k 、W v They are learned through the model training process. They can automatically adjust to optimize overall performance based on the needs of specific tasks (such as personalized book recommendations).
[0126] In step S2312, the computer system uses the query vector and the anchor vector to calculate the attention weights. This process simulates the distribution of attention between different information points when reading. Specifically, the system first calculates the scalar product (or dot product) between the query vector and the anchor vector (or its flipped form), and then applies the softmax function (or similar normalization function) to convert the result into a probability distribution form as the attention weight.
[0127] To calculate the attention weight, the system first calculates the dot product between the query vector q and the anchor vector k. However, in the self-attention mechanism, the anchor vector is "flipped" (actually achieved by matrix transposition) so that it can be batched with the query vector for dot product calculation. But here, for the sake of simplicity, it is assumed that the anchor vector has been processed in some way so that it can be directly dot-producted with the query vector.
[0128] Assume that we have the processed anchor vector, denoted as ktrans. Then, calculate the dot product of the query vector and the anchor vector: score ij =q i ·ktran s,j ;
[0129] Among them, score ij represents the dot product score (i.e., “attention score”) between the i-th query element and the j-th anchor element, which measures the similarity or correlation between the two.
[0130] In order to convert the attention score into a probability distribution form (i.e., attention weight), the system can apply the softmax function:
[0131]
[0132] Among them, α ij represents the attention weight from the i-th query element to the j-th anchor element. The softmax function ensures that the sum of all weights is 1, thereby achieving normalization of the probability distribution.
[0133] In practical applications, since the exponential operation in the softmax function may cause numerical stability problems (especially when the score values are very large or very small), some techniques are used to avoid these problems, such as subtracting the maximum value of the score or using a more stable logarithmic softmax function. However, in a typical implementation of the self-attention mechanism, the above calculation process is performed in parallel for all query-anchor pairs to form a complete attention weight matrix (or "attention map"). However, in the simplified description of this step, only the calculation process between a single query element and all anchor elements is shown. For the sake of completeness, it should be noted that in the self-attention mechanism, the query vector, anchor vector and result vector are usually generated by the same input feature vector (after different linear transformations). This means that in actual calculations, the attention weights between each element in the input feature vector and other elements are actually calculated.
[0134] In step S2313, the computer system performs a weighted sum operation on the result vector using the attention weights calculated in the previous step to generate an information focus feature vector. Using the attention weight matrix A = [α ij ](where each element α ij represents the attention weight from the i-th query element to the j-th anchor element), the system performs a weighted sum operation on the result vector v′: f attn =Av′; here, f attn It is the information focus feature vector corresponding to the feature vector v of the content to be processed. It is obtained by weighted summing each element in the result vector according to its corresponding attention weight, thus achieving information focusing and weighting.
[0135] Information focusing feature vector f attn Not only does it contain all the information in the original feature vector v (although obtained through linear transformation and weighted summation), but through the action of the attention mechanism, it also places greater emphasis on the feature elements that are most relevant to the current query. In the scenario of personalized book recommendations, this means that the system can pay more attention to the book features that best match the reader's current borrowing preferences, thereby generating more accurate recommendation results.
[0136] As an implementation method, in step S200, obtaining a behavior feature vector corresponding to the borrowing behavior data includes:
[0137] Step S210': decompose the borrowing behavior data into T component data items, and obtain the implicit representation of the data items corresponding to the T component data items; T≥1;
[0138] Step S220': based on the behavioral semantics of the T component data items in the borrowing behavior data, obtaining the semantic implicit representations corresponding to the T component data items respectively;
[0139] Step S230': based on the temporal distribution of the T component data items in the borrowing behavior data, obtaining the temporal distribution implicit representations corresponding to the T component data items;
[0140] Step S240': fusing the data item implicit representation, the semantic implicit representation, and the temporal distribution implicit representation to obtain a behavior feature vector to be processed corresponding to the borrowing behavior data;
[0141] Step S250 ′: loading the behavior feature vector to be processed into the behavior embedding layer in the target recommendation information determination network, performing feature embedding on the behavior feature vector to be processed based on the behavior embedding layer, and obtaining the behavior feature vector corresponding to the borrowing behavior data.
[0142] In step S210', the computer system decomposes the borrowing behavior data into T component data items and obtains the implicit representations of the data items corresponding to each of these component data items. For example, assuming T is 5, this means that the system has decomposed a reader's borrowing behavior data into five data items. Each data item can be a specific borrowing behavior, such as the number of times a book was borrowed, the borrowing time, the type of book borrowed, etc. For the number of times a book was borrowed, its implicit representation might be a vector, such as [3, 0, 2, 1, 0], where the numbers represent the number of borrowings in different time periods.
[0143] After obtaining the basic implicit representation of the data item, step S220' further mines the behavioral semantics of each data item in the borrowing behavior data and generates a corresponding semantic implicit representation. Behavioral semantics refers to the deep meaning or purpose carried by the data item and related to the reader's borrowing behavior. Behavioral semantics refers to the meaning or motivation behind the behavior. For example, if a reader frequently borrows science fiction books, the system may deduce the behavioral semantics that the reader is interested in science fiction themes. Accordingly, the system generates a semantic implicit representation for each behavioral data item. If in the above example, the borrowing behavior is associated with science fiction books, then the semantic implicit representation of the behavioral data item may be a vector, such as [0.8, 0.2, 0.1, 0.05, 0.05], where each number represents the correlation score between the borrowing behavior and different types of books.
[0144] To capture these behavioral semantics, the system can generate semantic implicit representations using the following methods:
[0145] Rule-based mapping: Define a set of rules to map different types of books to predefined semantic categories (such as entertainment, education, professional, etc.).
[0146] Topic modeling: Using topic modeling techniques such as LDA (Latent Dirichlet Allocation), the topic distribution is extracted from the borrowed book content as a semantic implicit representation.
[0147] Knowledge graph: Build or utilize the existing knowledge graph in the book field, and map book types into a low-dimensional vector space through graph embedding technology (such as Node2Vec and Deep Walk).
[0148] Suppose the system uses a rule-based mapping method to map "novel" to the "entertainment" category and assigns it a semantic implicit representation vector [0.8, 0.2, 0] (assuming this is a three-dimensional vector space, representing the three dimensions of entertainment, education, and professional respectively).
[0149] Next, in step S230', the computer system obtains the implicit representation of the temporal distribution corresponding to each of the five component data items based on their temporal distribution in the borrowing behavior data. Temporal distribution refers to the temporal distribution of borrowing behavior. For example, the system will analyze whether a reader borrows books more frequently on weekends than on weekdays. For the implicit representation of temporal distribution, the system may generate another vector, such as [0.7, 0.15, 0.05, 0.05, 0.05], where the numbers represent the probability distribution of borrowing behavior in different time periods. The temporal information in the borrowing behavior data is crucial for understanding readers' borrowing habits and behavior patterns. In this step, the computer system analyzes the temporal distribution of data items in the borrowing behavior data to generate an implicit representation of temporal distribution. This representation can capture the dynamic changes and periodic laws of readers' borrowing behavior.
[0150] To generate an implicit representation of the time series distribution, the system can adopt the following methods:
[0151] Time series analysis: Use time series analysis methods such as ARIMA and seasonal decomposition to extract trend items, seasonal items, and random items of borrowing behavior.
[0152] Recurrent Neural Network (RNN): Use RNN variants such as LSTM and GRU to model borrowing time series and capture the long-term dependencies and periodic changes in borrowing behavior.
[0153] Discrete Fourier Transform (DFT): Converts the borrowed time series from the time domain to the frequency domain and extracts its spectral features as an implicit representation of the time series distribution.
[0154] Assume that the system uses a simple statistical method to generate an implicit representation of the temporal distribution, calculate the borrowing frequency of readers in different months (or quarters), and convert it into a normalized frequency distribution vector. For example, if a reader borrowed 3 times in the first quarter, 5 times in the second quarter, 4 times in the third quarter, and 2 times in the fourth quarter, the corresponding implicit representation vector of the temporal distribution might be [0.2, 0.33, 0.27, 0.13] (normalized).
[0155] In step S240', the computer system fuses the implicit representations of data items, semantics, and temporal distribution generated in steps S210', S220', and S230' to form a comprehensive feature vector of the behavior to be processed. This fusion process aims to integrate multiple aspects of information to more accurately characterize the characteristics of the reader's borrowing behavior.
[0156] For example, suppose we already have the following three implicit representations: data item implicit representation (using book type as an example): [0.8 (Entertainment), 0.2 (Education), 0 (Professional)]; semantic implicit representation (also using book type as an example, but based on a different generation method): [0.75 (Fiction), 0.2 (Non-fiction), 0.05 (Other)]; and temporal distribution implicit representation: [0.2, 0.33, 0.27, 0.13]. The system can use various fusion strategies to generate the feature vector of the behavior to be processed, such as concatenation, weighted sum, or automatic fusion using deep learning models.
[0157] After obtaining the behavior feature vector to be processed, the computer system loads it into the behavior embedding layer in the target recommendation information determination network for further processing. The behavior embedding layer is a pre-trained neural network layer that can map the high-dimensional, sparse behavior feature vector to be processed into a low-dimensional, dense vector space while retaining key behavior feature information. For example, the behavior embedding layer usually contains multiple learnable parameters (such as weight matrices and bias terms), which are optimized during the training process to adapt to specific recommendation tasks. When the behavior feature vector to be processed is input into the behavior embedding layer, it is first multiplied by the weight matrix of the embedding layer and subjected to a nonlinear transformation through an activation function (such as ReLU, Tanh, etc.).
[0158] As an implementation method, step S300, performing dynamic feature extraction on the content feature vector to obtain the content data dynamic feature vector corresponding to the reader's book borrowing content data, may include:
[0159] Step S310: Perform temporal feature embedding on the content feature vector to obtain a temporal embedding feature vector corresponding to the content feature vector, and fuse the content feature vector and the temporal embedding feature vector into content representation information;
[0160] Step S320: Obtain a preset dynamic feature vector with the same dimension as the behavior feature vector, and load the preset dynamic feature vector and content representation information into the dynamic feature processing layer in the target recommendation information determination network;
[0161] Step S330: Based on the dynamic feature processing layer and the content representation information, the preset dynamic feature vector is adjusted and optimized to obtain the content data dynamic feature vector corresponding to the reader's book borrowing content data.
[0162] In step S310, the computer system performs temporal feature embedding on the content feature vector, aiming to incorporate temporal variation information into the feature vector. Subsequently, the original content feature vector is fused with the temporal embedding feature vector to generate content representation information. This process helps capture the dynamic changes in content borrowed by readers.
[0163] Temporal feature embedding usually involves encoding time information into a feature vector in some way. In the book recommendation scenario, since the borrowing content data is collected in chronological order, time series analysis methods can be used to extract temporal features. A simple method is to convert the timestamp into an encodable form, such as converting the date into a combination of year, month, and day, or using the difference in days from a fixed starting point (such as the system launch time) to the current borrowing date as the time code. Another more advanced method is to use a time embedding matrix. Each row of this matrix represents an embedded representation of a time point (or time period). By looking up the matrix, the timestamp of each borrowing record can be mapped to a low-dimensional embedding vector.
[0164] For example, suppose a reader borrows multiple books over a period of time, and the borrowing time of each book is recorded. The content feature vector c has been generated by the previous step (such as step S230), representing the static features of the content borrowed by the reader.
[0165] Now, we need to embed the temporal features of c. Assume that the temporal embedding matrix E∈R T×d , where T is the number of time points and d is the dimension of the embedding vector. For each book borrowed by a reader, the corresponding embedding vector in E is found according to the borrowing time and used as the temporal embedding feature of the book borrowing record.
[0166] If we assume that the reader's borrowing records are arranged in chronological order, and each borrowing record is associated with a timestamp t i (i=1,2,...,N, where N is the total number of borrowing records), then for each borrowing record, the temporal embedding vector e can be retrieved from E ti .
[0167] Then, the temporal embedding vectors of all borrowing records are aggregated in some form (such as averaging, weighted sum, or attention mechanism) to obtain the temporal embedding feature vector t of the entire borrowing sequence.
[0168] After obtaining the temporal embedding feature vector t, it is fused with the original content feature vector c to generate content representation information r. The fusion method can be simple splicing, weighted sum, or automatic fusion using a deep learning model.
[0169] r = [c; t] or r = αc + (1-α) t
[0170] Where [;] represents the vector concatenation operation and α is a hyperparameter or a learnable weight.
[0171] In step S320, the computer system first generates a preset dynamic feature vector with the same dimension as the behavioral feature vector. This vector serves as the starting point for dynamic feature processing. Its initial value can be random, generated based on a heuristic rule, or learned from training data. This preset dynamic feature vector, along with the content representation information, is then loaded into the dynamic feature processing layer of the target recommendation information determination network.
[0172] The method for generating the preset dynamic feature vector depends on the specific application scenario and requirements. A simple method is to randomly initialize a vector with the same dimension as the behavioral feature vector and optimize it during the subsequent training process. Another method is to use prior knowledge or heuristic rules to set the initial value. In more complex scenarios, the preset dynamic feature vector may be obtained through some form of pre-training process. For example, an autoencoder can be used to perform unsupervised learning on a large amount of borrowing history data to obtain a low-dimensional representation that can capture the dynamic changes in borrowed content as a preset dynamic feature vector. The dynamic feature processing layer is a key component in the target recommendation information determination network. It is responsible for generating the final content data dynamic feature vector based on the input content representation information and the preset dynamic feature vector. This layer usually contains multiple neural network layers (such as fully connected layers, recurrent neural network layers, etc.), as well as possible attention mechanisms or gating mechanisms to enhance the model's dynamic processing capabilities.
[0173] During the loading process, the computer system passes the preset dynamic feature vector and content representation information as input to the dynamic feature processing layer and initializes the parameters of the layer (such as weights and biases). These parameters will be adjusted in the subsequent training process to optimize model performance.
[0174] In step S330, the computer system uses the dynamic feature processing layer to adjust and optimize the preset dynamic feature vector to generate a content data dynamic feature vector corresponding to the reader's book borrowing content data. This process involves the calculation of multiple neural network layers, the application of nonlinear activation functions, and the possible use of attention mechanisms or gating mechanisms.
[0175] Dynamic feature processing layers typically consist of multiple neural network layers, each of which performs a specific computational task. For example, fully connected layers perform linear transformations on input features; recurrent neural network layers (such as LSTM or GRU) can capture long-term dependencies in the input sequence; and attention mechanisms allow the model to dynamically focus on different parts of the input sequence when generating output.
[0176] In the book recommendation scenario, the dynamic feature processing layer might first perform preliminary processing on the input features through one or more fully connected layers, and then utilize a recurrent neural network layer to capture the temporal changes in borrowed content. An attention mechanism can be used to assign different weights to different borrowing records when generating the final feature vector.
[0177] To introduce nonlinear factors and enhance the model's expressiveness, a nonlinear activation function is applied to each neural network layer in the dynamic feature processing layer. Common activation functions include ReLU, Tanh, and Sigmoid. These functions map the results of linear transformations to a nonlinear output space, allowing the model to learn more complex feature representations.
[0178] Assume that LSTM is used as the core component of the dynamic feature processing layer. LSTM is a special recurrent neural network structure that overcomes the gradient vanishing or gradient exploding problems that traditional RNNs are prone to when training long sequences by introducing three "gates" (forget gate, input gate, and output gate).
[0179] In the book recommendation scenario, the content representation information r can be used as the input sequence of LSTM (although r itself may not be a sequence of data, it can be regarded as a sequence containing only one time step here), and the preset dynamic feature vector can be used as the initial hidden state and unit state of LSTM.
[0180] The LSTM network then updates its hidden state and cell state based on the content of r and the information passed through the gating mechanism. After the LSTM processes the entire input sequence (actually only one time step in this example), the final hidden state can be used as the content data dynamic feature vector d.
[0181] Through a series of operations, including temporal feature embedding, content representation information generation, pre-set dynamic feature vector loading, and dynamic feature processing layer optimization, a dynamic feature vector corresponding to the borrowed content data of readers is successfully generated. This process not only captures the static characteristics of the borrowed content but also introduces information about changes in the time dimension, thereby more comprehensively reflecting readers' borrowing preferences and behavior patterns.
[0182] As an implementation method, the content feature vector includes S sub-content feature vectors, where S≥1. Based on this, step S310 performs temporal feature embedding on the content feature vector to obtain a temporal embedding feature vector corresponding to the content feature vector, which may specifically include:
[0183] Step S311: Obtain the distribution positions of the S sub-content feature vectors in the reader's book borrowing content data, and decompose the distribution positions of the S sub-content feature vectors into even-numbered distribution positions and odd-numbered distribution positions;
[0184] Step S312: performing a first embedding operation (such as sine) on the even-number distribution position in the content feature vector to obtain a first embedding result corresponding to the even-number distribution position;
[0185] Step S313: performing a second embedding operation on the singular distribution position in the content feature vector to obtain a second embedding result corresponding to the singular distribution position;
[0186] Step S314: Determine the first embedding result and the second embedding result as the temporal embedding feature vector corresponding to the content feature vector.
[0187] In step S311, the computer system first identifies the distribution of each sub-content feature vector within the content feature vector. These sub-content feature vectors typically represent the characteristics of the borrowed content by the reader over different time periods. The system then arranges these sub-vectors in chronological order based on the timestamps of the borrowing records and determines their relative position within the entire borrowing period.
[0188] Since borrowing records may not be evenly distributed (for example, borrowing is frequent in certain time periods and less frequent in other time periods), the system needs a mechanism to distinguish these different time periods. In this embodiment, the system chooses a simple but effective method: decomposing the distribution position of the sub-content feature vector into an even distribution position and an odd distribution position. This decomposition may be based on some attribute of the timestamp (such as year, month, day of the week, etc.), but a more direct way may be to simply divide the timeline into alternating even and odd intervals. For example, suppose reader A borrows multiple books in a year, and the system generates 12 sub-content feature vectors by month (representing the borrowing content characteristics of each month). These vectors are arranged in chronological order as: v1, v2,…, v12.
[0189] The system first determines the time position (i.e., month) of each subvector. Then, depending on whether the month is odd or even, these vectors are assigned to even or odd distribution positions. For example, vectors for January, March, May, July, September, and November are assigned to odd distribution positions, while vectors for February, April, June, August, October, and December are assigned to even distribution positions.
[0190] In step S312, the computer system performs a first embedding operation on the feature vectors of the sub-contents assigned to even-numbered distribution positions. This embedding operation is intended to encode time information into the feature vectors in a specific manner so that the temporal changes of the borrowed content can be captured later.
[0191] In this embodiment, the first embedding operation is a sine function. The sine function is a periodic function whose value varies between [-1, 1] and has good smoothness and predictability. These properties make the sine function a suitable choice for time series embedding because it can reflect changes in time in a continuous and predictable manner.
[0192] In order to apply the sine function to the temporal embedding of the sub-content feature vector, the system needs to define a time scale (such as month, week, etc.) and a period (such as a year, a borrowing period, etc.). Then, for each sub-vector assigned to an even-numbered distribution position, the system calculates the sine value of its corresponding time point and combines this value with the original sub-vector in some way (such as weighting, splicing, etc.). For example, continuing with the previous example, assume that the selected time scale is month and the period is one year. For sub-vectors assigned to even-numbered distribution positions (such as vectors for February, April, ..., December), the system calculates the relative positions of these months in the year (such as February is the second month, April is the fourth month, and so on), and converts these positions into normalized timestamps from 0 to 1 (for example, by dividing by 12). The system then applies the sine function to each normalized timestamp to generate a sine value. This sine value can be combined with the corresponding sub-content feature vector as part of the time embedding. The specific combination method can be a simple splicing: for each sub-vector v of an even-numbered month i (where i is an even-numbered month), generating a new embedding vector e i =[v i ; sin(θ i )], where θ i It is the value of the normalized timestamp corresponding to the month converted to radians.
[0193] In practical applications, the sine value can be used as a form of weight or offset to adjust or enhance certain elements in the original feature vector.
[0194] Similar to step S312, step S313 involves performing a second embedding operation on the sub-content feature vector assigned to the singular distribution position. However, unlike the first embedding operation, the second embedding operation selects another function (such as a cosine function) to encode the time information.
[0195] The cosine function, like the sine function, is also a periodic function, but it is 90 degrees out of phase with the sine function. This means that when the sine function reaches its maximum, the cosine function is zero, and vice versa. By using both sine and cosine functions for timing embedding, the system can capture richer timing variation patterns.
[0196] Similar to sine embedding, the system first determines the time positions of the sub-content feature vectors assigned to singular distribution positions. The cosine function is then applied to these time positions to generate embedding values. These values are then combined with the original sub-vectors in some way to form new embedding vectors. For example, continuing with the previous example, for sub-vectors assigned to singular distribution positions (such as vectors for January, March,..., November), the system calculates the relative positions of these months in the year and converts these positions into normalized timestamps. The cosine function is then applied to each normalized timestamp to generate a cosine value. Similar to sine embedding, this cosine value can be combined with the original sub-vector in some way. For consistency (although it may not be necessary in practical applications), the splicing method is adopted again: for each sub-vector v of the odd month j (where j is an odd month), generate a new embedding vector e j =[v j ; cos(θ j )], where θ j It is the value of the normalized timestamp corresponding to the month converted to radians.
[0197] In step S314, the computer system combines all embedding vectors generated in steps S312 and S313 (whether sine embedding or cosine embedding) to form a final temporal embedding feature vector. This vector will contain all the information of the original content feature vector as well as the temporal variation information introduced by the sine and cosine functions.
[0198] The choice of combination strategy depends on the specific application scenario and requirements. A simple approach is to simply concatenate all embedding vectors together to form a longer vector. However, this approach may cause the vector dimension to increase dramatically and contain a lot of redundant information.
[0199] To overcome these problems, the system can adopt more complex combination strategies such as weighted averaging, principal component analysis (PCA) dimensionality reduction, or autoencoder compression, etc. These methods can reduce the dimension and redundancy of the vector while retaining key information.
[0200] To simplify the explanation, we use the splicing strategy as a combination example again: Assume that 6 sub-content feature vectors are assigned to even-numbered distribution positions and sinusoidal embedding is performed to generate 6 new embedding vectors (denoted as e2, e4, ..., e 12 ), the other 6 sub-vectors are assigned to the singular distribution position and cosine embedding is performed to generate another 6 embedding vectors (denoted as e1, e3, ..., e 11 ). The system simply concatenates these embedding vectors together to form the final temporal embedding feature vector [e1,e2,…,e 11 ,e 12 ].
[0201] By performing temporal feature embedding on the content feature vector (especially using sine and cosine functions to perform different embedding operations on sub-vectors in even and odd distribution positions), the computer system successfully generated a temporal embedding feature vector containing rich temporal change information. This vector not only retains all the information of the original content feature vector but also enhances the feature representation capability by introducing changes in the time dimension. In subsequent steps, this temporal embedding feature vector will be used together with the behavioral feature vector to generate personalized book recommendation results to meet the diverse needs of readers. It should also be noted that although this embodiment uses sine and cosine functions as examples of embedding operations, in actual applications the system can select other types of periodic functions or more complex embedding strategies according to specific needs to achieve temporal feature embedding.
[0202] As an embodiment, the dynamic feature processing layer in the target recommendation information determination network includes A cross-weighted focusing units and A internal weighted focusing units, and the A cross-weighted focusing units and the A internal weighted focusing units are alternately arranged, and A ≥ 1. Based on this, step S330 adjusts and optimizes the preset dynamic feature vector based on the dynamic feature processing layer and the content representation information to obtain the content data dynamic feature vector corresponding to the reader's book borrowing content data, which may specifically include:
[0203] Step S331: Obtain the execution feature of the Yth cross-weighted focusing unit in the dynamic feature processing layer;
[0204] Step S332: If Y=1, the execution features of the Yth cross-weighted focusing unit include content representation information and a preset dynamic feature vector;
[0205] Step S333: If Y≠1, the execution characteristics of the Yth cross-weight focusing unit include the content representation information and the output of the Y-1th internal weight focusing unit, and Y≤A;
[0206] Step S334: Obtain the first weighted array, the second weighted array, and the third weighted array corresponding to the Yth cross-weight focusing unit, and perform a scalar product calculation on the first weighted array and the output of the Y-1th internal weighted focusing unit to obtain a second search array;
[0207] Step S335: performing a scalar product calculation on the second weighted array and the content representation information to obtain a second anchor array, and performing a scalar product calculation on the third weighted array and the content representation information to obtain a second result array;
[0208] Step S336: Determine the output of the Yth cross-weight focusing unit based on the second search array, the second anchor array, and the second result array;
[0209] Step S337: Loading the output of the Yth cross-weight focusing unit to the Yth internal weight focusing unit in the dynamic feature processing layer, performing internal focus feature embedding on the output of the Yth cross-weight focusing unit based on the Yth internal weight focusing unit, and obtaining the output of the Yth internal weight focusing unit;
[0210] Step S338: Determine the output of the Ath internal weight focusing unit in the dynamic feature processing layer as the content data dynamic feature vector corresponding to the reader's book borrowing content data.
[0211] In step S331, the computer system first locates the Yth cross-weight focusing unit in the dynamic feature processing layer and prepares to obtain the feature input required for its execution. The cross-weight focusing unit is one of the core components in the dynamic feature processing layer. It is responsible for calculating the attention weight based on the input features and weighting and focusing the features accordingly. For example, assuming that the dynamic feature processing layer contains 3 cross-weight focusing units (A=3) and 3 internal weight focusing units, focus on the second cross-weight focusing unit (Y=2). According to step S331, the system needs to obtain the execution characteristics of the unit.
[0212] If Y=1, the execution feature will include content representation information (denoted as r) and the preset dynamic feature vector (denoted as d init ). However, in this example, Y = 2, so this condition does not apply.
[0213] If Y≠1, the execution feature includes the content representation information r and the output of the Y-1th internal weight focusing unit (in this case, the output of the 1st internal weight focusing unit, denoted as o1).
[0214] Steps S332 to S333: Determine the execution characteristics according to the value of Y.
[0215] Since Y = 2, according to step S333, the execution features of the second cross-weighted focusing unit include the content representation information r and the output o1 of the first internal weighted focusing unit. These features will be passed as input to the second cross-weighted focusing unit for subsequent calculation and weight allocation.
[0216] After obtaining the execution features, the second cross-weight focusing unit will use the first weight array defined within it (denoted as ) is quantified with the output o1 of the first internal weight focusing unit to generate the second search array (denoted as Q Y ). This step simulates the “query” process in the self-attention mechanism, preparing for subsequent attention weight calculations through weighted sum transformations.
[0217] The calculation process is, for example:
[0218] in, is the query weight matrix specific to the Yth cross-weight focusing unit.
[0219] Next, the second cross-weight focusing unit uses its internal second weight array (denoted as ) and the third weighted array (denoted as ) and the content representation information r to perform a quantitative product calculation to generate the second anchor array (denoted as K Y ) and the second result array (denoted as V Y ). This process simulates the key-value pair generation in the self-attention mechanism, where the anchor array is used to calculate the attention weights and the result array is weighted summed according to these weights.
[0220] Calculation process example:
[0221] With the second search array, the second anchor array, and the second result array, the second cross-weighted focusing unit can calculate the attention weights and perform weighted summation of the features in the second result array according to these weights to generate its output (denoted as o' Y ). This process usually involves the application of a softmax function to ensure that the sum of the attention weights is 1.
[0222] The output o' of the second cross-weight focusing unit Y It is then loaded into the second internal weight focusing unit for further processing. The internal weight focusing unit is responsible for performing internal focusing feature embedding on the output of the cross weight focusing unit to enhance its representation ability and prepare for the next round of cross weight focusing calculation (if any).
[0223] Internal weight focused feature embedding usually involves the calculation of a series of neural network layers, including fully connected layers, activation functions (such as ReLU, Tanh, etc.), and possible normalization layers (such as Batch Normalization). The role of these layers is to perform nonlinear transformation and feature extraction on the input features to generate more representative outputs.
[0224] Finally, when all cross-weight focusing units and internal weight focusing units in the dynamic feature processing layer have been executed in sequence, the system determines the output of the last internal weight focusing unit as the content data dynamic feature vector corresponding to the reader's book borrowing content data (denoted as d final In this example, since the dynamic feature processing layer contains 3 units (A=3), d final will be the output of the 3rd inner weight focusing unit.
[0225] Through the above steps, the computer system uses the dynamic feature processing layer to adjust and optimize the preset dynamic feature vectors, generating more representative dynamic feature vectors for the content data. This process involves complex attention mechanisms, neural network calculations, and multi-level feature embedding and transformation. The cross-weighted focusing units and internal weighted focusing units in the dynamic feature processing layer, through alternating arrangement and collaborative operation, achieve in-depth analysis and understanding of the borrowed content data.
[0226] The dynamic feature vector of content data not only reflects the static characteristics of readers' borrowed content (such as book type and author preferences), but also captures the dynamic patterns of these characteristics over time. By combining these dynamic features with the behavioral feature vector, the system can more accurately predict readers' potential borrowing needs and generate personalized book recommendation lists based on them. This helps improve the accuracy of recommendations and user satisfaction, thereby promoting the effective utilization of library resources and enhancing readers' reading experience.
[0227] As an implementation method, step S400, performing feature embedding on multi-source feature vectors to obtain a multi-source integrated embedding vector, performing borrowing recommendation reduction mapping on the multi-source integrated embedding vector, and obtaining borrowing recommendation information that matches the reader's book borrowing content data, may include:
[0228] Step S410: Loading the multi-source feature vectors into the multi-source embedding layer in the target recommendation information determination network, performing forward and backward feature embedding on the multi-source feature vectors based on the multi-source embedding layer to obtain a multi-source integrated embedding vector;
[0229] Step S420: Loading the multi-source integrated embedding vector into the recommendation mapping restoration layer in the target recommendation information determination network, performing weighted information fusion on the multi-source integrated embedding vector based on the recommendation mapping restoration layer, and obtaining a focused weighted fusion vector;
[0230] Step S430: incrementally generate the focused weighted fusion vector to obtain a recommendation confidence array, and determine borrowing recommendation information that matches the reader's book borrowing content data based on the recommendation confidence array.
[0231] In step S410, the computer system loads the multi-source feature vectors into the multi-source embedding layer of the target recommendation information determination network. The multi-source embedding layer is responsible for performing forward and backward feature embedding (also known as bidirectional encoding) on these feature vectors to capture the contextual relationships and long-term dependencies between features. Bidirectional encoding ensures that the model considers both forward and backward information when processing sequential data, thereby improving the accuracy and richness of feature representation.
[0232] In computer systems, bidirectional feature embedding is typically implemented using models such as bidirectional recurrent neural networks (BiRNNs) or bidirectional long short-term memory networks (BiLSTMs). These models consist of two independent RNN or LSTM layers, one processing the forward portion of the input sequence and the other processing the reverse portion. Ultimately, the hidden states from both directions are merged to generate a bidirectionally encoded output.
[0233] For example, suppose a multi-source feature vector is concatenated from a content feature vector c and a behavior feature vector b, i.e., f = [c; b]. The computer system loads this multi-source feature vector into a multi-source embedding layer, which is composed of a BiLSTM network.
[0234] The forward LSTM processes the forward portion of the input sequence (i.e., from left to right) to generate a series of forward hidden states. The backward LSTM processes the reverse portion of the input sequence (i.e., from right to left) to generate a series of backward hidden states. For each time step t, the forward hidden state and the backward hidden state are merged in some form (such as concatenation, summation, or weighted averaging) to obtain a bidirectional hidden state. The bidirectional hidden states of all time steps are further processed (such as through a pooling layer, an attention mechanism, or simple averaging / max pooling) to generate the final multi-source integrated embedding vector e. In this process, the BiLSTM network is able to capture the dependencies between the previous and next contexts in the multi-source feature vectors and encode this information into the multi-source integrated embedding vector.
[0235] After obtaining the multi-source integrated embedding vector, the computer system loads it into the recommendation mapping reduction layer for weighted information fusion. The recommendation mapping reduction layer is responsible for combining and optimizing the different features in the multi-source integrated embedding vector according to a specific fusion strategy and weight distribution mechanism to generate a focused weighted fusion vector. This vector will serve as input for subsequent recommendation generation.
[0236] Weighted information fusion can be implemented using a variety of methods, including simple weighted averaging, attention mechanisms, factorization machines, and more. In computer systems, the choice of method often depends on the characteristics of the data, the requirements of the recommendation task, and the complexity of the model. For example, suppose the recommendation mapping reduction layer uses an attention mechanism to implement weighted information fusion. The attention mechanism allows the model to dynamically adjust the weights of different features during the fusion process to highlight important features and suppress unimportant ones.
[0237] First, the recommended mapping reduction layer may generate a query vector q, which serves as a reference point for the attention mechanism to calculate the weights of each component in the multi-source integrated embedding vector. For each component in the multi-source integrated embedding vector e (such as the bidirectional hidden state at each time step), the similarity between it and the query vector q is calculated (such as dot product, cosine similarity, etc.), and then normalized using the softmax function to obtain the attention weight. The attention weight is used to perform a weighted summation of each component in the multi-source integrated embedding vector to obtain a focused weighted fusion vector.
[0238] After generating the focused weighted fusion vector, the computer system uses an incremental generation strategy (also known as autoregressive generation) to predict borrowing recommendations. Incremental generation allows the model to gradually build a list of recommendations, predicting one item at a time and adjusting subsequent predictions based on previous predictions. This approach captures dependencies between recommended items and produces a more coherent and organized list of recommendations.
[0239] Incremental generation is typically implemented using a sequence-to-sequence (Seq2Seq) model, a Transformer model, or an RNN-based decoder. These models accept a focused weighted fusion vector as input and incrementally generate representations of the recommended items (such as book IDs, titles, or feature vectors). For example, suppose a recommendation system uses an RNN-based decoder to implement incremental generation. The decoder receives the focused weighted fusion vector as the initial hidden state and begins incrementally generating representations of the recommended items.
[0240] At each step, the decoder predicts the representation of the next recommendation item based on the current hidden state and the previous output (if any). This representation may be a distribution vector that represents the recommendation probability of different books. Sample a recommendation item from the predicted distribution (such as selecting the book with the highest probability through the argmax operation), or use a more complex search strategy (such as beam search) to find the optimal recommendation sequence. For each recommendation item representation generated by the decoder, its corresponding recommendation confidence (such as predicted probability) can be calculated, and these confidences can be combined into a recommendation confidence array. Based on the recommendation confidence array, several recommendations with the highest confidence are selected as the final borrowing recommendation information. This information may include the book's ID, title, author, abstract, etc. for display to readers.
[0241] Through this process, the computer system generates personalized borrowing recommendations based on readers' borrowing behavior and content preferences. These recommendations not only take into account readers' historical borrowing records but also optimize and improve the recommendation process through various technical means such as feature embedding, bidirectional encoding, weighted information fusion, and incremental generation. The resulting recommendation list will better align with readers' interests and needs, thereby improving recommendation accuracy and user satisfaction.
[0242] The present application also provides a training process for the target recommendation information determination network, which may specifically include the following steps:
[0243] Step S10: Obtaining reader book borrowing content training data and borrowing behavior training data corresponding to the reader book borrowing content training data and training borrowing recommendation information;
[0244] Step S20: Based on the initial recommendation information, the content embedding layer in the network is determined to output a sample content feature vector corresponding to the reader's book borrowing content training data. Based on the initial recommendation information, the behavior embedding layer in the network is determined to output a sample behavior feature vector corresponding to the borrowing behavior training data. The content embedding layer and the behavior embedding layer are trained based on multiple content-behavior data tuples, where each content-behavior data tuple includes a sub-book borrowing content training data and a borrowing behavior data.
[0245] Step S30: Obtaining the focus shielding matrix in the initial dynamic feature processing layer included in the initial recommendation information determination network, performing dynamic feature extraction on the sample content feature vector based on the focus shielding matrix and the cross-weight focusing unit and internal weight focusing unit in the initial dynamic feature processing layer to obtain a sample dynamic feature vector, and fusing the sample dynamic feature vector with the sample behavior feature vector into a sample multi-source feature vector;
[0246] Step S40: Based on the initial recommendation information, the initial multi-source embedding layer in the network determines the features of the sample multi-source feature vector to obtain a sample integrated embedding vector. Based on the initial recommendation information, the initial recommendation mapping-reduction layer in the network determines the features of the sample integrated embedding vector to output a borrowing recommendation information prediction confidence array corresponding to the sample integrated embedding vector; the borrowing recommendation information prediction confidence array is used to represent the prediction confidence corresponding to each component data item in the training borrowing recommendation information;
[0247] Step S50: Based on the focus masking matrix, the borrowing recommendation information prediction confidence array, and the training borrowing recommendation information, the parameters of the initial dynamic feature processing layer, the initial multi-source embedding layer, and the initial recommendation mapping restoration layer are adjusted, and the initial recommendation information determination network containing the adjusted parameters is determined as the target recommendation information determination network.
[0248] In the development of personalized book recommendation systems, training an efficient and accurate target recommendation information determination network is crucial. This application embodiment provides a detailed training process, which aims to enable the network to accurately capture the dynamic changes in readers' borrowing behavior and content preferences through continuous iteration and optimization, thereby generating high-quality borrowing recommendations.
[0249] In step S10, the computer system first collects and prepares the data sets required for training. These data sets include reader book borrowing content training data, corresponding borrowing behavior training data, and training borrowing recommendation information. These data are the basis for subsequent training processes, and they will be used to construct and verify the performance of the recommendation information determination network. For example, reader book borrowing content training data: suppose there is a database containing a large number of reader borrowing records. These records cover the information of books borrowed by different readers in different time periods. In order to train the network, a part of these records needs to be extracted as training data. For example, the borrowing records of all readers in the past year can be selected as the training set.
[0250] Corresponding to borrowed content data, borrowing behavior data records readers' borrowing frequency, borrowing duration, return status, and other specific behavioral information. This data is crucial for understanding readers' borrowing habits and preferences.
[0251] Training recommendation information is manually annotated based on borrowing content and borrowing behavior data or mined from historical data. It represents the list of books the system should recommend given borrowing records and behavior characteristics. In practice, this recommendation information may come from librarians' expert knowledge, reader feedback, or statistical analysis of historical borrowing data.
[0252] In step S20, the computer system uses the initial recommendation information to determine the content embedding layer and behavior embedding layer in the network. The system then converts the borrowing content training data and borrowing behavior training data into sample content feature vectors and sample behavior feature vectors, respectively. These two embedding layers are pre-trained to capture the intrinsic characteristics of the data and map them into a low-dimensional vector space.
[0253] Before training the initial recommendation information determination network, the content embedding layer and behavior embedding layer are typically pre-trained through unsupervised or supervised learning on a large number of content-behavior data pairs. Each pair consists of a sub-book borrowing content training data and a borrowing behavior data pair. By continuously optimizing the weights of the embedding layer, the system learns how to convert raw data into meaningful feature vectors.
[0254] For example, the content embedding layer generates corresponding vector representations for information such as the book title and author in each borrowing record by looking up pre-trained word embedding matrices or using deep learning models (such as convolutional neural networks (CNNs) and recurrent neural networks (RNNs). These vectors capture key features of the book content, such as its theme and style.
[0255] For borrowing behavior data, the behavior embedding layer converts raw values such as borrowing frequency and borrowing duration into feature vectors through a series of transformations (such as fully connected layers and activation functions). These vectors reflect readers' borrowing habits and preferences.
[0256] In step S30, the computer system uses the initial recommendation information to determine the dynamic feature processing layer in the network to extract dynamic features from the sample content feature vector. The dynamic feature processing layer includes a cross-weighted focusing unit and an internal weighted focusing unit. These units weight and transform the feature vectors using an attention mechanism and a multi-layer neural network to capture the dynamic relationships and temporal changes between features. The extracted sample dynamic feature vector is then fused with the sample behavior feature vector to form a sample multi-source feature vector.
[0257] The focusing masking matrix is a sparse matrix used to guide the allocation of attention weights during the dynamic feature extraction process. It is often used to handle invalid positions in sequence data (such as padding positions) or information that needs to be ignored (such as information at future time points). In the book recommendation scenario, the focusing masking matrix may be used to ensure that the model does not "see" future borrowing records when predicting. For example, the cross-weight focusing unit in the dynamic feature processing layer first calculates the attention weights based on the content feature vector and the focusing masking matrix. These weights reflect the importance of different time steps or feature dimensions. The internal weight focusing unit then performs weighted summation and transformation on the feature vector according to these weights to generate a sample dynamic feature vector.
[0258] The extracted sample dynamic feature vectors and sample behavioral feature vectors are fused through concatenation, weighted sum, or attention mechanism. The fused sample multi-source feature vectors contain both dynamic content change information and static behavior feature information.
[0259] In step S40, the computer system uses the initial recommendation information to determine the multi-source embedding layer in the network to embed the sample multi-source feature vectors, generating a sample integrated embedding vector. The recommendation mapping reduction layer then outputs an array of predicted confidence scores for borrowing recommendation information based on the sample integrated embedding vector. This array reflects the system's predicted confidence score for each book in the recommendation list.
[0260] For example, a multi-source embedding layer may contain multiple neural network layers (such as fully connected layers and convolutional layers), which further process and transform the sample multi-source feature vectors to enhance their feature expression capabilities. By applying multiple layers of nonlinear transformations and activation functions, the multi-source embedding layer can generate a more representative sample integrated embedding vector.
[0261] The recommendation mapping reduction layer receives the sample integrated embedding vector as input and gradually generates an array of prediction confidences for borrowing recommendation information through a series of transformations (such as decoders and autoregressive models). During this process, the system may use strategies such as greedy search and beam search to optimize the order and quality of the recommendation list.
[0262] In step S50, the computer system adjusts and optimizes the parameters of the dynamic feature processing layer, multi-source embedding layer, and recommendation mapping reduction layer in the initial recommendation information determination network based on the focus masking matrix, the borrowing recommendation information prediction confidence array, and the training borrowing recommendation information. The network weights and bias terms are updated by minimizing a loss function (such as cross-entropy loss, mean squared error loss, etc.) to make the prediction results output by the network closer to the actual training borrowing recommendation information. After multiple iterative training, the initial recommendation information determination network containing the adjusted parameters is determined as the target recommendation information determination network.
[0263] During training, the computer system calculates the gradient of the loss function with respect to the network parameters using a backpropagation algorithm and uses optimization algorithms (such as gradient descent and Adam) to update these parameters to minimize the loss function. For example, in each iteration, the computer system first calculates the loss between the predicted confidence array of the borrowing recommendation information output by the current network and the training borrowing recommendation information. Then, based on the loss value, the gradient of the network parameters is calculated and the optimization algorithm is used to update these parameters. This process is repeated multiple times until a stopping condition is met (such as reaching a preset number of iterations or the loss value falling below a certain threshold).
[0264] After sufficient training, the initial recommendation information determination network, including the adjusted parameters, becomes the target recommendation information determination network. This network accurately captures the dynamic changes in readers' borrowing behavior and content preferences, and generates high-quality borrowing recommendations to meet readers' personalized needs. In actual applications, the target network will be deployed in a production environment for real-time recommendation services.
[0265] In one embodiment, step S30, performing dynamic feature extraction on the sample content feature vector based on the focus shielding matrix and the cross-weight focusing unit and the internal weight focusing unit in the initial dynamic feature processing layer to obtain the sample dynamic feature vector, includes:
[0266] Step S31: obtaining a sample preset dynamic feature vector having the same dimension as the sample behavior feature vector, performing a scalar product calculation on the sample preset dynamic feature vector and the first mapping array corresponding to the cross-weighted focusing unit in the initial dynamic feature processing layer to obtain a third search array;
[0267] Step S32: performing a scalar product calculation on the sample content feature vector and the second mapping array corresponding to the cross-weighted focusing unit in the initial dynamic feature processing layer to obtain a third anchor array, and performing a scalar product calculation on the sample content feature vector and the third mapping array corresponding to the cross-weighted focusing unit in the initial dynamic feature processing layer to obtain a third result array;
[0268] Step S33: determining a cross-focus weight vector associated with the sample content feature vector based on the third search array, the third anchor array, and the third result array;
[0269] Step S34: performing a nonlinear transformation on the focus shielding matrix to obtain a focus activation vector, and multiplying the focus activation vector by the cross-focus weight vector to determine the output of the cross-weight focusing unit in the initial dynamic feature processing layer;
[0270] Step S35: Load the output of the cross-weight focusing unit in the initial dynamic feature processing layer into the internal weight focusing unit in the initial dynamic feature processing layer, and perform internal focusing feature embedding on the output of the cross-weight focusing unit in the initial dynamic feature processing layer based on the internal weight focusing unit in the initial dynamic feature processing layer to obtain a sample dynamic feature vector corresponding to the sample content feature vector.
[0271] In step S31, the computer system first generates a sample preset dynamic feature vector that is consistent with the dimension of the sample behavior feature vector. This vector serves as the starting point for dynamic feature extraction, and its initial value can be random, generated based on some heuristic rules, or pre-learned from training data. Subsequently, the system performs a scalar product calculation on this preset dynamic feature vector and the first mapping array corresponding to the cross-weighted focusing unit in the initial dynamic feature processing layer to generate a third search array. For example, assuming that the dimension of the sample behavior feature vector is D, the sample preset dynamic feature vector d preset ∈R D is initialized to a vector of all zeros (or a vector generated according to some strategy). At the same time, the cross-weight focusing unit has a first mapping array W q ∈R D×M , where M is the dimension of the third search array (which may be different from D). The calculation process is as follows: Q =W q d preset .
[0272] Here, Q∈RM This is the third search array, which contains the query information used for subsequent attention weight calculation.
[0273] After obtaining the third search array, the computer system then performs a scalar product calculation on the sample content feature vector with the second and third mapping arrays corresponding to the cross-weighted focusing unit to generate a third anchor array and a third result array. These two arrays serve as the "key" and "value," respectively, in the subsequent attention weight calculation.
[0274] For example, suppose the sample content feature vector is c∈R N , where N is the dimension of the sample content feature vector. The cross-weight focusing unit has two mapping arrays: the second mapping array W k ∈R N×K Used to generate the third anchor array and the third mapping array W v ∈R N×V Used to generate the third result array. The calculation process is as follows: f K =W k c,V=W v c;
[0275] Here, K∈R K is the third anchor array, V∈R V is the third result array. In actual applications, K and V may be equal to M or may not be equal, depending on the specific design and implementation.
[0276] After obtaining the third search array, the third anchor array, and the third result array, the computer system uses these arrays to calculate a cross-focus weight vector associated with the sample content feature vector. This weight vector reflects the importance of different positions (or feature dimensions) in the dynamic feature extraction process.
[0277] For example, the calculation of the cross-focus weight vector usually involves the core steps of the attention mechanism: calculating the similarity (or "score") between the search array and the anchor array and normalizing it through the softmax function. The specific calculation process is as follows:
[0278] First, we compute the score array (also called “raw attention scores”):
[0279]
[0280] Among them, d k Is the dimension of the anchor array (key vector), which is used to scale the dot product result to prevent the gradient from disappearing or exploding. Then, the softmax function is applied for normalization:
[0281] α=softmax(scores)
[0282] Here, α∈R K This is the cross-focus weight vector. Each element α i Indicates the importance of the i-th anchor position (or feature dimension) in the dynamic feature extraction process.
[0283] In step S34, the computer system performs a nonlinear transformation on the focus shielding matrix (such as activation by a sigmoid function or a ReLU function) to obtain a focus activation vector. This focus activation vector is then multiplied by the cross-focus weight vector to determine the output of the cross-weight focus unit. The focus shielding matrix is used to introduce additional constraints or preferences in the attention weight calculation process.
[0284] For example, suppose the focus masking matrix is M∈R M×K , which may be a sparse matrix composed of 0s and 1s, used to mask out certain anchor positions that do not need to be paid attention to. In practical applications, M may not be directly used as input for calculation, but may affect the distribution of attention weights in some way (such as element-by-element multiplication with the cross-focus weight vector). To simplify the explanation, assume that M is nonlinearly transformed here (although this may not be common in practice):
[0285] f A =σ(M);
[0286] Where σ is a nonlinear transformation function (e.g., a sigmoid function, or other functions). However, it is more common to use M directly as a masking matrix without performing a nonlinear transformation. To conform to the description of the original step, we will temporarily ignore this and assume that there is a virtual focused activation vector (if M is used directly as a mask, this step can be regarded as A = M).
[0287] The cross-focus weight vector is then multiplied with the focus activation vector (or a masking matrix is applied) and weighted summed with the third result array to obtain the output of the cross-weight focusing unit:
[0288] fo cross =A⊙αV;
[0289] Here, ⊙ represents element-wise multiplication (if A is the focused activation vector after sigmoid transformation, this step is actually weighting; if A is a masking matrix, this step is applying masking). cross ∈R V This is the output of the cross-weighted focusing unit.
[0290] Finally, the computer system loads the output of the cross-weight focusing unit into the internal weight focusing unit in the initial dynamic feature processing layer. The internal weight focusing unit is responsible for further transforming and embedding the output of the cross-weight focusing unit to enhance its characterization capability and generate a sample dynamic feature vector. For example, the internal weight focusing unit may include multiple neural network layers (such as fully connected layers, convolutional layers, recurrent neural network layers, etc.), which perform in-depth processing of input features through a series of nonlinear transformations and activation functions. However, in the context of this embodiment, more attention is paid to how to achieve feature embedding through internal focusing. It is assumed that the internal weight focusing unit includes one or more fully connected layers and corresponding activation functions (such as ReLU).
[0291] Through the implementation of step S30 above, the computer system successfully extracts dynamic features from the sample content feature vector using the focused masking matrix, cross-weighted focusing unit, and internal weighted focusing unit. This process not only captures the temporal variations and inherent patterns in the sample content feature vector, but also enhances the feature representation capabilities through the attention mechanism and internally focused feature embedding. The resulting sample dynamic feature vector will serve as one of the inputs for subsequent steps, further fusion of features, and generation of borrowing recommendation information. Throughout the training process, these steps will be continuously iterated and optimized to ensure the accuracy and effectiveness of the recommendation model.
[0292] In one embodiment, step S50 adjusts parameters of the initial dynamic feature processing layer, the initial multi-source embedding layer, and the initial recommendation mapping and restoration layer based on the focus masking matrix, the borrowing recommendation information prediction confidence array, and the training borrowing recommendation information, and determines the initial recommendation information determination network including the adjusted parameters as the target recommendation information determination network, including:
[0293] Step S51: taking the absolute sum of each matrix unit in the focus shielding matrix as the focus shielding activation value, and determining the multiplication result between the focus shielding activation value and the supervision parameter as the focus supervision value corresponding to the initial dynamic feature processing layer;
[0294] Step S52: determining the incremental error associated with the initial recommendation mapping restoration layer based on the amount of training data on the reader's book borrowing content and the prediction confidence of each component data item in the training borrowing recommendation information in the borrowing recommendation information prediction confidence array;
[0295] Step S53: Add the focused supervision value and the incremental error to obtain the initial recommendation information to determine the combined error corresponding to the network;
[0296] Step S54: Based on the merging error, the parameters of the initial dynamic feature processing layer, the initial multi-source embedding layer, and the initial recommendation mapping restoration layer are cyclically debugged, and the debugging is ended when the merging error reaches the set debugging cutoff requirement, and the content embedding layer, the behavior embedding layer, and the initial dynamic feature processing layer, the initial multi-source embedding layer, and the initial recommendation mapping restoration layer at the end are determined as the target recommendation information determination network.
[0297] In step S51, the computer system first calculates the absolute sum (i.e., the sum of the absolute values) of each matrix cell in the focus mask matrix and uses this value as the focus mask activation value. The focus mask activation value is then multiplied by a supervision parameter (usually a sparsity constraint parameter) to obtain the focus supervision value corresponding to the initial dynamic feature processing layer. The focus supervision value is used to guide the model to focus on important feature dimensions during training, while ignoring or suppressing unimportant feature dimensions.
[0298] For example, assume that the focus masking matrix M∈R m×n It is a sparse matrix used to mask out unnecessary locations during dynamic feature extraction. Each element m in the matrix ij Represents the shielding relationship between the i-th time step or feature dimension and the j-th position. If m ij = 0, it means that the jth position is masked at the i-th time step or feature dimension; if m ij =0, it means that the position is retained. The process of calculating the focus mask activation value can be expressed as:
[0299] Among them, |m ij ∣ represents the matrix element m ij The absolute value of .
[0300] Next, the focused mask activation value is multiplied by the supervision parameter λ (a positive scalar) to obtain the focused supervision value: s =λ×f a ;
[0301] In practical applications, the choice of the supervisory parameter λ depends on the requirements of the specific task and the complexity of the model. A larger value of λ will strengthen the constraint on the focus masking matrix, making the model pay more attention to the retained positions; while a smaller value of λ will weaken this constraint and give the model more degrees of freedom.
[0302] In step S52, the computer system calculates the incremental error (i.e., autoregressive error) associated with the initial recommendation mapping reduction layer based on the amount of training data on the reader's book borrowing content and the prediction confidence of each component data item in the training borrowing recommendation information in the borrowing recommendation information prediction confidence array. The incremental error reflects the degree of difference between the model's prediction results and the actual training data and is one of the objectives to be minimized during the model optimization process.
[0303] For example, suppose the training borrowing recommendation information contains T samples, each sample corresponds to a recommendation list, and the list contains L possible recommended items. For each sample, the model outputs a prediction confidence array p of length L. t =[p t1 ,p t2 ,…,p tL ], where p ti Indicates the prediction confidence of the i-th recommendation item in the t-th sample. At the same time, the training borrowing recommendation information also provides a true label array y of length L t =[y t1 ,y t2 ,…,y tL ], where y ti ∈{0,1} indicates whether the i-th recommendation in the t-th sample is a true recommendation (1 for yes, 0 for no). The loss values of all samples are then averaged or summed to obtain the incremental error for the entire training set. In practice, the calculation method of incremental error may vary depending on the specific task and dataset. In addition to cross-entropy loss, other types of loss functions such as mean squared error and hinge loss can also be used.
[0304] In step S53, the computer system adds the focused supervision value calculated in step S51 to the incremental error calculated in step S52 to obtain the combined error corresponding to the initial recommendation information determination network. The combined error is the total loss function in the model optimization process and is used to guide the adjustment and optimization of parameters.
[0305] In practical applications, the specific form of the merged error may vary depending on the model structure and optimization objectives. However, in any case, the merged error should be able to fully reflect the performance of the model during training and guide the model optimization in the desired direction.
[0306] In step S54, the computer system performs cyclic debugging on the parameters of the initial dynamic feature processing layer, the initial multi-source embedding layer, and the initial recommendation mapping restoration layer based on the merging error. The debugging process usually involves the application of optimization algorithms such as gradient descent, stochastic gradient descent, and Adam. In each iteration, the system updates the value of the parameter according to the gradient information of the merging error to reduce the merging error and improve the prediction performance of the model. When the merging error reaches the set debugging cutoff requirement (such as reaching a preset number of iterations, the merging error is less than a certain threshold, etc.), the debugging process ends. At this point, the content embedding layer, behavior embedding layer, initial dynamic feature processing layer, initial multi-source embedding layer, and initial recommendation mapping restoration layer containing the adjusted parameters will be determined as the target recommendation information determination network.
[0307] Upon completion of the debugging process, the resulting target recommendation information determination network will possess improved predictive performance and generalization capabilities. This network will accurately capture the dynamic changes in readers' borrowing behavior and content preferences, and generate borrowing recommendations that meet readers' personalized needs. In actual application, the target network will be deployed in a production environment for real-time recommendation services, providing readers with a more convenient and efficient book borrowing experience.
[0308] In one embodiment, step S52, based on the amount of training data of the reader's book borrowing content and the prediction confidence of each component data item in the training borrowing recommendation information in the borrowing recommendation information prediction confidence array, determines the incremental error associated with the initial recommendation mapping reduction layer, including:
[0309] Step S521: Obtaining the prediction confidence corresponding to each component data item in the training borrowing recommendation information from the borrowing recommendation information prediction confidence array, performing logarithmic calculation on the prediction confidence corresponding to each component data item in the training borrowing recommendation information, and obtaining the logarithmic confidence corresponding to each component data item in the training borrowing recommendation information;
[0310] Step S522: Add the logarithmic confidences corresponding to the various component data items in the training borrowing recommendation information to obtain the combined logarithmic confidences corresponding to the reader's book borrowing content training data, and determine the incremental error associated with the initial recommendation mapping restoration layer based on the ratio between the combined logarithmic confidences and the number of reader's book borrowing content training data.
[0311] In step S521, the computer system first obtains the prediction confidence corresponding to each component data item in the training borrowing recommendation information from the borrowing recommendation information prediction confidence array. The prediction confidence array is generated by the initial recommendation mapping reduction layer based on the reader's book borrowing content training data. It reflects the model's prediction confidence level for each recommendation item. The system then performs a logarithmic calculation on these prediction confidences to obtain the corresponding logarithmic confidence. Logarithmic transformation is a commonly used mathematical transformation method that can compress or expand the scale of the original data, making the data distribution more uniform, which is beneficial for subsequent calculations and processing.
[0312] For example, suppose the training borrowing recommendation information contains three recommended items, each corresponding to a different book. The initial recommendation mapping reduction layer generates a prediction confidence array of length 3 for each training sample. For example, for a training sample, its prediction confidence array is [p1, p2, p3] = [0.7, 0.2, 0.1], where p1, p2, and p3 represent the confidence of the model's prediction of the three recommended items for that sample.
[0313] Next, the computer system performs a logarithmic calculation on each prediction confidence. The logarithmic calculation can be done using either the natural logarithm (base e) or the common logarithm (base 10). Here, we use the natural logarithm as an example: ln(p1) = ln(0.7), ln(p2) = ln(0.2), ln(p3) = ln(0.1);
[0314] The resulting logarithmic confidence array is [ln(p1),ln(p2),ln(p3)]. Note that since the domain of the logarithmic function is positive, the prediction confidence must be greater than 0. In practice, if the prediction confidence is very small (close to 0), you can avoid numerical problems in the logarithmic calculation by adding a small positive number (such as 10-9).
[0315] In step S522, the computer system first sums the logarithmic confidence scores of all training samples calculated in step S521 to obtain a combined logarithmic confidence score corresponding to the reader's book borrowing content training data. This combined logarithmic confidence score is then proportional to the number of reader book borrowing content training data (i.e., the number of training samples) to determine the incremental error associated with the initial recommendation mapping reduction layer. The incremental error reflects the average prediction performance of the model across the entire training set and is an important metric in the model optimization process.
[0316] However, it should be noted that directly summing the log confidence and calculating the ratio does not directly correspond to the traditional loss function (such as cross entropy loss, mean squared error loss, etc.). In practical applications, the calculation of incremental error may be more complicated and closely related to the specific task requirements and model structure. Therefore, in the following explanation, I will provide a more practical incremental error calculation method that combines the concepts of log likelihood function and average loss.
[0317] For example, in order to more accurately reflect the model's prediction performance, a calculation method similar to the log-likelihood function can be used to evaluate the degree of fit of the model to the training data. Assume that each component data item in the training borrowing recommendation information is a binary label (0 or 1), indicating whether the corresponding recommendation item is a true recommendation item. At the same time, assume that the prediction confidence output by the model can be interpreted as the probability that the recommendation item is true. For each training sample, its log-likelihood value can be calculated. Then, the sum of the log-likelihood values of all training samples is calculated, and the negative value is taken (because maximizing the log-likelihood is equivalent to minimizing the negative log-likelihood) to obtain the negative log-likelihood loss.
[0318] In summary, the incremental error calculation in step S52 is a complex and critical process, involving multiple mathematical concepts and technical means, such as logarithmic transformation, likelihood function, and loss function. In practical applications, an appropriate loss function and optimization algorithm can be selected based on the specific task requirements and model structure, and a high-performance recommendation model can be obtained through repeated iterative training.
[0319] The embodiment of the present application provides a computer system, such as Figure 2 As shown, computer system 100 includes: a processor 101 and a memory 103. Processor 101 and memory 103 are connected, for example, via bus 102. Optionally, computer system 100 may further include a transceiver 104. It should be noted that in actual applications, the number of transceivers 104 is not limited to one, and the structure of computer system 100 does not constitute a limitation on the embodiments of this application.
[0320] An embodiment of the present application provides a computer system. The computer system in the embodiment of the present application includes: one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory and configured to be executed by the one or more processors. When the one or more programs are executed by the processor, the method provided in the embodiment of the present application is implemented.
Claims
1. A personalized book recommendation method based on reader behavior data analysis, characterized in that: include: Obtaining reader book borrowing content data and borrowing behavior data corresponding to the reader book borrowing content data, wherein the reader book borrowing content data includes book borrowing content data collected at multiple time points; wherein the reader book borrowing content data includes reader borrowed book information and reader information, and the borrowing behavior data includes borrowing frequency, borrowing duration, borrowing time period preference, and return timeliness; Obtaining a content feature vector corresponding to the reader's book borrowing content data, and obtaining a behavior feature vector corresponding to the borrowing behavior data; Performing dynamic feature extraction on the content feature vector to obtain a content data dynamic feature vector corresponding to the reader's book borrowing content data, and fusing the content data dynamic feature vector with the behavior feature vector to obtain a multi-source feature vector; Performing feature embedding on the multi-source feature vector to obtain a multi-source integrated embedding vector, and performing borrowing recommendation restoration mapping on the multi-source integrated embedding vector to obtain borrowing recommendation information matching the reader's book borrowing content data; The step of extracting dynamic features from the content feature vector to obtain the content data dynamic feature vector corresponding to the reader's book borrowing content data includes: Performing temporal feature embedding on the content feature vector to obtain a temporal embedding feature vector corresponding to the content feature vector, and fusing the content feature vector and the temporal embedding feature vector into content representation information; Obtaining a preset dynamic feature vector having the same dimension as the behavior feature vector, and loading the preset dynamic feature vector and the content representation information into a dynamic feature processing layer in a target recommendation information determination network; Based on the dynamic feature processing layer and the content representation information, the preset dynamic feature vector is adjusted and optimized to obtain a content data dynamic feature vector corresponding to the reader's book borrowing content data; The dynamic feature processing layer in the target recommendation information determination network includes A cross-weighted focusing units and A internal weighted focusing units, and the A cross-weighted focusing units and the A internal weighted focusing units are alternately arranged, and A≥1; The step of adjusting and optimizing the preset dynamic feature vector based on the dynamic feature processing layer and the content representation information to obtain the content data dynamic feature vector corresponding to the reader's book borrowing content data includes: Obtaining the execution feature of the Yth cross-weighted focusing unit in the dynamic feature processing layer; If Y=1, the execution characteristics of the Y-th cross-weight focusing unit include the content representation information and the preset dynamic feature vector; If Y≠1, the execution characteristics of the Yth cross-weight focusing unit include the content representation information and the output of the Y-1th internal weight focusing unit, Y≤A; Obtaining a first weighted array, a second weighted array, and a third weighted array corresponding to the Yth cross-weight focusing unit, and performing a scalar product calculation on the first weighted array and the output of the Y-1th internal weighted focusing unit to obtain a second search array; Performing a scalar product calculation on the second weighted array and the content representation information to obtain a second anchor array, and performing a scalar product calculation on the third weighted array and the content representation information to obtain a second result array; Determining an output of the Yth cross-weight focusing unit based on the second search array, the second anchor array, and the second result array; Loading the output of the Yth cross-weight focusing unit to the Yth internal weight focusing unit in the dynamic feature processing layer, performing internal focus feature embedding on the output of the Yth cross-weight focusing unit based on the Yth internal weight focusing unit, and obtaining the output of the Yth internal weight focusing unit; The output of the Ath internal weight focusing unit in the dynamic feature processing layer is determined as the content data dynamic feature vector corresponding to the reader's book borrowing content data.
2. The method according to claim 1, wherein The step of obtaining the content feature vector corresponding to the reader's book borrowing content data includes: Splitting the reader's book borrowing content data into time periods to obtain a borrowing content time series set, decomposing each sub-book borrowing content data in the borrowing content time series set into a plurality of data units corresponding to a uniform time length, and obtaining a data unit set corresponding to each sub-book borrowing content data in the borrowing content time series set; Based on a data unit set corresponding to the sub-book borrowing content data X contained in the borrowing content time series set, obtaining a to-be-processed content feature vector corresponding to the sub-book borrowing content data X, and loading the to-be-processed content feature vector into a content embedding layer in a target recommendation information determination network; wherein X is not greater than the number of sub-book borrowing content data corresponding to the borrowing content time series set; Perform feature embedding on the to-be-processed content feature vector based on the content embedding layer to obtain a sub-content feature vector corresponding to the sub-book borrowing content data X; The sub-content feature vectors corresponding to the borrowing content data of each sub-book in the borrowing content time series set are fused into a content feature vector corresponding to the reader's book borrowing content data.
3. The method according to claim 2, wherein The step of performing feature embedding on the to-be-processed content feature vector based on the content embedding layer to obtain the sub-content feature vector corresponding to the sub-book borrowing content data X includes: Based on the information focusing unit in the content embedding layer outputting the information focusing feature vector corresponding to the to-be-processed content feature vector, the to-be-processed content feature vector and the information focusing feature vector are merged into a content merging feature vector; Obtain a transformation matrix and a displacement array corresponding to the feedforward neural network in the content embedding layer, determine a content transformation feature vector corresponding to the sub-book borrowing content data X based on the displacement array and the scalar product between the transformation matrix and the content merge feature vector, and fuse the content merge feature vector and the content transformation feature vector into a sub-content feature vector corresponding to the sub-book borrowing content data X.
4. The method according to claim 3, wherein The outputting of the information focusing feature vector corresponding to the to-be-processed content feature vector by the information focusing unit in the content embedding layer includes: Obtaining a mapping weight matrix corresponding to the information focusing unit in the content embedding layer, and mapping the to-be-processed content feature vector into a first search array, a first anchor array, and a first result array based on the mapping weight matrix of the information focusing unit; Performing a scalar product calculation on the flipped array of the first search array and the first anchor array to obtain an intermediate weighted matrix, and obtaining the number of array columns corresponding to the first search array; A ratio between the intermediate weighting matrix and the square root of the number of array columns is normalized to obtain a first focusing weighting matrix, and an information focusing feature vector corresponding to the feature vector of the content to be processed is determined based on a scalar product between the first focusing weighting matrix and the first result array.
5. The method according to claim 1, wherein The obtaining of the behavior feature vector corresponding to the borrowing behavior data includes: Decomposing the borrowing behavior data into T component data items, and obtaining implicit representations of data items corresponding to the T component data items; T ≥ 1; Based on the behavioral semantics of the T component data items in the borrowing behavior data, obtaining semantic implicit representations corresponding to the T component data items respectively; Based on the time series distribution of the T component data items in the borrowing behavior data, obtaining implicit representations of the time series distribution corresponding to the T component data items; fusing the data item implicit representation, the semantic implicit representation, and the temporal distribution implicit representation to obtain a to-be-processed behavior feature vector corresponding to the borrowing behavior data; The behavior feature vector to be processed is loaded into a behavior embedding layer in a target recommendation information determination network, and feature embedding is performed on the behavior feature vector to be processed based on the behavior embedding layer to obtain a behavior feature vector corresponding to the borrowing behavior data.
6. The method according to claim 1, wherein The step of performing feature embedding on the multi-source feature vector to obtain a multi-source integrated embedding vector, and performing borrowing recommendation reduction mapping on the multi-source integrated embedding vector to obtain borrowing recommendation information matching the reader's book borrowing content data, includes: Loading the multi-source feature vector into a multi-source embedding layer in a target recommendation information determination network, and performing forward and backward feature embedding on the multi-source feature vector based on the multi-source embedding layer to obtain a multi-source integrated embedding vector; Loading the multi-source integrated embedding vector into the recommendation mapping restoration layer in the target recommendation information determination network, performing weighted information fusion on the multi-source integrated embedding vector based on the recommendation mapping restoration layer to obtain a focused weighted fusion vector; The focused weighted fusion vector is incrementally generated to obtain a recommendation confidence array, and borrowing recommendation information matching the reader's book borrowing content data is determined based on the recommendation confidence array.
7. The method according to any one of claims 1 to 6, wherein: The method further comprises: Obtaining reader book borrowing content training data and borrowing behavior training data and training borrowing recommendation information corresponding to the reader book borrowing content training data; Based on the initial recommendation information, the content embedding layer in the network is determined to output a sample content feature vector corresponding to the reader's book borrowing content training data; based on the initial recommendation information, the behavior embedding layer in the network is determined to output a sample behavior feature vector corresponding to the borrowing behavior training data; The content embedding layer and the behavior embedding layer are obtained by training based on a plurality of content behavior data tuples, wherein a content behavior data tuple includes a sub-book borrowing content training data and a borrowing behavior data; Obtaining a focus shielding matrix in an initial dynamic feature processing layer included in the initial recommendation information determination network, performing dynamic feature extraction on the sample content feature vector based on the focus shielding matrix and a cross-weight focusing unit and an internal weight focusing unit in the initial dynamic feature processing layer to obtain a sample dynamic feature vector, and fusing the sample dynamic feature vector with the sample behavior feature vector into a sample multi-source feature vector; performing feature embedding on the sample multi-source feature vector by an initial multi-source embedding layer in the initial recommendation information determination network to obtain a sample integrated embedding vector, and outputting a borrowing recommendation information prediction confidence array corresponding to the sample integrated embedding vector by an initial recommendation mapping reduction layer in the initial recommendation information determination network; the borrowing recommendation information prediction confidence array is used to represent the prediction confidence corresponding to each component data item in the training borrowing recommendation information; Based on the focus masking matrix, the borrowing recommendation information prediction confidence array and the training borrowing recommendation information, the parameters of the initial dynamic feature processing layer, the initial multi-source embedding layer and the initial recommendation mapping restoration layer are adjusted, and the initial recommendation information determination network containing the adjusted parameters is determined as the target recommendation information determination network.
8. A computer system, characterized in that: include: one or more processors; Memory; one or more computer programs; The one or more computer programs are stored in the memory and configured to be executed by the one or more processors, and when the one or more computer programs are executed by the processors, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Book recommendation method and device, computer equipment and readable storage medium
CN114896500A
Book borrowing method and system based on digital human
CN117035245A