Entity recommendation method and device, storage medium, equipment and program product
Through feature encoding and fusion processing of the sequence inference model, the shortcomings of traditional algorithms in dynamic sequence feature processing are solved, model sharing and parallel tasks are realized, the accuracy and efficiency of click-through rate estimation are improved, and the effect of advertising recommendation is enhanced.
Patent Information
- Application Number
- CN202410262337.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-06
- Publication Date
- 2025-09-09
AI Technical Summary
Traditional algorithms find it difficult to effectively capture the intrinsic patterns and correlations of dynamic sequence features, resulting in large computational complexity and high model complexity in advertising recommendation systems, and the inability to share models for similar scenarios.
A sequential reasoning model is adopted, which includes multiple expert models and a shared model. Through feature encoding and fusion processing, rich feature resources are generated to achieve model sharing and parallel task processing of similar scenarios.
The accuracy of click-through rate estimation and model estimation efficiency are improved, the recommended entities are more in line with user interests and needs, and the recommendation effect is improved.
Smart Images

Figure CN120611085A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information processing technology, and in particular to an entity recommendation method, apparatus, storage medium, device, and program product. Background Art
[0002] Click-through rate prediction technology is an important part of the Internet application advertising recommendation business. The click-through rate prediction algorithm is essentially a part of the recommendation algorithm, and the primary task of advertising recommendation is to estimate the click-through rate.
[0003] In ad recommendation tasks, user behavior data is often presented in the form of sequences. These sequence features change dynamically over time and are crucial for models to capture user intent and preferences. However, these dynamic sequence features are often highly dimensional and sparse, and unstable over time, making it difficult for traditional algorithmic models to accurately capture their inherent patterns and relationships. Furthermore, ad recommendation systems typically involve the task of predicting click-through rates in multiple different scenarios, each requiring independent modeling and calculation, resulting in high computational effort and model complexity. Therefore, effectively processing dynamic sequence features, improving model estimation efficiency, and enabling model sharing for similar scenarios have become major technical challenges in ad recommendation tasks. Summary of the Invention
[0004] The embodiments of the present application provide an entity recommendation method, apparatus, storage medium, device, and program product, which can effectively extract and utilize sequence features, realize model sharing of similar scenarios, and achieve parallel estimation of click rates of multiple tasks, thereby improving model estimation efficiency and improving recommendation effects.
[0005] In one aspect, an embodiment of the present application provides an entity recommendation method, the method comprising:
[0006] Obtain data to be processed, wherein the data to be processed includes N candidate entity data to be processed corresponding to the target entity, wherein N is an integer greater than 1; encode the data to be processed to generate sequence feature encoding data and position feature encoding data corresponding to each candidate entity in the N candidate entities, wherein the sequence feature encoding data includes sequence features corresponding to each candidate entity in each time series; input the sequence feature encoding data and the position feature encoding data into a sequence reasoning model including N expert models and a shared model for feature reasoning processing to generate expert model output features and shared model output features corresponding to each task, wherein each task is a click-through rate prediction task for each candidate entity of the target entity; perform feature fusion on the expert model output features corresponding to each task and the shared model output features to obtain a target fusion feature corresponding to each task; perform click-through rate estimation based on the target fusion feature corresponding to each task to obtain a click-through rate estimation value of the target entity for each candidate entity; determine a recommended entity corresponding to the target entity from the N candidate entities based on the click-through rate estimation value, and perform entity recommendation based on the recommended entity.
[0007] On the other hand, an embodiment of the present application provides an entity recommendation device, comprising:
[0008] An acquiring unit, configured to acquire data to be processed, wherein the data to be processed includes N candidate entity data to be processed corresponding to the target entity, where N is an integer greater than 1;
[0009] A first processing unit is configured to perform encoding processing on the data to be processed to generate sequence feature encoding data and position feature encoding data corresponding to each candidate entity in the N candidate entities, wherein the sequence feature encoding data includes sequence features corresponding to each candidate entity in each time sequence;
[0010] a second processing unit, configured to input the sequence feature encoding data and the position feature encoding data into a sequence inference model comprising N expert models and one shared model for feature inference processing, and generate expert model output features and shared model output features corresponding to each task, wherein each task is a click-through rate estimation task for each candidate entity of the target entity;
[0011] A fusion unit, configured to fuse the output features of the expert model corresponding to each task with the output features of the shared model to obtain target fusion features corresponding to each task;
[0012] The recommendation unit is used to estimate the click rate based on the target fusion features corresponding to each task, obtain the click rate estimate value of the target entity for each candidate entity, and determine the recommended entity corresponding to the target entity from the N candidate entities based on the click rate estimate value, and perform entity recommendation based on the recommended entity.
[0013] On the other hand, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor to execute the entity recommendation method as described in any of the above embodiments.
[0014] On the other hand, an embodiment of the present application provides a computer device, which includes a processor and a memory, wherein a computer program is stored in the memory, and the processor is used to execute the entity recommendation method described in any of the above embodiments by calling the computer program stored in the memory.
[0015] On the other hand, an embodiment of the present application provides a computer program product, comprising computer instructions, which, when executed by a processor, implement the entity recommendation method as described in any of the above embodiments.
[0016] The embodiment of the present application obtains data to be processed, which includes N candidate entity data to be processed corresponding to the target entity, wherein N is an integer greater than 1; encodes the data to be processed to generate sequence feature encoding data and position feature encoding data corresponding to each candidate entity in the N candidate entities, wherein the sequence feature encoding data includes sequence features corresponding to each candidate entity in each time series; inputs the sequence feature encoding data and the position feature encoding data into a sequence reasoning model including N expert models and a shared model for feature reasoning processing to generate expert model output features and shared model output features corresponding to each task, wherein each task is a click-through rate prediction task for each candidate entity of the target entity; performs feature fusion on the expert model output features and the shared model output features corresponding to each task to obtain the target fusion features corresponding to each task; performs click-through rate estimation based on the target fusion features corresponding to each task to obtain the target entity click-through rate estimation value for each candidate entity, and determines the recommended entity corresponding to the target entity from the N candidate entities according to the click-through rate estimation value, and performs entity recommendation based on the recommended entity. The embodiment of the present application encodes the data to be processed to generate sequence feature encoding data and position feature encoding data corresponding to each candidate entity, which can effectively extract and utilize sequence features, capture the time series information and position information in the data, and provide rich feature resources for subsequent click-through rate estimation. The sequence reasoning model includes multiple expert models and a shared model. This structure can share models for similar scenarios, thereby reducing the number of models and computational complexity. At the same time, multiple expert models can process different tasks in parallel, improving the model's estimation efficiency. The output features of the expert model corresponding to each task are fused with the output features of the shared model to obtain the target fusion features corresponding to each task. This feature fusion method can fully utilize the advantages of different models to express more comprehensive feature information, thereby improving the accuracy of click-through rate estimation. Click-through rate estimation is performed based on the target fusion features corresponding to each task. Since the target fusion features fuse the output features of the expert model and the shared model, they contain more comprehensive and rich information, making the click-through rate estimation more accurate. The recommended entity selection based on the click-through rate estimation value can improve the accuracy of the recommendation. Due to the improved estimation accuracy, the recommended entities are more in line with the user's interests and needs, thereby improving the recommendation effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 Schematic diagram of the application scenario of the entity recommendation device provided in the application embodiment.
[0018] Figure 2 A flowchart of the entity recommendation method provided in an embodiment of the present application.
[0019] Figure 3A schematic diagram of the first application scenario of the entity recommendation method provided in an embodiment of the present application.
[0020] Figure 4 A schematic diagram of a second application scenario of the entity recommendation method provided in an embodiment of the present application.
[0021] Figure 5 Schematic diagram of the third application scenario of the entity recommendation method provided in an embodiment of the present application.
[0022] Figure 6 A schematic diagram of a fourth application scenario of the entity recommendation method provided in an embodiment of the present application.
[0023] Figure 7 Another flowchart of the entity recommendation method provided in an embodiment of the present application.
[0024] Figure 8 A schematic diagram of the structure of the entity recommendation device provided in an embodiment of the present application.
[0025] Figure 9 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts are within the scope of protection of this application.
[0027] The embodiments of the present application provide an entity recommendation method, apparatus, storage medium, device and program product. For example, the entity recommendation method of the embodiments of the present application can be executed by a computer device, wherein the computer device can be a terminal or a server. The terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart TV, a smart speaker, a wearable smart device, a personal computer (PC), a smart car terminal and other devices. The terminal can also include a client, which can be a video client, a shopping application client, a reading application client, a browser client or an instant messaging client, etc. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and basic cloud computing services such as big data and artificial intelligence platforms.
[0028] The embodiments of the present application can be applied to scenarios such as artificial intelligence, machine learning, information recommendation, resource recommendation, advertising recommendation, and entity recommendation.
[0029] First, some nouns or terms that appear in the description of the embodiments of this application are explained as follows:
[0030] Artificial Intelligence (AI) is the theory, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, to perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive field within computer science that seeks to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. AI also studies the design principles and implementation methods of various intelligent machines, enabling them to possess the capabilities of perception, reasoning, and decision-making. AI technology is an interdisciplinary discipline encompassing a wide range of fields, encompassing both hardware and software technologies. Foundational AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, pre-trained models, operating / interaction systems, and mechatronics. Pre-trained models, also known as large models or basic models, can be fine-tuned and widely applied to downstream tasks across various AI domains. AI software technologies primarily encompass computer vision, speech processing, natural language processing, and machine learning / deep learning.
[0031] Computer Vision (CV): Computer vision is the science of enabling machines to "see." Specifically, it refers to machine vision techniques such as using cameras and computers to replace the human eye in identifying and measuring objects, and further processing the images to create images more suitable for human observation or transmission to instruments. As a scientific discipline, computer vision studies related theories and technologies, aiming to build artificial intelligence systems that can extract information from images or multidimensional data. Large model technology has brought significant changes to the development of computer vision technology. Pre-trained models in the field of vision, such as the Swin Transformer, ViT, V-MOE, and MAE, can be fine-tuned to quickly and widely apply to specific downstream tasks. Computer vision technology generally includes image processing, image recognition, image semantic understanding, image retrieval, optical character recognition (OCR), video processing, video semantic understanding, video content / action recognition, 3D object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous localization and mapping, and other technologies. It also includes common biometric recognition technologies such as facial recognition and fingerprint recognition.
[0032] Speech Technology: Key technologies include automatic speech recognition (ASR), text-to-speech (TTS), and voiceprint recognition. Enabling computers to hear, see, speak, and feel is the future direction of human-computer interaction, with speech becoming one of the most promising methods of human-computer interaction. Large model technology is revolutionizing the development of speech technology. Pre-trained models such as WavLM and UniSpeech, which leverage the Transformer architecture, possess strong generalization and versatility, enabling them to effectively handle a wide range of speech processing tasks.
[0033] Natural language processing (NLP) is an important field in the fields of computer science and artificial intelligence. It studies various theories and methods that can enable effective communication between humans and computers using natural language. Natural language processing involves natural language, that is, the language people use in daily life, and is closely related to linguistics research; it also involves computer science and mathematics. The pre-training model, an important technology for model training in the field of artificial intelligence, is developed from the large language model (Large Language Model) in the field of NLP. After fine-tuning, the large language model can be widely used in downstream tasks. Natural language processing technology generally includes text processing, semantic understanding, machine translation, robot question answering, knowledge graphs and other technologies.
[0034] Machine Learning (ML) is a multidisciplinary field that encompasses probability theory, statistics, approximation theory, convex analysis, and algorithmic complexity theory. It specifically studies how computers simulate or implement human learning behaviors to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications span all areas of artificial intelligence. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and learning by demonstration. Pretrained models are the latest development in deep learning, integrating these techniques.
[0035] With the research and advancement of artificial intelligence technology, artificial intelligence technology has been studied and applied in many fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned driving, autonomous driving, drones, digital twins, virtual humans, robots, artificial intelligence generated content (AIGC), conversational interaction, smart medical care, smart customer service, game AI, etc. It is believed that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.
[0036] Click-through rate prediction technology is an important part of the Internet application advertising recommendation business. The click-through rate prediction algorithm is essentially a part of the recommendation algorithm, and the primary task of advertising recommendation is to estimate the click-through rate.
[0037] In ad recommendation tasks, user behavior data is often presented in the form of sequences. These sequence features change dynamically over time and are crucial for models to capture user intent and preferences. However, these dynamic sequence features are often highly dimensional and sparse, and unstable over time, making it difficult for traditional algorithmic models to accurately capture their inherent patterns and relationships. Furthermore, ad recommendation systems typically involve the task of predicting click-through rates in multiple different scenarios, each requiring independent modeling and calculation, resulting in high computational effort and model complexity. Therefore, effectively processing dynamic sequence features, improving model estimation efficiency, and enabling model sharing for similar scenarios have become major technical challenges in ad recommendation tasks.
[0038] The embodiment of the present application designs a sequence reasoning model that can effectively process various sequence features before and after entity push, effectively mine the information of sequence feature data, and improve the accuracy of click-through rate estimation. The embodiment of the present application also designs a multi-task learning framework based on the sequence reasoning model, which can simultaneously perform click-through rate estimation on multiple tasks, thereby improving the efficiency of click-through rate estimation. The embodiment of the present application also designs a gated fusion unit that uses a flexible feature fusion method to efficiently combine the output results of the expert model and the output results of the shared model, making the expression learned by the model more comprehensive. Specifically, the embodiment of the present application encodes the data to be processed to generate sequence feature encoding data and position feature encoding data corresponding to each candidate entity, which can effectively extract and utilize sequence features, capture the time series information and position information in the data, and provide rich feature resources for subsequent click-through rate estimation. The sequence reasoning model includes multiple expert models and a shared model. This structure can share models for similar scenarios, thereby reducing the number of models and computational complexity. At the same time, multiple expert models can process different tasks in parallel, improving the model's estimation efficiency. The output features of the expert model corresponding to each task are fused with the output features of the shared model to obtain the target fusion features corresponding to each task. This feature fusion method can fully utilize the advantages of different models to express more comprehensive feature information, thereby improving the accuracy of click-through rate estimation. Click-through rate estimation is performed based on the target fusion features corresponding to each task. Since the target fusion features fuse the output features of the expert model and the shared model, they contain more comprehensive and rich information, making the click-through rate estimation more accurate. The recommended entity selection based on the click-through rate estimation value can improve the accuracy of the recommendation. Due to the improved estimation accuracy, the recommended entities are more in line with the user's interests and needs, thereby improving the recommendation effect.
[0039] The solutions provided in the embodiments of this application involve technologies such as entity recommendation based on artificial intelligence, which are specifically illustrated by the following embodiments. Detailed descriptions are given below. It should be noted that the order in which the following embodiments are described does not limit the priority order of the embodiments.
[0040] It is understandable that in the specific implementation of this application, when it comes to user object data, context data and other related data, when the embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0041] See also Figure 1 , Figure 1Schematic diagram of an application scenario of the entity recommendation device provided in an embodiment of the present application. Taking the entity recommendation method executed by a computer device as an example, wherein the computer device can be a terminal or a server. During the training phase, a computer device obtains sample data, which includes N candidate sample entity sample data corresponding to a target sample entity, where N is an integer greater than 1, and the sample data corresponds to a sample label; the sample data is encoded to generate sample sequence feature encoding data and sample position feature encoding data corresponding to each candidate sample entity in the N candidate entities, where the sample sequence feature encoding data includes the sample sequence features corresponding to each candidate entity in each time series; the sample sequence feature encoding data and the sample position feature encoding data are input into a sequence inference model for feature inference processing to generate sample expert model output features and sample sharing model output features corresponding to each task, where each task is a click-through rate estimation task for each candidate sample entity of the target sample entity; the sample expert model output features corresponding to each task are fused with the sample sharing model output features to obtain sample fusion features corresponding to each task; click-through rate is estimated based on the sample fusion features corresponding to each task to obtain a sample click-through rate estimation value of the target sample entity for each candidate sample entity; an objective function value is calculated based on the sample click-through rate estimation value, the sample label, and the number of samples, and the model parameters of the sequence inference model are updated based on the objective function value. During the recommendation stage, the computer device obtains data to be processed, which includes N candidate entity data to be processed corresponding to the target entity, where N is an integer greater than 1; the data to be processed is encoded to generate sequence feature encoding data and position feature encoding data corresponding to each candidate entity in the N candidate entities, and the sequence feature encoding data includes sequence features corresponding to each candidate entity in each time series; the sequence feature encoding data and the position feature encoding data are input into a sequence reasoning model including N expert models and a shared model for feature reasoning processing to generate expert model output features and shared model output features corresponding to each task, where each task is a click-through rate prediction task for each candidate entity of the target entity; the expert model output features corresponding to each task are fused with the shared model output features to obtain the target fusion features corresponding to each task; the click-through rate is estimated based on the target fusion features corresponding to each task to obtain the target entity's click-through rate estimate value for each candidate entity, and the recommended entity corresponding to the target entity is determined from the N candidate entities based on the click-through rate estimate value, and entity recommendation is performed based on the recommended entity.
[0042] It should be noted that the training process and the recommendation process can be completed in the server or in the terminal.
[0043] An embodiment of the present application provides an entity recommendation method, which can be executed by a terminal or a server, or jointly by a terminal and a server. The embodiment of the present application takes the entity recommendation method executed by a server as an example for explanation.
[0044] See also Figures 2 to 7 , Figure 2 and Figure 7 A flowchart of the entity recommendation method provided in an embodiment of the present application is provided. Figures 3 to 6 These are schematic diagrams of application scenarios of the entity recommendation method provided in the embodiments of the present application. The method may include the following steps 110 to 160:
[0045] Step 110: Acquire data to be processed, where the data to be processed includes N candidate entity data to be processed corresponding to the target entity, where N is an integer greater than 1.
[0046] The data to be processed may have different meanings depending on different scenarios and types of target entities.
[0047] For example, if the target entity is a target object, the data to be processed is the N candidate resource data to be processed corresponding to the target object. In this case, the target object can be a user, customer, consumer, device or other entity with needs or interests. Candidate resources can be advertisements, commodities, books, movies, games, applications, etc. related to the target object. These candidate resources will serve as the target of the recommendation system to provide personalized recommendation results to users. For example, on an online shopping platform, the target object may be a user who is browsing the website. At this time, the candidate resources related to the user may be various commodities, services or promotional activities, and these candidate resources can be determined based on the user's browsing history, purchase patterns or preferences.
[0048] For example, if the target entity is a target resource, the data to be processed is the N candidate object data to be processed corresponding to the target resource. In this case, the target resource can be an advertisement, commodity, book, film, game, application, etc. The candidate object can be a user, customer, consumer, device or other entity with needs or interests related to the target resource. For example, the candidate object may be a user group interested in the resource, a potential purchaser, or a target audience suitable for receiving a specific type of advertisement. These candidate objects will be used as the target of the recommendation system to find suitable users or devices for promotion or sales. For example, if the target resource is a newly released movie, the candidate object may be a movie lover selected based on factors such as viewing history, age, gender, and geographic location.
[0049] In practical applications, the method for obtaining the data to be processed may vary depending on the specific scenario. For example, relevant data can be obtained through database queries, application programming interface (API) calls, crawlers, etc. At the same time, data preprocessing and cleaning can also be considered to ensure data quality and accuracy.
[0050] The goal of step 110 is to obtain data to be processed, including the target entity and N candidate entities, so that the subsequent recommendation algorithm can use this data to make model predictions and select the most appropriate recommendation result from the candidate entities. N is an integer greater than 1, indicating that multiple possible candidates are considered, so that in subsequent steps, CTR estimation for multiple tasks can be achieved in parallel.
[0051] The data to be processed may include detailed information related to object data, resource data, context data, etc.
[0052] For example, object data can include basic object information, object behavior data, object interest tags, and object device information. For example, basic object information may include age, gender, location, and education level. For example, object behavior data may include the object's browsing history, search history, click behavior, purchase history, favorites history, ratings, and reviews. For example, object interest tags can be interest preference tags derived from object behavior analysis, such as fashion, travel, technology, and food. Data such as basic object information, object behavior data, and object interest tags help build object profiles and tagging systems, thereby better understanding user needs and preferences.
[0053] For example, the target device information may include device type, operating system, browser type, screen resolution, etc. Taking the ad recommendation scenario as an example, the target device information helps analyze the differences in ad performance on different devices.
[0054] For example, resource data can include resource content information, resource goals, resource targeting conditions, and resource performance data. This resource data helps analyze the characteristics and effectiveness of advertisements. For example, resource content information can include resource titles, descriptions, images or video materials, and landing page links. For example, resource goals can include increasing brand awareness, promoting sales, and driving downloads. For example, resource targeting conditions can include age, gender, geographic location, interest tags, and other conditions for targeted delivery. For example, resource performance data can include historical click-through rates, conversion rates, impressions, and engagement rates.
[0055] For example, contextual data refers to the contextual environment when an object interacts with a resource, such as the content of the page the user is browsing, time, location, and other factors, all of which may affect the object's click-through rate on the resource. For example, contextual data may include time information, location information, weather information, and event information. For example, time information is the time of the object's visit (such as daytime, nighttime, weekdays, weekends, etc.). Location information is the object's current geographic location (such as a city, business district, transportation station, etc.). Weather information is the real-time weather conditions at the object's location. Event information is information such as holidays, promotions, major events, etc. that may affect the object's behavior.
[0056] Optionally, the acquiring of the data to be processed includes: performing data preprocessing on the acquired initial data to be processed to obtain the data to be processed, wherein the preprocessing includes at least one of data cleaning processing, abnormal data elimination processing and missing data filling processing.
[0057] The initial data to be processed includes the initial data of N candidate entity data to be processed corresponding to the target entity.
[0058] Data preprocessing is a crucial step in the data processing process. It involves cleaning, transforming, and preparing raw data, and it determines the effectiveness and accuracy of subsequent model training. The primary goal of data preprocessing is to ensure data integrity, consistency, and accuracy, providing reliable learning material for the model. When acquiring data to be processed, preprocessing can significantly improve data quality, reduce noise and errors, and ultimately make analysis results more accurate and reliable.
[0059] Data cleaning involves detecting and correcting errors and inconsistencies in data. This can involve identifying and removing duplicate records, correcting spelling errors, and handling inconsistent date formats. In ad recommendation scenarios, data cleaning can include removing invalid clicks from user behavior logs, filtering out traffic generated by bots, and standardizing different data formats to ensure that all information is stored and processed according to unified specifications.
[0060] Abnormal data at least includes garbled characters and values that do not fall within the standard threshold range, i.e., abnormal values. Abnormal data removal refers to removing garbled characters and abnormal values from the original data to be processed.
[0061] Garbled characters refer to values that are not of the specified type, such as characters appearing in a numeric format. This often occurs because of errors during data entry, transmission, or storage. Garbled data not only fails to provide valuable information but can also mislead model training. Therefore, garbled characters must be removed. For numeric data, garbled characters may appear as non-numeric characters in numeric fields.
[0062] Outliers are values in a dataset that significantly deviate from the mean of other data points. They may be caused by data entry errors, sensor failure, or other reasons. The presence of outliers can severely impact model training and accuracy. Common methods for handling outliers include removing them, filling them with the mean or median, and applying statistical corrections. The specific method chosen depends on the specific data and model requirements.
[0063] For example, taking the advertising recommendation scenario as an example, as shown in Table 1, a data comparison table before and after the abnormal data removal process is shown, after obtaining the initial data to be processed (the initial data to be processed corresponding to the advertising IDs 0000001 and 0000002 as shown in Table 1), the initial data to be processed (the initial data to be processed corresponding to the advertising IDs 0000001 and 0000002 as shown in Table 1) can be preprocessed. For example, the garbled characters (such as the interaction value at time 3 of the advertising ID 0000001: Oexc as shown in Table 1) or abnormal values (the interaction value at time 3 of the advertising ID 0000002: 1023 as shown in Table 1) in the initial data to be processed are removed to obtain the first preprocessed data.
[0064] Table 1
[0065]
[0066] Among them, missing data is one of the common problems in data analysis. Missing data may be caused by the user not filling in certain fields, data collection failure, etc. For the processing of missing data, you need to choose according to the actual situation. A common processing method is to use a certain strategy to fill in the missing data. For example, for numerical data, you can use 0 or -1 to fill. Among them, filling 0 usually means that the field has no value or is not applicable to the record, while filling -1 can be used as a special identifier to indicate missing values. In addition to direct filling, you can also consider using other methods to handle missing data, such as statistical-based methods (such as mean, median, and mode filling), model-based methods (such as using machine learning models to predict missing values), etc. Which method to choose depends on the specific situation of the data and the requirements of the model.
[0067] For example, taking the advertising recommendation scenario as an example, as shown in Table 2, a data comparison table before and after missing data filling processing can be used to detect missing data in the first preprocessed data described in Table 1. If missing data is detected in the first preprocessed data (for example, the interaction values at time 3 corresponding to the advertisement IDs 0000001 and 0000002 shown in Table 2 are empty), the missing data in the first preprocessed data is filled. For example, the interaction value at time 3 for the advertisement ID 0000001 shown in Table 2 is filled with a value of 0. For example, the interaction value at time 3 for the advertisement ID 0000002 shown in Table 2 is filled with a value of -1. The filled data is standardized and convenient for computer recognition and processing. The second preprocessed data can be determined as the data to be processed described in step 110. In addition, if it is detected that there is no missing data in the first preprocessed data, the first preprocessed data is determined as the data to be processed described in step 110.
[0068] Table 2
[0069]
[0070] Step 120 , encoding the data to be processed to generate sequence feature encoding data and position feature encoding data corresponding to each candidate entity in the N candidate entities, wherein the sequence feature encoding data includes sequence features corresponding to each candidate entity at each time sequence.
[0071] Optionally, the encoding processing of the data to be processed to generate sequence feature coding data and position feature coding data corresponding to each candidate entity in the N candidate entities includes: based on the time sequence, performing static feature coding processing on the N candidate entity data to be processed to generate static feature coding data corresponding to the N candidate entities; performing feature dynamic query processing on the static feature coding data to generate sequence feature coding data corresponding to each candidate entity in the N candidate entities, wherein N is an integer greater than or equal to 2; performing sequence position coding on the sequence feature coding data corresponding to each candidate entity to generate position feature coding data corresponding to each candidate entity.
[0072] In step 120, the data to be processed for the N candidate entities may be encoded in chronological order. The chronological order is taken into consideration because many real-world sequential data, such as text and time series, have inherent temporal dependencies or sequentiality, which is crucial for understanding the meaning and structure of the data.
[0073] Static feature encoding primarily involves extracting features from raw data to generate a set of static feature encoding data that can describe the basic characteristics of candidate entities. These static features can be used to describe the characteristics of entity data (such as object data and resource data) and contextual data related to the target entity and candidate entities. Static feature encoding can transform raw, potentially difficult-to-process data into a form that is easier to analyze and process, providing a foundation for subsequent dynamic feature encoding and position encoding.
[0074] After generating static feature encoding data, dynamic feature query processing can be performed. The purpose of this step is to capture the dynamic characteristics of candidate entities in the time series, that is, how the characteristics of candidate entities change over time, so as to extract the dynamic sequence characteristics of candidate entities in the time series. The generation of sequence feature encoding data corresponding to each candidate entity not only considers the static characteristics of the candidate entity, but also its dynamic characteristics over time, thus providing richer information for understanding and analyzing the candidate entity.
[0075] After generating the sequence feature encoding data, it is also necessary to perform sequence position encoding on the sequence feature encoding data corresponding to each candidate entity. The purpose of this step is to capture the position information of the candidate entity in the time series, that is, the relative position or order of the candidate entity in the time series. Sequence position encoding can adopt various methods, such as positional embedding (Positional Embedding), positional encoding (Positional Encoding), etc. These methods can convert the position information of the candidate entity into a data format that can be directly used for machine learning model processing. Through sequence position encoding, the position and order information of the candidate entity in the time series can be more accurately understood and analyzed, which is crucial for many time series analysis tasks (such as time series prediction, time series classification, etc.).
[0076] By encoding the data to be processed and generating sequence feature encoding data and position feature encoding data corresponding to each of the N candidate entities, the original, possibly disorganized data can be converted into a structured and regular data format, providing strong support for subsequent data analysis and processing.
[0077] Among the data to be processed, there is dynamic sequence data that changes over time. For example, the dynamic sequence data may include the following:
[0078] Subject behavior sequences: This is one of the most common types of dynamic sequence data. For example, a subject's browsing history, purchase history, and click behavior can all constitute a subject's behavior sequence. These behavior sequences reflect the subject's interests and preferences and serve as an important basis for ad recommendations. For example, if a subject has recently frequently browsed items related to sneakers, it can be inferred that the subject is likely interested in sneakers.
[0079] Time-dependent sequences: Time itself is an important dynamic sequence. For example, different times of day, days of the week, seasons of the year, and holidays all influence a user's behavior and interests. Furthermore, seasonal changes and annual trends can also influence the effectiveness of ad recommendations. For example, in winter, a user may have an increased demand for warm clothing.
[0080] Geographic location information: An object's geographic location is also an important dynamic sequence. For example, the object's city, region, and country can influence ad content and recommendation strategies. An object's movement trajectory can also be used to construct dynamic sequence features. For example, if a subject frequently spends time near a gym, it can be inferred that the subject is likely interested in fitness-related topics.
[0081] Object device information: The object's device type, operating system, browser, and other information can change over time, and these changes can form a dynamic sequence. For example, the emergence of new devices or operating system updates can cause changes in object behavior.
[0082] Ad exposure and feedback sequences: Ad exposure and feedback data are also important dynamic sequences. For example, ad click-through rates, impressions, and conversion rates also change over time, and these changes can form a dynamic sequence.
[0083] The embodiment of the present application can be based on the time sequence, and by performing feature coding processing on the dynamic sequence data in the above-mentioned data to be processed, static feature coding data containing dynamic sequence features with time series feature coding can be obtained. Among them, the static feature coding data is used to describe the dynamic sequence features with time series feature coding. The static feature coding data can be understood as sorting the static features of the data to be processed in sequence and numbering them. Since there are many types of sequences, this embodiment can obtain static feature coding data by static coding of the time series. The dynamic sequence features can specifically be expressed as object behavior sequence features, time series features, geographic location sequence features, object device sequence features, context sequence features, etc. in time sequence, and can also be expressed as other dynamic sequence features, which are not specifically limited here.
[0084] Optionally, the static feature coding processing is performed on the N candidate entity data to be processed based on the time sequence to generate static feature coding data corresponding to the N candidate entities, including: performing static feature coding processing on the N candidate entity data to be processed based on the time sequence to obtain the sequence features corresponding to each candidate entity in each time series; obtaining N initial candidate entity codes corresponding to the N candidate entities respectively from the N candidate entity data to be processed, and determining the N initial time series feature codes corresponding to each initial time series based on the N initial candidate entity codes; calculating the time series feature code corresponding to each candidate entity in each time series based on the initial time series feature code of each candidate entity, the time sequence corresponding to each time series, and the number of candidate entities; generating static feature coding data corresponding to the N candidate entities based on the time sequence corresponding to each time series, the N initial candidate entity codes, the sequence features corresponding to each candidate entity in each time series, and the time series feature code corresponding to each candidate entity in each time series.
[0085] For example, first, the data to be processed for N candidate entities is arranged in chronological order. Because time series data often exhibits temporal dependence and sequentiality, the correct time order is crucial for subsequent feature extraction and encoding. As shown in the static feature encoding data table in Table 3, each time series can be sorted in chronological order. For example, the time series encodings for three time series, Time1, Time2, and Time3, are illustrated in Table 3. After determining the time order, sequence features are extracted for each candidate entity at each time series. These sequence features can be based on the inherent attributes of the target entity (such as object basic information, object interest tags, and object device information) and the inherent attributes of the candidate entity (such as resource content information, resource goals, resource targeting conditions, and resource performance data). They can also be based on statistical characteristics (such as mean, variance, and trend) of the time series data (such as object behavior data and contextual data). Sequence features corresponding to each candidate entity at each time series are obtained. These sequence features describe the state and behavior of the candidate entity at different time points. For each candidate entity, its static features can be extracted by looking at the entity's metadata, attributes, or using a predefined feature extractor. Then, an encoding method (such as one-hot encoding, word embedding, etc.) can be used to convert these static features into numerical form to obtain sequence features so that the machine learning model can process them.
[0086] For example, as shown in Table 3, the corresponding initial candidate entity codes of the four candidate entities are 00001, 00002, 00003 and 00004. The candidate entity to-be-processed data corresponding to each candidate entity in Time1 shown in Table 3 are subjected to feature extraction, and the sequence features corresponding to candidate entity 00001 are (1, 2, 3), the sequence features corresponding to candidate entity 00002 are (2, 1, 3), the sequence features corresponding to candidate entity 00003 are (0, 2, 5), and the sequence features corresponding to candidate entity 00004 are (3, 1, 2). Similarly, the candidate entity to-be-processed data corresponding to each candidate entity in Time2 shown in Table 3 are subjected to feature extraction, and the candidate entity to-be-processed data are obtained. The sequence feature corresponding to candidate entity 00001 is (0, 1, 1), the sequence feature corresponding to candidate entity 00002 is (1, 0, 0), the sequence feature corresponding to candidate entity 00003 is (3, 6, 9), and the sequence feature corresponding to candidate entity 00004 is (2, 1, 0); feature extraction is performed on the candidate entity processing data corresponding to each candidate entity in Time3 shown in Table 3, and the sequence feature corresponding to candidate entity 00001 is (2, 2, 1), the sequence feature corresponding to candidate entity 00002 is (0, 0, 1), the sequence feature corresponding to candidate entity 00003 is (0, 0, 0), and the sequence feature corresponding to candidate entity 00004 is (0, 2, 0).
[0087] Then, after obtaining the sequence features of each candidate entity in each time series, the initial candidate entity code corresponding to each candidate entity is obtained from the N candidate entity data to be processed. Based on these initial candidate entity codes, the N initial time series feature codes corresponding to each initial time series are further determined. Then, after determining the feature code of each initial time series, the time series feature code corresponding to each candidate entity in each time series is calculated based on the initial time series feature code of each candidate entity, the time order corresponding to each time series, and the number of candidate entities.
[0088] For example, as shown in Table 3, the four candidate entities have the corresponding initial candidate entity codes 00001, 00002, 00003 and 00004. For the initial time series such as Time1, the candidate entities 00001, 00002, 00003 and 00004 are assigned the corresponding initial time series feature codes according to the initial candidate entity codes, such as 1, 2, 3 and 4 as shown in Table 1. Then, in subsequent different time series such as Time2 and Time3, the same dimension features of the same candidate entity can be calculated according to the coding calculation formula shown in the following formula (1), and its time series feature codes at different time series are:
[0089] Temporal feature coding = initial temporal feature coding + temporal ranking (increasing from 0) * number of candidate entities (1).
[0090] For example, the second temporal feature encoding of candidate entity 00003 is: 3+1*4=7.
[0091] For example, the second temporal feature encoding of candidate entity 00004 is: 4+1*4=8.
[0092] For example, the third temporal feature encoding of candidate entity 00001 is: 1+2*4=9.
[0093] For example, the third temporal feature encoding of candidate entity 00002 is: 2+2*4=10.
[0094] Then, based on the time order corresponding to each time series, the N initial candidate entity codes, the sequence features corresponding to each candidate entity at each time series, and the time series feature codes corresponding to each candidate entity at each time series, static feature code data corresponding to the N candidate entities is generated. This static feature code data not only contains the inherent attributes of the candidate entity and the statistical characteristics of the time series, but also captures the dynamic changes and position information of the candidate entity in the time series. This data provides strong support for subsequent data analysis and processing.
[0095] Table 3
[0096]
[0097] Optionally, the static feature coding data is subjected to dynamic feature query processing to generate sequence feature coding data corresponding to each candidate entity in the N candidate entities, including: based on the initial candidate entity code of each candidate entity, querying the time series feature code corresponding to each candidate entity in each time series from the static feature coding data; based on the time series feature code corresponding to each candidate entity in each time series and the feature matrix corresponding to the static feature coding data, determining the sequence feature coding data corresponding to each candidate entity.
[0098] When applying the model, if predictions are made on a single piece of data, dynamic feature querying is not necessary. However, if predictions are made on a batch of data, dynamic feature querying is required. When predicting on a batch of data, it is not necessary to input all features into the model; only the sequence features of the specified candidate entities need to be selected. This selection method can use matrix multiplication to implement dynamic feature querying.
[0099] Taking the features of candidate entity 00001 in Table 3 as an example, the temporal feature encoding of this candidate entity in three time series is (1, 5, 9). The temporal feature encoding of candidate entity 00001 is converted to one-hot encoding. The encoding matrix w corresponding to the temporal feature encoding is id It is expressed as the following formula (2):
[0100]
[0101] The feature matrix X corresponding to all candidate entities in the static feature coding data of Table 3 is expressed as the following formula (3):
[0102]
[0103] Then, using matrix multiplication, the dynamic query result of the feature of candidate entity 00001 is as follows:
[0104]
[0105] Then, by analogy, the sequence features of the required candidate entities can be queried using the above matrix multiplication method, which is concise and efficient.
[0106] Optionally, the performing serial position encoding on the sequence feature coding data corresponding to each candidate entity to generate position feature coding data corresponding to each candidate entity includes: performing serial position encoding on the sequence features of each position corresponding to the time series feature coding in the sequence feature coding data corresponding to each candidate entity according to the position of the current sequence feature in the time series feature coding to generate position feature coding data corresponding to each candidate entity, wherein the sequence feature coding data and the position feature coding data have the same feature dimension.
[0107] Among them, the position feature vector can be used to express the position information of the feature in the sequence. For example, the calculation formulas (5) and (6) of the position feature can be used to generate the position feature encoding data corresponding to each candidate entity:
[0108] T (pos,2i) =sin(pos / 10000 2i / dim_model ) (5);
[0109] T (pos,2i+1) =cos(pos / 10000 2i / dim_model ) (6);
[0110] Among them, pos represents the position of the current sequence feature in the time series feature encoding, 2i represents the case when pos is an even number, and 2i+1 represents the case when pos is an odd number. i represents the dimensional range of the feature, dim_model represents the dimension of the feature, which is equal to the dimension of the input feature (sequence feature). Taking Table 3 as an example, the value range of i is 0-2 (because the feature is 3-dimensional in total), and dim_model = 3. The sequence feature of each position corresponding to the time series feature encoding in the sequence feature encoding data is calculated using formulas (5) and (6), and finally the position feature encoding data with the same dimension as formula (4) is obtained. Among them, the current sequence feature is the sequence feature currently undergoing sequence position encoding processing in the sequence feature encoding data.
[0111] For example, as shown in Table 3, the temporal feature encodings of candidate entity 00001 in three time series are (1, 5, 9), where the sequence feature (1, 2, 3) indicates that the position in the temporal feature encoding is 1, i.e., pos = 1. Similarly, the position of the sequence feature (0, 1, 1) in the temporal feature encoding is 2, i.e., pos = 2. Similarly, the position of the sequence feature (2, 2, 1) in the temporal feature encoding is 3, i.e., pos = 3. The sequence feature elements (1, 2, 3) at each position of the sequence feature with pos = 1 and the sequence feature elements (2, 2, 1) at each position of the sequence feature with pos = 3 can be calculated using formula (6), and the sequence feature elements (0, 1, 1) at each position of the sequence feature with pos = 2 can be calculated using formula (5) to obtain the positional feature encoding data corresponding to candidate entity 00001. Similarly, the positional feature encoding data corresponding to each candidate entity is generated.
[0112] In step 130, the sequence feature coding data and the position feature coding data are input into a sequence reasoning model including N expert models and a shared model for feature reasoning processing to generate expert model output features and shared model output features corresponding to each task, wherein each task is a click rate estimation task for each candidate entity of the target entity.
[0113] The sequential reasoning model receives sequence feature encoding data and position feature encoding data as input sequences. These data contain static and dynamic features of candidate entities, as well as their position information in the sequence. In the sequential reasoning model, there are N expert models and one shared model. Expert models are usually models optimized for specific tasks or specific data subsets. They can focus on capturing features related to specific tasks. In the embodiment of the present application, each expert model is responsible for processing a specific click-through rate prediction task, that is, predicting the click-through rate of the target entity for each candidate entity. The shared model is designed to capture shared features between all tasks. It receives the same input data and outputs features related to all tasks. Through the shared model, the model can share information between different tasks, thereby improving generalization ability and efficiency. Training multiple tasks together (i.e., multi-task learning) enables the model to learn shared representations and correlations between tasks to improve the performance of each task. In this scenario, each task is to estimate the click-through rate corresponding to the target entity, but each task corresponds to a different candidate entity. Through multi-task learning, the model can learn common features between different candidate entities, as well as their respective unique features.
[0114] In step 130, the sequence reasoning model receives the sequence feature encoding data and the position feature encoding data as the input sequence, and performs feature reasoning processing through the expert model and the shared model. Each expert model generates output features related to its corresponding task, which capture information related to the click-through rate estimation task of a specific candidate entity. The shared model generates output features related to all tasks, which capture shared information across all tasks. Then, the sequence reasoning model generates expert model output features and shared model output features for each task. These features can be further used for click-through rate estimation or related tasks in other scenarios, such as ranking, recommendation, etc.
[0115] By inputting the sequence feature encoding data and the position feature encoding data into the sequence inference model comprising the expert model and the shared model for feature inference processing, step 130 enables parallel processing of multiple CTR prediction tasks and shared features between learning tasks. This strategy can improve model performance and enable the model to better adapt to the characteristics of different tasks and candidate entities.
[0116] Optionally, the step of inputting the sequence feature coding data and the position feature coding data into a sequence inference model comprising N expert models and a shared model for feature inference processing to generate expert model output features and shared model output features corresponding to each task includes: inputting the sequence feature coding data and the position feature coding data corresponding to each candidate entity into the expert model corresponding to each task to generate the expert model output features corresponding to each task; and inputting the sequence feature coding data and the position feature coding data corresponding to the N candidate entities into the shared model to generate the shared model output features corresponding to each task.
[0117] The sequence feature encoding data and position feature encoding data corresponding to each candidate entity are used as the model's input sequence and fed into the expert model corresponding to each task. "Each task" here refers to the task of estimating the click-through rate of the target entity for each candidate entity. Since there are N candidate entities, there are also N such tasks. For example, before inputting data, some preprocessing steps may be required, such as data standardization and normalization, to ensure the validity and stability of the data in the model.
[0118] Each expert model is trained for a specific task, enabling it to capture features closely related to that task. When input data enters the expert model, it uses its own model parameters (such as weights and parameters) to perform feature inference on the data, generating output features specific to the task. These features reflect the model's understanding and prediction of the task.
[0119] In addition to being input into the expert model, the sequence feature encoding data and position feature encoding data corresponding to all N candidate entities are also input into the shared model. The shared model is used to capture shared features between all tasks, that is, those features that are important for all tasks. Similar to the expert model, some preprocessing steps may also be required before inputting data into the shared model. The shared model then uses its own model parameters (such as weights and parameters) to perform feature inference processing on all input data to generate shared model output features corresponding to each task. These features can better reflect the shared information and common patterns between all tasks.
[0120] The output features of the expert model and the shared model can be used individually or in combination. This combination can be achieved through simple concatenation, weighted averaging, or more complex fusion methods, depending on the task requirements and model design. These output features can be used directly in subsequent CTR prediction tasks or as input to other machine learning models (such as classifiers and regression models) to further improve prediction accuracy and performance.
[0121] In step 130, by inputting the sequence feature encoding data and the position feature encoding data into the expert model and the shared model, respectively, expert model output features and shared model output features corresponding to each task are generated. These features not only capture information related to the specific task but also capture shared information across all tasks, thereby improving the model's generalization ability and prediction accuracy.
[0122] In step 130, the sequence reasoning models of different tasks are integrated through the multi-task learning model architecture. Figure 3 As shown in the figure, taking the learning process of two tasks as an example, the training / inference process of task 1 is implemented through expert model 1 and shared model, and the training / inference process of task 2 is implemented through expert model 2 and shared model. Expert model 1 is a dedicated model for task 1, which carries the model parameter information of task 1. Expert model 2 is a dedicated model for task 2, which carries the model parameter information of task 2. The shared model is a module used by both task 1 and task 2. The shared model is used to realize model migration between different tasks.
[0123] Among them, each expert model and shared model is equipped with several temporal reasoning modules. For example, each expert model has 3 superimposed temporal reasoning modules, and each shared model has 3 superimposed temporal reasoning modules.
[0124] Optionally, each of the expert models has a first temporal reasoning module, which includes a first multi-head self-attention mechanism layer, a first residual and normalization layer, a first forward neural network and a second residual and normalization layer; the sequence feature encoding data and the position feature encoding data corresponding to each candidate entity are input into the expert model corresponding to each task to generate the expert model output features corresponding to each task, including: for the expert model corresponding to each task, the sequence feature encoding data and the position feature encoding data corresponding to each candidate entity are calculated through the first multi-head self-attention mechanism layer to obtain the first attention operation result corresponding to each candidate entity; based on the first residual and normalization layer, the first attention operation result, the sequence feature encoding data and the position feature encoding data corresponding to each candidate entity are normalized to obtain a first normalized result; based on the first forward neural network, the first normalized result is nonlinearly transformed to obtain a first forward feedback result; based on the second residual and normalization layer, the first normalized result and the first forward feedback result are normalized to generate the expert model output features corresponding to each task.
[0125] For example, introducing Figure 4The first temporal reasoning module 40 shown in the figure includes a first multi-head self-attention mechanism layer 41, a first residual and normalization layer 42, a first forward neural network 43 and a second residual and normalization layer 44. It is intended to enhance the ability of the expert model in temporal reasoning, thereby more accurately generating the expert model output features corresponding to each task.
[0126] For each task-specific expert model, the first multi-head self-attention layer 41 calculates attention weights for the sequence feature encoding data and position feature encoding data corresponding to each candidate entity, yielding the first attention calculation result for each candidate entity. The multi-head self-attention mechanism allows the model to simultaneously learn from multiple different representation subspaces, enhancing its ability to capture complex patterns. Through this layer, the model generates an attention weight for each position in the input sequence, reflecting the degree of association between different positions in the input sequence.
[0127] For example, the temporal reasoning capability is achieved through the multi-head self-attention mechanism. The calculation formula of self-attention is expressed as the following formula (7):
[0128]
[0129] Where Q represents the query vector matrix, Q = X*W Q ; K represents the key vector matrix, K = X * W K ; V represents the value vector matrix, V = X * W V ;X represents the input sequence;W Q ,
[0130] W K , W V are model parameters, which can represent query weight matrix, key weight matrix and value weight matrix respectively; d k Indicates the dimension of the key vector.
[0131] Specifically, first, the input sequence X is multiplied by the three weight matrices Wq, Wk, and Wv to obtain the query vector matrix Q, the key vector matrix K, and the value vector matrix V. Then, the dot product of the query vector Q and the key vector K is calculated and divided by the dimension d of the key value. k The square root of , we get the attention score: Among them, the attention score is a matrix, each element of which represents the correlation between a query vector and a key vector. Then, the attention score is normalized using the normalized exponential (softmax) function to obtain the weight coefficient corresponding to each key vector. Finally, the weight coefficient matrix Multiply it with the value vector matrix V to get the output sequence attention(Q,K,V).
[0132] Among them, the calculation formula of multi-head self-attention can be expressed as the following formula (8) and formula (9).
[0133] multiHead(Q,K,V)=concat(head1,...,head n )W O (8);
[0134]
[0135] Among them, W i Q , They represent the query weight matrix of the i-th head, the key weight matrix of the i-th head, and the value weight matrix of the i-th head respectively; W o Represents the output weight matrix; W i Q , W o are all model parameters; concat represents concatenation operation; the value of head can be adjusted as needed, for example, the embodiment of the present application adopts h=8, and the scaling factor
[0136] For example, split Q, K, and V into h heads respectively, and the size of each head is Where dmodel represents the dimension of the input sequence, and h is the number of heads. Where Q = [Q1, Q2, ..., Qh]; K = [K1, K2, ..., Kh]; V = [V1, V2, ..., Vh]. Then, combine the above formula (7) and formula (9) to perform self-attention calculation on each head to obtain the output head of each head i Then, based on the above formula (8), the outputs of all heads are concatenated and multiplied by an output weight matrix Wo to obtain the attention operation result multiHead(Q,K,V).
[0137] For each task-specific expert model, the first multi-head self-attention mechanism layer 41 calculates the attention weights for the sequence feature encoding data and position feature encoding data corresponding to each candidate entity using formulas (7) to (9) above, obtaining the first attention operation result corresponding to each candidate entity. In formula (7), X represents the input sequence. In the expert model, X represents the sequence feature encoding data and position feature encoding data corresponding to each candidate entity.
[0138] Then, based on the first residual and normalization layer 42, the first attention operation result, the sequence feature encoding data corresponding to each candidate entity, and the position feature encoding data are normalized to obtain a first normalized result. Residual connections help the model retain more original information, preventing gradient vanishing or representation bottleneck problems that occur in deep networks. Normalization helps the model converge faster and stabilizes the training process. The output of this step is the normalized result, which combines the original features and the attention-weighted features.
[0139] The residual and normalization (Add&Norm) layers are normalized based on the following formula (10):
[0140] moduleOutput=layerNorm(x+subModule(x)) (10);
[0141] Among them, layerNorm represents the normalization operation, x represents the input result of the previous layer, and subModule(*) represents the output result of the previous layer.
[0142] The Add & Norm layer is a commonly used layer for adding residual connections and normalization operations between the multi-head self-attention mechanism and the feedforward neural network. This layer adds the output of the previous layer to the input of the previous layer and normalizes it to better transfer information and control gradients.
[0143] The first residual and normalization layer 42 performs a normalization operation on the first attention operation result, the sequence feature encoding data corresponding to each candidate entity, and the position feature encoding data using the above formula (10) to obtain a first normalized result. In the first residual and normalization layer 42, x in formula (10) represents the initial input sequence (i.e., the sequence feature encoding data and position feature encoding data corresponding to each candidate entity), and subModule (*) represents the processing result of the multi-head self-attention mechanism layer (i.e., the first attention operation result).
[0144] The first normalized result is then subjected to a nonlinear transformation by a first feedforward neural network 43 to obtain a first feedforward result. A feedforward neural network typically consists of multiple linear layers and nonlinear activation functions to capture complex patterns in the data. This step aims to further perform nonlinear transformations and enhance feature representation, making the first feedforward result more adaptable to subsequent task requirements.
[0145] Then, the result of the normalized multi-head self-attention operation is input into the feed-forward neural network for calculation. The calculation formula can be expressed as follows (11):
[0146] FFN(x)=max(0,xW1+b1)W2+b2 (11);
[0147] Among them, max() represents a nonlinear conversion function, W1 and W2 represent weight matrices, b1 and b2 represent bias terms, and W1, W2, b1, and b2 are all model parameters; x represents the output result of the previous layer.
[0148] The first feedforward neural network 43 performs a nonlinear transformation on the first normalized result using the above formula (11) to obtain a first forward feedback result. In the first feedforward neural network 43, x in formula (11) represents the first normalized result.
[0149] Then, the first normalized result and the first forward feedback result are normalized based on the second residual and the normalization layer 44. The purpose of this step is to stabilize the output of the model again and ensure that the model can effectively combine the previous processing steps and the current forward feedback result.
[0150] The second residual and normalization layer 44 performs a normalization operation on the first normalization result and the first forward feedback result using the above formula (10). In the second residual and normalization layer 44, x in formula (10) represents the first normalization result, and subModule (*) represents the processing result of the forward neural network (Feed Forward) (i.e., the first forward feedback result).
[0151] In each expert model, after a first temporal reasoning module is completed, the next first temporal reasoning module can be connected. A total of N first temporal reasoning modules can be stacked to complete the entire sequential reasoning process of the expert model. N can be set as needed, for example, based on the complexity of the problem. The higher the complexity, the larger N is, and N is generally 2-3. For example, N = 3 means that three first temporal reasoning modules complete the temporal reasoning task of the expert model.
[0152] After completing the above steps, the model will generate expert model output features corresponding to each task. These features represent the model's understanding and representation of the input data and can be directly used for subsequent classification, regression, or other tasks.
[0153] Through these steps, each expert model can effectively utilize the sequence feature encoding data and position feature encoding data to generate task-relevant output features. The multi-head self-attention mechanism, residual connections, and normalization processing in the first temporal reasoning module jointly enhance the model's temporal reasoning capabilities, enabling the model to better capture dependencies and complex patterns in the sequence, thereby generating more accurate expert model output features.
[0154] Optionally, the shared model has a second temporal reasoning module, which includes a second multi-head self-attention mechanism layer, a third residual and normalization layer, a second forward neural network and a fourth residual and normalization layer;
[0155] The step of inputting the sequence feature coding data and the position feature coding data corresponding to the N candidate entities into the shared model to generate the shared model output features corresponding to each task includes: for the shared model, performing attention weight calculation on the sequence feature coding data and the position feature coding data corresponding to the N candidate entities through the second multi-head self-attention mechanism layer to obtain a second attention operation result corresponding to each candidate entity; performing normalization operation on the second attention operation result, the sequence feature coding data and the position feature coding data corresponding to the N candidate entities based on the third residual and normalization layer to obtain a second normalized result; performing nonlinear transformation processing on the second normalized result based on the second forward neural network to obtain a second forward feedback result; performing normalization operation on the second normalized result and the second forward feedback result based on the fourth residual and normalization layer to generate the shared model output features corresponding to each task.
[0156] Among them, the shared model should not only be able to capture the shared features between multiple tasks, but also maintain adaptability to different tasks. For example, introducing Figure 5 The second temporal reasoning module 50 shown includes a second multi-head self-attention mechanism layer 51, a third residual and normalization layer 52, a second forward neural network 53 and a fourth residual and normalization layer 54. These components together enhance the shared model's capabilities in temporal reasoning and multi-task learning.
[0157] The second multi-head self-attention mechanism layer 51 calculates attention weights for the sequence feature encoding data and position feature encoding data corresponding to the N candidate entities, obtaining the second attention operation result for each candidate entity. This step enables the model to focus on important information at different positions in the input sequence, thereby better capturing dependencies within the sequence. The multi-head self-attention mechanism allows the model to learn information from multiple different representation subspaces, enhancing the model's representational capabilities.
[0158] For the shared model, the second multi-head self-attention mechanism layer 51 calculates the attention weights for the sequence feature encoding data and position feature encoding data corresponding to the N candidate entities using formulas (7) to (9) above, obtaining the second attention operation result corresponding to each candidate entity. In formula (7), X represents the input sequence. In the shared model, X represents the sequence feature encoding data and position feature encoding data corresponding to the N candidate entities.
[0159] Then, based on the third residual and normalization layer 52, the second attention operation result, the sequence feature encoding data corresponding to the N candidate entities, and the position feature encoding data are normalized to obtain a second normalized result. Residual connections help preserve the original information of the model and prevent the vanishing gradient problem that may occur in deep networks. At the same time, the normalization operation can accelerate model convergence and improve the stability of the training process.
[0160] The third residual and normalization layer 52 performs a normalization operation on the second attention operation result, the sequence feature encoding data corresponding to the N candidate entities, and the position feature encoding data using the above formula (10) to obtain a second normalized result. In the third residual and normalization layer 52, x in formula (10) represents the initial input sequence (i.e., the sequence feature encoding data and position feature encoding data corresponding to the N candidate entities), and subModule(*) represents the processing result of the multi-head self-attention mechanism layer (i.e., the second attention operation result).
[0161] The second normalized result is then subjected to a nonlinear transformation by a second feedforward neural network 53 to obtain a second feedforward result. A feedforward neural network typically includes multiple linear layers and nonlinear activation functions for further nonlinear transformation and enhanced feature representation, making the second feedforward result more adaptable to subsequent task requirements and improving the model's generalization capabilities.
[0162] The second feedforward neural network 53 performs a nonlinear transformation on the second normalized result using the above formula (11) to obtain a second forward feedback result. In the second feedforward neural network 53, x in formula (11) represents the second normalized result.
[0163] Then, the second normalized result and the second forward feedback result are normalized based on the fourth residual and normalization layer 54. The purpose of this step is to ensure that the model can effectively combine the previous processing steps and the current forward feedback result to generate the final shared model output features.
[0164] The fourth residual and normalization layer 54 performs a normalization operation on the first normalization result and the first forward feedback result using the above formula (10). In the fourth residual and normalization layer 54, x in formula (10) represents the second normalization result, and subModule (*) represents the processing result of the forward neural network (Feed Forward) (i.e., the second forward feedback result).
[0165] In the shared model, after one second temporal reasoning module is completed, the next second temporal reasoning module can be connected. A total of N second temporal reasoning modules can be stacked to complete the entire sequential reasoning process of the shared model. N can be set as needed, for example, based on the complexity of the problem. The higher the complexity, the larger N is, and N is generally 2-3. For example, N = 3 means that there are three second temporal reasoning modules to complete the temporal reasoning task of the shared model.
[0166] After completing the above steps, the shared model will generate output features corresponding to each task. These features not only capture information related to the specific task, but also incorporate shared information across all tasks, thereby improving the model's generalization ability and prediction accuracy.
[0167] By introducing a second temporal reasoning module into the shared model and combining it with multi-head self-attention, residual connections, and normalization techniques, the model is able to better handle temporal data and multi-task learning. This not only improves the model's representation and generalization capabilities, but also provides more accurate and effective feature representation for subsequent classification, regression, or other tasks.
[0168] Step 140 , performing feature fusion on the output features of the expert model corresponding to each task and the output features of the shared model to obtain target fusion features corresponding to each task.
[0169] See also Figure 3 and Figure 6 , the output features of the expert model and the shared model are sent to the feature fusion gating unit for feature fusion. Figure 6 The feature fusion gating unit 60 shown in FIG. 5 can adopt a flexible feature fusion method to retain the effective information of the input features (the output features of the expert model and the output features of the shared model) on both sides of the feature fusion gating unit 60. The calculation formula can be expressed as the following formula (12):
[0170]
[0171] Among them, x 1 is the output result of the expert model (expert model output feature), x 2 The output result of the shared model (shared model output features); are model parameters; f is a nonlinear activation function.
[0172] For example, effective information refers to weighting the original two input features (expert model output features and shared model output features) through some weights, and then fusing the weighted results. This not only retains the original information expressed by the two input features, but also finds the focus of the two input features through the weights, which is equivalent to a more effective fusion.
[0173] Step 150 : performing click-through rate estimation based on the target fusion features corresponding to each task, and obtaining an estimated click-through rate value of the target entity for each candidate entity.
[0174] In step 150, the target fused features corresponding to each task are obtained by fusing the output features of the expert model with the output features of the shared model. These fused features contain rich information and can more comprehensively express the characteristics of the candidate entities and user behavior patterns. When performing click-through rate estimation, the target fused features are analyzed to predict the target entity's click-through rate for each candidate entity.
[0175] Optionally, if the target entity is a target object, the data to be processed is the data to be processed of N candidate resources corresponding to the target object; the click-through rate is estimated based on the target fusion features corresponding to each task to obtain the click-through rate estimate of the target entity for each candidate entity, and the recommended entity corresponding to the target entity is determined from the N candidate entities based on the click-through rate estimate, and entity recommendation is performed based on the recommended entity, including: the click-through rate is estimated based on the target fusion features corresponding to each task to obtain the click-through rate estimate of the target object for each candidate resource.
[0176] For example, when the target entity is a target object, the data to be processed is the N candidate resource data corresponding to the target object. This means that the current focus is on how to provide the most appropriate resource recommendations for the target object. A target object typically refers to a user, viewer, consumer, or any other entity with specific needs and interests. Candidate resources, on the other hand, are a series of content, products, services, or other entities that are related to or potentially attractive to the target object. For example, candidate resources include articles, videos, advertisements, product recommendations, etc. Candidate resources can be determined based on the interests and needs of the target object. After obtaining the data to be processed, it is encoded according to the steps described above to generate sequence feature encoding data and position feature encoding data corresponding to each candidate resource. This encoding data is used for subsequent model inference and feature fusion. The sequence feature encoding data and position feature encoding data corresponding to each candidate resource are then input into a sequential inference model consisting of multiple expert models and a shared model. The sequential inference model performs feature inference on each candidate resource, generating the corresponding expert model output features and shared model output features. These features are then fused to obtain the target fused features corresponding to each task (i.e., each candidate resource). This fusion process fully considers the complementarity and redundancy between different models and features, aiming to extract more comprehensive and representative feature information. Then, based on these target fused features, click-through rate (CTR) estimates are generated, yielding the target audience's estimated CTR for each candidate resource. This CTR estimate reflects the target audience's potential interest and preference for the candidate resource.
[0177] Optionally, if the target entity is a target resource, the data to be processed is the data to be processed of N candidate objects corresponding to the target resource; the click-through rate estimation based on the target fusion features corresponding to each task to obtain the click-through rate estimation value of the target entity for each candidate entity includes: the click-through rate estimation based on the target fusion features corresponding to each task to obtain the click-through rate estimation value of the target resource for each candidate object.
[0178] For example, when the target entity is a target resource, the data to be processed is the N candidate objects corresponding to the target resource. This means that the current focus is on how to find the most suitable candidate for the target resource, that is, how to effectively recommend the resource to the users or groups most likely to be interested. A target resource typically refers to a specific piece of content, product, service, or other entity that may have potential appeal or value. Candidates, on the other hand, are users, viewers, readers, or any other entities that may be interested in the target resource. After obtaining the data to be processed, it is encoded according to a predetermined procedure to generate sequence feature encoding data and position feature encoding data corresponding to each candidate object. This encoding data is used for subsequent model inference and feature fusion. The sequence feature encoding data and position feature encoding data corresponding to each candidate object are then input into a sequential inference model consisting of multiple expert models and a shared model. The sequential inference model performs feature inference on each candidate object, generating the corresponding expert model output features and shared model output features. Through feature fusion, the target fused features corresponding to each task (i.e., each candidate object) are obtained. This fusion process fully considers the complementarity and redundancy between different models and features to extract more comprehensive and representative feature information. Based on these target fused features, a click-through rate (CTR) estimate is generated, yielding an estimated CTR for each candidate. This CTR estimate reflects the target resource's potential appeal and compatibility with the candidate.
[0179] Step 160 : Determine a recommended entity corresponding to the target entity from the N candidate entities according to the click-through rate estimate, and perform entity recommendation based on the recommended entity.
[0180] Among them, the candidate entities can be sorted according to their estimated click-through rate. Generally, the candidate entities with higher estimated click-through rates are ranked higher. This sorting algorithm can be a simple descending order, or it can be more complexly adjusted according to actual needs, such as sorting based on factors such as the diversity and freshness of the candidate entities. After sorting, a click-through rate threshold may be set, and only candidate entities with estimated click-through rates exceeding the threshold are selected as recommended entities. This can filter out candidate entities with low estimated click-through rates that are unlikely to attract the target entity, thereby improving the accuracy of the recommendation.
[0181] After sorting, you can perform additional filtering operations based on actual needs. For example, you can exclude some candidate entities that do not meet the requirements based on the attributes of the candidate entities, the preferences of the target entity, etc.
[0182] When determining recommended entities, in addition to the click-through rate estimate, the recommended entities can also be personalized based on factors such as the relevance, timeliness, and diversity of the candidate entities.
[0183] Then, based on the results of sorting, filtering, and personalization, the most appropriate recommended entities are selected from the candidate entities. These recommended entities will serve as the content or objects that are ultimately recommended to the target entity.
[0184] Optionally, the method determines a recommended entity corresponding to the target entity from the N candidate entities based on the click-through rate estimate, and performs entity recommendation based on the recommended entity, including: determining the candidate resource whose click-through rate estimate among the N candidate resources is greater than a first click-through rate threshold as the recommended resource corresponding to the target resource; and recommending the recommended resource to the target object.
[0185] For example, when the target entity is a target object, the data to be processed is the data to be processed for the N candidate resources corresponding to the target object. Candidate resources can be any information or content that is potentially valuable to the target object, such as articles, videos, products, advertisements, etc., or content, products, services, or any other form of entity that the target object may be interested in. The click-through rate of the target object is estimated based on the target fusion features corresponding to each task, and the probability of the target object clicking on each candidate resource can be predicted. Then, based on the click-through rate estimate, the resources that are most likely to be clicked by the target object are screened. This is usually achieved by setting a first click-through rate threshold, and only resources whose click-through rate estimate exceeds this first click-through rate threshold will be considered recommended resources. The screened recommended resources will then be recommended to the target object. This can be achieved in various ways, such as displaying a list of recommended resources on the user interface, sending recommendation notifications, etc.
[0186] Optionally, the method determines a recommended entity corresponding to the target entity from the N candidate entities based on the click-through rate estimate, and performs entity recommendation based on the recommended entity, including: determining the candidate object whose click-through rate estimate among the N candidate objects is greater than a second click-through rate threshold as a recommended object; and recommending the target resource to the recommended object.
[0187] For example, when the target entity is a target resource, the data to be processed is the data to be processed of N candidate objects corresponding to the target resource. The candidate object can be any entity that may be interested in the target resource, such as a user, an audience, a reader, etc. Among them, the click rate of the target resource is estimated based on the target fusion feature corresponding to each task, and the click rate estimate of the target resource for each candidate object is obtained. Then, those objects that are most likely to be interested in the target resource are screened out based on the click rate estimate. This can also be achieved by setting a second click rate threshold, and determining the candidate objects with a click rate estimate greater than the second click rate threshold among the N candidate objects as recommended objects. Then, the target resource is recommended to the screened recommended objects. This can be achieved by displaying the resource to the recommended object, sending a recommendation notification, etc.
[0188] The click-through rate threshold is crucial for effective recommendations. If the threshold is set too high, too few resources or objects may be recommended; if it is set too low, too many irrelevant items may be recommended. Therefore, it's important to set the click-through rate threshold appropriately based on actual conditions and business needs.
[0189] Additionally, since user interests and behaviors may change over time, the recommendation system needs to be able to update its models and features in real time to reflect these changes.
[0190] In addition, the recommendation system can also continuously optimize its recommendation effect by collecting user feedback (such as clicks, purchases, ratings, etc.). This feedback can be used to update model parameters, adjust feature weights, or re-rank candidate resources / objects.
[0191] Optional, in the above Figure 2 Based on the corresponding embodiment, in another optional embodiment of the entity recommendation method provided in the embodiment of the present application, as Figure 7 As shown, the steps of training the sequence reasoning model include the following steps S71 to S76:
[0192] S71 , obtaining sample data, where the sample data includes N candidate sample entity sample data corresponding to the target sample entity, where N is an integer greater than 1, and the sample data corresponds to a sample label.
[0193] Optionally, obtaining sample data includes:
[0194] The acquired initial sample data is subjected to data preprocessing to obtain the sample data, wherein the preprocessing includes at least one of data cleaning processing, abnormal data elimination processing and missing data filling processing.
[0195] The specific implementation of step S71 may refer to the specific implementation of step 110 above, and will not be elaborated here.
[0196] S72 , encoding the sample data to generate sample sequence feature encoding data and sample position feature encoding data corresponding to each of the N candidate sample entities, wherein the sample sequence feature encoding data includes the sample sequence feature corresponding to each candidate sample entity at each time sequence.
[0197] Optionally, the encoding processing of the sample data to generate sample sequence feature coding data and sample position feature coding data corresponding to each candidate sample entity in the N candidate sample entities includes: performing static feature coding processing on the sample data of the N candidate sample entities based on time sequence to generate sample static feature coding data corresponding to the N candidate sample entities; performing feature dynamic query processing on the sample static feature coding data to generate sample sequence feature coding data corresponding to each candidate sample entity in the N candidate sample entities, wherein N is an integer greater than or equal to 2; performing sequence position coding on the sample sequence feature coding data corresponding to each candidate sample entity to generate sample position feature coding data corresponding to each candidate sample entity.
[0198] Optionally, the static feature coding processing is performed on the sample data of the N candidate sample entities based on the time sequence to generate sample static feature coding data corresponding to the N candidate sample entities, including: performing static feature coding processing on the sample data of the N candidate sample entities based on the time sequence to obtain the sample sequence features corresponding to each candidate sample entity in each time series; obtaining N initial candidate sample entity codes corresponding to the N candidate sample entities respectively from the N candidate sample entity sample data, and determining the N sample initial time series feature codes corresponding to each initial time series based on the N initial candidate sample entity codes; calculating the sample time series feature code corresponding to each candidate sample entity in each time series based on the sample initial time series feature code of each candidate sample entity, the time sequence corresponding to each time series, and the number of candidate sample entities; generating the sample static feature coding data corresponding to the N candidate sample entities based on the time sequence corresponding to each time series, the N initial candidate sample entity codes, the sample sequence features corresponding to each candidate sample entity in each time series, and the sample time series feature code corresponding to each candidate sample entity in each time series.
[0199] Optionally, the sample static feature coding data is subjected to dynamic feature query processing to generate sample sequence feature coding data corresponding to each candidate sample entity among the N candidate sample entities, including: based on the initial candidate sample entity code of each candidate sample entity, querying the sample time series feature code corresponding to each candidate sample entity at each time series from the sample static feature coding data; based on the sample time series feature code corresponding to each candidate sample entity at each time series and the feature matrix corresponding to the sample static feature coding data, determining the sample sequence feature coding data corresponding to each candidate sample entity.
[0200] Optionally, the performing sequence position encoding on the sample sequence feature coding data corresponding to each candidate sample entity to generate sample position feature coding data corresponding to each candidate sample entity includes: performing sequence position encoding on the sample sequence feature of each position corresponding to the sample time series feature coding in the sample sequence feature coding data corresponding to each candidate sample entity according to the position of the current sample sequence feature in the sample time series feature coding to generate sample position feature coding data corresponding to each candidate sample entity, wherein the sample sequence feature coding data and the sample position feature coding data have the same feature dimension.
[0201] The specific implementation of step S72 may refer to the specific implementation of step 120 above, which will not be elaborated here.
[0202] S73, input the sample sequence feature coding data and the sample position feature coding data into the sequence inference model for feature inference processing, and generate the sample expert model output features and sample sharing model output features corresponding to each task, wherein each task is the click rate estimation task of the target sample entity for each candidate sample entity.
[0203] Optionally, the sample sequence feature coding data and the sample position feature coding data are input into a sequence inference model comprising N expert models and a shared model for feature inference processing to generate sample expert model output features and sample shared model output features corresponding to each task, including: inputting the sample sequence feature coding data and the sample position feature coding data corresponding to each candidate sample entity into the expert model corresponding to each task to generate the sample expert model output features corresponding to each task; inputting the sample sequence feature coding data and the sample position feature coding data corresponding to the N candidate sample entities into the shared model to generate the sample shared model output features corresponding to each task.
[0204] Optionally, each of the expert models has a first temporal reasoning module, which includes a first multi-head self-attention mechanism layer, a first residual and normalization layer, a first forward neural network and a second residual and normalization layer; the sample sequence feature coding data and the sample position feature coding data corresponding to each candidate sample entity are input into the expert model corresponding to each task to generate the output features of the sample expert model corresponding to each task, including: for the expert model corresponding to each task, the sample sequence feature coding data and the sample position feature coding data corresponding to each candidate entity are weighted by the first multi-head self-attention mechanism layer. Recalculate to obtain the sample first attention operation result corresponding to each candidate sample entity; based on the first residual and normalization layer, normalize the sample first attention operation result, the sample sequence feature coding data and the sample position feature coding data corresponding to each candidate sample entity to obtain the sample first normalized result; based on the first forward neural network, perform nonlinear transformation processing on the sample first normalized result to obtain the sample first forward feedback result; based on the second residual and normalization layer, normalize the sample first normalized result and the sample first forward feedback result to generate the sample expert model output feature corresponding to each task.
[0205] Optionally, the shared model has a second temporal reasoning module, which includes a second multi-head self-attention mechanism layer, a third residual and normalization layer, a second forward neural network and a fourth residual and normalization layer;
[0206] The sample sequence feature coding data and the sample position feature coding data corresponding to the N candidate sample entities are input into the shared model to generate the sample shared model output features corresponding to each task, including: for the shared model, performing attention weight calculation on the sample sequence feature coding data and the sample position feature coding data corresponding to the N candidate sample entities through the second multi-head self-attention mechanism layer to obtain the sample second attention operation result corresponding to each candidate sample entity; normalizing the sample second attention operation result, the sample sequence feature coding data and the sample position feature coding data corresponding to the N candidate sample entities based on the third residual and normalization layer to obtain a sample second normalized result; performing nonlinear transformation processing on the sample second normalized result based on the second forward neural network to obtain a sample second forward feedback result; and normalizing the sample second normalized result and the sample second forward feedback result based on the fourth residual and normalization layer to generate the sample shared model output features corresponding to each task.
[0207] The specific implementation of step S73 may refer to the specific implementation of step 130 above, and will not be elaborated here.
[0208] S74, performing feature fusion on the output features of the sample expert model corresponding to each task and the output features of the sample shared model to obtain the sample fusion features corresponding to each task.
[0209] The specific implementation of step S74 may refer to the specific implementation of step 140 above, which will not be elaborated here.
[0210] S75 , performing click-through rate estimation based on the sample fusion features corresponding to each task, and obtaining a sample click-through rate estimation value of the target sample entity for each candidate sample entity.
[0211] Optionally, if the target sample entity is a target sample object, the sample data is the sample data of N candidate sample resources corresponding to the target sample object; the click-through rate estimation is performed based on the sample fusion features corresponding to each task to obtain the sample click-through rate estimation value of the target sample entity for each candidate sample entity, including: the click-through rate estimation is performed based on the sample fusion features corresponding to each task to obtain the sample click-through rate estimation value of the target sample object for each candidate sample resource.
[0212] Optionally, if the target sample entity is a target sample resource, the sample data is the sample data of N candidate sample objects corresponding to the target sample resource; the click-through rate estimation based on the sample fusion features corresponding to each task to obtain the sample click-through rate estimation value of the target sample entity for each candidate sample entity includes: the click-through rate estimation based on the sample fusion features corresponding to each task to obtain the sample click-through rate estimation value of the target sample resource for each candidate object.
[0213] The specific implementation of step S75 may refer to the specific implementation of step 150 above, which will not be elaborated here.
[0214] S76 , calculating an objective function value based on the sample click rate estimate, the sample label, and the number of samples, and updating the model parameters of the sequence reasoning model based on the objective function value.
[0215] Among them, for the multi-task learning process, the sequential reasoning model has multiple objective functions, and the number of objective functions is equal to the number of tasks. For each task, the objective function of the model training is as follows (13):
[0216]
[0217] Where n is the number of samples, y iis the sample label of the i-th candidate sample entity (i.e., the actual value of the sample click rate), p i is the estimated click rate of the sample of the i-th candidate sample entity.
[0218] For example, Figure 2 Taking the two tasks shown as an example, during the training process, expert model 1 inputs the sample sequence feature coding data and sample position feature coding data corresponding to task 1, and the model parameter information of task 1 is trained with the relevant features of task 1 in the training phase; expert model 2 inputs the sample sequence feature coding data and sample position feature coding data corresponding to task 2, and the model parameter information of task 2 is trained with the relevant features of task 2 in the training phase; the shared model inputs the sample sequence feature coding data and sample position feature coding data corresponding to task 1 and task 2, and the shared model parameter information is trained with the relevant features of task 1 and task 2 in the training phase.
[0219] For example, during training, consider two different batches of samples, such as multiple samples corresponding to Task 1 and multiple samples corresponding to Task 2. The sample sequence features selected from these samples are also different. During model training, it is not necessary to input all sample sequence features into the model; only the sample sequence features of specific samples need to be selected. This selection method can use matrix multiplication to implement dynamic feature querying. For example, consider a total of 100 million sample sequence features, with 100 sample sequence features corresponding to Task 1 and 200 sample sequence features corresponding to Task 2. These 100 and 200 sample sequence features are both found from these 100 million samples through dynamic feature querying, and may or may not overlap. All of these sample sequence features are then fed into the model for training.
[0220] For example, during training, you can first train Task 1. After a few steps of training, the model parameters of the shared model will change. Then, you can train Task 2. After a few steps of training, the model parameters of the shared model may also change. Then, you can train Task 1 again. By using the shared model as the link between Expert Model 1 and Expert Model 2, you can repeatedly train the entire sequential reasoning model. You can also set an error threshold, and stop training when the calculated result of the objective function is less than the error threshold.
[0221] The embodiment of the present application designs a sequence reasoning model, which can effectively process various sequence features before and after the entity push, effectively mine the information of the sequence data, and improve the accuracy of the click-through rate estimation. The embodiment of the present application designs a multi-task learning framework based on the sequence reasoning model, which can realize model migration by sharing some parameters of different task models, and can perform click-through rate estimation for multiple tasks at the same time, thereby improving the efficiency of click-through rate estimation. The embodiment of the present application also designs a feature fusion gating unit, which adopts an organic fusion method to efficiently combine the expert model results and the shared model results, so that the expression learned by the model is more comprehensive. The sequence reasoning model of the embodiment of the present application generates expert model output features and shared model output features for each task. These features are dense features and can be used as input features for other business scenarios. Other business scenarios may include ranking, recommendation and other scenarios.
[0222] The entity recommendation method provided in the embodiment of the present application is not limited to advertising click-through rate estimation, but can also be applied to other task target estimations with sequence characteristics, such as advertising conversion rate estimation, film and television click-through rate estimation, product click-through rate estimation, book click-through rate estimation, etc.
[0223] All of the above technical solutions can be combined in any way to form optional embodiments of the present application, and will not be described in detail here.
[0224] The embodiment of the present application obtains data to be processed, which includes N candidate entity data to be processed corresponding to the target entity, wherein N is an integer greater than 1; encodes the data to be processed to generate sequence feature encoding data and position feature encoding data corresponding to each candidate entity in the N candidate entities, wherein the sequence feature encoding data includes sequence features corresponding to each candidate entity in each time series; inputs the sequence feature encoding data and the position feature encoding data into a sequence reasoning model including N expert models and a shared model for feature reasoning processing to generate expert model output features and shared model output features corresponding to each task, wherein each task is a click-through rate prediction task for each candidate entity of the target entity; performs feature fusion on the expert model output features and the shared model output features corresponding to each task to obtain the target fusion features corresponding to each task; performs click-through rate estimation based on the target fusion features corresponding to each task to obtain the target entity click-through rate estimation value for each candidate entity, and determines the recommended entity corresponding to the target entity from the N candidate entities according to the click-through rate estimation value, and performs entity recommendation based on the recommended entity. The embodiment of the present application encodes the data to be processed to generate sequence feature encoding data and position feature encoding data corresponding to each candidate entity, which can effectively extract and utilize sequence features, capture the time series information and position information in the data, and provide rich feature resources for subsequent click-through rate estimation. The sequence reasoning model includes multiple expert models and a shared model. This structure can share models for similar scenarios, thereby reducing the number of models and computational complexity. At the same time, multiple expert models can process different tasks in parallel, improving the model's estimation efficiency. The output features of the expert model corresponding to each task are fused with the output features of the shared model to obtain the target fusion features corresponding to each task. This feature fusion method can fully utilize the advantages of different models to express more comprehensive feature information, thereby improving the accuracy of click-through rate estimation. Click-through rate estimation is performed based on the target fusion features corresponding to each task. Since the target fusion features fuse the output features of the expert model and the shared model, they contain more comprehensive and rich information, making the click-through rate estimation more accurate. The recommended entity selection based on the click-through rate estimation value can improve the accuracy of the recommendation. Due to the improved estimation accuracy, the recommended entities are more in line with the user's interests and needs, thereby improving the recommendation effect.
[0225] In order to better implement the entity recommendation method of the embodiment of the present application, the embodiment of the present application also provides an entity recommendation device. Figure 8 , Figure 8 This is a schematic diagram of the structure of the entity recommendation device provided in an embodiment of the present application. The entity recommendation device 200 may include:
[0226] An acquiring unit 210 is configured to acquire data to be processed, wherein the data to be processed includes N candidate entity data to be processed corresponding to the target entity, where N is an integer greater than 1;
[0227] A first processing unit 220 is configured to perform encoding processing on the data to be processed to generate sequence feature encoding data and position feature encoding data corresponding to each candidate entity in the N candidate entities, wherein the sequence feature encoding data includes sequence features corresponding to each candidate entity in each time sequence;
[0228] A second processing unit 230 is configured to input the sequence feature encoding data and the position feature encoding data into a sequence inference model comprising N expert models and one shared model for feature inference processing, thereby generating expert model output features and shared model output features corresponding to each task, wherein each task is a task of estimating the click rate of the target entity for each candidate entity;
[0229] A fusion unit 240 is configured to fuse the output features of the expert model corresponding to each task with the output features of the shared model to obtain target fusion features corresponding to each task;
[0230] An estimating unit 250 is configured to perform click-through rate estimation based on the target fusion features corresponding to each task, and obtain an estimated click-through rate value of the target entity for each candidate entity;
[0231] The recommendation unit 260 is configured to determine a recommended entity corresponding to the target entity from the N candidate entities according to the estimated click rate, and perform entity recommendation based on the recommended entity.
[0232] Optionally, the second processing unit 230 can be used to: input the sequence feature coding data and the position feature coding data corresponding to each candidate entity into the expert model corresponding to each task, and generate the expert model output features corresponding to each task; input the sequence feature coding data and the position feature coding data corresponding to the N candidate entities into the shared model, and generate the shared model output features corresponding to each task.
[0233] Optionally, each of the expert models has a first temporal reasoning module, which includes a first multi-head self-attention mechanism layer, a first residual and normalization layer, a first forward neural network and a second residual and normalization layer; the second processing unit 230 can be used to: for the expert model corresponding to each task, perform attention weight calculation on the sequence feature encoding data and the position feature encoding data corresponding to each candidate entity through the first multi-head self-attention mechanism layer to obtain the first attention operation result corresponding to each candidate entity; based on the first residual and normalization layer, perform normalization operation on the first attention operation result, the sequence feature encoding data and the position feature encoding data corresponding to each candidate entity to obtain a first normalized result; based on the first forward neural network, perform nonlinear transformation processing on the first normalized result to obtain a first forward feedback result; based on the second residual and normalization layer, perform normalization operation on the first normalized result and the first forward feedback result to generate the expert model output feature corresponding to each task.
[0234] Optionally, the shared model has a second temporal reasoning module, which includes a second multi-head self-attention mechanism layer, a third residual and normalization layer, a second forward neural network and a fourth residual and normalization layer;
[0235] The second processing unit 230 can be used to: for the shared model, perform attention weight calculation on the sequence feature encoding data and the position feature encoding data corresponding to the N candidate entities through the second multi-head self-attention mechanism layer to obtain the second attention operation result corresponding to each candidate entity; based on the third residual and normalization layer, perform normalization operation on the second attention operation result, the sequence feature encoding data and the position feature encoding data corresponding to the N candidate entities to obtain a second normalized result; based on the second forward neural network, perform nonlinear transformation processing on the second normalized result to obtain a second forward feedback result; based on the fourth residual and normalization layer, perform normalization operation on the second normalized result and the second forward feedback result to generate the shared model output feature corresponding to each task.
[0236] Optionally, the first processing unit 220 can be used to: perform static feature coding processing on the N candidate entity to-be-processed data based on time sequence to generate static feature coding data corresponding to the N candidate entities; perform feature dynamic query processing on the static feature coding data to generate sequence feature coding data corresponding to each candidate entity in the N candidate entities, wherein N is an integer greater than or equal to 2; perform sequence position coding on the sequence feature coding data corresponding to each candidate entity to generate position feature coding data corresponding to each candidate entity.
[0237] Optionally, when the first processing unit 220 performs static feature coding processing on the N candidate entity data to be processed based on time sequence to generate static feature coding data corresponding to the N candidate entities, it can be used to: perform static feature coding processing on the N candidate entity data to be processed based on time sequence to obtain the sequence features corresponding to each candidate entity in each time series; obtain N initial candidate entity codes corresponding to the N candidate entities respectively from the N candidate entity data to be processed, and determine the N initial time series feature codes corresponding to each initial time series based on the N initial candidate entity codes; calculate the time series feature code corresponding to each candidate entity in each time series based on the initial time series feature code of each candidate entity, the time sequence corresponding to each time series, and the number of candidate entities; generate static feature coding data corresponding to the N candidate entities based on the time sequence corresponding to each time series, the N initial candidate entity codes, the sequence features corresponding to each candidate entity in each time series, and the time series feature code corresponding to each candidate entity in each time series.
[0238] Optionally, when the first processing unit 220 performs dynamic feature query processing on the static feature coding data to generate sequence feature coding data corresponding to each candidate entity of the N candidate entities, it can be used to: based on the initial candidate entity code of each candidate entity, query the time series feature code corresponding to each candidate entity at each time series from the static feature coding data; based on the time series feature code corresponding to each candidate entity at each time series and the feature matrix corresponding to the static feature coding data, determine the sequence feature coding data corresponding to each candidate entity.
[0239] Optionally, when the first processing unit 220 performs serial position encoding on the serial feature encoding data corresponding to each candidate entity to generate position feature encoding data corresponding to each candidate entity, it can be used to: perform serial position encoding on the serial feature of each position in the serial feature encoding data corresponding to each candidate entity according to the position of the current serial feature in the serial feature encoding data to generate position feature encoding data corresponding to each candidate entity, wherein the serial feature encoding data and the position feature encoding data have the same feature dimension.
[0240] Optionally, if the target entity is a target object, the data to be processed is the N candidate resource data to be processed corresponding to the target object; the estimation unit 250 can be used to: perform click-through rate estimation based on the target fusion features corresponding to each task, and obtain the click-through rate estimation value of the target object for each candidate resource.
[0241] Optionally, the recommendation unit 260 may be configured to: determine, among the N candidate resources, a candidate resource whose estimated click-through rate is greater than a first click-through rate threshold as a recommended resource; and recommend the recommended resource to the target object.
[0242] Optionally, if the target entity is a target resource, the data to be processed is the data to be processed of N candidate objects corresponding to the target resource; the estimation unit 250 can be used to: perform click-through rate estimation based on the target fusion features corresponding to each task, and obtain the click-through rate estimation value of the target resource for each candidate object.
[0243] Optionally, the recommendation unit 260 may be configured to: determine a candidate object whose estimated click rate is greater than a second click rate threshold among the N candidate objects as a recommended object; and recommend the target resource to the recommended object.
[0244] Optionally, the acquisition unit 210 can be used to perform data preprocessing on the acquired initial data to be processed to obtain the data to be processed, wherein the preprocessing includes at least one of data cleaning processing, abnormal data elimination processing and missing data filling processing.
[0245] Optionally, the entity recommendation device 200 further includes a training unit, which is used to: obtain sample data, wherein the sample data includes N candidate sample entity sample data corresponding to the target sample entity, wherein N is an integer greater than 1, and the sample data corresponds to a sample label; encode the sample data to generate sample sequence feature encoding data and sample position feature encoding data corresponding to each candidate sample entity in the N candidate sample entities, wherein the sample sequence feature encoding data includes sample sequence features corresponding to each candidate sample entity in each time sequence; input the sample sequence feature encoding data and the sample position feature encoding data into the sequence inference model for feature inference processing to generate The sample expert model output features and the sample sharing model output features corresponding to each task are synthesized, wherein each task is a click rate estimation task of the target sample entity for each candidate sample entity; the sample expert model output features corresponding to each task are fused with the sample sharing model output features to obtain the sample fusion features corresponding to each task; the click rate is estimated based on the sample fusion features corresponding to each task to obtain the sample click rate estimation value of the target sample entity for each candidate sample entity; the objective function value is calculated based on the sample click rate estimation value, the sample label and the number of samples, and the model parameters of the sequence reasoning model are updated based on the objective function value.
[0246] It should be noted that the functions of each module in the entity recommendation device 200 in the embodiment of the present application may correspond to the specific implementation of any embodiment in the above-mentioned method embodiments, and will not be repeated here.
[0247] Each unit in the above-mentioned apparatus may be implemented in whole or in part by software, hardware, or a combination thereof. Each unit may be embedded in or independent of a processor in a computer device in the form of hardware, or may be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each unit.
[0248] For example, the entity recommendation device 200 may be integrated into a terminal or server that has a storage device and a processor installed therein and has computing capabilities, or the entity recommendation device 200 is the terminal or server.
[0249] Optionally, the present application also provides a computer device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0250] Figure 9 A schematic structural diagram of a computer device provided in an embodiment of the present application, such as Figure 9 As shown, computer device 300 may include: a communication interface 301, a memory 302, a processor 303, and a communication bus 304. Communication interface 301, memory 302, and processor 303 communicate with each other via communication bus 304. Communication interface 301 is used for data communication between device 300 and external devices. Memory 302 may be used to store software programs and modules. Processor 303 executes the software programs and modules stored in memory 302, such as the software programs for the corresponding operations in the aforementioned method embodiments.
[0251] Optionally, the processor 303 can call the software program and module stored in the memory 302 to perform the following operations: obtain the data to be processed, the data to be processed includes N candidate entity data to be processed corresponding to the target entity, wherein N is an integer greater than 1; encode the data to be processed to generate sequence feature encoding data and position feature encoding data corresponding to each candidate entity in the N candidate entities, the sequence feature encoding data includes the sequence features corresponding to each candidate entity in each time series; input the sequence feature encoding data and the position feature encoding data into a sequence reasoning model including N expert models and a shared model. The model performs feature inference processing to generate expert model output features and shared model output features corresponding to each task, wherein each task is a click-through rate estimation task of the target entity for each candidate entity; the expert model output features corresponding to each task are fused with the shared model output features to obtain target fusion features corresponding to each task; click-through rate is estimated based on the target fusion features corresponding to each task to obtain a click-through rate estimation value of the target entity for each candidate entity; a recommended entity corresponding to the target entity is determined from the N candidate entities according to the click-through rate estimation value, and entity recommendation is performed based on the recommended entity.
[0252] Optionally, the computer device 300 may be integrated into a terminal or server that has storage and a processor and has computing capabilities, or the computer device 300 may be the terminal or server. The terminal may be a smartphone, tablet computer, laptop computer, smart TV, smart speaker, wearable smart device, personal computer, or other device. The server may be an independent physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
[0253] This application also provides a computer-readable storage medium for storing a computer program. This computer-readable storage medium can be applied to a computer device, and the computer program causes the computer device to execute the corresponding processes in the above-mentioned methods in the embodiments of this application. For the sake of brevity, it is not further described here.
[0254] This application also provides a computer program product, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the corresponding processes of the above-described methods in the embodiments of this application. For the sake of brevity, these processes are not further described here.
[0255] This application also provides a computer program comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the corresponding processes of the above-described methods in the embodiments of this application. For the sake of brevity, these processes are not further described here.
[0256] It should be understood that the processor of the embodiments of the present application may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method embodiment can be completed by hardware integrated logic circuits in the processor or software instructions. The above processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The various methods, steps, and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of the present application can be directly implemented as a hardware decoding processor, or can be implemented by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium mature in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0257] It is understood that the memory in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DR RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0258] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0259] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0260] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0261] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0262] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0263] In addition, each functional unit in the embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0264] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
[0265] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. An entity recommendation method, characterized in that: The method comprises: Acquire data to be processed, where the data to be processed includes N candidate entity data to be processed corresponding to the target entity, where N is an integer greater than 1; Encoding the data to be processed to generate sequence feature encoding data and position feature encoding data corresponding to each candidate entity in the N candidate entities, wherein the sequence feature encoding data includes sequence features corresponding to each candidate entity in each time sequence; Inputting the sequence feature encoding data and the position feature encoding data into a sequence reasoning model comprising N expert models and a shared model for feature reasoning processing, generating expert model output features and shared model output features corresponding to each task, wherein each task is a click-through rate estimation task for each candidate entity of the target entity; Perform feature fusion on the output features of the expert model corresponding to each task and the output features of the shared model to obtain the target fusion features corresponding to each task; Estimating the click-through rate based on the target fusion features corresponding to each task, and obtaining an estimated click-through rate value of the target entity for each candidate entity; A recommended entity corresponding to the target entity is determined from the N candidate entities according to the click-through rate estimate, and entity recommendation is performed based on the recommended entity.
2. The entity recommendation method according to claim 1, wherein: The step of inputting the sequence feature encoding data and the position feature encoding data into a sequence inference model including N expert models and a shared model for feature inference processing to generate expert model output features and shared model output features corresponding to each task includes: Inputting the sequence feature encoding data and the position feature encoding data corresponding to each candidate entity into the expert model corresponding to each task, to generate the expert model output features corresponding to each task; The sequence feature encoding data and the position feature encoding data corresponding to the N candidate entities are input into the shared model to generate the shared model output features corresponding to each task.
3. The entity recommendation method according to claim 2, wherein: Each of the expert models has a first temporal reasoning module, which includes a first multi-head self-attention mechanism layer, a first residual and normalization layer, a first forward neural network and a second residual and normalization layer; The step of inputting the sequence feature encoding data and the position feature encoding data corresponding to each candidate entity into the expert model corresponding to each task to generate the output features of the expert model corresponding to each task includes: For the expert model corresponding to each task, performing attention weight calculation on the sequence feature encoding data and the position feature encoding data corresponding to each candidate entity through the first multi-head self-attention mechanism layer to obtain a first attention operation result corresponding to each candidate entity; performing a normalization operation on the first attention operation result, the sequence feature encoding data corresponding to each candidate entity, and the position feature encoding data based on the first residual and the normalization layer to obtain a first normalized result; Performing nonlinear transformation processing on the first normalized result based on the first forward neural network to obtain a first forward feedback result; The first normalized result and the first forward feedback result are normalized based on the second residual and the normalization layer to generate the expert model output features corresponding to each task.
4. The entity recommendation method according to claim 2, wherein: The shared model has a second temporal reasoning module, which includes a second multi-head self-attention mechanism layer, a third residual and normalization layer, a second forward neural network and a fourth residual and normalization layer; The step of inputting the sequence feature encoding data and the position feature encoding data corresponding to the N candidate entities into the shared model to generate the shared model output features corresponding to each task includes: For the shared model, performing attention weight calculation on the sequence feature encoding data and the position feature encoding data corresponding to the N candidate entities through the second multi-head self-attention mechanism layer to obtain a second attention operation result corresponding to each candidate entity; performing a normalization operation on the second attention operation result, the sequence feature encoding data corresponding to the N candidate entities, and the position feature encoding data based on the third residual and the normalization layer to obtain a second normalized result; Performing nonlinear transformation processing on the second normalized result based on the second forward neural network to obtain a second forward feedback result; The second normalized result and the second forward feedback result are normalized based on the fourth residual and normalization layer to generate the shared model output features corresponding to each task.
5. The entity recommendation method according to claim 1, wherein: The encoding process of the data to be processed to generate sequence feature encoding data and position feature encoding data corresponding to each candidate entity in the N candidate entities includes: Based on the time sequence, static feature coding processing is performed on the N candidate entity to-be-processed data to generate static feature coding data corresponding to the N candidate entities; Performing dynamic feature query processing on the static feature coding data to generate sequence feature coding data corresponding to each candidate entity in the N candidate entities, wherein N is an integer greater than or equal to 2; Perform sequence position encoding on the sequence feature encoding data corresponding to each candidate entity to generate position feature encoding data corresponding to each candidate entity.
6. The entity recommendation method according to claim 5, wherein: The step of performing static feature coding processing on the N candidate entity to-be-processed data based on the time sequence to generate static feature coding data corresponding to the N candidate entities includes: Based on the time sequence, static feature coding processing is performed on the N candidate entity to-be-processed data to obtain the sequence features corresponding to each candidate entity in each time sequence; Obtaining N initial candidate entity codes corresponding to the N candidate entities respectively from the N candidate entity to-be-processed data, and determining N initial time series feature codes corresponding to each initial time series based on the N initial candidate entity codes; Calculate the time series feature code corresponding to each candidate entity at each time series based on the initial time series feature code of each candidate entity, the time order corresponding to each time series, and the number of candidate entities; Based on the time order corresponding to each time sequence, the N initial candidate entity codes, the sequence features corresponding to each candidate entity in each time sequence and the time sequence feature codes corresponding to each candidate entity in each time sequence, static feature coding data corresponding to the N candidate entities are generated.
7. The entity recommendation method according to claim 6, wherein: The performing dynamic feature query processing on the static feature coding data to generate sequence feature coding data corresponding to each candidate entity in the N candidate entities includes: Based on the initial candidate entity code of each candidate entity, querying the time series feature code corresponding to each candidate entity in each time series from the static feature code data; Based on the time series feature code corresponding to each candidate entity in each time series and the feature matrix corresponding to the static feature code data, the sequence feature code data corresponding to each candidate entity is determined.
8. The entity recommendation method according to claim 5, wherein: The performing sequence position encoding on the sequence feature encoding data corresponding to each candidate entity to generate position feature encoding data corresponding to each candidate entity includes: According to the position of the current sequence feature in the sequence feature encoding data, the sequence feature of each position in the sequence feature encoding data corresponding to each candidate entity is sequence position encoded to generate position feature encoding data corresponding to each candidate entity, wherein the sequence feature encoding data and the position feature encoding data have the same feature dimension.
9. The entity recommendation method according to claim 1, wherein: If the target entity is a target object, the data to be processed is the N candidate resource data to be processed corresponding to the target object; The click-through rate estimation based on the target fusion features corresponding to each task to obtain the click-through rate estimation value of the target entity for each candidate entity includes: The click rate is estimated based on the target fusion features corresponding to each task to obtain an estimated click rate value of the target object for each candidate resource.
10. The entity recommendation method according to claim 9, wherein: Determining a recommended entity corresponding to the target entity from the N candidate entities according to the click-through rate estimate, and performing entity recommendation based on the recommended entity, includes: Determine, among the N candidate resources, a candidate resource whose estimated click-through rate is greater than a first click-through rate threshold as a recommended resource corresponding to the target object; Recommend the recommended resource to the target object.
11. The entity recommendation method according to claim 1, wherein: If the target entity is a target resource, the data to be processed is the N candidate object data to be processed corresponding to the target resource; The click-through rate estimation based on the target fusion features corresponding to each task to obtain the click-through rate estimation value of the target entity for each candidate entity includes: The click rate is estimated based on the target fusion features corresponding to each task to obtain an estimated click rate value of the target resource for each candidate object.
12. The entity recommendation method according to claim 11, wherein: Determining a recommended entity corresponding to the target entity from the N candidate entities according to the click-through rate estimate, and performing entity recommendation based on the recommended entity, includes: Determine, among the N candidate objects, a candidate object whose estimated click-through rate is greater than a second click-through rate threshold as a recommended object corresponding to the target resource; The target resource is recommended to the recommendation object.
13. The entity recommendation method according to claim 1, wherein: The obtaining of data to be processed includes: The acquired initial data to be processed is subjected to data preprocessing to obtain the data to be processed, wherein the preprocessing includes at least one of data cleaning processing, abnormal data elimination processing and missing data filling processing.
14. The entity recommendation method according to claim 1, wherein: The steps of training the sequence reasoning model include: Acquire sample data, the sample data including N candidate sample entity sample data corresponding to the target sample entity, where N is an integer greater than 1, and the sample data corresponds to a sample label; Performing encoding processing on the sample data to generate sample sequence feature encoding data and sample position feature encoding data corresponding to each candidate sample entity in the N candidate sample entities, wherein the sample sequence feature encoding data includes a sample sequence feature corresponding to each candidate sample entity at each time sequence; Inputting the sample sequence feature encoding data and the sample position feature encoding data into the sequence inference model for feature inference processing to generate sample expert model output features and sample sharing model output features corresponding to each task, wherein each task is a click rate estimation task for the target sample entity for each candidate sample entity; Perform feature fusion on the output features of the sample expert model corresponding to each task and the output features of the sample shared model to obtain the sample fusion features corresponding to each task; Estimating the click rate based on the sample fusion features corresponding to each task, and obtaining an estimated click rate of the target sample entity for each candidate sample entity; An objective function value is calculated based on the sample click rate estimate, the sample label, and the number of samples, and model parameters of the sequence reasoning model are updated based on the objective function value.
15. An entity recommendation device, characterized in that: The device comprises: An acquiring unit, configured to acquire data to be processed, wherein the data to be processed includes N candidate entity data to be processed corresponding to the target entity, where N is an integer greater than 1; A first processing unit is configured to perform encoding processing on the data to be processed to generate sequence feature encoding data and position feature encoding data corresponding to each candidate entity in the N candidate entities, wherein the sequence feature encoding data includes sequence features corresponding to each candidate entity in each time sequence; a second processing unit, configured to input the sequence feature encoding data and the position feature encoding data into a sequence inference model comprising N expert models and one shared model for feature inference processing, and generate expert model output features and shared model output features corresponding to each task, wherein each task is a click-through rate estimation task for each candidate entity of the target entity; A fusion unit, configured to fuse the output features of the expert model corresponding to each task with the output features of the shared model to obtain target fusion features corresponding to each task; An estimation unit, configured to estimate the click-through rate based on the target fusion features corresponding to each task, and obtain an estimated click-through rate value of the target entity for each candidate entity; A recommendation unit is configured to determine a recommended entity corresponding to the target entity from the N candidate entities according to the click-through rate estimate, and perform entity recommendation based on the recommended entity.
16. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor to execute the entity recommendation method according to any one of claims 1 to 14.
17. A computer device, characterized in that: The computer device includes a processor and a memory, wherein a computer program is stored in the memory, and the processor is configured to execute the entity recommendation method according to any one of claims 1 to 14 by calling the computer program stored in the memory.
18. A computer program product comprising computer instructions, characterized in that When the computer instructions are executed by a processor, the entity recommendation method according to any one of claims 1 to 14 is implemented.