An item recommendation method and a related device
By extracting shared information between the source and target domains using an independent first model, constructing a new target domain, and processing it using a second model, the problem of poor flexibility in neural network models is solved, and accurate item recommendations are achieved when content changes.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HUAWEI TECH CO LTD
- Filing Date
- 2023-05-30
- Publication Date
- 2026-07-10
Smart Images

Figure CN116881542B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence (AI) technology, and in particular to a method for recommending items and related equipment. Background Technology
[0002] Recommendation systems determine which items a user might be interested in based on information associated with them, and then recommend these items to the user for viewing and use. These systems often utilize neural network models within AI technology to make item recommendations, thereby meeting user needs.
[0003] In related technologies, when recommending items to a user, a source domain (containing information about multiple source domain items) and a target domain (containing information about multiple target domain items) can be input into a neural network model. The neural network model can then extract features from both the source and target domains, fuse these features, and finally output a recommendation result based on the feature fusion. This recommendation result can be used to determine which items can be recommended to the user from among multiple target domain items. Thus, the item recommendation is successfully completed.
[0004] In the above process, a feature fusion module (also known as a shared module) needs to be built in the neural network model. This module is difficult to reuse. Once the content in the source domain or the content in the target domain changes, a new feature fusion module needs to be retrained, which limits the flexible use of the neural network model and results in poor usability of the neural network model. Summary of the Invention
[0005] This application provides a method for recommending items and related equipment, which enables the neural network model used to implement item recommendation to be used flexibly and improves the usability of the neural network model.
[0006] A first aspect of this application provides a method for recommending items, the method comprising:
[0007] When it is necessary to recommend items to users, the source domain and target domain associated with the user can be obtained first. The source domain contains the user's information and the information of N source domain items, and the target domain contains the user's information and the information of M target domain items, where N≥2 and M≥2.
[0008] After obtaining the source domain and target domain, the source domain can be input into the first model to perform a series of processes on it. Therefore, the first model can select K source domain items from the information of N source domain items, where N ≥ K ≥ 1. It should be noted that the selected K source domain items are related to the M target domain items; for example, there is a relationship between the types of the K source domain items and the types of the M target domain items.
[0009] After obtaining the information of K source domain items output by the first model, this information, along with the information of M target domain items contained in the target domain, can be used to form a new target domain. This new target domain is then input into the second model, which performs a series of processes to obtain recommendation results for that target domain. Based on these recommendations, items that can be recommended to the user can be identified from the M target domain items, and these items can then be recommended for the user to view and use.
[0010] As can be seen from the above method, the information of the K source domain items selected by the first model is related to the information of the M target domain items contained in the target domain. Therefore, the information of these K source domain items can be regarded as shared information between the source domain and the target domain. Since the first model for extracting shared information is independent of the second model, even if the content in the source domain or the target domain changes, the first model can still be reused to extract the shared information between the source domain and the target domain, so as to transfer the shared information to the target domain and obtain a new target domain with enhanced performance. Therefore, the second model can obtain accurate item recommendation results based on the new target domain without retraining to obtain a new first model and a new second model. This allows the first and second models to be used flexibly and improves their usability.
[0011] In one possible implementation, processing the source domain using a first model to determine the information of K source domain items from the information of N source domain items includes: evaluating the source domain using the first model to obtain evaluation values for the information of the N source domain items; and selecting the information of K source domain items whose evaluation values satisfy preset conditions from the information of the N source domain items using the first model. In the aforementioned implementation, after obtaining the source domain and the target domain, the source domain can be input into the first model for evaluation, thereby obtaining evaluation values for the information of the N source domain items. After obtaining the evaluation values of the N source domain items, the first model selects the information of K source domain items whose evaluation values satisfy preset conditions from the information of the N source domain items and outputs the information of the K source domain items. In this way, the first model can accurately extract the shared information between the source domain and the target domain.
[0012] In one possible implementation, selecting K source domain items whose evaluation values meet preset conditions from the information of N source domain items using a first model includes: selecting K source domain items whose evaluation values are greater than or equal to preset values from the information of N source domain items using the first model. In the aforementioned implementation, after obtaining the evaluation values of N source domain items, the first model removes NK source domain items whose evaluation values are less than preset values from the information of N source domain items, and selects K source domain items whose evaluation values are greater than or equal to preset values, and outputs the information of these K source domain items as shared information between the source domain and the target domain.
[0013] In one possible implementation, selecting K source domain items whose evaluation values meet preset conditions from the information of N source domain items using a first model includes: selecting the K source domain items with the highest ranking in evaluation values from the information of N source domain items using the first model. In the aforementioned implementation, after obtaining the evaluation values of N source domain items, the first model removes the information of the NK source domain items with the lowest ranking in evaluation values from the information of N source domain items, and selects the information of the K source domain items with the highest ranking in evaluation values (K / N is a preset ratio), and outputs the information of these K source domain items as shared information between the source domain and the target domain.
[0014] In one possible implementation, the evaluation includes at least one of the following: mapping, linear operation, and normalization. In the aforementioned implementation, after obtaining the source domain, the first model can first map the information of the N source domain items contained in the source domain to obtain the first features of the N source domain items. Next, the first model can perform a linear operation on the first features of the N source domain items to obtain the second features of the N source domain items. Then, the first model can normalize the third features of the N source domain items to obtain the third features of the N source domain items, which are the evaluation values of the N source domain items.
[0015] A second aspect of this application provides a model training method, which includes two training phases. First, a first training phase is performed to train a first model, and this phase includes:
[0016] Obtain a first source domain and a first target domain. The first source domain contains information on N source domain items, and the first target domain contains information on M target domain items, where N≥2 and M≥2. Process the first source domain using a first training model to determine information on K source domain items from the information on the N source domain items, where N≥K≥1. Based on the information on the K source domain items and the information on the M target domain items, construct a first new target domain. Process the first new target domain using a second training model to obtain a first recommendation result. Train the second training model based on the first recommendation result to obtain a third model. The first recommendation result is used to determine recommendable items from the M target domain items. Train the first training model based on the second and third training models to obtain the first model.
[0017] After completing the first training phase, the second training phase can be performed. The second training phase is used to train and obtain the second model, and this phase includes:
[0018] Obtain a second source domain and a second target domain. The second source domain contains information on X source domain items, and the second target domain contains information on Y target domain items, where X ≥ 2 and Y ≥ 2. Process the second source domain using a first model to determine information on Z source domain items from the information on the X source domain items, where X ≥ Z ≥ 1. Based on the information on the Z source domain items and the information on the Y target domain items, construct a second new target domain. Process the second new target domain using a second model to be trained to obtain a second recommendation result. Train the second model to be trained based on the second recommendation result to obtain a second model. The second recommendation result is used to determine recommendable items from the Y target domain items.
[0019] The first and second models trained using the above method form a system capable of item recommendation. Specifically, when recommending items to a user, a source domain and a target domain are first obtained. The source domain contains information on N source domain items, and the target domain contains information on M target domain items. Next, the source domain is input into the first model for processing, thereby determining information on K source domain items from the N source domain items. Then, using the information on the K source domain items and the M target domain items, a new target domain is constructed. Subsequently, the new target domain is input into the second model for processing, resulting in a recommendation. In this way, items that can be recommended to the user are determined from the M target domain items based on the recommendation results, and these items are then recommended to the user. In the aforementioned process, the information on the K source domain items selected by the first model from the source domain is related to the information on the M target domain items; therefore, the information on these K source domain items can be considered shared information between the source and target domains. Since the first model for extracting shared information is independent of the second model, even if the content in the source domain or the target domain changes, the first model can still be reused to extract the shared information between the source domain and the target domain. This shared information can then be transferred to the target domain to obtain a new target domain with enhanced performance. Therefore, the second model can obtain accurate item recommendation results based on the new target domain without needing to retrain to obtain a new first model and a new second model. This allows the first and second models to be used flexibly, improving their usability.
[0020] In one possible implementation, training the first model to obtain the first model based on the second and third models includes: processing the first source domain using the second model to obtain a third recommendation result; processing the first source domain using the third model to obtain a fourth recommendation result; processing the third target domain using the second model to obtain a fifth recommendation result; processing the third target domain using the third model to obtain a sixth recommendation result; and training the first model based on the third, fourth, fifth, and sixth recommendation results to obtain the first model. In the aforementioned implementation, after obtaining the third model, the first source domain can be input into both the second and third models respectively, so that the first source domain is processed by the second model to obtain the third recommendation result, and the first source domain is processed by the third model to obtain the fourth recommendation result. Then, the third recommendation result can be calculated to obtain a third loss, and the fourth recommendation result can be calculated to obtain a fourth loss. Simultaneously, after obtaining the third model, the third target domain can be input into both the second and third models. The second model processes the third target domain to obtain the fifth recommendation result, and the third model processes the third target domain to obtain the sixth recommendation result. Next, the fifth recommendation result is calculated to obtain the first performance index, and the sixth recommendation result is calculated to obtain the second performance index. Then, a reward value can be calculated based on the third and fourth losses, the first and second performance indices, and used to train the first model to obtain the first model.
[0021] In one possible implementation, processing the first source domain using a first model to be trained to determine the information of K source domain items from the information of N source domain items contained in the first source domain includes: evaluating the first source domain using a first model to obtain evaluation values of the information of the N source domain items contained in the first source domain; and selecting the information of K source domain items whose evaluation values satisfy preset conditions from the information of the N source domain items using the first model.
[0022] In one possible implementation, selecting K source domain items whose evaluation values satisfy preset conditions from the evaluation values of N source domain items through the first model includes: selecting K source domain items whose evaluation values are greater than or equal to preset values from the information of N source domain items through the first model.
[0023] In one possible implementation, selecting K source domain items whose evaluation values satisfy preset conditions from the evaluation values of N source domain items through the first model includes: selecting the K source domain items whose evaluation values rank highest from the information of N source domain items through the first model.
[0024] In one possible implementation, the evaluation includes at least one of the following: mapping, linear operation, and normalization.
[0025] A third aspect of this application provides an item recommendation device, comprising: an acquisition module for acquiring a source domain and a target domain, wherein the source domain contains information on N source domain items and the target domain contains information on M target domain items, where N≥2 and M≥2; a first processing module for processing the source domain using a first model to determine information on K source domain items from the information on the N source domain items, where N≥K≥1; a construction module for constructing a new target domain based on the information on the K source domain items and the information on the M target domain items; and a second processing module for processing the new target domain using a second model to obtain a recommendation result, wherein the recommendation result is used to determine recommendable items from the M target domain items.
[0026] As can be seen from the above device, when it is necessary to recommend items to a user, a source domain and a target domain can be obtained first. The source domain contains information on N source domain items, and the target domain contains information on M target domain items. Next, the source domain can be input into a first model for processing, thereby determining information on K source domain items from the information on the N source domain items. Then, a new target domain can be constructed using the information on the K source domain items and the information on the M target domain items. Subsequently, the new target domain can be input into a second model for processing, thereby obtaining recommendation results. In this way, items that can be recommended to the user can be determined from the M target domain items based on the recommendation results, and these items can be recommended to the user. In the aforementioned process, the information on the K source domain items selected by the first model from the source domain is related to the information on the M target domain items contained in the target domain; therefore, the information on these K source domain items can be considered as shared information between the source domain and the target domain. Since the first model for extracting shared information is independent of the second model, even if the content in the source domain or the target domain changes, the first model can still be reused to extract the shared information between the source domain and the target domain. This shared information can then be transferred to the target domain to obtain a new target domain with enhanced performance. Therefore, the second model can obtain accurate item recommendation results based on the new target domain without needing to retrain to obtain a new first model and a new second model. This allows the first and second models to be used flexibly, improving their usability.
[0027] In one possible implementation, the first processing module is configured to: evaluate the source domain using a first model to obtain evaluation values for the information of N source domain items contained in the source domain; and select, from the information of the N source domain items, the information of K source domain items whose evaluation values satisfy preset conditions using the first model.
[0028] In one possible implementation, the first processing module is used to: select, from the information of N source domain items, the information of K source domain items whose evaluation value is greater than or equal to a preset value through a first model.
[0029] In one possible implementation, the first processing module is used to: select the information of the top K source domain items in terms of their evaluation values from the information of N source domain items using a first model.
[0030] In one possible implementation, the evaluation includes at least one of the following: mapping, linear operation, and normalization.
[0031] A fourth aspect of this application provides a model training apparatus, comprising: a first acquisition module for acquiring a first source domain and a first target domain, wherein the first source domain contains information on N source domain items and the first target domain contains information on M target domain items, where N≥2 and M≥2; a first processing module for processing the first source domain using a first model to be trained to determine information on K source domain items from the information on the N source domain items contained in the first source domain, where N≥K≥1; a first construction module for constructing a first new target domain based on the information on the K source domain items and the information on the M target domain items contained in the first target domain; a second processing module for processing the first new target domain using a second model to be trained to obtain a first recommendation result, and training the second model to be trained based on the first recommendation result to obtain a third model, wherein the first recommendation result is used to determine recommendable items from the M target domain items; and a third processing module for training the first model to be trained based on the second model to be trained and the third model to obtain the first model.
[0032] Furthermore, the device also includes: a second acquisition module for acquiring a second source domain and a second target domain, wherein the second source domain contains information on X source domain items and the second target domain contains information on Y target domain items, where X ≥ 2 and Y ≥ 2; a fourth processing module for processing the second source domain using a first model to determine information on Z source domain items from the information on the X source domain items contained in the second source domain, where X ≥ Z ≥ 1; a second construction module for constructing a second new target domain based on the information on the Z source domain items and the information on the Y target domain items contained in the second target domain; and a fifth processing module for processing the second new target domain using a second training model to obtain a second recommendation result, and training the second training model based on the second recommendation result to obtain a second model, wherein the second recommendation result is used to determine recommendable items from the Y target domain items.
[0033] The system composed of the first and second models trained by the aforementioned device has an item recommendation function. Specifically, when it is necessary to recommend items to a user, a source domain and a target domain are first obtained. The source domain contains information on N source domain items, and the target domain contains information on M target domain items. Next, the source domain is input into the first model for processing, thereby determining information on K source domain items from the information on the N source domain items. Then, a new target domain is constructed using the information on the K source domain items and the information on the M target domain items. Subsequently, the new target domain is input into the second model for processing, thereby obtaining a recommendation result. In this way, items that can be recommended to the user can be determined from the M target domain items based on the recommendation result, and these items are recommended to the user. In the aforementioned process, the information on the K source domain items selected by the first model from the source domain is related to the information on the M target domain items contained in the target domain; therefore, the information on these K source domain items can be considered as shared information between the source and target domains. Since the first model for extracting shared information is independent of the second model, even if the content in the source domain or the target domain changes, the first model can still be reused to extract the shared information between the source domain and the target domain. This shared information can then be transferred to the target domain to obtain a new target domain with enhanced performance. Therefore, the second model can obtain accurate item recommendation results based on the new target domain without needing to retrain to obtain a new first model and a new second model. This allows the first and second models to be used flexibly, improving their usability.
[0034] In one possible implementation, the third processing module is used to: process the first source domain using the second model to be trained to obtain a third recommendation result; process the first source domain using the third model to obtain a fourth recommendation result; process the third target domain using the second model to be trained to obtain a fifth recommendation result; process the third target domain using the third model to obtain a sixth recommendation result; and train the first model to be trained based on the third, fourth, fifth, and sixth recommendation results to obtain a first model.
[0035] In one possible implementation, the first processing module is configured to: evaluate the first source domain using a first model to obtain evaluation values of information on N source domain items contained in the first source domain; and select information on K source domain items whose evaluation values satisfy preset conditions from the information on the N source domain items using the first model.
[0036] In one possible implementation, a first processing module is used to select information on K source domain items whose evaluation values are greater than or equal to preset values from information on N source domain items using a first model.
[0037] In one possible implementation, the first processing module is used to select the information of the top K source domain items in terms of their evaluation values from the information of N source domain items using a first model.
[0038] In one possible implementation, the evaluation includes at least one of the following: mapping, linear operation, and normalization.
[0039] A third aspect of this application provides an item recommendation device, which includes a memory and a processor; the memory stores code, and the processor is configured to execute the code. When the code is executed, the item recommendation device performs the method described in the first aspect or any possible implementation thereof.
[0040] A fourth aspect of this application provides a model training apparatus, which includes a memory and a processor; the memory stores code, and the processor is configured to execute the code. When the code is executed, the model training apparatus performs the method described in the second aspect or any possible implementation thereof.
[0041] A fifth aspect of this application provides a circuit system including a processing circuit configured to perform the method described in the first aspect, any possible implementation of the first aspect, the second aspect, or any possible implementation of the second aspect.
[0042] A sixth aspect of this application provides a chip system including a processor for calling a computer program or computer instructions stored in a memory, such that the processor performs the method as described in the first aspect, any possible implementation of the first aspect, the second aspect, or any possible implementation of the second aspect.
[0043] In one possible implementation, the processor is coupled to the memory via an interface.
[0044] In one possible implementation, the chip system also includes a memory that stores computer programs or computer instructions.
[0045] A seventh aspect of this application provides a computer storage medium storing a computer program that, when executed by a computer, causes the computer to perform the method as described in the first aspect, any possible implementation of the first aspect, the second aspect, or any possible implementation of the second aspect.
[0046] An eighth aspect of this application provides a computer program product storing instructions that, when executed by a computer, cause the computer to perform the method as described in the first aspect, any possible implementation of the first aspect, the second aspect, or any possible implementation of the second aspect.
[0047] In this embodiment, when it is necessary to recommend items to a user, a source domain and a target domain are first obtained. The source domain contains information on N source domain items, and the target domain contains information on M target domain items. Next, the source domain is input into a first model for processing, thereby determining information on K source domain items from the information on the N source domain items. Then, a new target domain is constructed using the information on the K source domain items and the information on the M target domain items. Subsequently, the new target domain is input into a second model for processing, thereby obtaining recommendation results. In this way, items that can be recommended to the user can be determined from the M target domain items based on the recommendation results, and these items are recommended to the user. In the aforementioned process, the information on the K source domain items selected by the first model from the source domain is related to the information on the M target domain items contained in the target domain; therefore, the information on these K source domain items can be considered as shared information between the source domain and the target domain. Since the first model for extracting shared information is independent of the second model, even if the content in the source domain or the target domain changes, the first model can still be reused to extract the shared information between the source domain and the target domain. This shared information can then be transferred to the target domain to obtain a new target domain with enhanced performance. Therefore, the second model can obtain accurate item recommendation results based on the new target domain without needing to retrain to obtain a new first model and a new second model. This allows the first and second models to be used flexibly, improving their usability. Attached Figure Description
[0048] Figure 1 A structural diagram illustrating the main framework of artificial intelligence;
[0049] Figure 2a A schematic diagram of the structure of the item recommendation system provided in the embodiments of this application;
[0050] Figure 2b Another structural diagram of the item recommendation system provided in the embodiments of this application;
[0051] Figure 2c A schematic diagram of the related equipment recommended for the articles provided in the embodiments of this application;
[0052] Figure 3 A schematic diagram of the system 100 architecture provided in the embodiments of this application;
[0053] Figure 4 A schematic diagram of the structure of the item recommendation system provided in the embodiments of this application;
[0054] Figure 5 A flowchart illustrating the item recommendation method provided in this application embodiment;
[0055] Figure 6a Another structural diagram of the item recommendation system provided in the embodiments of this application;
[0056] Figure 6b A schematic diagram of the controller provided in an embodiment of this application;
[0057] Figure 7 A schematic diagram of the structure of a single-domain recommendation model provided in an embodiment of this application;
[0058] Figure 8 A schematic flowchart of the model training method provided in the embodiments of this application;
[0059] Figure 9 A schematic diagram of the training framework provided in the embodiments of this application;
[0060] Figure 10 A schematic diagram of the structure of the item recommendation method provided in the embodiments of this application;
[0061] Figure 11 A schematic diagram of the structure of the model training apparatus provided in the embodiments of this application;
[0062] Figure 12 A schematic diagram of the structure of the execution device provided in the embodiments of this application;
[0063] Figure 13 A schematic diagram of the structure of the training device provided in the embodiments of this application;
[0064] Figure 14 This is a schematic diagram of the structure of a chip provided in an embodiment of this application. Detailed Implementation
[0065] This application provides a method for recommending items and related equipment, which enables the neural network model used to implement item recommendation to be used flexibly and improves the usability of the neural network model.
[0066] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements, but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.
[0067] Recommendation systems determine which items a user might be interested in based on information associated with them, and then recommend these items to the user for viewing and use. These systems often utilize neural network models within AI technology to make item recommendations, thereby meeting user needs.
[0068] In related technologies, when recommending items to a user, a source domain and a target domain are first obtained. The source domain contains information about multiple source domain items, and the target domain contains information about multiple target domain objects. Next, the source and target domains are input into a neural network model, which can then extract features from the source and target domains respectively. The neural network model then fuses these features to obtain a feature fusion result. Subsequently, the model uses this feature fusion result to obtain and output recommendation results. Finally, the recommendation results are used to determine which items can be recommended to the user from among the multiple target domain items, and these items are then recommended to the user. This completes the item recommendation process successfully.
[0069] In the above process, the feature fusion module (also known as the sharing module) is located in the middle layer (hidden layer) of the neural network model, which makes it difficult to reuse the shared information extracted by this module between the source domain and the target domain. Once the content in the source domain (e.g., the type of items in the source domain) or the content in the target domain (e.g., the type of items in the target domain) changes, a new feature fusion module needs to be retrained, which limits the flexible use of the neural network model and results in poor usability of the neural network model.
[0070] To address the aforementioned problems, this application provides an item recommendation method that can be implemented using artificial intelligence (AI) technology. AI technology is a discipline that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence. AI technology achieves optimal results by perceiving the environment, acquiring knowledge, and using that knowledge. In other words, artificial intelligence is a branch of computer science that attempts to understand the essence of intelligence and produce a new type of intelligent machine that can react in a way similar to human intelligence. Using artificial intelligence for data processing is a common application of AI.
[0071] First, the overall workflow of the artificial intelligence system is described; please refer to [link / reference]. Figure 1 , Figure 1 This is a structural diagram illustrating the main framework of artificial intelligence. The following explanation of the AI framework is based on two dimensions: the "Intelligent Information Chain" (horizontal axis) and the "IT Value Chain" (vertical axis). The "Intelligent Information Chain" reflects a series of processes from data acquisition to processing. For example, it could be the general process of intelligent information perception, intelligent information representation and formation, intelligent reasoning, intelligent decision-making, and intelligent execution and output. In this process, data undergoes a condensation process of "data—information—knowledge—wisdom." The "IT Value Chain" reflects the value that artificial intelligence brings to the information technology industry, from the underlying infrastructure of human intelligence and information (provided and processed by technology) to the industrial ecosystem of the system.
[0072] (1) Infrastructure
[0073] Infrastructure provides computing power to support artificial intelligence systems, enabling communication with the external world and providing support through a basic platform. This communication occurs through sensors; computing power is provided by intelligent chips (hardware acceleration chips such as CPUs, NPUs, GPUs, ASICs, and FPGAs); and the basic platform includes distributed computing frameworks and related platform guarantees and support, which may include cloud storage and computing, interconnected networks, etc. For example, sensors communicate with the outside world to acquire data, and this data is provided to intelligent chips in the distributed computing system provided by the basic platform for computation.
[0074] (2) Data
[0075] The data at the next layer of infrastructure is used to represent the data sources in the field of artificial intelligence. The data involves graphics, images, voice, text, and IoT data from traditional devices, including business data from existing systems and sensor data such as force, displacement, liquid level, temperature, and humidity.
[0076] (3) Data processing
[0077] Data processing typically includes methods such as data training, machine learning, deep learning, search, reasoning, and decision-making.
[0078] Among them, machine learning and deep learning can perform intelligent information modeling, extraction, preprocessing, and training on data, including symbolization and formalization.
[0079] Reasoning refers to the process in which, in a computer or intelligent system, the machine thinks and solves problems by simulating human intelligent reasoning, based on reasoning control strategies and using formalized information. Typical functions include search and matching.
[0080] Decision-making refers to the process of making decisions based on intelligent information after reasoning, and it typically provides functions such as classification, sorting, and prediction.
[0081] (4) General ability
[0082] After the data processing mentioned above, the results of the data processing can be used to form some general capabilities, such as algorithms or a general system, for example, translation, text analysis, computer vision processing, speech recognition, image recognition, etc.
[0083] (5) Smart Products and Industry Applications
[0084] Intelligent products and industry applications refer to products and applications of artificial intelligence systems in various fields. They are the encapsulation of overall artificial intelligence solutions, productizing intelligent information decision-making and realizing practical applications. Their application areas mainly include: intelligent terminals, intelligent transportation, intelligent healthcare, autonomous driving, smart cities, etc.
[0085] The following sections will introduce several application scenarios for this application.
[0086] Figure 2a This is a schematic diagram of the structure of an item recommendation system provided in an embodiment of this application. The item recommendation system includes user equipment and data processing equipment. The user equipment includes smart terminals such as mobile phones, personal computers, or information processing centers. The user equipment is the initiator of item recommendations; as the initiator of item recommendation requests, requests are typically initiated by the user through the user equipment.
[0087] The aforementioned data processing equipment can be devices or servers with data processing capabilities, such as cloud servers, network servers, application servers, and management servers. The data processing equipment receives item recommendation requests from smart terminals through an interactive interface, and then performs item recommendations using machine learning, deep learning, search, reasoning, and decision-making methods through a storage device that stores the data and a data processing processor. The storage device in the data processing equipment can be a general term, including local storage and a database storing historical data. The database can be located on the data processing equipment or on other network servers.
[0088] exist Figure 2a In the illustrated item recommendation system, a user device can receive user instructions. For example, the user device can obtain source and target domains associated with the user and then send a request to a data processing device. This causes the data processing device to perform item recommendation processing on the source and target domains from the user device, thereby obtaining item recommendation results. For instance, the user device can obtain source and target domains associated with the user (the source domain may contain user information and information about multiple source domain items, and the target domain may contain user information and information about multiple target domain objects). The user device can then send an item recommendation request to the data processing device, causing the data processing device to perform a series of processes on the source and target domains based on the item recommendation request, thereby obtaining item recommendation results, i.e., the probability that the user is interested in multiple target domain objects and will click on them.
[0089] exist Figure 2a In this process, the data processing device can execute the item recommendation method of the embodiments of this application.
[0090] Figure 2b This is another structural diagram of the item recommendation system provided in the embodiments of this application. Figure 2b In this context, the user equipment (UE) directly functions as a data processing device. This UE can directly acquire input from the user and process it directly through its own hardware. The specific process is similar to... Figure 2a Similar to the description above, it will not be repeated here.
[0091] exist Figure 2b In the item recommendation system shown, the user device can receive instructions from the user. For example, the user device can obtain the source domain and target domain associated with the user (the source domain can contain the user's information and the information of multiple source domain items, and the target domain can contain the user's information and the information of multiple target domain objects). Then, the user device can perform a series of processing on the source domain and target domain to obtain the item recommendation result, that is, the probability that the user is interested in multiple target domain objects and will click on them.
[0092] exist Figure 2b In this application, the user equipment itself can execute the item recommendation method of the embodiments of this application.
[0093] Figure 2c A schematic diagram of the related equipment recommended for the articles provided in the embodiments of this application.
[0094] The above Figure 2a and Figure 2b The user equipment in the context can specifically be Figure 2c Local device 301 or local device 302 in the system. Figure 2a The data processing equipment in the middle can specifically be Figure 2c The execution device 210 in the process includes a data storage system 250 that can store the data to be processed by the execution device 210. The data storage system 250 can be integrated into the execution device 210 or set up in the cloud or on other network servers.
[0095] Figure 2a and Figure 2b The processor in the system can perform data training / machine learning / deep learning using neural network models or other models (e.g., support vector machine-based models), and use the data to train or learn the model to perform fault prediction applications on images, thereby obtaining the corresponding processing results.
[0096] Figure 3 A schematic diagram of the system 100 architecture provided in this application embodiment, in Figure 3 In the process, the execution device 110 is configured with an input / output (I / O) interface 112 for data interaction with external devices. Users can input data to the I / O interface 112 through the client device 140. The input data in this embodiment may include various scheduled tasks, callable resources, and other parameters.
[0097] During the preprocessing of input data by the execution device 110, or during the calculation module 111 of the execution device 110 performing calculations and other related processing (such as implementing the neural network function in this application), the execution device 110 may call data, code, etc. in the data storage system 150 for corresponding processing, or store the data, instructions, etc. obtained from the corresponding processing into the data storage system 150.
[0098] Finally, I / O interface 112 returns the processing result to client device 140, thereby providing it to the user.
[0099] It is worth noting that the training device 120 can generate corresponding target models / rules based on different training data for different objectives or tasks. These target models / rules can then be used to achieve the aforementioned objectives or complete the aforementioned tasks, thereby providing the user with the required results. The training data can be stored in the database 130 and originates from training samples collected by the data acquisition device 160.
[0100] exist Figure 3In the scenario shown, the user can manually provide input data, which can be done through the interface provided by I / O interface 112. Alternatively, the client device 140 can automatically send input data to I / O interface 112. If user authorization is required for the client device 140 to automatically send input data, the user can set the corresponding permissions in the client device 140. The user can view the output results of the execution device 110 on the client device 140, which can be presented in various forms such as display, sound, or animation. The client device 140 can also act as a data acquisition terminal, collecting the input data and output results of the input I / O interface 112 as new sample data and storing them in the database 130. Alternatively, data can be collected directly from the I / O interface 112 without going through the client device 140, using the input data and output results of the input I / O interface 112 as new sample data and storing them in the database 130.
[0101] It is worth noting that, Figure 3 This is merely a schematic diagram of a system architecture provided in an embodiment of this application. The positional relationships between the devices, components, modules, etc., shown in the diagram do not constitute any limitation. For example, in Figure 3 In this context, the data storage system 150 is an external memory relative to the execution device 110. However, in other cases, the data storage system 150 can also be placed within the execution device 110. For example... Figure 3 As shown, a neural network can be trained using training device 120.
[0102] This application also provides a chip including a neural network processor (NPU). This chip can be configured as follows: Figure 3 The execution device 110 shown is used to perform the calculations of the calculation module 111. This chip can also be located in, for example... Figure 3 The training device 120 shown is used to complete the training work of the training device 120 and output the target model / rules.
[0103] The Neural Processing Unit (NPU) is a coprocessor mounted on the main central processing unit (CPU) (host CPU), where tasks are assigned by the CPU. The core of the NPU is the computation circuitry, which is controlled by a controller to retrieve data from memory (weight memory or input memory) and perform calculations.
[0104] In some implementations, the arithmetic circuitry includes multiple process engines (PEs). In some implementations, the arithmetic circuitry is a two-dimensional pulsating array. The arithmetic circuitry can also be a one-dimensional pulsating array or other electronic circuitry capable of performing mathematical operations such as multiplication and addition. In some implementations, the arithmetic circuitry is a general-purpose matrix processor.
[0105] For example, suppose we have an input matrix A, a weight matrix B, and an output matrix C. The arithmetic circuit retrieves the corresponding data of matrix B from the weight memory and caches it in each PE (Process Equipment) of the arithmetic circuit. The arithmetic circuit retrieves the data of matrix A from the input memory and performs matrix operations with matrix B. The partial or final result of the obtained matrix is stored in the accumulator.
[0106] Vector computation units can further process the output of computational circuits, such as vector multiplication, vector addition, exponentiation, logarithmic operations, size comparisons, etc. For example, vector computation units can be used for computation in non-convolutional / non-FC layers of neural networks, such as pooling, batch normalization, and local response normalization.
[0107] In some implementations, the vector computation unit can store the processed output vector into a unified buffer. For example, the vector computation unit can apply a nonlinear function to the output of the arithmetic circuit, such as a vector of accumulated values, to generate activation values. In some implementations, the vector computation unit generates normalized values, merged values, or both. In some implementations, the processed output vector can be used as activation input to the arithmetic circuit, for example, for use in subsequent layers of a neural network.
[0108] The unified memory is used to store input data and output data.
[0109] The weight data is directly transferred from the external memory to the input memory and / or unified memory, stored in the weight memory, and stored in the unified memory to the external memory through the direct memory access controller (DMAC).
[0110] The bus interface unit (BIU) is used to enable interaction between the main CPU, DMAC, and instruction fetch memory via a bus.
[0111] The instruction fetch buffer, connected to the controller, is used to store the instructions used by the controller.
[0112] The controller is used to invoke instructions cached in the memory to control the operation of the computing accelerator.
[0113] Generally, the unified memory, input memory, weight memory, and instruction fetch memory are all on-chip memories, while external memory is memory outside the NPU. This external memory can be double data rate synchronous dynamic random access memory (DDRSDRAM), high bandwidth memory (HBM), or other readable and writable memories.
[0114] Since the embodiments of this application involve a large number of neural network applications, for ease of understanding, the relevant terms and concepts such as neural networks involved in the embodiments of this application will be introduced below.
[0115] (1) Neural Network
[0116] A neural network can be composed of neural units, which can be operational units that take xs and an intercept of 1 as inputs, and whose output can be:
[0117]
[0118] Where s = 1, 2, ..., n, where n is a natural number greater than 1, Ws is the weight of xs, and b is the bias of the neural unit. f is the activation function of the neural unit, used to introduce nonlinear characteristics into the neural network to convert the input signal in the neural unit into the output signal. The output signal of this activation function can be used as the input of the next convolutional layer. The activation function can be the sigmoid function. A neural network is a network formed by connecting many of the above-mentioned individual neural units together, that is, the output of one neural unit can be the input of another neural unit. The input of each neural unit can be connected to the local receptive field of the previous layer to extract the features of the local receptive field, which can be a region composed of several neural units.
[0119] The work of each layer in a neural network can be described by the mathematical expression y = a(Wx + b). From a physical perspective, the work of each layer in a neural network can be understood as transforming the input space (the set of input vectors) to the output space (i.e., from the row space to the column space of a matrix) through five operations on the input space. These five operations include: 1. Dimensionality increase / decrease; 2. Magnification / scaling; 3. Rotation; 4. Translation; 5. "Bending". Operations 1, 2, and 3 are performed by Wx, operation 4 by +b, and operation 5 by a(). The term "space" is used here because the objects being classified are not individual things, but a class of things, and space refers to the set of all individuals of this class of things. Here, W is the weight vector, and each value in this vector represents the weight value of a neuron in that layer of the neural network. This vector W determines the spatial transformation from the input space to the output space mentioned above; that is, the weights W of each layer control how the space is transformed. The purpose of training a neural network is to ultimately obtain the weight matrix of all layers of the trained neural network (a weight matrix formed by the vectors W of many layers). Therefore, the training process of a neural network is essentially about learning how to control the transformation space, and more specifically, learning the weight matrix.
[0120] Because we want the output of the neural network to be as close as possible to the actual predicted value, we can compare the current network's prediction with the desired target value, and then update the weight vector of each layer of the neural network based on the difference between the two (of course, there is usually an initialization process before the first update, that is, pre-configuring the parameters of each layer in the neural network). For example, if the network's prediction is too high, the weight vector is adjusted to make it predict lower, and this adjustment is continued until the neural network can predict the actual target value. Therefore, it is necessary to predefine "how to compare the difference between the predicted value and the target value," which is the loss function or objective function. These are important equations used to measure the difference between the predicted value and the target value. Taking the loss function as an example, the higher the output value (loss) of the loss function, the greater the difference, so training the neural network becomes the process of minimizing this loss as much as possible.
[0121] (2) Backpropagation algorithm
[0122] Neural networks can employ backpropagation (BP) to correct the parameters of the initial neural network model during training, thereby reducing the reconstruction error loss. Specifically, forward propagation of the input signal to the output generates error loss; this error loss information is then propagated back to update the parameters of the initial neural network model, leading to convergence of the error loss. The backpropagation algorithm is an error-loss-driven backpropagation process aimed at obtaining the optimal parameters of the neural network model, such as the weight matrix.
[0123] (3) Recommender system
[0124] Recommender systems are a technology that uses neural network models to help users find items they are interested in. By collecting users' historical behavior data and learning their behavioral preferences, recommender systems help users discover items (such as goods, services, or content) that they might like. This can increase user satisfaction with websites or applications, boost sales, and increase user activity.
[0125] (4) Single-domain recommendation algorithm
[0126] Recommendation systems based on single-domain recommendation algorithms are designed for specific and relatively fixed scenarios. For example, the "You May Like" section of a music app is a recommendation system developed for long-term active users of the app, and can be considered a single-domain recommendation system. The single-domain recommendation models built within this system can be broadly categorized into three types: content-based filtering models, collaborative filtering models, and hybrid models. Content-based recommendation models infer a user's preference for items based on the similarity between the user's profile and the items to be recommended. Collaborative filtering provides a final recommendation list based on the similarity within users or items, either by identifying items liked by users similar to the current user or items similar to items liked by the current user. Hybrid models integrate content filtering and collaborative filtering into a unified framework.
[0127] (5) Cross-domain recommendation algorithm
[0128] Recommender systems require vast amounts of historical user information to mine user preferences, which is often difficult to achieve in many scenarios, leading to the cold start problem. To address this information acquisition issue, information from other domains can be used to train a model within the same domain, thereby improving recommendation performance. This algorithm is called a cross-domain recommendation algorithm. In this case, the other domain containing more information can be called the source domain, and the domain containing less information can be called the target domain. Since information distribution differs between domains, how to model the commonalities and characteristics between different domains, and how to transfer beneficial information from the source domain to the target domain, is a topic worthy of exploration.
[0129] The method provided in this application is described below from the perspectives of neural network training and neural network application.
[0130] The model training method provided in this application involves the processing of data sequences. Specifically, it can be applied to data training, machine learning, deep learning, and other methods. It performs symbolic and formal intelligent information modeling, extraction, preprocessing, and training on training data (e.g., the first source domain, first target domain, second source domain, and second target domain in this application embodiment), ultimately obtaining a trained neural network (e.g., the first model and second model in this application embodiment). Furthermore, the item recommendation method provided in this application embodiment can utilize the aforementioned trained neural network, inputting input data (e.g., the source domain and target domain in this application embodiment) into the trained neural network to obtain output data (e.g., the recommendation result in this application embodiment). It should be noted that the model training method and item recommendation method provided in this application embodiment are inventions based on the same concept, and can also be understood as two parts of a system, or two stages of an overall process: such as the model training stage and the model application stage.
[0131] The item recommendation method provided in this application can be implemented through an item recommendation system. Figure 4 A schematic diagram of the structure of the item recommendation system provided in the embodiments of this application is shown below. Figure 4 As shown, the item recommendation system includes a first model and a second model. The first model can also be called the controller, and the second model can be called the single-domain recommendation model. To understand the workflow of the item recommendation system, the following section combines... Figure 5 This section introduces the workflow of an item recommendation system. Figure 5 A flowchart illustrating the item recommendation method provided in this application embodiment, such as... Figure 5 As shown, the method includes:
[0132] 501. Obtain the source domain and the target domain. The source domain contains information on N source domain items, and the target domain contains information on M target domain items, where N≥2 and M≥2.
[0133] In this embodiment, when it is necessary to recommend items to a user, the source domain and target domain associated with the user can be obtained first. It should be noted that the source domain contains N source domain samples (N is a positive integer greater than or equal to 2), where the first source domain sample contains user information and information of the first source domain item, the second source domain sample contains user information and information of the second source domain item, ..., the Nth source domain sample contains user information and information of the Nth source domain item. The target domain contains M target domain samples (M is a positive integer greater than or equal to 2), where the first target domain sample contains user information and information of the first target domain item, the second target domain sample contains user information and information of the second target domain item, ..., the Mth target domain sample contains user information and information of the Mth target domain item.
[0134] It is worth noting that among the N source domain items, any two source domain items can be either the same or different. Similarly, among the M target domain items, any two target domain items can be either the same or different.
[0135] For example, such as Figure 6a As shown ( Figure 6a (This is another structural diagram of the item recommendation system provided in an embodiment of this application). Suppose it is necessary to recommend movies that a user is interested in. A source domain S and a target domain T associated with the user can be obtained. S includes a first source domain sample, a second source domain sample, ..., an Nth source domain sample. The first source domain sample consists of user information (e.g., user's name, gender, height, etc.) and information about the first book (e.g., the name, price, type, etc. of the first book). The second source domain sample consists of user information and information about the second book, ..., the Nth source domain sample consists of user information and information about the Nth book. T includes a first target domain sample, a second target domain sample, ..., an Mth target domain sample. The first target domain sample consists of user information and information about the first movie (e.g., the name, type, duration, etc. of the first movie). The second target domain sample consists of user information and information about the second movie, ..., the Mth target domain sample consists of user information and information about the Mth movie.
[0136] In these N books, any two books can be the same book or two different books. Similarly, in these M movies, any two movies can be the same movie or two different movies.
[0137] 502. Process the source domain using the first model to determine the information of K source domain items from the information of N source domain items contained in the source domain, where N≥K≥1.
[0138] After obtaining the source domain and the target domain, the source domain can be input into the first model so that the source domain can be processed by the first model. Therefore, the first model can select the information of K source domain items from the information of N source domain items contained in the source domain (K is a positive integer less than or equal to N and K is a positive integer greater than or equal to 1).
[0139] It is worth noting that the selected K source domain items are related to the M target domain items (for example, there is a relationship between the types of the K source domain items and the types of the M target domain items). Moreover, among the selected K source domain items, any two source domain items are usually different source domain items.
[0140] Specifically, the first model can select information on K source domain items in the following way:
[0141] (1) After obtaining the source domain and the target domain, the source domain can be input into the first model to evaluate the source domain through the first model, thereby obtaining the evaluation value of the information of the N source domain items contained in the source domain.
[0142] The first model can obtain the evaluation values of N source domain items in the following way:
[0143] (1.1) After obtaining the source domain, the first model can first map the information of the N source domain items contained in the source domain to obtain the first features of the N source domain items.
[0144] (1.2) The first model can perform linear operations on the first features of N source domain items to obtain the second features of N source domain items.
[0145] (1.3) The first model can normalize the third features of N source domain items, thereby obtaining the third features of N source domain items, which are the evaluation values of N source domain items.
[0146] Continuing with the example above, after obtaining S and T, T can be input to the controller. The controller can contain a series of embedding layers, linear operation layers, and softmax normalization layers. After receiving S, the N source domain samples contained in S are processed by the embedding, linear operation, and normalization layers in the controller to obtain the evaluation values of the N source domain samples, which are the evaluation values of the N books.
[0147] (2) After obtaining the evaluation values of N source domain items, the first model can select the information of K source domain items whose evaluation values meet the preset conditions from the information of N source domain items.
[0148] The first model can obtain information about K source domain items through the following multiple methods:
[0149] (2.1) After obtaining the evaluation values of N source domain items, the first model selects K source domain items whose evaluation values are greater than or equal to a preset value (the size of the preset value can be set according to actual needs, and is not limited here) from the information of the N source domain items, and discards the information of the remaining NK source domain items. In this way, the first model can obtain and output the information of K source domain items, and the information of these K source domain items is related to the information of M target domain items.
[0150] As in the example above, such as Figure 6b As shown ( Figure 6b (This is a schematic diagram of a controller provided in an embodiment of this application). The controller may include a threshold layer and a selection layer. After receiving the evaluation values of N source domain samples, the threshold layer may set the selection result of NK source domain samples (i.e., NK book information) whose evaluation values are less than a preset evaluation threshold to "not selected" (e.g., ...). Figure 6b The "cross" in the text indicates that the selection result of the K source domain samples (i.e., the information from the K books) whose evaluation value is greater than or equal to the preset evaluation threshold is set to "selected" (e.g., the "cross" in the text indicates that the selection result is set to "selected"). Figure 6b The threshold layer can then send the action results of these N source domain samples to the selection layer. The addition layer can then superimpose the action results of the N source domain samples with the N source domain samples, thereby eliminating NK source domain samples whose evaluation values are less than a preset evaluation threshold, and outputting K source domain samples whose evaluation values are greater than or equal to the preset evaluation threshold—that is, information about K books. These K books are related to M movies; for example, the M movies in the target domain can be action movies, and the K books output by the controller can be martial arts novels. Therefore, among these M movies, action movies with a martial arts theme can be recommended to the user.
[0151] (2.2) After obtaining the evaluation values of N source domain items, the first model selects the information of the top K source domain items from the information of the N source domain items, and removes the information of the remaining NK source domain items, where K / N is equal to a preset ratio (the size of the preset ratio can be set according to actual needs, and is not limited here). In this way, the first model can obtain and output the information of K source domain items, and the information of these K source domain items is related to the information of M target domain items.
[0152] Continuing with the example above, the controller can include a ratio layer and a selection layer. After receiving evaluation values from N source domain samples, the ratio layer can set the selection result of the NK source domain samples with the lowest evaluation values to "not selected" (e.g., ...). Figure 6b The "cross" in the text indicates that the selection results of the top K source domain samples in the evaluation ranking are set as "selected" (e.g., the "cross" in the text indicates that the selection results are set as "selected"). Figure 6b The ratio layer can then send the action results of these N source domain samples to the selection layer. The addition layer can then superimpose the action results of the N source domain samples with the N source domain samples, thereby eliminating the NK source domain samples with the lowest evaluation values and outputting the K source domain samples with the highest evaluation values, which is the information of the K books.
[0153] 503. Based on the information of K source domain items and the information of M target domain items contained in the target domain, construct a new target domain.
[0154] After obtaining the information of the K source domain items output by the first model, this information, along with the information of the M target domain items contained in the target domain, can be used to form a new target domain. It can be understood that the new target domain contains the information of the K source domain items from the original source domain and the information of the M target domain items from the original target domain.
[0155] Continuing with the example above, after obtaining the K source domain samples output by the controller, these K source domain samples and the M target domain samples in T can be combined to construct a new target domain T'. Therefore, T' contains K source domain samples and M target domain samples, which represent information from K books and M movies.
[0156] 504. The new target domain is processed by the second model to obtain the recommendation results. The recommendation results are used to determine the recommended items from the M target domain items.
[0157] After obtaining the new target domain, it can be input into the second model. The second model then processes the new target domain to obtain recommendation results. The recommendation results include the probability that a user is interested in and clicks on items from the M target domains. Therefore, among the M target domain items, the items with the highest probability are identified as items that can be recommended to the user and recommended for viewing and use. At this point, item recommendations have been successfully completed for the user.
[0158] As in the example above, such as Figure 7 As shown ( Figure 7(This is a schematic diagram of the single-domain recommendation model provided in an embodiment of this application). T' is obtained and can be input into the single-domain recommendation model. After a series of processing steps (e.g., feature extraction), the single-domain recommendation model can obtain and output the probability that a user is interested in the first movie (0.26), the probability that a user is interested in the second movie (0.13), ..., and the probability that a user is interested in the Mth movie (0.95). Then, from these M movies, the movies with the highest probabilities can be recommended to the user for viewing.
[0159] Furthermore, the item recommendation system provided in this application embodiment (the system is ITPN in Table 1, and the recommendation model in the system can be DCN, IPNN, OPNN, FNN, and AFM in Table 1) can be compared with the item recommendation system provided by related technologies (the system is CDR in Table 1, and the recommendation model used in the system is CLFM, DTCDR, and CMF). The comparison results are shown in Table 1.
[0160] Table 1
[0161]
[0162] As shown in Table 1, the item recommendation system provided in this application embodiment is superior to the item recommendation system provided by related technologies in all indicators.
[0163] In this embodiment, when it is necessary to recommend items to a user, a source domain and a target domain are first obtained. The source domain contains information on N source domain items, and the target domain contains information on M target domain items. Next, the source domain is input into a first model for processing, thereby determining information on K source domain items from the information on the N source domain items. Then, a new target domain is constructed using the information on the K source domain items and the information on the M target domain items. Subsequently, the new target domain is input into a second model for processing, thereby obtaining recommendation results. In this way, items that can be recommended to the user can be determined from the M target domain items based on the recommendation results, and these items are recommended to the user. In the aforementioned process, the information on the K source domain items selected by the first model from the source domain is related to the information on the M target domain items contained in the target domain; therefore, the information on these K source domain items can be considered as shared information between the source domain and the target domain. Since the first model for extracting shared information is independent of the second model, even if the content in the source domain or the target domain changes, the first model can still be reused to extract the shared information between the source domain and the target domain. This shared information can then be transferred to the target domain to obtain a new target domain with enhanced performance. Therefore, the second model can obtain accurate item recommendation results based on the new target domain without needing to retrain to obtain a new first model and a new second model. This allows the first and second models to be used flexibly, improving their usability.
[0164] The above is a detailed description of the item recommendation method provided in the embodiments of this application. The model training method provided in the embodiments of this application will be introduced below. Figure 8 A schematic flowchart of the model training method provided in the embodiments of this application is shown below. Figure 8 As shown, the method includes:
[0165] 801. Obtain the first source domain and the first target domain. The first source domain contains information on N source domain items, and the first target domain contains information on M target domain items, where N≥2 and M≥2.
[0166] In this embodiment, when model training is required, a training dataset and a validation dataset can be obtained first. The training dataset includes a first training dataset and a second training dataset. The first training dataset is used to train a first model to be trained, and the second training dataset is used to train a second model to be trained.
[0167] When training the first model to be trained, the first training dataset can be divided into multiple batches of training data, and one batch of training data can be obtained from it. This batch of training data includes a first source domain and a first target domain. The first source domain contains information on N source domain items, and the first target domain contains information on M target domain items, where N≥2 and M≥2. It should be noted that for this batch of training data in the first source domain and the first target domain, both the first true recommendation result (i.e., the true probability that a user is interested in and clicks on the M target domain items) and the second true recommendation result (i.e., the true probability that a user is interested in and clicks on the N source domain items) are known.
[0168] In addition, a third target domain can be obtained from the validation dataset. The third target domain contains information on P target domain items (P≥2), and for the third target domain, the third true recommendation result (that is, the true probability that a user is interested in P target domain items and clicks on them) is known.
[0169] 802. The first source domain is processed by the first model to be trained in order to determine the information of K source domain items from the information of N source domain items contained in the first source domain, where N≥K≥1.
[0170] 803. Based on the information of K source domain items and the information of M target domain items contained in the first target domain, construct the first new target domain.
[0171] 804. The first new target domain is processed by the second model to be trained to obtain the first recommendation result. The first recommendation result is used to determine the recommended items from M target domain items.
[0172] After obtaining the first source domain and the first target domain, the first source domain can be input into the first model to be trained (the controller to be trained) so that the source domain can be processed by the first model to be trained. Therefore, the first model can select the information of K source domain items from the information of N source domain items contained in the source domain, where N≥K≥1.
[0173] After obtaining the information of the K source domain items output by the first model to be trained, the information of these K source domain items and the information of the M target domain items contained in the first target domain can be used to form the first new target domain.
[0174] After obtaining the first new target domain, the first new target domain can be input into the second model to be trained (the single-domain recommendation model to be trained) so that the new target domain can be processed by the second model to obtain the first (predicted) recommendation result. The first recommendation result contains the (predicted) probability that the user is interested in M target domain items and clicks on them. Therefore, among the M target domain items, the items with the highest probability can be identified as items that can be recommended to the user.
[0175] In one possible implementation, processing the first source domain using a first model to be trained to determine the information of K source domain items from the information of N source domain items contained in the first source domain includes: evaluating the first source domain using a first model to obtain evaluation values of the information of the N source domain items contained in the first source domain; and selecting the information of K source domain items whose evaluation values satisfy preset conditions from the information of the N source domain items using the first model.
[0176] In one possible implementation, selecting K source domain items whose evaluation values satisfy preset conditions from the evaluation values of N source domain items through the first model includes: selecting K source domain items whose evaluation values are greater than or equal to preset values from the information of N source domain items through the first model.
[0177] In one possible implementation, selecting K source domain items whose evaluation values satisfy preset conditions from the evaluation values of N source domain items through the first model includes: selecting the K source domain items whose evaluation values rank highest from the information of N source domain items through the first model.
[0178] In one possible implementation, the evaluation includes at least one of the following: mapping, linear operation, and normalization.
[0179] For a description of steps 802 to 804, please refer to [link / reference]. Figure 5 The relevant descriptions of steps 502 to 504 in the illustrated embodiment will not be repeated here.
[0180] 805. Based on the first recommendation result, train the second model to be trained to obtain the third model.
[0181] After obtaining the first recommendation result, since the first true recommendation result is known, the first recommendation result and the first true recommendation result are calculated to obtain the first loss. The parameters of the second model to be trained are then updated using the first loss to obtain the third model (a single-domain recommendation model that has been temporarily trained).
[0182] For example, such as Figure 9 As shown ( Figure 9 (This is a schematic diagram of the training framework provided in an embodiment of this application). When it is necessary to train the controller to be trained, the i-th batch of training data B can be obtained from the training dataset used to train the controller. i B i Includes source domain S i (S i Contains N source domain samples (i.e., information from N books) and target domain T i (T iIt contains M target domain samples, i.e., information from M movies.
[0183] Next, S can be... i Input is sent to the controller, and the controller can then access it from the S... i Select K source domain samples (i.e., information from K books) from T, and add these K source domain samples to T. i The new target domain T' is obtained i .
[0184] Then, T` i The input is fed into the single-domain recommendation model RS to be trained, thereby obtaining the predicted probability that the user is interested in M movies. Since the true probability that the user is interested in M movies is known, the loss L(θ) can be calculated using the following formula:
[0185]
[0186] In the above formula, Let y be the predicted probability that a user is interested in the m-th movie (m = 1, ..., M). m Let m be the true probability that a user is interested in the m-th movie.
[0187] Subsequently, L(θ) can be used to update the parameters of RS, thereby obtaining a temporarily completed single-domain recommendation model RS'.
[0188] 806. Based on the second and third models, the first model is trained to obtain the first model.
[0189] After obtaining the third model, the first model can be trained using the second and third models. Figure 5 The first model in the illustrated embodiment (the controller that has completed training).
[0190] Specifically, the first model can be trained in the following way:
[0191] (1) After obtaining the third model, the first source domain can be input into the second training model and the third model respectively, so that the first source domain can be processed by the second training model to obtain the third recommendation result, and the first source domain can be processed by the third model to obtain the fourth recommendation result.
[0192] (2) After obtaining the third recommendation result and the fourth recommendation result, since the second true recommendation result is known, the third recommendation result and the second true recommendation result can be calculated to obtain the third loss, and the fourth recommendation result and the second true recommendation result can be calculated to obtain the fourth loss.
[0193] (3) After obtaining the third model, the third target domain can be input into the second training model and the third model respectively, so that the third target domain can be processed by the second training model to obtain the fifth recommendation result, and the third target domain can be processed by the third model to obtain the sixth recommendation result.
[0194] (4) After obtaining the fifth and sixth recommendation results, since the third true recommendation result is known, the fifth and third true recommendation results can be calculated to obtain the first performance index, and the sixth and third true recommendation results can be calculated to obtain the second performance index.
[0195] (5) Then, the reward value can be calculated based on the third loss, the fourth loss, the first performance index and the second performance index, and the parameters of the first model to be trained can be updated using the reward value to obtain the first model to be trained with updated parameters. Then, the next batch of training data can be obtained from the first training dataset to continue training the first model to be trained with updated parameters using the next batch of training data until the model training conditions are met (e.g., the reward value converges, etc.), thereby obtaining the first model.
[0196] As in the example above, after obtaining RS', the target domain T can be obtained from the validation dataset. val (Contains P target domain samples, i.e., information on P movies, and the true probability that a user is interested in these P movies is known).
[0197] Then, S can be... i Input to RS to obtain the predicted probability that the user is interested in N books. Since the actual probability that the user is interested in N books is known, the loss LOSS can be calculated based on the predicted probability and the actual probability that the user is interested in N books. (The calculation process of LOSS can be referred to the aforementioned formula (2), which will not be repeated here).
[0198] S can also be i Input to RS` to obtain the new predicted probability that the user is interested in N books. Since the true probability that the user is interested in N books is known, the loss LOSS` can be calculated based on the new predicted probability that the user is interested in N books and the true probability that the user is interested in N books. (The calculation process of LOSS` can be referred to the aforementioned formula (2), which will not be repeated here).
[0199] T can be valInput to RS to obtain the predicted probability that the user is interested in movie P. Since the true probability that the user is interested in movie P is known, the performance metric AUC can be obtained by calculating based on the predicted probability and the true probability that the user is interested in movie P.
[0200] T can be val Input to RS` to obtain the new predicted probability that the user is interested in movie P. Since the true probability that the user is interested in movie P is known, the performance metric AUC` can be obtained by calculating based on the new predicted probability and the true probability.
[0201] Therefore, the total reward value R can be calculated using the following formula:
[0202] R n =(AUC′-AUC)*(LOSS) n -LOSS n ′)
[0203]
[0204]
[0205]
[0206] In the above formula, The predicted probability that a user is interested in the nth book (n = 1, ..., N). For the new predicted probability that a user is interested in the nth book, y n Let R be the true probability that a user is interested in the nth book. n Let R be the reward value corresponding to the nth source domain sample (the nth book). n The larger the value, the greater the enhancement effect of the nth source domain sample on the target domain, and vice versa.
[0207] After obtaining R, the parameters of the controller can be updated using a certain algorithm (e.g., the REINFORCE algorithm, etc.) to obtain the updated controller `, and then the i+1th batch of training data B can be used. i+1 Continue training the controller until R converges, and you will get the trained controller.
[0208] 807. Obtain the second source domain and the second target domain. The second source domain contains information on X source domain items, and the second target domain contains information on Y target domain items, where X ≥ 2 and Y ≥ 2.
[0209] After training the first model, training the second model can begin. First, the second training dataset is divided into multiple batches of training data, and one batch is selected from these batches. This batch of training data contains the second source domain and the second target domain. The second source domain contains information on X source domain items, and the second target domain contains information on Y target domain items, where X ≥ 2 and Y ≥ 2. It should be noted that for this batch of training data in the second source and second target domains, the fourth true recommendation result (i.e., the true probability that a user is interested in and clicks on the Y target domain items) is known.
[0210] 808. Process the second source domain using the first model to determine the information of Z source domain items from the information of X source domain items contained in the second source domain, where X ≥ Z ≥ 1.
[0211] 809. Based on the information of Z source domain items and the information of Y target domain items contained in the second target domain, construct a second new target domain.
[0212] 810. The second new target domain is processed by the second model to be trained to obtain the second recommendation result. The second recommendation result is used to determine the recommended items from the Y target domain items.
[0213] After obtaining the second source domain and the second target domain, the second source domain can be input into the second model to be trained (the controller to be trained) so that the source domain can be processed by the second model to be trained. Therefore, the second model can select the information of Z source domain items from the information of X source domain items contained in the source domain, where X≥Z≥1.
[0214] After obtaining the information of the Z source domain items output by the second model to be trained, the information of these Z source domain items and the information of the Y target domain items contained in the second target domain can be used to form a second new target domain.
[0215] After obtaining the second new target domain, it can be input into the second model to be trained (the single-domain recommendation model to be trained) so that the new target domain can be processed by the second model to obtain the second (predicted) recommendation result. The second recommendation result contains the (predicted) probability that the user is interested in Y target domain items and clicks on them. Therefore, among the Y target domain items, the items with the highest probability can be identified as items that can be recommended to the user.
[0216] In one possible implementation, processing the second source domain using a second model to determine the information of Z source domain items from the information of X source domain items contained in the second source domain includes: evaluating the second source domain using the second model to obtain evaluation values of the information of X source domain items contained in the second source domain; and selecting the information of Z source domain items whose evaluation values satisfy preset conditions from the information of X source domain items using the second model.
[0217] In one possible implementation, selecting Z source domain items whose evaluation values satisfy preset conditions from the evaluation values of X source domain items through the second model includes: selecting Z source domain items whose evaluation values are greater than or equal to preset values from the information of X source domain items through the second model.
[0218] In one possible implementation, selecting Z source domain items whose evaluation values satisfy preset conditions from the evaluation values of X source domain items through the second model includes: selecting the Z source domain items whose evaluation values rank highest from the information of X source domain items through the second model.
[0219] In one possible implementation, the evaluation includes at least one of the following: mapping, linear operation, and normalization.
[0220] For a description of steps 808 to 810, please refer to [link / reference]. Figure 8 The relevant descriptions of steps 802 to 804 in the illustrated embodiment will not be repeated here.
[0221] 811. Based on the second recommendation result, train the second model to be trained to obtain the second model.
[0222] After obtaining the second recommendation result, since the true fourth recommendation result is known, the second recommendation result and the true fourth recommendation result can be calculated to obtain the second loss. This second loss is then used to update the parameters of the second training model, resulting in the updated second training model. Next, the next batch of training data is obtained from the second training dataset to continue training the updated second training model until the model training conditions are met (e.g., the second loss converges, etc.). Figure 5 The second model in the illustrated embodiment.
[0223] The system formed by the first and second models trained in this embodiment has an item recommendation function. Specifically, when it is necessary to recommend items to a user, a source domain and a target domain are first obtained. The source domain contains information on N source domain items, and the target domain contains information on M target domain items. Next, the source domain is input into the first model for processing, thereby determining the information on K source domain items from the information on the N source domain items. Then, a new target domain is constructed using the information on the K source domain items and the information on the M target domain items. Subsequently, the new target domain is input into the second model for processing, thereby obtaining a recommendation result. In this way, items that can be recommended to the user can be determined from the M target domain items based on the recommendation result, and these items are recommended to the user. In the aforementioned process, the information on the K source domain items selected by the first model from the source domain is related to the information on the M target domain items contained in the target domain; therefore, the information on these K source domain items can be regarded as shared information between the source domain and the target domain. Since the first model for extracting shared information is independent of the second model, even if the content in the source domain or the target domain changes, the first model can still be reused to extract the shared information between the source domain and the target domain. This shared information can then be transferred to the target domain to obtain a new target domain with enhanced performance. Therefore, the second model can obtain accurate item recommendation results based on the new target domain without needing to retrain to obtain a new first model and a new second model. This allows the first and second models to be used flexibly, improving their usability.
[0224] The above is a detailed description of the item recommendation method and model training method provided in the embodiments of this application. The following will introduce the item recommendation device and model training device provided in the embodiments of this application. Figure 10 A schematic diagram of the structure of the item recommendation method provided in the embodiments of this application is shown below. Figure 10 As shown, the device includes:
[0225] The acquisition module 1001 is used to acquire the source domain and the target domain. The source domain contains information on N source domain items, and the target domain contains information on M target domain items, where N≥2 and M≥2.
[0226] The first processing module 1002 is used to process the source domain through the first model to determine the information of K source domain items from the information of N source domain items contained in the source domain, where N≥K≥1;
[0227] Module 1003 is used to construct a new target domain based on the information of K source domain items and the information of M target domain items contained in the target domain;
[0228] The second processing module 1004 is used to process the new target domain through the second model to obtain recommendation results. The recommendation results are used to determine the recommendable items from M target domain items.
[0229] In this embodiment, when it is necessary to recommend items to a user, a source domain and a target domain are first obtained. The source domain contains information on N source domain items, and the target domain contains information on M target domain items. Next, the source domain is input into a first model for processing, thereby determining information on K source domain items from the information on the N source domain items. Then, a new target domain is constructed using the information on the K source domain items and the information on the M target domain items. Subsequently, the new target domain is input into a second model for processing, thereby obtaining recommendation results. In this way, items that can be recommended to the user can be determined from the M target domain items based on the recommendation results, and these items are recommended to the user. In the aforementioned process, the information on the K source domain items selected by the first model from the source domain is related to the information on the M target domain items contained in the target domain; therefore, the information on these K source domain items can be considered as shared information between the source domain and the target domain. Since the first model for extracting shared information is independent of the second model, even if the content in the source domain or the target domain changes, the first model can still be reused to extract the shared information between the source domain and the target domain. This shared information can then be transferred to the target domain to obtain a new target domain with enhanced performance. Therefore, the second model can obtain accurate item recommendation results based on the new target domain without needing to retrain to obtain a new first model and a new second model. This allows the first and second models to be used flexibly, improving their usability.
[0230] In one possible implementation, the first processing module 1002 is used to: evaluate the source domain using a first model to obtain evaluation values of information on N source domain items contained in the source domain; and select information on K source domain items whose evaluation values satisfy preset conditions from the information on the N source domain items using the first model.
[0231] In one possible implementation, the first processing module 1002 is used to: select, from the information of N source domain items, the information of K source domain items whose evaluation value is greater than or equal to a preset value through a first model.
[0232] In one possible implementation, the first processing module 1002 is used to: select the information of the top K source domain items in terms of evaluation value from the information of N source domain items using a first model.
[0233] In one possible implementation, the evaluation includes at least one of the following: mapping, linear operation, and normalization.
[0234] Figure 11 A schematic diagram of the model training apparatus provided in the embodiments of this application is shown below. Figure 11 As shown, the device includes:
[0235] The first acquisition module 1101 is used to acquire a first source domain and a first target domain. The first source domain contains information on N source domain items, and the first target domain contains information on M target domain items, where N≥2 and M≥2.
[0236] The first processing module 1102 is used to process the first source domain through the first model to be trained, so as to determine the information of K source domain items from the information of N source domain items contained in the first source domain, where N≥K≥1;
[0237] The first construction module 1103 is used to construct a first new target domain based on the information of K source domain items and the information of M target domain items contained in the first target domain;
[0238] The second processing module 1104 is used to process the first new target domain through the second model to be trained to obtain the first recommendation result, and to train the second model to be trained based on the first recommendation result to obtain the third model. The first recommendation result is used to determine the recommendable items from M target domain items.
[0239] The third processing module 1105 is used to train the first model to be trained based on the second model to be trained and the third model to obtain the first model.
[0240] Furthermore, the device also includes:
[0241] The second acquisition module is used to acquire the second source domain and the second target domain. The second source domain contains information on X source domain items, and the second target domain contains information on Y target domain items, where X≥2 and Y≥2.
[0242] The fourth processing module is used to process the second source domain through the first model to determine the information of Z source domain items from the information of X source domain items contained in the second source domain, where X≥Z≥1;
[0243] The second construction module is used to construct a second new target domain based on the information of Z source domain items and the information of Y target domain items contained in the second target domain;
[0244] The fifth processing module is used to process the second new target domain through the second training model to obtain the second recommendation result, and to train the second training model based on the second recommendation result to obtain the second model. The second recommendation result is used to determine the recommendable items from the Y target domain items.
[0245] The system formed by the first and second models trained in this embodiment has an item recommendation function. Specifically, when it is necessary to recommend items to a user, a source domain and a target domain are first obtained. The source domain contains information on N source domain items, and the target domain contains information on M target domain items. Next, the source domain is input into the first model for processing, thereby determining the information on K source domain items from the information on the N source domain items. Then, a new target domain is constructed using the information on the K source domain items and the information on the M target domain items. Subsequently, the new target domain is input into the second model for processing, thereby obtaining a recommendation result. In this way, items that can be recommended to the user can be determined from the M target domain items based on the recommendation result, and these items are recommended to the user. In the aforementioned process, the information on the K source domain items selected by the first model from the source domain is related to the information on the M target domain items contained in the target domain; therefore, the information on these K source domain items can be regarded as shared information between the source domain and the target domain. Since the first model for extracting shared information is independent of the second model, even if the content in the source domain or the target domain changes, the first model can still be reused to extract the shared information between the source domain and the target domain. This shared information can then be transferred to the target domain to obtain a new target domain with enhanced performance. Therefore, the second model can obtain accurate item recommendation results based on the new target domain without needing to retrain to obtain a new first model and a new second model. This allows the first and second models to be used flexibly, improving their usability.
[0246] In one possible implementation, the third processing module 1105 is used to: process the first source domain using the second model to be trained to obtain a third recommendation result; process the first source domain using the third model to obtain a fourth recommendation result; process the third target domain using the second model to be trained to obtain a fifth recommendation result; process the third target domain using the third model to obtain a sixth recommendation result; and train the first model to be trained based on the third recommendation result, the fourth recommendation result, the fifth recommendation result, and the sixth recommendation result to obtain a first model.
[0247] In one possible implementation, the first processing module 1102 is configured to: evaluate the first source domain using a first model to obtain evaluation values of information of N source domain items contained in the first source domain; and select information of K source domain items whose evaluation values satisfy preset conditions from the information of the N source domain items using the first model.
[0248] In one possible implementation, the first processing module 1102 is used to select information on K source domain items whose evaluation values are greater than or equal to preset values from information on N source domain items using a first model.
[0249] In one possible implementation, the first processing module 1102 is used to select the information of the top K source domain items in terms of evaluation value from the information of N source domain items using a first model.
[0250] In one possible implementation, the evaluation includes at least one of the following: mapping, linear operation, and normalization.
[0251] It should be noted that the information interaction and execution process between the modules / units of the above-mentioned device are based on the same concept as the method embodiment of this application, and the resulting technical effects are the same as those of the method embodiment of this application. For details, please refer to the description in the method embodiment shown above in the embodiment of this application, and it will not be repeated here.
[0252] This application also relates to an execution device. Figure 12 This is a schematic diagram of the execution device provided in an embodiment of this application. Figure 12 As shown, the execution device 1200 can specifically be a mobile phone, tablet, laptop, smart wearable device, server, etc., and is not limited here. Among them, the execution device 1200 can be deployed with... Figure 10 The item recommendation device described in the corresponding embodiment is used to implement Figure 5 The corresponding embodiment describes the item recommendation function. Specifically, the execution device 1200 includes: a receiver 1201, a transmitter 1202, a processor 1203, and a memory 1204 (wherein the execution device 1200 may have one or more processors 1203). Figure 12 (Taking a processor as an example), the processor 1203 may include an application processor 12031 and a communication processor 12032. In some embodiments of this application, the receiver 1201, transmitter 1202, processor 1203, and memory 1204 may be connected via a bus or other means.
[0253] Memory 1204 may include read-only memory and random access memory, and provides instructions and data to processor 1203. A portion of memory 1204 may also include non-volatile random access memory (NVRAM). Memory 1204 stores processor and operation instructions, executable modules, or data structures, or subsets thereof, or extended sets thereof, wherein the operation instructions may include various operation instructions for implementing various operations.
[0254] Processor 1203 controls the operation of the execution device. In specific applications, the various components of the execution device are coupled together through a bus system, which may include not only the data bus, but also power buses, control buses, and status signal buses. However, for clarity, all buses in the diagram are referred to as the bus system.
[0255] The methods disclosed in the embodiments of this application can be applied to or implemented by the processor 1203. The processor 1203 can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 1203 or by instructions in software form. The processor 1203 can be a general-purpose processor, a digital signal processor (DSP), a microprocessor, or a microcontroller, and may further include 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 processor 1203 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 1204. Processor 1203 reads the information in memory 1204 and, in conjunction with its hardware, completes the steps of the above method.
[0256] Receiver 1201 can be used to receive input digital or character information, and to generate signal inputs related to the settings and function control of the execution device. Transmitter 1202 can be used to output digital or character information through the first interface; transmitter 1202 can also be used to send instructions to the disk group through the first interface to modify the data in the disk group; transmitter 1202 may also include a display device such as a display screen.
[0257] In one embodiment of this application, the processor 1203 is used to... Figure 5 Based on the first and second models in the corresponding embodiments, items that can be recommended to users are determined.
[0258] This application also relates to a training device. Figure 13 This is a schematic diagram of the structure of a training device provided in an embodiment of this application. Figure 13 As shown, the training device 1300 is implemented by one or more servers. The training device 1300 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 1313 (e.g., one or more processors) and memory 1332, and one or more storage media 1330 (e.g., one or more mass storage devices) for storing application programs 1342 or data 1344. The memory 1332 and storage media 1330 can be temporary or persistent storage. The program stored in the storage media 1330 may include one or more modules (not shown in the figure), each module may include a series of instruction operations on the training device. Furthermore, the CPU 1313 may be configured to communicate with the storage media 1330 and execute the series of instruction operations in the storage media 1330 on the training device 1300.
[0259] The training device 1300 may also include one or more power supplies 1326, one or more wired or wireless network interfaces 1350, one or more input / output interfaces 1358; or, one or more operating systems 1341, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.
[0260] Specifically, the training equipment can perform Figure 8 The model training method in the corresponding embodiment is used to obtain a first model and a second model, which can constitute an item recommendation system.
[0261] This application also relates to a computer storage medium storing a program for signal processing, which, when run on a computer, causes the computer to perform steps as performed by the aforementioned execution device, or causes the computer to perform steps as performed by the aforementioned training device.
[0262] This application also relates to a computer program product that stores instructions that, when executed by a computer, cause the computer to perform steps as performed by the aforementioned execution device, or to perform steps as performed by the aforementioned training device.
[0263] The execution device, training device, or terminal device provided in this application embodiment can specifically be a chip. The chip includes a processing unit and a communication unit. The processing unit can be, for example, a processor, and the communication unit can be, for example, an input / output interface, pins, or circuits. The processing unit can execute computer execution instructions stored in the storage unit to cause the chip within the execution device to execute the data processing method described in the above embodiments, or to cause the chip within the training device to execute the data processing method described in the above embodiments. Optionally, the storage unit can be a storage unit within the chip, such as a register or cache. Alternatively, the storage unit can be a storage unit located outside the chip within the wireless access device, such as a read-only memory (ROM) or other types of static storage devices capable of storing static information and instructions, such as random access memory (RAM).
[0264] For details, please refer to Figure 14 , Figure 14 This is a schematic diagram of the chip provided in an embodiment of this application. The chip can be represented as a neural network processor (NPU) 1400. The NPU 1400 is mounted as a coprocessor on the host CPU, and tasks are assigned by the host CPU. The core part of the NPU is the arithmetic circuit 1403, which is controlled by the controller 1404 to extract matrix data from the memory and perform multiplication operations.
[0265] In some implementations, the arithmetic circuit 1403 internally includes multiple processing engines (PEs). In some implementations, the arithmetic circuit 1403 is a two-dimensional pulsating array. The arithmetic circuit 1403 can also be a one-dimensional pulsating array or other electronic circuitry capable of performing mathematical operations such as multiplication and addition. In some implementations, the arithmetic circuit 1403 is a general-purpose matrix processor.
[0266] For example, suppose we have an input matrix A, a weight matrix B, and an output matrix C. The arithmetic circuit retrieves the corresponding data of matrix B from the weight memory 1402 and caches it in each PE of the arithmetic circuit. The arithmetic circuit retrieves the data of matrix A from the input memory 1401 and performs matrix operations with matrix B. The partial result or the final result of the obtained matrix is stored in the accumulator 1408.
[0267] Unified memory 1406 is used to store input and output data. Weight data is directly transferred to weight memory 1402 via Direct Memory Access Controller (DMAC) 1405. Input data is also transferred to unified memory 1406 via DMAC.
[0268] BIU stands for Bus Interface Unit, which is used for interaction between the AXI bus and the DMAC and the Instruction Fetch Buffer (IFB) 1409.
[0269] The Bus Interface Unit (BIU) 1413 is used by the instruction fetch memory 1409 to fetch instructions from external memory, and also by the memory access controller 1405 to fetch the original data of the input matrix A or the weight matrix B from external memory.
[0270] The DMAC is mainly used to move input data from external memory DDR to unified memory 1406, or to weight data to weight memory 1402, or to input data to input memory 1401.
[0271] The vector computation unit 1407 includes multiple processing units that further process the output of the computation circuit 1403 when necessary, such as vector multiplication, vector addition, exponential operations, logarithmic operations, size comparisons, etc. It is mainly used for computation in non-convolutional / fully connected layers of neural networks, such as Batch Normalization, pixel-level summation, and upsampling of the predicted label plane.
[0272] In some implementations, the vector computation unit 1407 can store the processed output vector in the unified memory 1406. For example, the vector computation unit 1407 can apply a linear function, or a nonlinear function, to the output of the computation circuit 1403, such as linearly interpolating the predicted label plane extracted from the convolutional layer, or, for example, accumulating a vector of values to generate activation values. In some implementations, the vector computation unit 1407 generates normalized values, pixel-level summed values, or both. In some implementations, the processed output vector can be used as activation input to the computation circuit 1403, for example, for use in subsequent layers of the neural network.
[0273] The instruction fetch buffer 1409 connected to the controller 1404 is used to store the instructions used by the controller 1404;
[0274] Unified memory 1406, input memory 1401, weighted memory 1402, and instruction fetch memory 1409 are all on-chip memories. External memory is proprietary to this NPU hardware architecture.
[0275] The processor mentioned above can be a general-purpose central processing unit, a microprocessor, an ASIC, or one or more integrated circuits used to control the execution of the above program.
[0276] It should also be noted that the device embodiments described above are merely illustrative. 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 the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.
[0277] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0278] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.
[0279] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).
Claims
1. A model training method, characterized in that, The method includes: Obtain a first source domain and a first target domain. The first source domain contains information on N source domain items, and the first target domain contains information on M target domain items, where N≥2 and M≥2. The first source domain is processed by the first model to be trained, so as to determine the information of K source domain items from the information of N source domain items contained in the first source domain, where N≥K≥1; Based on the information of the K source domain items and the information of the M target domain items contained in the first target domain, a first new target domain is constructed; The first new target domain is processed by the second training model to obtain the first recommendation result, and the second training model is trained based on the first recommendation result to obtain the third model. The first recommendation result is used to determine the recommendable items from the M target domain items. Based on the second model to be trained and the third model, the first model to be trained is trained to obtain the first model; The method further includes: Obtain a second source domain and a second target domain. The second source domain contains information on X source domain items, and the second target domain contains information on Y target domain items, where X ≥ 2 and Y ≥ 2. The second source domain is processed by the first model to determine the information of Z source domain items from the information of X source domain items contained in the second source domain, where X≥Z≥1; Based on the information of the Z source domain items and the information of the Y target domain items contained in the second target domain, a second new target domain is constructed; The second new target domain is processed by the second training model to obtain a second recommendation result, and the second training model is trained based on the second recommendation result to obtain a second model. The second recommendation result is used to determine recommendable items from the Y target domain items.
2. The method according to claim 1, characterized in that, The step of training the first model based on the second model to be trained and the third model to obtain the first model includes: The first source domain is processed by the second model to be trained to obtain a third recommendation result; The first source domain is processed by the third model to obtain the fourth recommendation result; The third target domain is processed by the second model to be trained to obtain the fifth recommendation result; The third target domain is processed by the third model to obtain the sixth recommendation result; Based on the third recommendation result, the fourth recommendation result, the fifth recommendation result, and the sixth recommendation result, the first model to be trained is trained to obtain the first model.
3. The method according to claim 2, characterized in that, The step of processing the first source domain using a first model to be trained to determine the information of K source domain items from the information of N source domain items contained in the first source domain includes: The first source domain is evaluated using the first model to obtain the evaluation values of the information of N source domain items contained in the first source domain; The first model selects K source domain items whose evaluation values meet preset conditions from the information of the N source domain items.
4. The method according to claim 3, characterized in that, The step of selecting K source domain items whose evaluation values satisfy preset conditions from the evaluation values of the N source domain items through the first model includes: The first model selects information on K source domain items whose evaluation values are greater than or equal to preset values from the information of the N source domain items.
5. The method according to claim 3, characterized in that, The step of selecting K source domain items whose evaluation values satisfy preset conditions from the evaluation values of the N source domain items through the first model includes: The first model selects the information of the K source domain items with the highest evaluation values from the information of the N source domain items.
6. The method according to any one of claims 3 to 5, characterized in that, The evaluation includes at least one of the following: mapping, linear operation, and normalization.
7. A method for recommending items, characterized in that, The first model and the second model in the method are obtained based on the model training method according to any one of claims 1 to 6, and the method includes: Obtain the source domain and the target domain, wherein the source domain contains information on N source domain items and the target domain contains information on M target domain items, where N≥2 and M≥2; The source domain is processed by the first model to determine the information of K source domain items from the information of N source domain items contained in the source domain, where N≥K≥1; Based on the information of the K source domain items and the information of the M target domain items contained in the target domain, a new target domain is constructed; The new target domain is processed by the second model to obtain a recommendation result, which is used to determine the recommendable items from the M target domain items. The step of processing the source domain using the first model to determine the information of K source domain items from the information of N source domain items includes: The source domain is evaluated using the first model to obtain the evaluation values of the information of N source domain items contained in the source domain; The first model selects K source domain items whose evaluation values meet preset conditions from the information of the N source domain items.
8. The method according to claim 7, characterized in that, The step of selecting K source domain items whose evaluation values meet preset conditions from the information of the N source domain items through the first model includes: The first model selects information on K source domain items whose evaluation values are greater than or equal to preset values from the information of the N source domain items.
9. The method according to claim 7, characterized in that, The step of selecting K source domain items whose evaluation values meet preset conditions from the information of the N source domain items through the first model includes: The first model selects the information of the K source domain items with the highest evaluation values from the information of the N source domain items.
10. The method according to any one of claims 7 to 9, characterized in that, The evaluation includes at least one of the following: mapping, linear operation, and normalization.
11. A model training device, characterized in that, The device includes: The first acquisition module is used to acquire a first source domain and a first target domain. The first source domain contains information on N source domain items, and the first target domain contains information on M target domain items, where N≥2 and M≥2. The first processing module is used to process the first source domain through the first model to be trained, so as to determine the information of K source domain items from the information of N source domain items contained in the first source domain, where N≥K≥1; The first construction module is used to construct a first new target domain based on the information of the K source domain items and the information of the M target domain items contained in the first target domain; The second processing module is used to process the first new target domain through the second model to be trained to obtain a first recommendation result, and to train the second model to be trained based on the first recommendation result to obtain a third model. The first recommendation result is used to determine the recommendable items from the M target domain items. The third processing module is used to train the first model to be trained based on the second model to be trained and the third model to obtain the first model; The device further includes: The second acquisition module is used to acquire a second source domain and a second target domain. The second source domain contains information on X source domain items, and the second target domain contains information on Y target domain items, where X≥2 and Y≥2. The fourth processing module is used to process the second source domain through the first model to determine the information of Z source domain items from the information of X source domain items contained in the second source domain, where X≥Z≥1; The second construction module is used to construct a second new target domain based on the information of the Z source domain items and the information of the Y target domain items contained in the second target domain; The fifth processing module is used to process the second new target domain through the second training model to obtain a second recommendation result, and to train the second training model based on the second recommendation result to obtain a second model. The second recommendation result is used to determine recommendable items from the Y target domain items.
12. An item recommendation device, characterized in that, The first model and the second model in the device are obtained based on the model training device of claim 11, the device comprising: The acquisition module is used to acquire a source domain and a target domain. The source domain contains information on N source domain items, and the target domain contains information on M target domain items, where N≥2 and M≥2. The first processing module is used to process the source domain through the first model to determine the information of K source domain items from the information of N source domain items contained in the source domain, where N≥K≥1; A construction module is used to construct a new target domain based on the information of the K source domain items and the information of the M target domain items contained in the target domain; The second processing module is used to process the new target domain through the second model to obtain a recommendation result, which is used to determine the recommendable items from the M target domain items; The first processing module is used for: The source domain is evaluated using the first model to obtain the evaluation values of the information of N source domain items contained in the source domain; The first model selects K source domain items whose evaluation values meet preset conditions from the information of the N source domain items.
13. An image processing apparatus, characterized in that, The device includes a memory and a processor; the memory stores code, and the processor is configured to execute the code, wherein when the code is executed, the image processing device performs the method as described in any one of claims 1 to 10.
14. A computer storage medium, characterized in that, The computer storage medium stores one or more instructions that, when executed by one or more computers, cause the one or more computers to perform the method of any one of claims 1 to 10.
15. A computer program product, characterized in that, The computer program product stores instructions that, when executed by a computer, cause the computer to perform the method described in any one of claims 1 to 10.