Time prediction method and device, electronic equipment, storage medium and program product
The time prediction method enhances user preference prediction accuracy by using multi-head attention processing to identify key features and time weights, addressing low accuracy for non-mainstream users and optimizing business interactions.
Patent Information
- Application Number
- CN202410996819.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2024-12-20
AI Technical Summary
Existing methods for predicting user preferences for business interactions at different times, such as weekdays or weekends, result in low accuracy for non-mainstream user groups, leading to poor prediction results.
A time prediction method that determines first and second business features using multi-head attention processing on business data to extract importance differences in time intervals, enhancing the accuracy of preference and time predictions by weighting loss and samples.
Improves the accuracy of predicting user preferences by identifying key features and time weights, effectively distinguishing between mainstream and non-mainstream user preferences, thereby optimizing business interactions.
Smart Images

Figure CN119168609A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a time prediction method and device, an electronic device, a computer-readable storage medium, and a computer program product. Background Art
[0002] With the development of the Internet and communication technology, enterprises usually use non-face-to-face methods such as telephone or network to introduce, communicate, and sell products or services. However, users have different acceptance levels for services at different times, such as day or night, weekdays or weekends, so it is necessary to predict the user's preferred service time so as to initiate services during the preferred service time and improve the success rate of services. Summary of the invention
[0003] The present disclosure provides a time prediction method and device, an electronic device, a computer-readable storage medium, and a computer program product.
[0004] In a first aspect, the present disclosure provides a time prediction method, the time prediction method comprising:
[0005] Determine, according to the business data of the target object, a first business feature and a second business feature corresponding to a target time interval included in a predicted time period, wherein the predicted time period includes a plurality of time intervals;
[0006] Performing multi-head attention processing on the first service feature and the second service feature to obtain service preference information and time weight information of the target object in each time interval;
[0007] Prediction is performed based on the business preference information and time weight information of each time interval to obtain a business preference prediction result of the target object in the target time interval.
[0008] In a second aspect, the present disclosure provides a time prediction device, the time prediction device comprising:
[0009] A feature determination module, configured to determine, based on the business data of the target object, a first business feature and a second business feature corresponding to a target time interval included in a predicted time period, wherein the predicted time period includes a plurality of time intervals;
[0010] An information acquisition module, configured to perform multi-head attention processing on the first service feature and the second service feature to obtain service preference information and time weight information of the target object in each time interval;
[0011] The prediction module is used to make predictions based on the business preference information and time weight information of each time interval to obtain the business preference prediction results of the target object in the target time interval.
[0012] In a third aspect, the present disclosure provides an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores one or more computer programs executable by the at least one processor, and one or more of the computer programs are executed by the at least one processor to enable the at least one processor to execute the above-mentioned time prediction method.
[0013] In a fourth aspect, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the above-mentioned time prediction method when executed by a processor.
[0014] In a fifth aspect, the present disclosure provides a computer program product, which includes a computer-readable code, or a non-volatile computer-readable storage medium carrying a computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above-mentioned time prediction method.
[0015] According to the embodiments of the present disclosure, it is possible to determine the first business feature and the second business feature corresponding to the target time interval based on the business data of the object, perform multi-head attention processing on the first business feature and the second business feature, extract the importance differences of the business features in different time intervals based on the multi-head attention mechanism, and realize the prediction of business preference information and selection of time weight information for each time interval under the first business feature and the second business feature, thereby improving the accuracy of preference prediction and time prediction; and then determine the business preference prediction result of the target time interval based on the business preference information and the time weight information, thereby improving the accuracy of preference time prediction.
[0016] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the present disclosure and do not constitute a limitation of the present disclosure. The above and other features and advantages will become more apparent to those skilled in the art by describing detailed example embodiments with reference to the accompanying drawings, in which:
[0018] Figure 1 A flow chart of a time prediction method provided by an embodiment of the present disclosure;
[0019] Figure 2 A flow chart of a time prediction method provided by an embodiment of the present disclosure;
[0020] Figure 3 A schematic diagram of a prediction model provided by an embodiment of the present disclosure;
[0021] Figure 4 A block diagram of a time prediction device provided by an embodiment of the present disclosure;
[0022] Figure 5 A block diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0023] In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made 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 description of well-known functions and structures is omitted in the following description.
[0024] In the absence of conflict, the various embodiments of the present disclosure and the various features therein may be combined with each other.
[0025] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.
[0026] The terms used herein are only used to describe specific embodiments and are not intended to limit the present disclosure. As used herein, the singular forms "a" and "the" are also intended to include plural forms, unless the context clearly indicates otherwise. It will also be understood that when the terms "including" and / or "made of" are used in this specification, the presence of the features, wholes, steps, operations, elements and / or components is specified, but the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof is not excluded. "Connected" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect.
[0027] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted as having an idealized or overly formal meaning unless explicitly defined as such herein.
[0028] In the technical solution disclosed in this disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals. The use of user data in this technical solution complies with relevant national laws and regulations (for example, the "Information Security Technology Personal Information Security Specification", etc.). For example: corresponding prescribed measures are taken for personal information access control; prescribed restrictions are imposed on the display of personal information; the purpose of using personal information does not exceed the scope of direct or reasonable association; when using personal information, clear identity orientation is eliminated to avoid precise positioning of specific individuals.
[0029] Business scenarios that implement product or service introduction, communication, and sales through non-face-to-face methods such as telephone or the Internet include telephone sales, interest e-commerce, live broadcast e-commerce, etc. In these business scenarios, it may be necessary to predict the user's business preference time. In this way, initiating business within the business preference time can increase the probability of reaching users, such as the connection rate of phone calls, the probability of users watching live broadcasts, and the probability of users browsing product pages, thereby improving the success rate of business.
[0030] When prediction is made through deep learning and other methods, since there are mainstream business preference times in the overall samples, that is, the business preference times of most samples are in a certain time interval, such as 9 am to 10 am; there are also non-mainstream business preference times, that is, a small number of samples have business preference times different from the business preference times of most samples, such as 8 pm to 9 pm. In the overall prediction task, the users corresponding to this small number of samples will be relatively weak, and the prediction accuracy of these users in related technologies is low.
[0031] In related technologies, it is possible to enhance the network model's learning of these time-preference users by weighting the loss (e.g., weighting the loss of positive samples) and weighting the samples (e.g., duplicating a small number of non-mainstream positive samples). However, the prediction results obtained by this processing method are still the business preferences in a certain time interval, rather than the business preferences after eliminating the distribution of the mainstream business preference time, resulting in poor prediction results.
[0032] According to an embodiment of the present disclosure, a time prediction method is provided, which can determine a first business feature and a second business feature corresponding to a target time interval based on object business data; perform multi-head attention processing on the first business feature and the second business feature, extract the importance difference of the business features in different time intervals based on the multi-head attention mechanism, realize the prediction of business preference information and the selection of time weight information for each time interval under the first business feature and the second business feature, improve the accuracy of preference prediction and the accuracy of time prediction; and then determine the business preference prediction result of the target time interval based on the business preference information and the time weight information, improve the accuracy of preference time prediction.
[0033] Figure 1 A diagram of an application scenario of the time prediction method and device provided in an embodiment of the present disclosure.
[0034] like Figure 1 As shown, the application scenario of the embodiment of the present disclosure may include a terminal device 101, a network 103 and a server 102. The network 103 is used to provide a medium for a communication link between the terminal device 101 and the server 102. The network 103 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0035] The user can use the terminal device 101 to interact with the server 102 through the network 103 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).
[0036] The terminal device 101 may be any electronic device having a display screen and supporting web browsing, including but not limited to a smart phone, a tablet computer, a laptop computer, a desktop computer, and the like.
[0037] The server 102 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the terminal device 101. The background management server may analyze and process received data such as user requests, and feed back processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.
[0038] It should be noted that the time prediction method and apparatus provided in the embodiments of the present disclosure may be executed by the server 102. Accordingly, the time prediction method and apparatus provided in the embodiments of the present disclosure may be arranged in the server 102. The time prediction method and apparatus provided in the embodiments of the present disclosure may also be executed by a server or server cluster that is different from the server 102 and that can communicate with the terminal device 101 and / or the server 102. Accordingly, the time prediction method and apparatus provided in the embodiments of the present disclosure may also be arranged in a server or server cluster that is different from the server 102 and that can communicate with the terminal device 101 and / or the server 102.
[0039] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0040] Figure 2 A flow chart of a time prediction method provided by an embodiment of the present disclosure. Figure 2 , the method comprising:
[0041] Step S21, determining, according to the business data of the target object, a first business feature and a second business feature corresponding to a target time interval included in a prediction time period, wherein the prediction time period includes a plurality of time intervals;
[0042] Step S22, performing multi-head attention processing on the first service feature and the second service feature to obtain service preference information and time weight information of the target object in each time interval;
[0043] Step S23, predicting based on the business preference information and time weight information of each time interval to obtain a business preference prediction result of the target object in the target time interval.
[0044] For example, the predicted time period represents the time period for the service to be initiated, such as 1 day, 1 week, 1 month, etc. The predicted time period includes multiple time intervals. For example, when the predicted time period is 1 day, each time interval corresponds to 1 hour, including 8 o'clock-9 o'clock, 9 o'clock-10 o'clock, etc.; when the predicted time period is 1 week, each time interval corresponds to 1 day, including Monday-Sunday. Among them, the multiple time intervals may not be all time intervals within the predicted time period. For example, the predicted time period is 1 day, each time interval corresponds to 1 hour, and multiple time intervals correspond to 14 time intervals from 8 am to 10 pm (no service will be initiated from 10 pm to 8 am the next day). The present disclosure does not limit the specific selection of time intervals for the predicted time period and the specific number of time intervals included in the predicted time period.
[0045] In some possible implementations, the business data of the target object, that is, the business data within the target time period, can be obtained. The target time period can be a relatively long historical time (that is, the end node of the target time period is earlier than the current time), including multiple time periods. For example, the time period is 1 day, the target time period is 3 months or 6 months, etc. The present disclosure does not limit the specific length of the target time period.
[0046] In some possible implementations, the content of the business data may vary according to different business scenarios. When the business scenario is a telephone sales scenario, the business data may include telephone call information and basic information of the target object. Among them, the telephone call information may include the number of calls, the number of connections, the connection rate, etc. within the target time period; the basic information may include the gender, age group, marital status, etc. of the object, and may also include portrait information determined based on the gender, age group, marital status, etc. of the object. The present disclosure does not limit the specific content of the business data, the specific content of the telephone call information and the basic information.
[0047] In some possible implementations, the business data may be counted and divided according to time intervals to obtain interval data for each time interval of the target time period. For example, multiple interval data of time interval 1 (8:00-9:00), multiple interval data of time interval 2 (9:00-10:00), ..., multiple interval data of time interval 14 (21:00-22:00) within the target time period (3 months).
[0048] In some possible implementations, in step S21, based on the business data of the target object in the target time period, the first business feature and the second business feature corresponding to the target time interval included in the prediction time period are determined. The target time interval can be any one of the multiple time intervals of the prediction time period, such as time interval 2 (9 o'clock-10 o'clock).
[0049] Under the target time interval, the business data of multiple target time intervals within the target time period (for example, the business data of time interval 2 (9 o'clock-10 o'clock) within 3 months) is the business data of the target time interval; the interval data of other time intervals outside the multiple target time intervals within the target time period (for example, the interval data of time interval 1 (8 o'clock-9 o'clock), time interval 3 (10 o'clock-11 o'clock), ..., time interval 14 (21 o'clock-22 o'clock) within 3 months) is the business data of the non-target time interval. Furthermore, the first business feature corresponding to the target time can be determined based on the business data of the target time interval, and the second business feature corresponding to the non-target time can be determined based on the business data of the non-target time interval and the basic information of the target object.
[0050] In some possible implementations, in a telephone sales scenario, the interval data is telephone call information, and the first business feature is determined based on the target object's telephone call information in multiple target time intervals in a target time period, and the end node of the target time period is earlier than the current time; the second business feature is determined based on the target object's telephone call information in a second time interval outside the multiple target time intervals in the target time period and the basic information of the target object.
[0051] In some possible implementations, the business data in the target time interval can be embedded (Embedding) and the business data can be vectorized to obtain the first business feature; and the business data in the non-target time interval and the basic information of the target object can be embedded (Embedding) and the business data and the basic information of the target object can be vectorized to obtain the second business feature.
[0052] It should be understood that those skilled in the art may set the method for determining the first service feature and the second service feature according to actual conditions, such as performing convolution and pooling after embedding, and the present disclosure does not limit this.
[0053] In some possible implementations, in step S22, multi-head attention processing is performed on the first business feature and the second business feature to obtain business preference information and time weight information of the target object in each time interval.
[0054] In some possible implementations, the linear transformation of the second business feature can be used as the query feature Q, and the linear transformations of the first business feature and the second business feature can be fused as the key feature K and the value feature V; then, based on the multi-head attention mechanism, the product of the query feature Q and the key feature K is activated (for example, Softmax activation) to obtain the time weight information of each time interval; then, the time weight information of each time interval is multiplied by the value feature V to obtain the business preference information of each time interval.
[0055] In some possible implementations, in step S23, prediction is performed based on the service preference information and time weight information of each time interval to obtain a service preference prediction result of the target object in the target time interval.
[0056] In some possible implementations, the business preference information of each time interval can be activated (for example, Sigmoid activation) to determine the business preference probability of the target time interval, that is, to predict the business preference degree of the target object in the target time interval; the time weight information of each time interval can be activated (for example, Softmax activation) to determine the time prediction probability of the target time interval, that is, to predict the probability distribution over all time intervals of the target object, and determine the probability that the current time interval is the target time interval.
[0057] In some possible implementations, the business preference probability and the time prediction probability can be multiplied to obtain the overall preference probability after eliminating the influence of time deviation; if the overall preference probability is greater than or equal to a preset threshold (for example, the average value of all objects), the business preference prediction result of the target time interval is determined to be that the target time interval is a preferred time interval; conversely, if the overall preference probability is less than the preset threshold, the business preference prediction result of the target time interval is determined to be that the target time interval is not a preferred time interval.
[0058] According to the embodiments of the present disclosure, it is possible to determine the first business feature and the second business feature corresponding to the target time interval based on the object business data, perform multi-head attention processing on the first business feature and the second business feature, extract the importance differences of the business features in different time intervals based on the multi-head attention mechanism, realize the prediction of business preference information and the selection of time weight information for each time interval under the first business feature and the second business feature, thereby improving the accuracy of preference prediction and the accuracy of time prediction; and then determine the business preference prediction result of the target time interval based on the business preference information and the time weight information, thereby improving the accuracy of preference time prediction.
[0059] The time prediction method according to the embodiment of the present disclosure is described below.
[0060] The time prediction method according to the embodiment of the present disclosure can be implemented through a prediction model, which may include an embedding layer, an attention layer, an activation layer, etc. The present disclosure does not limit the number and type of specific network layers included in the prediction model.
[0061] Figure 3 A schematic diagram of a prediction model provided by an embodiment of the present disclosure. Figure 3 As shown, the prediction model includes an embedding layer 31, an attention layer 32, a first activation layer 33 and a second activation layer 34. After statistics and division, the business data is input into the embedding layer 31 for vectorization, and the first business feature and the second business feature (not shown) are output; the first business feature and the second business feature are input into the attention layer 32 for processing, and the business preference information and time weight information of each time interval are output; the business preference information is input into the first activation layer 33 for processing, and the business preference probability P(Y|t) is output; the time weight information is input into the second activation layer 34 for processing, and the time prediction probability P(t) is output; the business preference probability P(Y|t) is multiplied by the time prediction probability P(t) to obtain the overall preference probability P(Y); and then, the business preference prediction result is determined according to the overall preference probability P(Y).
[0062] In some possible implementations, the embodiments of the present disclosure also include processing of the training phase of the prediction model. In the training phase, the business data of the target object, that is, the business data within the target time period, can also be obtained. The target time period is a relatively long historical time (that is, the end node of the target time period is earlier than the current time), including multiple time periods. For example, the time period is 1 day, the target time period is 3 months or 6 months, etc., and the present disclosure does not limit the specific length of the target time period.
[0063] In some possible implementations, the business data may be counted and divided according to time intervals to obtain interval data for each time interval of the target time period. For example, multiple interval data of time interval 1 (8:00-9:00), multiple interval data of time interval 2 (9:00-10:00), ..., multiple interval data of time interval 14 (21:00-22:00) within the target time period (3 months).
[0064] Under the target time interval, the business data of multiple target time intervals within the target time period (for example, the business data of time interval 2 (9:00-10:00) every day within 3 months) is the business data of the target time interval; the business data of other time intervals outside the multiple target time intervals within the target time period (for example, the business data of time interval 1 (8:00-9:00), time interval 3 (10:00-11:00), ..., time interval 14 (21:00-22:00) every day within 3 months) is the business data of non-target time intervals.
[0065] During the training phase, the target object has annotation information, which includes the sample preference time interval of the target object, such as time interval 2 (9 o'clock-10 o'clock). For the same target object, each time interval in the time period can be used as the target time interval to create a sample, and a positive sample (for example, the target time interval is time interval 2 (9 o'clock-10 o'clock), marked as 1) and multiple negative samples (for example, the target time intervals are time interval 1 (8 o'clock-9 o'clock), time interval 3 (10 o'clock-11 o'clock), ..., time interval 14 (21 o'clock-22 o'clock), marked as 0) are obtained.
[0066] In some possible implementations, during the training phase, for any target time interval, in step S21, the business data corresponding to the target time interval may be input into the embedding layer of the prediction model for vectorization processing to obtain the first business feature The business data of the non-target time interval corresponding to the target time interval and the basic information of the target object are input into the embedding layer of the prediction model for vectorization processing to obtain the second business feature Where i represents the sample number, t represents the target time interval, and X represents other time intervals outside the target time interval. and the second service feature are all eigenvectors.
[0067] It should be understood that those skilled in the art may set the method for determining the first service feature and the second service feature according to actual conditions, such as performing convolution and pooling after embedding, and the present disclosure does not limit this.
[0068] In some possible implementations, in step S22, multi-head attention processing is performed on the first service feature and the second service feature to obtain service preference information and time weight information of the target object in each time interval. Step S22 may include:
[0069] Performing linear transformation on the first service feature to obtain a query feature for each time interval;
[0070] Linearly transform and merge the first service feature and the second service feature to obtain a key feature and a value feature of each time interval;
[0071] Activate the query features and key features of each time interval to obtain the time weight information of each time interval;
[0072] The service preference information of each time interval is determined according to the time weight information and value characteristics of each time interval.
[0073] That is to say, the query feature Q, key feature K and value feature V of the multi-head attention mechanism can be constructed according to the first business feature and the second business feature.
[0074] Among them, the first business feature and the second business feature can be input into the attention layer of the prediction model, and the first business feature can be linearly transformed based on the query weight matrix to obtain the query feature of each time interval; the first business feature and the second business feature can be linearly transformed based on the key weight matrix, and the linear transformation results can be concatenated as the key feature; similarly, the first business feature and the second business feature can be linearly transformed based on the value weight matrix, and the linear transformation results can be concatenated as the value feature. It is expressed as follows:
[0075]
[0076] In formula (1), and represents the first service characteristic and the second service characteristic of the i-th sample; Q n , K n and V n They represent the query feature Q, key feature K and value feature V of the nth time interval respectively; Represents the query weight matrix of the nth time interval; and Respectively represent the key weight matrix corresponding to the first service feature and the key weight matrix of the second service feature in the nth time interval; and Respectively represent the value weight matrix of the first business feature and the value weight matrix of the second business feature corresponding to the nth time interval; […,…] represents splicing.
[0077] In formula (1), 1≤n≤N, N represents the number of time intervals included in the prediction time period, that is, the number of heads of the multi-head attention mechanism. For example, if the prediction time period is 1 day, and the multiple time intervals in the prediction time period correspond to 14 time intervals from 8 am to 10 pm, then N = 14. The dimension is is the key weight matrix and The sum of the dimensions of is also the value weight matrix and The sum of the dimensions of . Each weight matrix is a model parameter and can be obtained through training. The present disclosure does not limit the specific dimensions and element values of the weight matrix.
[0078] In some possible implementations, after obtaining the query feature Q, key feature K, and value feature V of each time interval, a multi-head attention mechanism can be processed in the attention layer. The query feature and the transpose of the key feature of each time interval can be multiplied, and then activated to obtain the time weight information of each time interval; the time weight information of each time interval is multiplied with the value feature to determine the business preference information of each time interval. It is expressed as follows:
[0079]
[0080] In formula (2), (K n )T represents the transposition of the key feature K of the nth time interval; softmax() represents the activation operation; Represents the time weight information of the i-th sample in the n-th time interval; Represents the service preference information of the i-th sample in the n-th time interval.
[0081] After processing by formula (2), the set of time weight information of N time intervals in the prediction time period can be obtained: and a collection of business preference information for N time intervals By concatenating the elements in the set separately, we can get Figure 3 The middle attention layer 32 finally outputs the time weight information and business preference information.
[0082] Among them, the collection of time weight information Includes time weight information for target time intervals and non-target time intervals. If the difference in the probability of reaching the target object in different time intervals (such as the connection rate of phone calls) is large, it means that the influence of the time interval itself in the data of the target time interval and the non-target time interval is large, and the difference between the time weight information of the target time interval and the time weight information of the non-target time interval is also large. Conversely, if the difference in the probability of reaching the target object in different time intervals (such as the connection rate of phone calls) is small, it means that the influence of the time interval itself in the data of the target time interval and the non-target time interval is small, and the difference between the time weight information of the target time interval and the time weight information of the non-target time interval is also small.
[0083] In this way, through the collection of time weight information According to the difference between the time weight information of the target time interval and the time weight information of the non-target time interval, the distribution of the i-th sample in all N time intervals can be predicted, thereby predicting which of the N time intervals the target time interval corresponding to the i-th sample is.
[0084] Among them, the collection of business preference information Representation: The time-differentiated representation after personalized selection of business preferences in each time interval of the prediction time period based on the multi-head attention mechanism can be used to predict the business preferences in the target time interval, so as to eliminate the influence of time deviation in subsequent processing.
[0085] In this way, the business preference information and time weight information of the target object in each time interval can be predicted, reflecting the business preferences of all time intervals and predicting the distribution in all time intervals, so as to eliminate the influence of time deviation in subsequent processing and improve the accuracy of time prediction.
[0086] In some possible implementations, in step S23, prediction is performed based on the service preference information and time weight information of each time interval to obtain a service preference prediction result of the target object in the target time interval. Step S23 may include:
[0087] Activate the service preference information of each time interval to obtain the service preference probability of the target object in the target time interval;
[0088] Activate the time weight information of each time interval to obtain the time prediction probability of the target time interval;
[0089] The business preference prediction result of the target object in the target time interval is determined according to the business preference probability and the time prediction probability.
[0090] For example, the collection of business preference information can be The elements in are concatenated to obtain the matrix of business preference information, and the input Figure 3 The first activation layer 33 is processed to output the service preference probability P(Y|t) of the target object in the target time interval; the set of time weight information The elements in are concatenated to obtain the matrix of time weight information, and the input Figure 3 The first activation layer 34 is processed to output the time prediction probability P(t) of the target object in the target time interval. The first activation layer is, for example, a Sigmoid activation layer, and the second activation layer is, for example, a Softmax activation layer. The present disclosure does not limit the specific activation types of the first activation layer and the second activation layer.
[0091] In some possible implementations, for the i-th sample of the target object, the above processing can be expressed as:
[0092]
[0093]
[0094] In formulas (3) and (4), P(Y i |t i ) indicates that the i-th sample is in the target time interval t i The business preference probability, that is, the probability that the target time interval corresponding to the current sample is the business preference time; P(t i ) indicates that the i-th sample is in the target time interval t i The time prediction probability, that is, the probability that the current time interval is the target time interval; W y and W t represents the weight matrix; B y and B t Represents the bias vector. Each weight matrix and bias vector are model parameters and can be obtained through training.
[0095] In some possible implementations, the business preference prediction result of the target object in the target time interval can be determined based on the business preference probability and the time prediction probability. The business preference probability and the time prediction probability can be dot-multiplied, and the dot-multiplication result can be directly used as the business preference prediction result; the dot-multiplication result can also be further processed to obtain the business preference prediction result.
[0096] In some possible implementations, the step of determining the service preference prediction result of the target object in the target time interval according to the service preference probability and the time prediction probability may include:
[0097] Multiplying the business preference probability and the time prediction probability to obtain the overall preference probability of the target object in the target time interval;
[0098] In a case where the overall preference probability is greater than or equal to a preset threshold, determining the business preference prediction result includes: the target time interval is a preference time interval.
[0099] That is to say, the business preference probability P(Y|t) and the time prediction probability P(t) can be multiplied to obtain the overall preference probability P(Y) after eliminating the influence of time deviation; then, the overall preference probability is compared with the preset threshold; if the overall preference probability is greater than or equal to the preset threshold, the business preference prediction result is determined to be that the target time interval is a preferred time interval; conversely, if the overall preference probability is less than the preset threshold, the business preference prediction result is determined to be that the target time interval is not a preferred time interval, or the target time interval is determined to be a non-preferred time interval.
[0100] In some possible implementations, the preset threshold may be determined according to an actual business scenario. When the business scenario is a telephone sales scenario, the preset threshold may be the average of the call connection rates of all objects. The present disclosure does not limit the specific value of the preset threshold.
[0101] In this way, by taking each target time interval as the target time interval for prediction, the preferred time interval of the target object can be determined from the multiple time intervals included in the prediction time period, thereby improving the accuracy of the preferred time prediction.
[0102] In some possible implementations, during the training phase, the prediction model may be trained using the obtained business preference prediction results and the preset annotation results. The time prediction method according to the embodiment of the present disclosure further includes:
[0103] Determining a first loss value of the prediction model according to the time prediction probability of the target time interval and the labeling result of the target object;
[0104] Determining a second loss value of the prediction model according to the business preference prediction result of the target object in the target time interval and the annotation result;
[0105] The prediction model is trained according to the first loss value and the second loss value.
[0106] For example, the loss of the prediction model can be determined in time and in the final business preference prediction result. In time, the loss values of positive samples (marked as 1) and negative samples (marked as 0) can be determined respectively; then the first loss value in time can be determined; in the final business preference prediction result, the second loss value can be determined by the difference between the business preference prediction result and the marked result; then the overall loss value can be determined based on the first loss value and the second loss value.
[0107] In some possible implementations, the labeling result of the target object includes the sample preference time interval of the target object. That is, the sample whose target time interval is the sample preference time interval is a positive sample, and the labeling result is 1, recorded as t|y=1; the sample whose target time interval is outside the sample preference time interval is a negative sample, and the labeling result is 0, recorded as t|y=0.
[0108] In some possible implementations, the step of determining the first loss value of the prediction model according to the time prediction probability of the target time interval and the labeling result of the target object includes:
[0109] Determining a first sub-loss value according to the time prediction probability of the sample whose target time interval is the sample preference time interval;
[0110] determining a second sub-loss value according to a time prediction probability of a sample whose target time interval is a first time interval outside the sample preference time interval;
[0111] determining the first loss value according to the first sub-loss value and the second sub-loss value,
[0112] Among them, the weight of the first sub-loss value is greater than the weight of the second sub-loss value.
[0113] That is to say, for the positive sample whose target time interval is the sample preference time interval, the first sub-loss value of the positive sample can be calculated according to its time prediction probability and the preset loss function; for the negative sample whose target time interval is the first time interval other than the sample preference time interval, the second sub-loss value of the negative sample can be calculated according to its time prediction probability and the preset loss function; and the weighted sum of the first sub-loss value and the second sub-loss value is determined as the first loss value.
[0114] In some possible implementations, the first loss value L t It can be expressed as:
[0115] L t = w t1 L1(t|y = 1, P(t)) +w t2 L1(t|y = 0, P(t)) (5)
[0116] In formula (5), L1() represents the time loss function, such as the cross entropy loss function, the L2 loss function, etc.; L1(t|y=1,P(t)) represents the first sub-loss value; L1(t|y=0,P(t)) represents the second sub-loss value; w t1 and w t2 Represent the weight of positive samples and the weight of negative samples respectively, which are hyperparameters and satisfy w t1 >w t2 , that is, the weight of the first sub-loss value is greater than the weight of the second sub-loss value. t1 and w t2 There is no restriction on the specific value of .
[0117] By weighting the positive samples, the expression of positive samples in the disadvantaged time interval can be enhanced, thereby improving the model training effect, and especially improving the accuracy of the trained model in predicting the business preference time in the disadvantaged time interval.
[0118] In some possible implementations, the second loss value L may be determined by the difference between the business preference prediction result and the annotation result. y , expressed as:
[0119] L y = L2(Y, P(Y)) (6)
[0120] In formula (6), L2() represents the loss function on the final result, such as a cross entropy loss function, an L2 loss function, etc., which may be the same as or different from L1; Y represents the labeling result of the sample, and the value may be 1 or 0. The present disclosure does not limit the specific type of the loss function.
[0121] In some possible implementations, the overall loss value L may be determined based on the first loss value and the second loss value. p , expressed as:
[0122] L p = w t L t + w y L y (7)
[0123] In formula (7), w t and w y The weights of the first loss value and the second loss value are respectively represented as hyperparameters. t and w y There is no restriction on the specific value of .
[0124] In some possible implementations, the total loss value L p The model gradient of the prediction model is calculated, and the model gradient is back-propagated to adjust the parameters of the prediction model; after multiple rounds of training iterations, when the training conditions (such as model convergence) are met, the training process can be completed to obtain the trained prediction model. The present disclosure does not limit the specific training method.
[0125] In this way, the model training process can be realized and the prediction accuracy of the model can be improved.
[0126] In some possible implementations, after the model training is completed, the model can be deployed, and the business preference time of the target object in the actual business scenario is predicted through the processing of steps S21-S23. The specific processing process is similar to the previous description and will not be repeated here.
[0127] According to the time prediction method of the embodiment of the present disclosure, it is possible to determine the first business feature and the second business feature corresponding to the target time interval based on the object business data, perform multi-head attention processing on the first business feature and the second business feature, extract the importance differences of the business features in different time intervals based on the multi-head attention mechanism, realize the prediction of business preference information and the selection of time weight information for each time interval under the first business feature and the second business feature, improve the accuracy of preference prediction and the accuracy of time prediction; and then determine the business preference prediction result of the target time interval based on the business preference information and the time weight information, and improve the accuracy of preference time prediction.
[0128] According to the time prediction method of the embodiment of the present disclosure, the time prediction probability is obtained by fusing the time weight information, the influence of time deviation is eliminated in the sample distribution, and the debiasing in time t is achieved, so that the final prediction result is more accurate; during the training process, the positive samples are weighted to enhance the expression of the positive samples in the weak time, and by fusing the weighting scheme with the time t debiasing scheme, targeted debiasing is achieved, further improving the prediction accuracy of the model.
[0129] According to the time prediction method of the embodiment of the present disclosure, adaptive weight selection of the first service feature and the second service feature is achieved through the attention mechanism, reflecting the difference in importance of time features of users with different dialing timing intensities, making the overall prediction more accurate.
[0130] According to the time prediction method of the embodiment of the present disclosure, the weight matrix of the time weight information is used as input, which makes full use of the weight information and enhances the ability of differentiated selection without interfering with the preferred time prediction, making the preferred time prediction more accurate.
[0131] It can be understood that the above-mentioned various method embodiments mentioned in the present disclosure can be combined with each other to form a combined embodiment without violating the principle logic. Due to space limitations, the present disclosure will not repeat them. It can be understood by those skilled in the art that in the above-mentioned method of the specific implementation method, the specific execution order of each step should be determined according to its function and possible internal logic.
[0132] In addition, the present disclosure also provides a time prediction device, an electronic device, and a computer-readable storage medium, all of which can be used to implement any time prediction method provided by the present disclosure. The corresponding technical solutions and descriptions are referred to the corresponding records in the method part and will not be repeated here.
[0133] Figure 4 A block diagram of a time prediction device provided in an embodiment of the present disclosure.
[0134] Reference Figure 4 , the embodiment of the present disclosure provides a time prediction device, the time prediction device comprising:
[0135] A feature determination module 41 is used to determine, according to the business data of the target object, a first business feature and a second business feature corresponding to a target time interval included in a prediction time period, wherein the prediction time period includes a plurality of time intervals;
[0136] An information acquisition module 42 is used to perform multi-head attention processing on the first service feature and the second service feature to obtain service preference information and time weight information of the target object in each time interval;
[0137] The prediction module 43 is used to perform prediction based on the service preference information and time weight information of each time interval to obtain the service preference prediction result of the target object in the target time interval.
[0138] In some possible implementations, the information acquisition module 42 is used to: linearly transform the first business feature to obtain a query feature for each time interval; linearly transform and fuse the first business feature and the second business feature to obtain a key feature and a value feature for each time interval; activate the query feature and the key feature of each time interval to obtain time weight information for each time interval; determine the business preference information for each time interval based on the time weight information and value feature of each time interval.
[0139] In some possible implementations, the prediction module 43 is used to: activate the business preference information of each time interval to obtain the business preference probability of the target object in the target time interval; activate the time weight information of each time interval to obtain the time prediction probability of the target time interval; determine the business preference prediction result of the target object in the target time interval based on the business preference probability and the time prediction probability.
[0140] In some possible implementations, the prediction module 43 is used to: multiply the business preference probability and the time prediction probability to obtain the overall preference probability of the target object in the target time interval; when the overall preference probability is greater than or equal to a preset threshold, determine that the business preference prediction result includes: the target time interval is a preference time interval.
[0141] In some possible implementations, the device is implemented by a prediction model, and the device further includes:
[0142] A first loss determination module, configured to determine a first loss value of the prediction model according to the time prediction probability of the target time interval and the labeling result of the target object;
[0143] A second loss determination module, configured to determine a second loss value of the prediction model according to the business preference prediction result of the target object in the target time interval and the annotation result;
[0144] A training module is used to train the prediction model according to the first loss value and the second loss value.
[0145] In some possible implementations, the labeling result of the target object includes a sample preference time interval of the target object, and the first loss determination module is configured to:
[0146] A first sub-loss value is determined based on the time prediction probability of samples whose target time interval is the sample preference time interval; a second sub-loss value is determined based on the time prediction probability of samples whose target time interval is a first time interval other than the sample preference time interval; and the first loss value is determined based on the first sub-loss value and the second sub-loss value, wherein the weight of the first sub-loss value is greater than the weight of the second sub-loss value.
[0147] In some possible implementations, the business data includes telephone call information, and the first business feature is determined based on the target object's telephone call information in multiple target time intervals of a target time period, and the end node of the target time period is earlier than the current time; the second business feature is determined based on the target object's telephone call information in a second time interval outside the multiple target time intervals of the target time period, and the basic information of the target object.
[0148] Each module in the above-mentioned time prediction device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0149] Figure 5 A block diagram of an electronic device provided in an embodiment of the present disclosure.
[0150] Reference Figure 5 An embodiment of the present disclosure provides an electronic device, which includes: at least one processor 701; at least one memory 702, and one or more I / O interfaces 703, connected between the processor 701 and the memory 702; wherein the memory 702 stores one or more computer programs that can be executed by the at least one processor 701, and the one or more computer programs are executed by the at least one processor 701 so that the at least one processor 701 can execute the above-mentioned time prediction method.
[0151] Each module in the above electronic device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0152] The present disclosure also provides a computer-readable storage medium on which a computer program is stored, wherein the computer program implements the above-mentioned time prediction method when executed by a processor / processing core. The computer-readable storage medium may be a volatile or non-volatile computer-readable storage medium.
[0153] The embodiment of the present disclosure also provides a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above-mentioned time prediction method.
[0154] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable storage medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium).
[0155] As is known to those of ordinary skill in the art, the term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable program instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), static random access memory (SRAM), flash memory or other memory technology, portable compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. In addition, it is known to those of ordinary skill in the art that communication media typically contain computer-readable program instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and may include any information delivery medium.
[0156] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0157] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0158] The computer program product described herein may be implemented in hardware, software, or a combination thereof. In one optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (SDK), etc.
[0159] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0160] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0161] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0162] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0163] Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for limiting purposes. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly noted, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, those skilled in the art will appreciate that various changes in form and detail may be made without departing from the scope of the present disclosure as set forth in the appended claims.
Claims
1. A time prediction method, characterized in that: include: Determine, according to the business data of the target object, a first business feature and a second business feature corresponding to a target time interval included in a predicted time period, wherein the predicted time period includes a plurality of time intervals; Performing multi-head attention processing on the first service feature and the second service feature to obtain service preference information and time weight information of the target object in each time interval; Prediction is performed based on the business preference information and time weight information of each time interval to obtain a business preference prediction result of the target object in the target time interval.
2. The method according to claim 1, characterized in that The performing multi-head attention processing on the first service feature and the second service feature to obtain service preference information and time weight information of the target object in each time interval includes: Performing linear transformation on the first service feature to obtain a query feature for each time interval; Linearly transform and merge the first service feature and the second service feature to obtain a key feature and a value feature of each time interval; Activate the query features and key features of each time interval to obtain the time weight information of each time interval; The service preference information of each time interval is determined according to the time weight information and value characteristics of each time interval.
3. The method according to claim 1, characterized in that Predictions are made based on the business preference information and time weight information of each time interval to obtain a business preference prediction result of the target object in the target time interval, including: Activate the service preference information of each time interval to obtain the service preference probability of the target object in the target time interval; Activate the time weight information of each time interval to obtain the time prediction probability of the target time interval; The business preference prediction result of the target object in the target time interval is determined according to the business preference probability and the time prediction probability.
4. The method according to claim 3, characterized in that Determining the business preference prediction result of the target object in the target time interval according to the business preference probability and the time prediction probability includes: Multiplying the business preference probability and the time prediction probability to obtain the overall preference probability of the target object in the target time interval; In a case where the overall preference probability is greater than or equal to a preset threshold, determining the business preference prediction result includes: the target time interval is a preference time interval.
5. The method according to claim 3, characterized in that: The method is implemented by a prediction model, and the method further comprises: Determining a first loss value of the prediction model according to the time prediction probability of the target time interval and the labeling result of the target object; Determining a second loss value of the prediction model according to the business preference prediction result of the target object in the target time interval and the annotation result; The prediction model is trained according to the first loss value and the second loss value.
6. The method according to claim 5, characterized in that The labeling result of the target object includes a sample preference time interval of the target object, and determining a first loss value of the prediction model according to the time prediction probability of the target time interval and the labeling result of the target object includes: Determining a first sub-loss value according to the time prediction probability of the sample whose target time interval is the sample preference time interval; determining a second sub-loss value according to a time prediction probability of a sample whose target time interval is a first time interval outside the sample preference time interval; determining the first loss value according to the first sub-loss value and the second sub-loss value, Among them, the weight of the first sub-loss value is greater than the weight of the second sub-loss value.
7. The method according to claim 1, characterized in that The business data includes telephone call information. The first service feature is determined based on the call information of the target object in multiple target time intervals of the target time period, and the end node of the target time period is earlier than the current time; The second service feature is determined based on the call making and receiving information of the target object in a second time interval outside the multiple target time intervals of the target time period, and the basic information of the target object.
8. A time prediction device, characterized in that: include: A feature determination module, configured to determine, based on the business data of the target object, a first business feature and a second business feature corresponding to a target time interval included in a predicted time period, wherein the predicted time period includes a plurality of time intervals; An information acquisition module, configured to perform multi-head attention processing on the first service feature and the second service feature to obtain service preference information and time weight information of the target object in each time interval; The prediction module is used to make predictions based on the business preference information and time weight information of each time interval to obtain the business preference prediction results of the target object in the target time interval.
9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores one or more computer programs executable by the at least one processor, and the one or more computer programs are executed by the at least one processor to enable the at least one processor to perform the time prediction method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the computer program implements the time prediction method according to any one of claims 1 to 7.
11. A computer program product, characterized in that The invention comprises a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the time prediction method as described in any one of claims 1 to 7.
