Data processing method and method for training a predictive model - Patents.com
By categorizing targets based on classification attributes and training separate predictive models for each subset, the method enhances the accuracy of variable prediction across different categories.
Patent Information
- Application Number
- JP2022581432
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2022-01-25
- Filing Date
- 2022-07-26
- Publication Date
- 2024-08-15
- Estimated Expiration
- 2042-07-26
AI Technical Summary
Existing methods for training predictive models struggle to accurately predict variables with different categories due to inconsistencies in classification attributes, leading to inadequate discrimination of object characteristics.
The method involves determining a target category based on classification attributes and using separate predictive models trained on distinct sample subsets to process prediction features, ensuring the prediction result and classification attribute are of the same type, thereby enhancing accuracy.
This approach allows for better discrimination of object characteristics in different categories by using tailored predictive models, resulting in more accurate prediction results.
Smart Images

Figure 0007535139000011 
Figure 0007535139000013 
Figure 0007535139000010
Abstract
Description
[Technical field]
[0001] This application claims priority to Chinese patent application No. 202210088356.X, filed on January 25, 2022, the entire contents of which are incorporated herein by reference. The present disclosure relates to the field of computer technology, in particular to artificial intelligence technology, and in particular to a method, apparatus, electronic device, computer-readable storage medium and computer program product for data processing and training a predictive model. [Background technology]
[0002] Artificial intelligence is a field that studies how computers can imitate some of the human thought processes and intelligent behaviors (e.g., learning, reasoning, thinking, planning, etc.), and includes both hardware and software technologies. AI hardware technologies generally include sensors, AI-dedicated chips, cloud computing, distributed storage, big data processing, etc., while AI software technologies mainly include computer vision technology, voice recognition technology, natural language processing technology, machine learning / deep learning, big data processing technology, knowledge graph technology, and other major directions.
[0003] Prediction tasks play an important role in various artificial intelligence application scenarios. For example, in the context of video recommendation, predicting the time a user will spend viewing a recommended video resource plays an important role in the video recommendation results.
[0004] The approaches described in this section are not necessarily approaches that have been previously contemplated or adopted. Unless otherwise noted, any approach described in this section should not be considered prior art by its inclusion in this section alone. Similarly, unless otherwise noted, any problem addressed in this section should not be considered an admission of prior art. Summary of the Invention
[0005] The present disclosure provides methods, apparatus, electronic devices, computer-readable storage media and computer program products for processing data and training predictive models. According to one aspect of the present disclosure, there is provided a data processing method including: determining an object to be processed; determining a target category to which the object to be processed belongs based on a classification attribute of the object to be processed; determining a prediction model to be used for the object to be processed based on the target category; and obtaining a prediction result for the object to be processed by processing at least one prediction feature of the object to be processed using the prediction model, wherein the prediction result and the classification attribute are variables of the same type.
[0006] According to another aspect of the present disclosure, there is provided a method for training a predictive model, comprising: determining a sample set including a plurality of sample objects; determining a first sample subset and a second sample subset in the sample set based on classification attributes of the sample objects; training a first predictive model using a first sample object in the first sample subset; and training a second predictive model using a second sample object in the second sample subset, wherein the first predictive model and the second predictive model are used to obtain a prediction result of a processed object by processing at least one predictive feature of the processed object, and the prediction result and the classification attribute are homogeneous variables.
[0007] According to another aspect of the present disclosure, there is provided a data processing apparatus including: a processed object determination unit configured to determine a processed object; a target category determination unit configured to determine a target category to which the processed object belongs based on a classification attribute of the processed object; a prediction model determination unit configured to determine a prediction model to be used for the processed object based on the target category; and a prediction unit configured to obtain a prediction result for the processed object by processing at least one prediction feature of the processed object using the prediction model, wherein the prediction result and the classification attribute are variables of the same type.
[0008] According to another aspect of the present disclosure, there is provided an apparatus for training a predictive model, the apparatus including: a sample determination unit configured to determine a sample set including a plurality of sample objects; a classification unit configured to determine a first sample subset and a second sample subset in the sample set based on classification attributes of the sample objects; a first predictive model training unit configured to train a first predictive model using a first sample object in the first sample subset; and a second predictive model training unit configured to train a second predictive model using a second sample object in the second sample subset, where the first predictive model and the second predictive model are used to obtain a prediction result of a processed object by processing at least one predictive feature of the processed object, where the prediction result and the classification attribute are homogeneous variables.
[0009] According to another aspect of the present disclosure, there is provided an electronic device including at least one processor and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to cause the at least one processor to perform the method described above.
[0010] According to another aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to perform the method described above. According to another aspect of the present disclosure there is provided a computer program product comprising a computer program which, when executed by a processor, implements the method described above.
[0011] According to one or more embodiments of the present disclosure, for a single-variable prediction problem, the object category to which the processed object belongs can be determined based on the value of a classification attribute, which is a variable of the same type as the single variable to be predicted, and a prediction result can be obtained based on a prediction model trained for objects belonging to the object category. Using the above method, predictions can be made using prediction models trained for predicting variables in different intervals, thereby better identifying the characteristics of the processed objects in different categories.
[0012] It should be understood that the contents described in this section are not intended to identify key or important features of the embodiments of the present disclosure, and are not intended to limit the scope of protection of the present disclosure. Other features of the present disclosure will be readily understood from the following description. [Brief description of the drawings]
[0013] The drawings illustratively illustrate the examples, constitute a part of the specification, and together with the written description serve to explain exemplary embodiments of the examples. The illustrated examples are for illustrative purposes only and are not intended to limit the scope of the claims. In all the drawings, the same reference numerals refer to similar, but not necessarily identical, elements. [Figure 1] FIG. 1 is a schematic diagram illustrating an example system capable of implementing various methods described herein, according to embodiments of the present disclosure. [Diagram 2] 4 is an exemplary flowchart illustrating a data processing method according to an embodiment of the present disclosure. [Diagram 3]1 is an exemplary flowchart illustrating a method for training a predictive model according to an embodiment of the present disclosure. [Figure 4A] FIG. 13 is an exemplary diagram illustrating a regression loss calculated by a loss function according to an embodiment of the present disclosure. [Figure 4B] FIG. 13 is an exemplary diagram illustrating the gradient of a loss function according to an embodiment of the present disclosure. [Diagram 5] FIG. 2 is an example diagram illustrating a multi-tasking training frame according to an embodiment of the present disclosure. [Figure 6] 1 is an exemplary block diagram illustrating a data processing apparatus according to an embodiment of the present disclosure. [Figure 7] FIG. 1 is an exemplary block diagram illustrating an apparatus for training a predictive model according to an embodiment of the present disclosure. [Figure 8] FIG. 1 is a block diagram illustrating an example electronic device that can be used to implement embodiments of the present disclosure. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0014] Hereinafter, exemplary embodiments of the present disclosure will be described in conjunction with the drawings, and various details in the embodiments of the present disclosure contained therein are to be considered as merely illustrative, in order to facilitate understanding. Therefore, it should be recognized that those skilled in the art can make various changes and modifications to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, the following description omits descriptions of known functions and structures.
[0015] In this application, unless otherwise specified, the terms "first," "second," and the like, used to describe various elements are not intended to limit the location, timing, or importance of these elements. Such terms are used only to distinguish one element from another. In some instances, a first element and a second element may refer to the same instance of an element, or in some cases, may refer to different instances based on the contextual description.
[0016] The terms used in the description of various examples of the present disclosure are intended only to describe particular examples and are not intended to be limiting. Unless otherwise clearly indicated by the context, an element may be one or more, unless specifically limited in number. It should be noted that the term "and / or" as used in the present disclosure covers any and all possible combinations of the listed items.
[0017] Hereinafter, embodiments of the present disclosure will be described in detail with reference to the drawings. 1 illustrates a schematic diagram of an example system 100 in which various methods and apparatus described herein may be implemented, according to embodiments of the present disclosure. With reference to FIG. 1, the system 100 includes one or more client devices 101, 102, 103, 104, 105, and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. The client devices 101, 102, 103, 104, 105, and 106 may be configured to execute one or more applications.
[0018] In an embodiment of the present disclosure, the server 120 operates to perform one or more services or software applications of methods according to an embodiment of the present disclosure. In some embodiments, server 120 may also provide other services or software applications, which may include non-virtualized and virtualized environments. In some embodiments, these services may be provided as web-based or cloud services, for example, provided to users of client devices 101, 102, 103, 104, 105, and / or 106 in a Software-as-a-Service (SaaS) model.
[0019] In the configuration shown in FIG. 1, the server 120 may include one or more assemblies that implement the functions performed by the server 120. These assemblies may include software assemblies, hardware assemblies, or a combination thereof that may be executed on one or more processors. Users operating the client devices 101, 102, 103, 104, 105, and / or 106 may interact with the server 120 using one or more client applications to utilize the services provided by these assemblies. It should be understood that a variety of different system configurations are possible and may differ from the system 100. Thus, FIG. 1 is an example of a system for implementing various methods described herein and is not intended to be limiting.
[0020] A user may use client devices 101, 102, 103, 104, 105 and / or 106 to obtain user input and provide the user with processing results obtained by a method according to an embodiment of the present disclosure. The client devices may provide an interface through which a user of the client device may interact with the client device. The client devices may also output information to the user through the interface. Although only six client devices are shown in FIG. 1, one skilled in the art will appreciate that the present disclosure may support any number of client devices.
[0021] The client devices 101, 102, 103, 104, 105, and / or 106 may include various types of computing devices, such as portable handheld devices, general purpose computers (e.g., personal computers or laptops), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, gaming systems, thin clients, various messaging devices, sensors, or other sensing devices. These computing devices may run various types and versions of software applications and operating systems, such as MICROSOFT Windows, APPLE iOS, UNIX-like operating systems, Linux or Linux-like operating systems (e.g., GOOGLE Chrome OS), and may include various mobile operating systems, such as MICROSOFT Windows Mobile OS, iOS, Windows Phone, Android, and the like. Portable handheld devices may include mobile phones, intelligent phones, tablets, personal digital assistants (PDAs), and the like. Wearable devices may include head-mounted displays (e.g., smart glasses) and other devices. Gaming systems may include various handheld gaming devices, Internet-enabled gaming devices, and the like. The client devices may run a variety of applications, such as Internet-related applications, communication applications (eg, email applications), Short Message Service (SMS) applications, and may use a variety of communication protocols.
[0022] Network 110 may be any type of network known to those skilled in the art that may use any one of a number of available protocols to support data communications, including, but not limited to, TCP / IP, SNA, IPX, etc. By way of example, one or more networks 110 may be a local area network (LAN), an Ethernet-based network, a token loop, a wide area network (WAN), the Internet, a virtual network, a virtual private network (VPN), an intranet, an extranet, a public switched telephone network (PSTN), an infrared network, a wireless network (e.g., Bluetooth, WIFI), and / or any combination of these and other networks.
[0023] Server 120 may include one or more general purpose computers, dedicated server computers (e.g., PC (personal computer) servers, UNIX servers, mid-range servers), blade servers, mainframes, server clusters, or any other suitable arrangement and / or combination. Server 120 may include one or more virtual machines running a virtual operating system, or other computing architecture involving virtualization (e.g., one or more flexible pools of virtualized logical storage devices to maintain the server's virtual storage). In various embodiments, server 120 may execute one or more services or software applications that provide the functionality described below.
[0024] The computing units in server 120 may run one or more operating systems, including any of the operating systems listed above and any commercially available server operating system. Server 120 may also run any one of a variety of additional server applications and / or mid-tier applications, such as an HTTP server, an FTP server, a CGI server, a JAVA server, a database server, etc.
[0025] In some embodiments, server 120 may include one or more applications for analyzing and consolidating data feeds and / or event updates received from users of client devices 101, 102, 103, 104, 105, and / or 106. Server 120 may include one or more applications for displaying data feeds and / or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105, and / or 106.
[0026] In some embodiments, the server 120 may be a server of a distributed system or a server incorporating blockchain. The server 120 may be a cloud server, or an intelligent cloud computing server or an intelligent cloud host equipped with artificial intelligence technology. The cloud server is a host product in a cloud computing service system, which solves the defects of traditional physical hosts and virtual private server (VPS) services, such as high management difficulty and low business scalability.
[0027] System 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data or other information. For example, one or more of databases 130 may be used to store information such as audio files or video files. Databases 130 may be located in a variety of locations. For example, a database used by server 120 may be local to server 120 or may be remote from server 120 and in communication with server 120 over a network or dedicated connection. Databases 130 may be of a variety of types. In some embodiments, a database used by server 120 may be a relational database. One or more of these databases may store, update, and retrieve data from the database and from the database in response to instructions.
[0028] In some embodiments, one or more of databases 130 may be used by an application to store data for the application. The databases used by the application may be various types of databases, such as a key-value repository, an object repository, a general-purpose repository supported by a file system, etc.
[0029] The system 100 of FIG. 1 can be configured and operated in a variety of ways to accommodate the application of the various methods and apparatus described in accordance with this disclosure. 2 is an exemplary flow chart illustrating a data processing method according to an embodiment of the present disclosure. A client device or a server such as that shown in FIG. 1 may be utilized to perform the method 200 as shown in FIG.
[0030] As shown in FIG. 2, in step S202, an object to be processed is determined. In step S204, a target category to which the object to be processed belongs is determined based on the classification attribute of the object to be processed.
[0031] In step S206, a prediction model to be used for the processed object is determined based on the object category. In step S208, a prediction result of the object is obtained by processing at least one prediction feature of the object using the prediction model, where the prediction result and the classification attribute are homogeneous variables.
[0032] In one or more embodiments of the present disclosure, the method for a single-variable prediction problem can determine an object category to which the processed object belongs based on the value of a classification attribute, which is a variable of the same type as the single variable to be predicted, and obtain a prediction result based on a prediction model trained for objects belonging to the object category. Using the above method, predictions can be made using prediction models trained for predicting variables in different intervals, thereby better identifying the characteristics of processed objects in different categories.
[0033] The data processing method provided by the present disclosure is described in detail below. In step S202, an object to be processed can be determined. In step S204, the object category to which the processed object belongs can be determined based on the classification attribute of the processed object.
[0034] In some embodiments, the object to be processed may be a video, and the classification attribute may be the video length. By processing the video using the method provided by the present disclosure, a predicted time for a user to watch the video may be obtained as a prediction result. Here, the predicted time may indicate the time for the user to watch the video when the video is recommended to the user. In another embodiment, the object to be processed may be weather history data, and the classification attribute may be one of the weather parameters (e.g., temperature, humidity, wind, precipitation, etc.) included in the weather history data. By processing the weather history data using the method provided by the present disclosure, a prediction result may be obtained that indicates a weather forecast. The prediction result may indicate a prediction result of the weather parameter. In another embodiment, the method provided by the embodiment of the present disclosure may realize any other type of single variable continuous value prediction task.
[0035] The following describes the principle of the present disclosure using an example in which the object to be processed is a moving image. In some embodiments, step S204 may include determining a video length interval to which the video belongs based on the video length of the video, and determining an indicator of the determined video length interval as the target category to which the video belongs.
[0036] For the video resources included in the video platform, the number of video resources is 1000, and the longest video length is 100 seconds, for example, the video resources can be classified according to the number of video resources with different video lengths. For example, the number of video length intervals to be classified is 2, for example, the 1000 video resources can be arranged according to the video lengths, and the interval of the video length to which the first half of the video belongs is determined as the first video category, and the interval of the video length to which the second half of the video belongs is determined as the second video category. For example, the first video category may include video resources in an interval with a video length of 0 to 45 seconds, and the second video category may include video resources in an interval with a video length of 46 to 100 seconds. In a similar manner, the video resources in the platform can be divided into two or more categories.
[0037] In some examples, when there is a large difference in the video section length obtained by average classification according to the quantity distribution, the result of video classification can be adjusted by various methods. For example, taking two video categories obtained by classification such that the longest video length is 100 seconds as an example, if the length of the video resources included in the first video category is in the range of 0 to 10 seconds, but the length of the video resources included in the second video category is in the range of 11 to 100 seconds, the result of video classification can be adjusted. For example, the difference in the length range of the video resources corresponding to the two video categories can be limited to 50 seconds or less. The result of video classification may be adjusted based on such a restriction, but the number of video resources included in the two video categories may not be limited to be similar (or approximately the same).
[0038] In step S206, a prediction model to be used for the processed object may be determined based on the object category. For example, the object category includes a first object category (e.g., a first video category) and a second object category (e.g., a second video category). In response to determining that the object category is the first object category, a first prediction model may be determined to be used for the processed object, and in response to determining that the object category is the second object category, a second prediction model may be determined to be used for the processed object. Here, the first prediction model may be a prediction model obtained by training using video resources belonging to the first video category, and the second prediction model may be a prediction model obtained by training using video resources belonging to the second video category. In such a manner, different prediction models may be trained to identify different characteristics possessed by objects in different object categories (e.g., different characteristics of long videos and short videos), so that different processed objects belonging to different object categories obtain more accurate prediction results.
[0039] In some examples, the first predictive model and the second predictive model may be similar models with different parameters, such as polynomials, neural networks, or any other applicable mathematical models.
[0040] In step S208, a prediction result of the object is obtained by processing at least one prediction feature of the object using the prediction model, where the prediction result and the classification attribute are homogeneous variables.
[0041] Here, the variable value of the prediction result and the variable value of the classification attribute have the same variable unit. Take the prediction of video viewing time as an example, the classification attribute is video time, the prediction result is video viewing time, and the units of the classification attribute and the variable of the prediction result are both time units. With such a method, it is easy to classify single-variable continuous value prediction problems and predict variables of different categories.
[0042] In some embodiments, step S208 may include obtaining a normalized prediction result for the object by processing at least one prediction feature of the object using the prediction model, and obtaining a prediction result by processing the normalized prediction result using a normalization parameter used for the object category.
[0043] For example, the processed object is video and the classification attribute is video length, for videos in different length intervals, a normalization process can be performed on the actual results of the viewing time of each sample video by users when training the model, so that the prediction effect of the model is not affected by the duration itself when training the model. That is, when training videos in different length intervals, the normalized prediction results are all used to obtain model parameters, so that the model can learn the viewing characteristics of users of videos in different length intervals.
[0044] In some embodiments, the normalization parameter corresponding to a target category may be an interval parameter of a classification variable corresponding to the target category. For example, the classification variable is video length, and the interval parameter may be the maximum value (i.e., the rightmost endpoint) of the interval of video length corresponding to the video category. This allows the actual results of the user's viewing time of sample videos in the video category to be normalized between 0 and 1. In other examples, the interval parameter may be determined as any other value in the interval of video length corresponding to the video category. In such a case, the actual results after normalization may be greater than 1. For example, when the rightmost endpoint of the interval corresponding to the classification variable includes an infinite term, the value of any one of the midpoints in the interval may be selected as the normalization parameter.
[0045] The prediction model obtained by training in such a manner outputs a normalized prediction result of the target object. The prediction result can be obtained by performing inverse processing on the normalized prediction result output from the prediction model using the normalization parameter of the target category corresponding to the prediction model. For example, for a video target in a section with a video length of 0 to 45 seconds, the normalization parameter may be 45. During training, the actual result of the user's viewing time of the sample video is normalized by dividing it by 45. The prediction model obtained by training in such a manner outputs a normalized prediction result, for example, 0.4, when processing the target video. The actual prediction result can be obtained by multiplying the normalized prediction result by 45 again, i.e., 45 x 0.4 = 18 seconds. When the normalization parameter is set to another value, the actual prediction result may be obtained by performing inverse processing on the normalized prediction result in a similar manner.
[0046] 3 is an exemplary flowchart illustrating a method for training a predictive model according to an embodiment of the present disclosure. A predictive model can be trained and used in method 200 according to the method illustrated in FIG. 3. A client device or a server such as that illustrated in FIG. 1 can be used to execute method 300 as illustrated in FIG.
[0047] As shown in FIG. 3, in step S302, a sample set including a plurality of sample subjects is determined. In step S304, a first sample subset and a second sample subset in the sample set are determined based on the classification attributes of the sample objects.
[0048] In step S306, a first prediction model is trained using the first sample object in the first sample subset. In step S308, a second predictive model is trained using second sample objects in the second sample subset.
[0049] Here, the first prediction model and the second prediction model are used to obtain a prediction result of the object to be processed by processing at least one prediction feature of the object to be processed, where the prediction result and the classification attribute are homogeneous variables.
[0050] The training method provided by the embodiments of the present disclosure may be used to train different prediction models for different objects with different classification attributes, thereby providing more accurate prediction results for objects with different characteristics.
[0051] The method for training the predictive model provided by the present disclosure is described in detail below. The predictive model according to the present disclosure can be realized by utilizing polynomials, neural networks, or any other form of mathematical model.
[0052] In step S302, a sample set including a plurality of sample subjects can be determined. It should be noted that the sample subjects in this embodiment are derived from a public dataset.
[0053] In step S304, a first sample subset and a second sample subset in the sample set can be determined based on classification attributes of the sample objects. In some embodiments, the sample object and the processed object related to the prediction model may be a video, and the classification attribute may be the video length. In another embodiment, the sample object and the processed object related to the prediction model may be meteorological history data, and the classification attribute may be one of the meteorological parameters included in the meteorological history data (e.g., temperature, humidity, wind force, precipitation, etc.). In the following, the principle of the present disclosure is described by taking the sample object as an example of a video. It should be understood that in another embodiment, the method provided by the embodiment of the present disclosure may also realize any other type of single variable continuous value prediction task.
[0054] The first sample subset may include at least one first sample object belonging to a first video length interval, and the second sample subset may include at least one second sample object belonging to a second video length interval. As described above, the sample videos may be classified based on the video length of the video resources. The sample videos may be classified based on the longest length of the video resources in the sample set and the distribution of the video resources in different video length intervals, thereby obtaining a first sample subset for a first video category and a second sample subset for a second video category. For example, taking an example in which the number of video resources is 1000 and the longest video length is 100 seconds, the first sample subset may include video resources in a video length interval of 0-45 seconds, and the second sample subset may include video resources in a video length interval of 46-100 seconds. In some examples, the number of sample objects in the first sample subset may be the same as the number of sample objects in the second sample subset. The number described here being similar refers to the number being completely the same or the number of sample objects in the two sample subsets being approximately the same, i.e., the difference in number is less than a predetermined threshold. In another example, when the section difference obtained by averaging distribution according to the number of samples is too large (e.g., when the section of the video length corresponding to the first sample subset is 0-10 seconds and the section of the video length corresponding to the second sample subset is 11-100 seconds), the section difference in the length of the video resources corresponding to the two video categories can be limited to 50 seconds or less. The result of sample video classification can be adjusted based on such a restriction, and the number of video resources included in the sample subsets of the two video categories does not need to be limited to be similar (or approximately the same).
[0055] In step S306, a first predictive model may be trained using the first sample objects in the first sample subset. In step S308, a second predictive model may be trained using second sample objects in the second sample subset.
[0056] Here, the first prediction model and the second prediction model are used to obtain a prediction result of the object to be processed by processing at least one prediction feature of the object to be processed, where the prediction result and the classification attribute are homogeneous variables.
[0057] Here, the sample objects used in training the first and second prediction models belong to different object categories, but the parameters in the models can be trained in the same way. Below, the training method according to the embodiment of the present disclosure is described by taking the first prediction model as an example. A similar method can be applied to the second sample subset to train and obtain the second prediction model.
[0058] A first prediction model can be obtained by training in the following manner: determining first current parameters of a first prediction model, and using the first current parameters to process at least one first sample feature of the first sample object to obtain a first sample prediction result of the first sample object; subject and adjusting the first current parameter based on the first sample predicted result and the first actual sample result.
[0059] When training starts, the first current parameters of the first prediction model may be a predetermined first initial parameter. After each training is completed, the first current parameters used for the current training round may be updated. The first current parameters may be updated by various optimization methods, such as various iterative methods including a first iterative method, a second iterative method, a gradient descent method, a Newton method, etc. For a prediction model realized by a neural network, the first current parameters may be updated by a backpropagation method.
[0060] In some embodiments, the current parameters may be adjusted based on the loss results obtained with the loss function. For example, a first loss may be determined based on the first sample predicted result and the first actual sample result, and a first current parameter of the first predictive model may be adjusted based on the first loss, where the first loss may be determined based on a predetermined loss function, where the predetermined loss function may indicate a difference between the first sample predicted result and the first actual sample result.
[0061] In some instances, applying different loss functions to sample points with different errors can improve the optimization effect on the current parameters of the predictive model during the training process.
[0062] For example, when the difference between the first sample prediction result and the first actual sample result is less than the training threshold, a first loss function is used to determine the first loss, and when the difference between the first sample prediction result and the first actual sample result is equal to or greater than the training threshold, a second loss function is used to determine the first loss. Here, when the difference between the first sample prediction result and the first actual sample result is equal to the training threshold, the loss determined by the first loss function and the loss determined by the second loss function are the same. It indicates that the greater the difference between the first sample prediction result and the first actual sample result, the greater the optimization error of the sample. By applying different loss functions to sample points with different optimization errors, the optimization efficiency of the model can be improved.
[0063] In some examples, the training threshold may change with an increase in the number of training times. For example, the training threshold may be attenuated with an increase in the number of training times. Attenuation of the training threshold may be performed using various learning rate decay methods used in machine learning methods, such as exponential decay, fixed step size decay, variable step size decay, cosine annealing decay, etc. Here, the larger the training threshold, the greater the influence and contribution of sample points with large optimization errors to the model. Therefore, by attenuating the training threshold with an increase in the number of training times, the influence of sample points with large optimization errors on model parameter adjustment in the early training stage can be made greater, thereby realizing rapid parameter adjustment, and the effect of fine-tuning parameters can be achieved by making the influence of sample points with small optimization errors on model parameter adjustment greater in the later training stage.
[0064] In some examples, the first loss function L1 can be expressed by the following equation (1).
[0065]
number
[0066] The second loss function L2 can be expressed by the following equation (2).
[0067]
number
[0068] where f(x) denotes the first sample predicted result, y denotes the first actual sample result, and β denotes the training threshold. In the initial stage of training, β can be 1 or any other suitable value.
[0069] For videos in different length intervals, a normalization process can be performed on the actual results of the viewing time of each sample video by the user when training the model, so that the prediction effect of the model is not affected by the duration itself when training the model. That is, when training videos in different length intervals, the normalized prediction results are all used to obtain model parameters, so that the model can learn the viewing characteristics of users of videos in different length intervals.
[0070] In some embodiments, the normalization parameter corresponding to a target category may be an interval parameter of a classification variable corresponding to the target category. For example, the classification variable is video length, and the interval parameter may be the maximum value of the interval of the video length corresponding to the video category. This allows the actual result of the user's viewing time of the sample video in the video category to be normalized between 0 and 1. In other examples, the interval parameter may be determined as any other value in the interval of the video length corresponding to the video category. In such a case, the actual result after normalization may be greater than 1. For example, when the end points of the interval corresponding to the classification variable include an infinite term, the value of any one of the midpoints in the interval may be selected as the normalization parameter. During the training process, the normalization parameter may be attenuated with an increase in the number of training times. Such attenuation may be linear attenuation, exponential attenuation, or any other possible attenuation.
[0071] 4A is an exemplary diagram showing a regression loss calculated by a loss function according to an embodiment of the present disclosure. As can be seen from FIG. 4A, regardless of the value of the training threshold β, the loss calculated by the loss function can be approximated by the L2 loss result when the regression loss error is small (i.e., the difference between the predicted result and the actual result is small), and can be approximated by the L1 loss result when the regression loss error is large (i.e., the difference between the predicted result and the actual result is large).
[0072] 4B is an exemplary diagram showing the gradient of the loss function according to an embodiment of the present disclosure. As can be seen from FIG. 4B, as the value of the training threshold β is decaying, the gradient value of the loss function corresponding to samples with small regression loss errors (i.e., small differences between predicted results and actual results) is increasing. That is, as training progresses, the decaying training threshold β can improve the influence and contribution of sample points with small errors to the model parameters.
[0073] In some embodiments, after obtaining the first and second prediction models by training using the first and second sample sets, respectively, the method 300 may further include performing multi-task training on the first and second prediction models using a multi-task training frame, thereby obtaining final parameters of the first and second prediction models. The multi-task training method can further improve the generalization ability of the first and second prediction models. Any conventional multi-task training frame can be used to perform multi-task training on the first and second prediction models. For example, a Multi-gate Mixture-of-Experts (MMoe) or Progressive Layered Extraction (PLE) model can be used to realize the multi-task training frame used in the embodiments of the present disclosure.
[0074] FIG. 5 is an example diagram illustrating a multi-task training frame according to an embodiment of the present disclosure. As shown in FIG. 5, a multitask frame 500 may include an input 501, an expert network 502, gate networks 503-A, 503-B, a first model 504, a second model 505, and a first output 506 and a second output 507 corresponding to the first model 504 and the second model 505, respectively.
[0075] Here, the first model 504 and the second model 505 may be a first prediction model and a second prediction model obtained by training according to the training method described in conjunction with Fig. 3. For example, the first model 504 may be used to predict the viewing time by a user of a video of a first video category, and the second model 505 may be used to predict the viewing time by a user of a video of a second video category.
[0076] It should be understood that although the first model 504 and the second model 505 are two different models, the feature indicators to be learned for the two tasks, namely, predicting the viewing time of videos of a first video category by a user and predicting the viewing time of videos of a second video category by a user, are similar, so that common points for predicting the prediction task corresponding to the first model and the task of the second model can be learned through the shared expert network 502 and gate networks 503-A and 503-B, thereby further improving the generalization ability of the model.
[0077] Although only two models are shown in FIG. 5, it should be understood that a multi-task training frame such as that shown in FIG. 5 can be used for multi-task training of many more models.
[0078] In some embodiments, the input 501 may correspond to at least one predicted feature of the object to be processed. For example, the object to be processed is a video, and the input 501 may be a user feature of a user who has watched the video, a feature of a video item, etc. Here, the video item feature may include a video identifier, a video content category, a number of likes, a number of comments, a number of collections, a historical click rate, etc. Furthermore, the input 501 may further include a label indicating a classification attribute of the corresponding object to be processed. Such a label may be used to determine an object category to which the object to be processed corresponding to the input 501 belongs, and further determine which model (e.g., either the first model or the second model) to use in a subsequent process to obtain a final output result.
[0079] In a multi-task training frame as shown in FIG. 5, for the kth task (k=1 or 2), the output may be given by equation (3).
[0080]
number
[0081] where n is the number of sub-expert networks in the expert network 502, and g k (x) i is the gate network of the kth task when the input is x, and is used for the output of the ith sub-expert network, E i (x) denotes the output of the i-th sub-expert network when the input is x. k Let f denote the model of the kth task. When k=1, f can denote the first model. When k=2, f can denote the second model.
[0082] Here, each sub-expert network can be realized as a fully connected network, and each Gate network can be realized as a combination of a linear transformation and softmax. The Gate network can be used to map the input x to n dimensions, and then the softmax function can be applied to the results of each dimension to obtain the weights used for each sub-expert network.
[0083] As described above, since the input x includes a label indicating a target category, the final output result can be determined using the first model or the second model based on the label. During multi-task training, the loss function for multi-tasks may be expressed by equation (4).
[0084]
number
[0085] Here, l i can denote the loss of the i-th task, and α i may denote the weight used for the i-th task, and N denotes the total number of tasks. Here, the weight of each task may be determined according to the importance of each task, for example, the weight of each task may be determined by a learning-based algorithm (e.g., reinforcement learning or evolutionary learning).
[0086] FIG. 6 is an exemplary block diagram illustrating a data processing apparatus according to an embodiment of the present disclosure. As shown in FIG. 6, the data processing device 600 may include a processed object determining unit 610, an object category determining unit 620, a prediction model determining unit 630, and a prediction unit 640.
[0087] Here, the processed object determination unit 610 may be configured to determine a processed object. The object category determination unit 620 may be configured to determine an object category to which the processed object belongs based on a classification attribute of the processed object. The prediction model determination unit 630 may be configured to determine a prediction model to be used for the processed object based on the object category. The prediction unit 640 may be configured to obtain a prediction result for the processed object by processing at least one prediction feature of the processed object using the prediction model. Here, the prediction result and the classification attribute are variables of the same type.
[0088] Steps S202 to S208 as shown in FIG. 2 can be executed using units 610 to 640 as shown in FIG. 6, and detailed description thereof will be omitted here. FIG. 7 is an exemplary block diagram illustrating an apparatus for training a predictive model according to an embodiment of the present disclosure.
[0089] As shown in FIG. 7, the apparatus 700 may include a sample determining unit 710, a classification unit 720, a first prediction model training unit 730 and a second model training unit 740.
[0090] Here, the sample determination unit 710 may be configured to determine a sample set including a plurality of sample objects. The classification unit 720 may be configured to determine a first sample subset and a second sample subset in the sample set based on classification attributes of the sample objects. The first prediction model training unit 730 may be configured to train a first prediction model using a first sample object in the first sample subset. The second model training unit 740 may be configured to train a second prediction model using a second sample object in the second sample subset. Here, the first prediction model and the second prediction model are used to obtain a prediction result of the processed object by processing at least one prediction feature of the processed object, where the prediction result and the classification attribute are homogeneous variables.
[0091] Steps S302 to S308 as shown in FIG. 3 can be executed using units 710 to 740 as shown in FIG. 7, and detailed description thereof will be omitted here. In the technical solution disclosed herein, the collection, storage, use, processing, transmission, provision and disclosure of relevant user personal information shall all comply with the provisions of relevant laws and regulations and shall not violate public order and morals.
[0092] According to embodiments of the present disclosure, an electronic device, a readable storage medium, and a computer program product are further provided. As shown in FIG. 8, a block diagram of an electronic device 800 that can be used as a server or client of the present disclosure, which is an example of a hardware device applicable to various aspects of the present disclosure, will be described. The electronic device may represent various forms of digital electronic computers, such as laptop computers, desktop computers, stages, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, mobile phones, smartphones, wearable devices, and other similar computing devices. The components, their connections, and their functions shown herein are merely exemplary and do not limit the implementation of the present disclosure as described and / or claimed herein.
[0093] 8, the electronic device 800 includes a computing unit 801, which can perform various suitable operations and processes according to a computer program stored in a read-only memory (ROM) 802 or loaded from a storage unit 808 into a random access memory (RAM) 803. The RAM 803 may further store various programs and data necessary for operating the electronic device 800. The computing unit 801, the ROM 802 and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0094] The components in the electronic device 800 are connected to an I / O interface 805, and include an input unit 806, an output unit 807, a storage unit 808, and a communication unit 809. The input unit 806 may be any type of device capable of inputting information to the electronic device 800, and the input unit 806 may generate input numeric or character information and key signal inputs related to user settings and / or function control of the electronic device, and may include, but are not limited to, a mouse, a keyboard, a touch screen, a track board, a track ball, a control lever, a microphone, and / or a remote control. The output unit 807 may be any type of device capable of presenting information, and may include, but are not limited to, a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 808 may include, but are not limited to, a magnetic disk, an optical disk. The communications unit 809 enables the electronic device 800 to exchange information / data with other devices via a computer network, e.g., the Internet, and / or various telecommunications networks, and may include, but is not limited to, a modem, a network card, an infrared communications device, a wireless communications transceiver, and / or a chipset, e.g., a Bluetooth™ device, an 802.11 device, a WiFi device, a WiMax device, a cellular communications device, and / or the like.
[0095] The computing unit 801 may be various general-purpose and / or special-purpose processing components having processing and computing capabilities. Some examples of the computing unit 801 may include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units for executing machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 performs each of the methods and processes described above, such as methods 200, 300. For example, in some embodiments, the methods 200, 300 may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 808. In some embodiments, some or all of the computer program may be loaded and / or installed in the electronic device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the computing unit 801, it may perform one or more steps of the methods 200, 300 described above. Alternatively, in other embodiments, the computing unit 801 is configured to perform the methods 200, 300 in any other suitable manner (eg, using firmware).
[0096] Various embodiments of the systems and techniques described herein may be implemented in digital electronic circuitry systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), software hardware, firmware, software, and / or combinations thereof. These various embodiments may be embodied in one or more computer programs that may be executed and / or interpreted by a programmable system that includes at least one programmable processor, which may be a special purpose or general purpose programmable processor, and may include receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0097] The program code implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer or other programmable data processing apparatus, such that when executed by the processor or controller, the program code performs the functions / operations specified in the flowcharts and / or block diagrams. The program code may be entirely executed on a machine, partly executed on a machine, partly executed on a machine and partly executed on a remote machine as a separate software package, or entirely executed on a remote machine or server.
[0098] In the context of this disclosure, a machine-readable medium may be a tangible medium, which may include or store a program for use in or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the above. More specific examples of machine-readable storage media include an electrical connection with one or more leads, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0099] To provide for interaction with a user, a computer may implement the systems and techniques described herein and include a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user, and a keyboard and pointing device (e.g., a mouse or trackball) through which the user may provide input to the computer. Other types of devices may also be provided for providing interaction with a user. For example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or haptic feedback), and may receive input from the user in any form (including audio input, speech input, or tactile input).
[0100] The systems and techniques described herein may be implemented in a computing system including a backstage component (e.g., as a data server), a middleware component (e.g., an application server), a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with the system or technique embodiment), or any combination of backstage, middleware, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communications network). Examples of communications networks include a local area network (LAN), a wide area network (WAN), and the Internet.
[0101] The computer system may include a client side and a server. The client side and the server are generally remote from each other and usually interact with each other via a communication network. The relationship between the client side and the server is generated by running computer programs having a client side-server relationship with each other on corresponding computers. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0102] It should be understood that the steps may be reordered, added, or removed using the various forms of flow described above, for example, the steps described in this disclosure may be performed in parallel, sequentially, or in a different order, and the present disclosure is not limited thereto as long as the technical solutions disclosed in this disclosure can achieve the desired results.
[0103] Although the embodiments or examples of the present disclosure have been described with reference to the drawings, it should be understood that the above methods, systems, and devices are merely exemplary embodiments or examples, and the scope of the present invention is not limited by these embodiments or examples, but only by the scope of the claims and their equivalents after grant. Various elements of the embodiments or examples may be omitted or replaced by their equivalent elements. In addition, each step may be performed in a different order from the order described in this disclosure. Furthermore, various elements of the embodiments or examples may be combined in various ways. It is important to note that with the evolution of technology, many elements described herein may be replaced by equivalent elements that appear later in this disclosure.
Claims
1. A computer-implemented data processing method, comprising: determining, by a processor of the computer, an object to be processed, the object being a moving image; The processor of the computer determines an object category to which the object belongs based on a classification attribute of the object, the classification attribute being video length; determining a predictive model to be used for the processed objects based on the object category; A data processing method comprising: the processor of the computer obtaining a prediction result for the processed object by processing at least one prediction feature of the processed object using the prediction model; the prediction result and the classification attribute have the same type of variables; and the prediction result is a predicted time for which a user will watch the video.
2. Determining an object category to which the processed object belongs based on a classification attribute of the processed object, determining a section of the moving image length to which the moving image belongs based on the moving image length of the moving image; and determining an indicator of said video length interval as said target category.
3. Determining a predictive model to be used for the processed object based on the object category includes: In response to determining that the object category to which the object belongs is a section of a first video length, determining to use a first prediction model for the object; The data processing method of claim 2, further comprising: determining to use a second predictive model for the processed object in response to determining that the object category to which the processed object belongs is in a second video length section.
4. The data processing method according to claim 1 , wherein the at least one predictive feature includes a user feature of a user who has watched the video and a feature of an item of the video.
5. obtaining a prediction result for the object by processing at least one prediction feature of the object using the prediction model, obtaining a normalized prediction result for the object by processing at least one prediction feature of the object using the prediction model; and obtaining the prediction result by processing the normalized prediction result using a normalization parameter used for the target category.
6. 2. The data processing method according to claim 1, wherein the object to be processed is weather history data, the classification attribute is a weather parameter included in the weather history data, and the prediction result is a predicted weather parameter.
7. A computer-implemented method for training a predictive model, comprising: determining a sample set including a plurality of sample subjects; The processor of the computer determines a first sample subset and a second sample subset in the sample set based on classification attributes of the sample objects, the first sample subset including at least one first sample object belonging to a first video length interval, and the second sample subset including at least one second sample object belonging to a second video length interval; training a first predictive model using first sample objects in the first sample subset; training a second predictive model using second sample objects in the second sample subset; wherein the first prediction model and the second prediction model are used to obtain a prediction result of an object to be processed by processing at least one prediction feature of the object to be processed, the sample object and the object to be processed are videos, the classification attribute is video length, and the prediction result and the classification attribute are homogeneous variables.
8. The method of claim 7 , wherein the number of sample objects in the first sample subset is the same as the number of sample objects in the second sample subset.
9. Training a first predictive model utilizing the sample objects in the first sample subset includes: determining first current parameters of a first predictive model; obtaining a first sample prediction result for the first sample object by processing at least one first sample feature of the first sample object using the first current parameters; determining a first actual sample result for the first sample subject; and adjusting the first current parameter based on the first sample predicted result and the first actual sample result.
10. Adjusting the first current parameter based on the first sample predicted result and the first actual sample result includes: determining a first loss based on the first sample predicted result and the first actual sample result; and adjusting the first current parameter based on the first loss.
11. Determining a first loss based on the first sample predicted result and the first actual sample result includes: determining the first loss using a first loss function when a difference between the first sample predicted result and the first actual sample result is less than a training threshold; and determining the first loss utilizing a second loss function when a difference between the first sample predicted result and the first actual sample result is greater than or equal to a training threshold.
12. The method of claim 11 , wherein the training threshold decays with increasing training frequency.
13. 12. The method of claim 11, wherein when a difference between the first sample predicted result and the first actual sample result is equal to the training threshold, a loss determined by the first loss function and a loss determined by the second loss function are the same.
14. The first loss function is expressed by the following equation (1): [0010] The second loss function is expressed by the following equation (2): [0025] 12. The method of claim 11, wherein f(x) denotes a first sample predicted result, y denotes a first actual sample result, and β denotes a training threshold.
15. 8. The method of claim 7, further comprising: obtaining final parameters of the first predictive model and final parameters of the second predictive model by performing multi-task training on the first predictive model and the second predictive model using a multi-task training frame.
16. 1. A data processing device, comprising: a processed object determination unit configured to determine a processed object; an object category determination unit configured to determine an object category to which the processed object belongs based on a classification attribute of the processed object, the classification attribute being a video length; a predictive model determination unit configured to determine a predictive model to be used for the processed object based on the object category; A data processing device comprising: a prediction unit configured to obtain a prediction result of the processed object by processing at least one prediction feature of the processed object using the prediction model, wherein the prediction result and the classification attribute are homogeneous variables, and the prediction result is a predicted time for a user to watch the video.
17. 1. An apparatus for training a predictive model, comprising: a sample determination unit configured to determine a sample set comprising a plurality of sample subjects; a classification unit configured to determine a first sample subset and a second sample subset in the sample set based on classification attributes of the sample objects, the first sample subset comprising at least one first sample object belonging to a first video length interval, and the second sample subset comprising at least one second sample object belonging to a second video length interval; a first predictive model training unit configured to train a first predictive model using first sample objects in the first sample subset; a second predictive model training unit configured to train a second predictive model using second sample objects in the second sample subset; wherein the first prediction model and the second prediction model are used to obtain a prediction result of an object to be processed by processing at least one prediction feature of the object to be processed, the sample object and the object to be processed are videos, the classification attribute is video length, and the prediction result and the classification attribute are homogeneous variables.
18. An electronic device, At least one processor; and a memory communicatively coupled to the at least one processor, wherein: An electronic device in which instructions executable by the at least one processor are stored in the memory, and the instructions, when executed by the at least one processor, cause the at least one processor to perform a method according to any one of claims 1 to 15.
19. A non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to carry out the method according to any one of claims 1 to 15.
20. A computer program which, when executed by a processor, implements the method according to any one of claims 1 to 15.
Citation Information
Patent Citations
Information prediction method and device, electronic equipment and storage medium
CN113554180A
State prediction device and state prediction control method
WO2019163141A1
Information processing method, information processing device, and program
WO2020250723A1
