Multi-intention prediction model training method and multi-intention recommendation method
By building a unified sample data set to train a multi-intention prediction model under the target scenario, the problem of high manpower and material consumption in the existing technology is solved, and efficient and low-cost multi-intention prediction and recommendation are achieved.
Patent Information
- Application Number
- CN202311861526.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2043-12-29
AI Technical Summary
When implementing multi-intention recommendations, the prior art requires constructing samples and training models for each user's intention, resulting in high manpower and material resources consumption and high cost.
By locating multiple target candidate intentions to the target scene dimension, a unified sample data set is constructed to train a multi-intention prediction model, avoiding repetitive sampling and multiple model training for each intention, saving manpower and material resources.
It can effectively predict the occurrence probability of multiple intentions in the target scenario, reduce the cost of manpower and material resources, and improve the accuracy of prediction.
Smart Images

Figure CN120277246A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and particularly to a multi-intent prediction model training method and a multi-intent recommendation method. Background Art
[0002] Currently, the AI and intelligentization on the terminal side are very popular. Among them, the "service finding people" project has designed dozens or hundreds of various user intents, such as payment intent, taking the subway intent, listening to music intent, and so on. If you want to achieve multi-intent recommendation, you need to construct samples for each user intent and train the corresponding model, predict the user intent according to the trained model, and recommend services related to the user intent to the user. For example: according to the trained taking the subway intent prediction model, it is predicted that the user will take the subway at the current moment, and the service "subway ride code" related to the user intent of "taking the subway" can be recommended to the user; according to the trained listening to music intent prediction model, it is predicted that the user will listen to music at the current moment, and the service "music player interface" related to the user intent of "listening to music" can be recommended to the user at the same time.
[0003] However, user intents are diverse. If you want to achieve the prediction and recommendation of multiple intents, you need to construct samples and train the corresponding model based on each user intent, which requires a lot of manpower and material resources and has a high cost. Summary of the Invention
[0004] The multi-intent prediction model training method and multi-intent recommendation method provided by this application can save manpower and material resources and reduce costs.
[0005] To achieve the above object, this application adopts the following technical solutions:
[0006] In the first aspect, a multi-intent prediction model training method is provided, which is applied to an electronic device and includes:
[0007] First, according to the historical user behavior events that occurred in the target scenario, determine multiple target candidate intents of the user. The historical user behavior events occurred in the past N days; secondly, according to the historical user behavior events corresponding to each target candidate intent among the multiple target candidate intents, generate a training sample data set in the target scenario. Each sample data in the training sample data set includes: the sampling moment corresponding to the sample data, and the labels of the multiple target candidate intents at the sampling moment. If the label is the first label, it indicates that the target candidate intent occurs at the sampling moment. If the label is the second label, it indicates that the target candidate intent does not occur at the sampling moment; finally, train a multi-intent prediction model according to the training sample data set. The multi-intent prediction model is used to predict the occurrence probability of each target candidate intent among the multiple target candidate intents in the target scenario.
[0008] In an embodiment of the present application, by positioning multiple target candidate intents to the dimension of the target scenario, a unified sample is constructed for the multiple target candidate intents of the user under the target scenario, and a model is trained using the unified sample. The obtained model can predict the occurrence probabilities of the multiple target candidate intents under this target scenario, without separately constructing samples for each target candidate intent and separately training the model using the constructed samples. Thus, the repetitive sampling operations at the same sampling moment for different intents are avoided, and at the same time, multiple model trainings are avoided, which can save manpower and material resources and reduce costs.
[0009] In a possible implementation manner of the first aspect, the training sample data set includes: sample data collected within a first preset time period before the occurrence of the historical user behavior event corresponding to each of the target candidate intents; at each sampling moment, the label corresponding to the target candidate intent is the first label, and if the historical user behavior events corresponding to other target candidate intents except the target candidate intent occur within a second preset time period after the sampling moment, the label corresponding to the other target candidate intents is the first label, otherwise it is the second label.
[0010] In this embodiment, by setting the label corresponding to the target candidate intent within the first preset time period before the occurrence of the historical user behavior event corresponding to the target candidate intent to the first label, the model can learn in advance within the first preset time whether the target candidate intent will occur, so that the trained model can predict in advance whether the target candidate intent will occur. Setting the labels of other target candidate intents except the target candidate intent that occur within the second preset time period after the sampling moment to the first label enables the model to learn in advance within the second preset time period whether the other target candidate intents will occur, so that the trained model can predict in advance whether the other target candidate intents will occur.
[0011] In a possible implementation manner of the first aspect, the training sample data set further includes: sample data collected within a third preset time period before the occurrence of the historical user behavior event corresponding to each of the target candidate intents, and the third preset time period is before the first preset time period; at each sampling moment, the label corresponding to the target candidate intent is the second label, and if the historical user behavior events corresponding to other target candidate intents except the target candidate intent occur within a second preset time period after the sampling moment, the label corresponding to the other target candidate intents is the first label, otherwise it is the second label.
[0012] In this embodiment, the model is enabled to learn that the target candidate intention does not occur within a third preset time period before the occurrence of the target candidate intention. After training, the target candidate intention predicts that the target candidate intention does not occur within the third preset time period before the occurrence of the target candidate intention, avoiding disturbing the user by prematurely predicting the occurrence of the target candidate intention. And the labels of other target candidate intentions except the target candidate intention that occur within the second preset time period after the sampling moment are set to the first label, enabling the model to learn whether other target candidate intentions occur in advance by the second preset time period, so that the trained model can predict in advance whether other target candidate intentions occur.
[0013] In a possible implementation manner of the first aspect, on each of the Y days within the past N days, the historical user behavior events corresponding to any one of the target candidate intentions did not occur. The training sample data set further includes: sample data collected in the target scenario on each of the Y days. At each sampling moment, the labels corresponding to the multiple target candidate intentions are the second label, where Y is less than N.
[0014] In a possible implementation manner of the first aspect, training the multi-intention prediction model according to the training sample data set includes: for each sampling moment corresponding to the sample data in the training sample data set, determining the historical behavior sequence and / or historical space trajectory sequence of the user within a fourth preset time period before the sampling moment; training the multi-intention prediction model according to the training sample data set, the historical behavior sequence and / or the historical space trajectory sequence within the fourth preset time period before each sampling moment corresponding to the sample data in the training sample data set.
[0015] In this embodiment, considering the user's personalized experience, there is generally a series of behavior sequences and / or space trajectory sequences before the occurrence of a certain target candidate intention. When training, the model learns the user's historical behavior sequence and / or historical space trajectory sequence, and can learn the user's more accurate behavior patterns. Thus, when predicting, the model will make a judgment by combining the current moment, the user's behavior sequence and / or the user's space trajectory before the current moment at the same time. That is to say, the model makes predictions from multiple dimensions of time, behavior sequence and / or space trajectory sequence, rather than only from the dimension of time, which can improve the prediction accuracy.
[0016] In a possible implementation of the first aspect, training the multi-intent prediction model according to the training sample data set, the historical behavior sequence and / or the historical spatial trajectory sequence within a fourth preset time period before the sampling time corresponding to each sample data in the training sample data set includes: performing hashing processing on the historical behavior sequence and / or the historical spatial trajectory sequence within a fourth preset time period before the sampling time corresponding to each sample data in the training sample data set to obtain a historical behavior sequence feature value and / or a historical spatial trajectory feature value; training the multi-intent prediction model according to the training sample data set and the historical behavior sequence feature value and / or the historical spatial trajectory feature value within a fourth preset time period before the sampling time corresponding to each sample data in the training sample data set.
[0017] In this embodiment, by converting the historical behavior sequence and / or the historical spatial trajectory sequence into historical behavior sequence feature values and / or historical spatial trajectory feature values recognizable by the model, it is convenient for the model to learn the deep behavior patterns of users.
[0018] In a possible implementation of the first aspect, determining the historical behavior sequence of the user within a fourth preset time period before the sampling time corresponding to each sample data in the training sample data set includes: for each sampling time corresponding to each sample data in the training sample data set, obtaining multiple historical behavior records within the fourth preset time period before the sampling time, and each historical behavior record includes: the name of the historical user behavior event and the occurrence time of the historical user behavior event; merging the Q historical behavior records that occur later into a historical behavior sequence according to the occurrence time of the historical user behavior event, where Q is a positive integer.
[0019] In a possible implementation of the first aspect, obtaining the historical spatial trajectory sequence of the user within a fourth preset time period before the sampling time corresponding to each sample data in the training sample data set includes: for each sampling time corresponding to each sample data in the training sample data set, obtaining multiple base station connection records within the fourth preset time period before the sampling time, and each base station connection record includes: the connection time with the base station and the identification code of the base station; merging the P base station connection records that occur later into a historical spatial trajectory sequence according to the connection time with the base station, where P is a positive integer.
[0020] In a possible implementation manner of the first aspect, determining multiple target candidate intents of a user according to historical user behavior events occurring in a target scenario includes: obtaining multiple initial candidate intents in the target scenario; counting the occurrence frequency of each of the multiple initial candidate intents in the target scenario within a fifth preset time period; and determining the initial candidate intents whose frequency is greater than or equal to a preset frequency as the target candidate intents of the user.
[0021] In a possible implementation manner of the first aspect, after determining multiple target candidate intents of a user according to historical user behavior events occurring in a target scenario, it further includes: generating a test sample data set in the target scenario according to the historical user behavior events corresponding to each of the multiple target candidate intents, where the test sample data set is sampled at preset time intervals in the target scenario in the past M days, and each test sample data includes: a sampling moment, and labels of the multiple target candidate intents at the sampling moment, and the past M days and the past N days do not include the same day; at each sampling moment, if the historical user behavior event corresponding to the target candidate intent occurs within a second preset time period after the sampling moment, the label corresponding to the target candidate intent is the first label, otherwise it is the second label; after training a multi-intent prediction model according to the training sample data set, it further includes: testing the multi-intent prediction model according to the test sample data set to obtain the multi-intent prediction model that meets the preset requirements.
[0022] In a second aspect, a multi-intent recommendation method is provided, which is applied to an electronic device and includes: when it is predicted that the target scenario is about to be triggered or it is detected that the target scenario has been triggered, obtaining multiple target candidate intents of a user in the target scenario; inputting the multiple target candidate intents into the model trained by the above method to predict the occurrence probability of each of the multiple target candidate intents in the target scenario; and recommending a target candidate intent to the user according to the occurrence probability of each of the multiple target candidate intents in the target scenario, where the occurrence probability of the recommended target candidate intent is greater than or equal to a preset probability value.
[0023] In a third aspect, a multi-intent recommendation method is provided, which is applied to an electronic device and includes: when it is predicted that the target scenario is about to be triggered or it is detected that the target scenario has been triggered, obtaining multiple target candidate intents of a user in the target scenario; inputting the multiple target candidate intents into a model trained by the above method to predict the occurrence probability of each of the multiple target candidate intents in the target scenario; and recommending a target candidate intent to the user according to the occurrence probability of each of the multiple target candidate intents in the target scenario, where the occurrence probability of the recommended target candidate intent is greater than or equal to a preset probability value.
[0024] In a fourth aspect, an electronic device is provided. The electronic device includes a memory and a processor. The memory is used to store instructions. When the instructions are executed by the processor, the electronic device executes the method of the first aspect or any one of the methods in the first aspect, or executes the method of the second aspect or the third aspect.
[0025] In a fifth aspect, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program, and the computer program includes program instructions. When the program instructions are executed, the method of the first aspect or any one of the methods in the first aspect is implemented, or the method of the second aspect or the third aspect is implemented.
[0026] In a sixth aspect, a computer program product is provided. The computer program product includes: computer program code. When the computer program code is run on an electronic device, the electronic device executes the method of the first aspect or any one of the methods in the first aspect, or executes the method of the second aspect or the third aspect. Description of the Drawings
[0027] Figure 1 is a schematic structural diagram of an electronic device provided by an embodiment of the present application;
[0028] Figure 2 is a software structural block diagram of the electronic device 100 according to an embodiment of the present application;
[0029] Figure 3 is a schematic implementation flow diagram of current multi-intent prediction;
[0030] Figure 4 is a schematic implementation flow diagram of multi-intent prediction provided by an embodiment of the present application;
[0031] Figure 5 is a schematic flow diagram of a method for training a multi-intent prediction model according to an embodiment of the present application;
[0032] Figure 6 is a schematic diagram of a sampling method according to an embodiment of the present application;
[0033] Figure 7 It is a schematic diagram of another sampling method according to an embodiment of the present application;
[0034] Figure 8 It is a schematic flowchart of another example of a multi-intention prediction model training method according to an embodiment of the present application;
[0035] Figure 9 It is a schematic flowchart of another example of a multi-intention prediction model training method according to an embodiment of the present application;
[0036] Figure 10 It is a schematic flowchart of another example of a multi-intention prediction model training method according to an embodiment of the present application;
[0037] Figure 11 It is a schematic diagram of a mobile phone interface for recommending target candidate intentions according to an embodiment of the present application. Detailed implementation manners
[0038] Next, the technical solutions in the present application will be described with reference to the accompanying drawings.
[0039] In the description of the embodiments of the present application, unless otherwise specified, " / " means "or". For example, A / B may mean A or B; herein, "and / or" is merely a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B may mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of the present application, "a plurality of" means two or more than two.
[0040] Hereinafter, the terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of this embodiment, unless otherwise specified, the meaning of "a plurality of" is two or more than two.
[0041] Currently, the AI and intelligence on the terminal side are very popular. Among them, the "service finds people" project has designed dozens or hundreds of various user intentions, such as payment intention, taking the subway intention, listening to music intention, and so on. If you want to achieve multi-intention recommendation, you need to construct samples for each user intention and train the corresponding models, predict the user intention according to the trained models, and recommend services related to the user intention to the user. As Figure 1 shown, the model 1 trained based on the sample constructed for the listening to music intention can be used to predict whether the user will listen to music at the current moment; the model 2 trained based on the sample constructed for the taking the subway intention can be used to predict whether the user will take the subway at the current moment; the model 3 trained based on the sample constructed for the payment intention can be used to predict whether the user will make a payment at the current moment, and so on.
[0042] Currently, if you want to achieve multi-intent recommendation, you need to first train multiple models corresponding to multiple intents. After that, when recommending multiple intents to users, call these multiple models for prediction to obtain the prediction results of multiple intents at the current moment. Then, recommend multiple intents to users according to the prediction results. For example, if there are multiple intents (such as payment intent, taking the subway intent, listening to music intent, self-driving intent, etc.), for these multiple intents Figure 1 Train multiple models corresponding to them one by one. When recommending multiple intents to users, call the trained multiple models. If the obtained prediction results are that the payment intent and taking the subway intent do not occur, and the listening to music intent and self-driving intent occur, then recommend services related to the listening to music intent and self-driving intent to the user. For example, display the playing interface of the music app and the navigation interface of the map app on the user's mobile phone desktop. The user can view the interfaces of the service apps that may be used currently on the mobile phone desktop.
[0043] However, the current solution for implementing multi-intent recommendation needs to separately construct samples for each intent and use the constructed samples to train models separately. There are repetitive sampling operations for different intents at the same sampling moment, and multiple models need to be trained for multiple intents. In the case of too many intents, a large amount of human and material resources are required.
[0044] In view of this, the embodiments of the present application provide a method for training a multi-intent prediction model, as Figure 2 shown. By positioning multiple target candidate intents of the user to the dimension of the target scenario, construct a unified sample for multiple target candidate intents in the target scenario, and use the unified sample to train a model. The obtained model can predict the occurrence probabilities of multiple target candidate intents (such as Figure 2 the payment intent, taking the subway intent, listening to music intent, etc.) shown in the target scenario, without separately constructing samples for each target candidate intent and using the constructed samples to train models separately, thus avoiding repetitive sampling operations for different intents at the same sampling moment, and at the same time avoiding training models multiple times, which can save human and material resources and reduce costs.
[0045] The method for training a multi-intent prediction model provided by the embodiments of the present application is applied to electronic devices such as mobile phones, tablet computers, wearable devices, laptop computers, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), etc. that can record historical user behavior events. The embodiments of the present application do not impose any restrictions on the specific types of electronic devices.
[0046] Exemplarily, Figure 3This is a schematic structural diagram of an electronic device 100 provided by an embodiment of the present application.
[0047] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0048] It can be understood that the structure schematically shown in the embodiments of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than those shown in the figure, or combine certain components, or split certain components, or have different component arrangements. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0049] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.
[0050] The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0051] A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory may store instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0052] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0053] It can be understood that the interface connection relationships between the modules illustrated in the embodiments of the present invention are only illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0054] The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, and the baseband processor, etc.
[0055] The antenna 1 and the antenna 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example: the antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0056] The mobile communication module 150 may provide solutions for wireless communications including 2G / 3G / 4G / 5G / 6G, etc., which are applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 may receive electromagnetic waves through the antenna 1, filter and amplify the received electromagnetic waves, and then transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 may also amplify the signal modulated by the modulation and demodulation processor and convert it into electromagnetic waves through the antenna 1 for radiation. In some embodiments, at least some functional modules of the mobile communication module 150 may be provided in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be provided in the same device.
[0057] The modulation and demodulation processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. Subsequently, the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, receiver 170B, etc.), or displays an image or video through the display screen 194. In some embodiments, the modulation and demodulation processor may be an independent device. In other embodiments, the modulation and demodulation processor may be independent of the processor 110 and be provided in the same device as the mobile communication module 150 or other functional modules.
[0058] The wireless communication module 160 may provide solutions for wireless communications applied to the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite systems (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 may also receive signals to be sent from the processor 110, perform frequency modulation and amplification on them, and convert them into electromagnetic waves through the antenna 2 for radiation.
[0059] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, such that electronic device 100 can communicate with a network and other devices through wireless communication technologies. The wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), beidou navigation satellite system (BDS), quasi-zenith satellite system (QZSS), and / or satellite based augmentation systems (SBAS).
[0060] Electronic device 100 implements a display function through a GPU, display screen 194, and an application processor, etc. The GPU is a microprocessor for image processing, and is connected to display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.
[0061] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or N display screens 194, where N is a positive integer greater than 1.
[0062] The electronic device 100 can implement the shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, etc.
[0063] The ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and light passes through the lens and is transmitted to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. The ISP can also optimize parameters such as the exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193.
[0064] The camera 193 is used to capture static images or videos. An object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard format such as RGB or YUV. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.
[0065] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy, etc.
[0066] The video codec is used to compress or decompress digital videos. The electronic device 100 can support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple coding formats, such as: Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0067] The NPU is a neural-network (NN) computing processor. By learning from the structure of biological neural networks, such as learning from the transmission pattern between human brain neurons, it can quickly process input information and can also continuously self-learn. Through the NPU, applications such as intelligent cognition of the electronic device 100 can be realized, such as: image recognition, face recognition, speech recognition, text understanding, etc.
[0068] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to achieve the data storage function. For example, files such as music and videos are saved in the external memory card.
[0069] The internal memory 121 can be used to store computer-executable program code, and the executable program code includes instructions. The internal memory 121 can include a program storage area and a data storage area. Among them, the program storage area can store the operating system, application programs required for at least one function (such as the sound playback function, the image playback function, etc.). The data storage area can store data created during the use of the electronic device 100 (such as audio data, phone book, etc.). In addition, the internal memory 121 can include high-speed random access memory, and can also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121, and / or the instructions stored in the memory provided in the processor.
[0070] The electronic device 100 can implement audio functions through the audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and the application processor, etc. For example, music playback, recording, etc.
[0071] The button 190 includes a power-on button, volume buttons, etc. The button 190 can be a mechanical button or a touch button. The electronic device 100 can receive button inputs and generate key signal inputs related to the user settings and function controls of the electronic device 100.
[0072] The motor 191 can generate vibration prompts. The motor 191 can be used for incoming call vibration prompts and also for touch vibration feedback. For example, touch operations for different applications (such as taking pictures, playing audio, etc.) can correspond to different vibration feedback effects. Touch operations on different areas of the display screen 194 can also correspond to different vibration feedback effects by the motor 191. Different application scenarios (such as time reminders, receiving messages, alarms, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
[0073] The indicator 192 can be an indicator light and can be used to indicate the charging status, power change, and can also be used to indicate messages, missed calls, notifications, etc.
[0074] The SIM card interface 195 is used to connect the SIM card. The SIM card can be in contact with and separated from the electronic device 100 by being inserted into or removed from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communication. In some embodiments, the electronic device 100 uses an eSIM, that is, an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
[0075] The electronic device 100 can implement the model training method through a GPU, an application processor, etc., such as the multi-intent prediction model training method in the embodiments of the present application.
[0076] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. In the embodiments of the present application, the Android system with a layered architecture is taken as an example to exemplarily illustrate the software structure of the electronic device 100. It should be noted that in the embodiments of the present application, the operating system of the electronic device can include but is not limited to (Symbian), (Andriod), (iOS), (Blackberry), HarmonyOS, etc. The operating system is not limited in this application.
[0077] Figure 4 It is a software structure block diagram of the electronic device 100 according to an embodiment of the present invention. The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Communication between layers is through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom are the application layer, the application framework layer, the Android runtime, and the system library, and the kernel layer.
[0078] The application layer may include a series of application packages. Such as Figure 2 shown, the application packages may include applications such as music, maps, videos, payments, etc.
[0079] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications in the application layer. The application framework layer includes some predefined functions.
[0080] Such as Figure 4 shown, the application framework layer may include a window manager, a perception middle platform, a learning middle platform, an intent screening module, a model training module, an intent prediction module, where the intent prediction module further includes a scenario prediction module, a scenario detection module, and a model inference module.
[0081] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0082] The perception middle platform is used to perceive the usage data of each application in the application layer and identify historical user behavior events according to the usage data of each application. The perception middle platform is also used to identify the start time and end time corresponding to the target scenario or the start event and end event corresponding to the target scenario. When identifying historical user behavior events, data of other hardware of the electronic device (such as: gyroscope, acceleration sensor, etc.) can also be combined for fusion perception. For example: when identifying historical user behavior events corresponding to the self-driving intent, the connection data between the electronic device and the in-vehicle display screen, the angular velocity measured by the gyroscope of the electronic device, and the acceleration measured by the acceleration sensor can be used together to determine whether a historical user behavior event corresponding to the self-driving intent occurs.
[0083] The learning middle platform is used to identify historical user behavior events by annotating and learning the usage data of each application when the perception middle platform fails to perceive historical user behavior events. The learning middle platform is also used to identify the start time and end time corresponding to the target scenario or the start event and end event corresponding to the target scenario by portrait learning when the perception middle platform fails to perceive the start time and end time corresponding to the target scenario or the start event and end event corresponding to the target scenario.
[0084] The intent recognition module is used to determine the target candidate intents of the user in the target scenario and the historical user behavior events corresponding to the target candidate intents of the user according to the historical user behavior events recognized by the perception middle platform or the learning middle platform, or to filter out the target candidate intents of the user in the target scenario according to the initial candidate intents sent from the cloud side, the corresponding relationship between the initial candidate intents and the historical user behavior events, and in combination with the historical user behavior events recognized by the perception middle platform or the learning middle platform.
[0085] The model training module is used to construct a training sample data set according to the target candidate intents of the user obtained by the intent recognition module and the historical user behavior events expected to correspond to the target candidate intents, and to train the model using the training sample data set.
[0086] In the intent prediction module, the scenario prediction module is used to predict in advance whether the target scenario is about to be triggered, and the scenario detection module is used to detect whether the target scenario is triggered. When the scenario prediction module predicts that the target scenario is about to be triggered or when the scenario detection module detects that the target scenario is triggered, the model inference module calls the trained model to perform multi-intent prediction.
[0087] Among them, the scenario prediction module is used to train the model to perform target scenario prediction by combining the start time and end time corresponding to the target scenario or the start event and end event corresponding to the target scenario recognized by the perception middle platform or the learning middle platform, and can predict in advance whether the target scenario is about to be triggered. For example: for the sleep scenario, it is necessary to make intent recommendations in advance to avoid the invalidation of recommendations caused by the user entering the sleep state. In this case, it is necessary to predict in advance whether the target scenario is about to be triggered. If it is predicted that the target scenario is about to be triggered, at this time, start using the model to perform intent prediction and recommend intents to the user according to the prediction results. For other scenarios (such as the commuting to work scenario or the commuting from work scenario), there is no need to predict in advance, directly detect whether these target scenarios are triggered, and when it is detected that the target scenario is triggered, perform multi-intent prediction and recommend intents to the user according to the prediction results.
[0088] The scene detection module determines whether the target scene is triggered by detecting the usage data of each application. For example, it can determine whether the current time reaches the start time of the target scene, and if it is detected that the current time reaches the start time of the target scene, it is determined that the target scene is triggered.
[0089] Android Runtime includes a core library and a virtual machine. Android runtime is responsible for the scheduling and management of the Android system. The core library consists of two parts: one part is the functional functions that need to be called by the Java language, and the other part is the core library of Android.
[0090] The application layer and the application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0091] The system library can include multiple functional modules. For example: surface manager, Media Libraries, 3D graphics processing library (such as: OpenGL ES), model library, and database, etc.
[0092] The surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.
[0093] The media library supports the playback and recording of various common audio and video formats, as well as static image files, etc. The media library can support multiple audio and video coding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0094] The model library is used to store the models trained by the model training module in the application framework layer.
[0095] The database is used to store the usage data of each application in the application layer, the historical user behavior events identified by the perception middle platform and the learning middle platform, and the start time and end time corresponding to the target scene or the start event and end event corresponding to the target scene, etc.
[0096] The kernel layer is the layer between the hardware and the software. The kernel layer at least includes a display driver, a camera driver, an audio driver, and a sensor driver.
[0097] For the sake of easy understanding, the following embodiments of this application will take an electronic device with Figure 2 the structure shown as an example to introduce the process of model training.
[0098] The perception middle platform and learning middle platform in the application framework layer obtain historical user behavior events and their occurrence times, as well as the start time and end time corresponding to the target scenario or the start event and end event corresponding to the target scenario based on the usage data of each application. These contents are stored in the database of the system library. Historical user behavior events include, for example: user behavior events of operating the mobile phone app (such as: the behavior event of opening the music app, the behavior event of using the subway ride code to scan and enter the station, etc.), events of entering and leaving the home fence, events of the user entering and leaving the company fence, events of disconnecting from the home wifi, events of disconnecting from the company wifi, and so on.
[0099] The intention recognition module is used to determine the target candidate intentions of the user in the target scenario and the historical user behavior events corresponding to the target candidate intentions of the user based on the historical user behavior events recognized by the perception middle platform or the learning middle platform. Or, according to the initial candidate intentions sent from the cloud side, the corresponding relationship between the initial candidate intentions and the historical user behavior events, and combined with the historical user behavior events recognized by the perception middle platform or the learning middle platform, to screen out the target candidate intentions of the user in the target scenario.
[0100] The model training module is used to construct a training sample data set based on the target candidate intentions of the user obtained by the intention recognition module and the historical user behavior events corresponding to the target candidate intentions, and use the training sample data set to train the model.
[0101] The model training module is used to construct a training sample data set according to the target candidate intentions of the user obtained by the intention recognition module and the historical user behavior events corresponding to the target candidate intentions of the user, and use the training sample data set to train the model. The trained model is stored in the model library.
[0102] In the process of using the trained model for multi-intention prediction, the scenario prediction module is used to predict in advance whether the target scenario is about to be triggered, and the scenario detection module is used to detect whether the target scenario is triggered. In the case where the scenario prediction module predicts that the target scenario is about to be triggered or the scenario detection module detects that the target scenario is triggered, the model inference module calls the trained model to perform multi-intention prediction, obtains the occurrence probabilities of multiple target candidate intentions in the target scenario, and determines the target candidate intentions to be recommended according to the occurrence probabilities of the target candidate intentions. The display driver component in the kernel layer drives the display screen of the electronic device to display services related to the target candidate intentions to be recommended.
[0103] Next, in combination with the accompanying drawings and application scenarios, the multi-intention prediction model training method provided by the embodiments of the present application will be specifically described. Figure 5 It is an exemplary flowchart of the multi-intention prediction model training method.
[0104] Step S110: Determine multiple target candidate intents of the user according to historical user behavior events that occur in the target scenario.
[0105] In this embodiment, the historical user behavior events may be historical user behavior events learned based on the data created during the use of the electronic device 100. For example, the behavior events of the user operating the mobile phone app (such as: the behavior event of opening the music app, the behavior event of using the subway ride code to scan and enter the station, etc.), the events of entering and leaving the home fence, the events of the user entering and leaving the company fence, the event of disconnecting from the home wifi, the event of disconnecting from the company wifi, and so on.
[0106] The target scenario may be a scenario that conforms to certain rules after the perception middleware or the learning middleware learns the historical user behavior events. The time periods in which these target scenarios occur are relatively fixed, or there will be landmark events before and after the time periods in which the scenarios occur. Suppose the target scenario is the commuting-to-work scenario. The commuting time of the user to work is generally relatively fixed. For example, the user's commuting time to work is from 7:30 to 8:30 in the morning. There will be landmark events before and after the time period corresponding to the commuting-to-work scenario. For example: in the case of the event that the user leaves the home fence, it represents the start of the commuting-to-work scenario; in the case of the event that the user arrives at the company fence, it represents the end of the commuting-to-work scenario. Suppose the target scenario is the commuting-from-work scenario. The commuting time of the user from work is generally also relatively fixed. For example, the user's commuting time from work is from 5:30 to 6:30 in the afternoon. There will be landmark events before and after the time period corresponding to the commuting-from-work scenario. For example, in the case of the event that the user leaves the company fence, it represents the start of the commuting-from-work scenario; in the case of the event that the user arrives at the home fence, it represents the end of the commuting-from-work scenario.
[0107] The target scenarios learned by the perception middleware or the learning middleware are diverse. In addition to the above commuting-to-work scenario and commuting-from-work scenario, they may also include: sleep scenario, dinner scenario, etc., which are not limited in this embodiment.
[0108] In this embodiment, the target candidate intent refers to the user's will or attempt pointed to by the historical user behavior event. For example, if the historical user behavior event is to open the music app, then the user's will or attempt pointed to by this historical user behavior event is 'listen to music'; another example is that if the historical user behavior event is to connect to the in-vehicle display screen, then the user's will or attempt pointed to by this historical user behavior event is 'drive by oneself'. The occurrence of the historical user behavior event corresponding to the target candidate intent can represent the occurrence of the target candidate intent. For example, when the historical user behavior event of opening the music app occurs, it can be considered that the intent of listening to music occurs. Another example is that when the historical user behavior event of scanning the subway ride code to enter the station occurs, it can be considered that the intent of taking the subway occurs.
[0109] In this embodiment, the user's target candidate intents can be obtained through the following two methods.
[0110] In a possible implementation, when the electronic device is in the screen-off or charging state, the intent recognition module learns multiple target candidate intents of the user in the target scenario by learning the historical user behavior events in the electronic device in the target scenario. At this time, the historical user behavior events corresponding to each of the multiple target candidate intents can also be learned.
[0111] In another possible implementation, multiple target candidate intents of the user can be determined according to the historical user behavior events that occurred in the target scenario, including: obtaining multiple initial candidate intents in the target scenario; counting the frequency of occurrence of each of the multiple initial candidate intents in the target scenario within the fifth preset time period; and determining the initial candidate intents with a frequency greater than or equal to the preset frequency as the user's target candidate intents.
[0112] In this embodiment, the cloud side learns the historical user behavior events in multiple user target scenarios, and obtains multiple initial candidate intents of the group in this target scenario, as well as the historical user behavior events corresponding to the initial candidate intents. The initial candidate intents and the historical user behavior events corresponding to the initial candidate intents can be stored in a list and sent to the electronic devices of each user. The initial candidate intent list stores the names of multiple target scenarios, as well as multiple initial candidate intents corresponding to each target scenario, and can also store the historical user behavior events corresponding to each initial candidate intent. A possible initial candidate intent list is shown in Table 1 below.
[0113] Table 1:
[0114]
[0115] It should be noted that the above initial candidate intent list is only for illustrative purposes. In practical applications, the initial candidate intent list may not include historical user behavior events, and the corresponding relationship between the initial candidate intents and the historical user behavior events can be stored separately.
[0116] After the electronic device obtains the multiple initial candidate intents in the target scenario sent by the cloud, as well as the corresponding relationship between the initial candidate intents and the historical user behavior events, the intent recognition module can count the frequency of occurrence of each of the multiple initial candidate intents in this target scenario within the fifth preset time period, and determine the initial candidate intents with a frequency greater than or equal to the preset frequency as the user's target candidate intents.
[0117] Specifically, when the electronic device is charging or the screen is off, after obtaining the initial candidate intent list sent by the cloud and the corresponding relationship between the initial candidate intents and the historical user behavior events, the mining starts.
[0118] Select historical user behavior events that occurred in the past X days, and separately count the occurrence frequencies of the initial candidate intents in each target scenario in the initial candidate intent list in the past X days. Here, X is a positive integer. If a historical user behavior event corresponding to a certain initial candidate intent occurred in the target scenario, it is considered that the initial candidate intent occurred in the target scenario. Regardless of the number of occurrences, the frequency of this initial candidate intent is incremented by 1. Suppose the results obtained from the statistics in the work commute scenario in the past X days are as follows: {Listen to music intent: 8, Take the subway intent: 2, Read WeChat intent: 3, Drive by oneself intent: 10}. Suppose the results obtained from the statistics in the off-work commute scenario in the past X days are as follows: {Watch short videos intent: 7, Take the subway intent: 4, Read WeChat intent: 2, Drive by oneself intent: 10}.
[0119] Suppose the preset frequency is W times. Compare the frequencies of the various initial candidate intents in the target scenario in the past X days obtained from the above statistics with the preset frequency W to determine whether the frequency of each initial candidate intent reaches W times, that is, whether it is greater than or equal to the preset frequency W. Here, W is a positive integer. If the occurrence frequency of a certain initial candidate intent in the target scenario in the past X days is greater than or equal to W times, it is determined that the user usually has this intent in this target scenario, and this initial candidate intent is determined as the target candidate intent of this user. After screening out the correspondence between the user's "target scenario - target candidate intent", it can be stored in the form of a list. When recommending intents to the user in the subsequent target scenario, recommend to the user from these target candidate intents that often occur in the target scenario.
[0120] It should be noted that when the perception middle platform or the learning middle platform learns the start time and end time corresponding to the target scenario or the start event and end event corresponding to the target scenario, it can also learn the time background of the target scenario. For example, the work commute scenario and the off-work commute scenario only occur on weekdays, while the sleep scenario, dinner scenario, etc. occur every natural day. Therefore, for the target scenario under a specific time background, it is necessary to lock the time range of the historical user behavior events according to the time background. For example, for the target scenarios such as the work commute scenario and the off-work commute scenario that only occur on weekdays, the time range of the past X working days can be locked, and the occurrence frequencies of the various initial candidate intents in the work commute scenario and the off-work commute scenario are counted based on the historical user behavior events that occurred in the past X working days. For the target scenarios such as the sleep scenario and the dinner scenario that are not limited to a specific time background, the time range of the past X natural days can be locked, and the occurrence frequencies of the various initial candidate intents in the target scenarios such as the sleep scenario and the dinner scenario are counted based on the historical user behavior events that occurred in the past X natural days.
[0121] Step S120: Generate a training sample data set in the target scenario according to the historical user behavior events corresponding to each target candidate intention among the multiple target candidate intentions.
[0122] Specifically, after determining the multiple target candidate intentions of the user in the target scenario, a training sample data set is generated according to the historical user behavior events corresponding to each target candidate intention among the multiple target candidate intentions. The occurrence of the historical user behavior event corresponding to the target candidate intention indicates the occurrence of the target candidate intention. For example, if the behavior event of the user opening the music app occurs, it indicates that the intention of "listening to music" occurs; another example is that if the behavior event of scanning the subway code to enter the station occurs, it indicates that the intention of "taking the subway" occurs.
[0123] In this embodiment, each sample data in the training sample data set includes: the sampling moment corresponding to the sample data, and the labels of the multiple target candidate intentions at the sampling moment. If the label is the first label, it indicates that the target candidate intention occurs at the sampling moment; if the label is the second label, it indicates that the target candidate intention does not occur at the sampling moment. Among them, the first label can be "positive" or "1", and the second label can be "negative" or "0". The format of a piece of sample data can be as shown in Table 2 below.
[0124] Table 2
[0125]
[0126] In the above Table 2, the meaning represented by this piece of sample data is: Target candidate intention A, target candidate intention D, and target candidate intention E occur at XX:XX:XX seconds at the sampling moment; Target candidate intention B and target candidate intention C do not occur at XX:XX seconds at the sampling moment. In an example, assuming that the sampling moment is 08:02:00, the label of the intention of listening to music is 1, the label of the intention of swiping short videos is 0, the label of the intention of taking the subway is 0, and the label of the intention of self-driving is 1, then the meaning represented by this piece of sample data is: At 08:02:00, the intention of listening to music and the intention of self-driving occur, and the intention of swiping short videos and the intention of taking the subway do not occur.
[0127] Exemplarily, the training sample data set includes: sample data collected within the first preset time period before the occurrence of the historical user behavior event corresponding to each target candidate intention; at each sampling moment, the label of the target candidate intention is the first label. If the historical user behavior events corresponding to other target candidate intentions occur within the second preset time period after the sampling moment, the labels of the other target candidate intentions are the first label, otherwise they are the second label.
[0128] Specifically, traverse the historical user behavior events that occurred each day in the past N days. If there is at least one historical user behavior event corresponding to a target candidate intention within the time period corresponding to the target scenario on that day, then for each occurring target candidate intention, sample to obtain sample data within the first preset time period before the occurrence of the historical user behavior event corresponding to the target candidate intention on that day. In the sample data obtained at this time, at each sampling moment, it is considered that the target candidate intention occurs, and the label corresponding to the target candidate intention is the first label.
[0129] If a historical user behavior event corresponding to another target candidate intention other than the target candidate intention occurs within the second preset time period after the sampling moment, it is considered that the other target candidate intention also occurs at the current sampling moment, and the label corresponding to the other target candidate intention is the first label; if a historical user behavior event corresponding to the other target candidate intention does not occur within the second preset time period after the sampling moment, it is considered that the other target candidate intention does not occur at the current sampling moment, and the label corresponding to the other target candidate intention is the second label.
[0130] In this embodiment, the label corresponding to the target candidate intention within the first preset time period before the occurrence of the historical user behavior event corresponding to the target candidate intention is set as the first label, so that the model can learn whether the target candidate intention occurs in advance by the first preset time, and the trained model can predict in advance whether the target candidate intention occurs. The label of other target candidate intentions other than the target candidate intention that occur within the second preset time period after the sampling moment is set as the first label, so that the model can learn whether the other target candidate intentions occur in advance by the second preset time period, and the trained model can predict in advance whether the other target candidate intentions occur.
[0131] It should be noted that the duration of the first preset time period can be set according to actual needs. Suppose the duration of the first preset time period is D minutes, and D minutes can be 2 minutes, 5 minutes, 10 minutes, etc. The sampling time range of the sample data is: from the moment corresponding to D minutes before the occurrence moment of the historical user behavior event corresponding to the target candidate intention to the occurrence moment of the historical user behavior event corresponding to the target candidate intention. The duration of the second preset time period can also be set as needed. Suppose the duration of the second preset time period is L minutes, and L minutes can be 5 minutes, 10 minutes, 15 minutes, etc. The durations of the first preset time period and the second preset time period can be the same or different, and this embodiment does not make a limitation.
[0132] It should be noted that the sampling times are all between the start time and the end time of the target scenario on the same day. If the time corresponding to D minutes before the occurrence time of the historical user behavior event corresponding to the target candidate intention is earlier than the start time of the target scenario on the same day, the sampling time range is from the start time of the target scenario on the same day to the occurrence time of the historical user behavior event corresponding to the target candidate intention.
[0133] Exemplarily, the training sample data set further includes: sample data collected within a third preset time period before the occurrence of the historical user behavior event corresponding to each target candidate intention, and the third preset time period is before the first preset time period; at each sampling time, the label corresponding to the target candidate intention is the second label. If the historical user behavior events corresponding to other target candidate intentions except the target candidate intention occur within the second preset time period after the sampling time, the labels corresponding to the other target candidate intentions are the first label, otherwise they are the second label.
[0134] Specifically, traverse the historical user behavior events that occurred each day in the past N days. If there is at least one historical user behavior event corresponding to a target candidate intention occurring within the time period corresponding to the target scenario on the same day, then for each occurring target candidate intention, sample to obtain sample data within the third preset time period before the occurrence of the historical user behavior event corresponding to the target candidate intention on the same day. In the sample data obtained at this time, at each sampling time, it is considered that the target candidate intention does not occur, and the label corresponding to the target candidate intention is the second label. The third preset time period is before the first preset time period, so that the model can learn that the target candidate intention does not occur within the third preset time period before the occurrence of the target candidate intention. After training, the target candidate intention predicts that the target candidate intention does not occur within the third preset time period before the occurrence of the target candidate intention, avoiding prematurely predicting the occurrence of the target candidate intention and disturbing the user.
[0135] If the historical user behavior events corresponding to other target candidate intentions except the target candidate intention occur within the second preset time period after the sampling time, it is considered that other target candidate intentions also occur at the current sampling time, and the labels corresponding to the other target candidate intentions are the first label; if the historical user behavior events corresponding to other target candidate intentions do not occur within the second preset time period after the sampling time, it is considered that other target candidate intentions do not occur at the current sampling time, and the labels corresponding to the other target candidate intentions are the second label.
[0136] In this embodiment, the model is enabled to learn that the target candidate intention does not occur within the third preset time period before the occurrence of the target candidate intention. After training, the target candidate intention predicts that the target candidate intention does not occur within the third preset time period before the occurrence of the target candidate intention, avoiding disturbing the user by prematurely predicting the occurrence of the target candidate intention. And the labels of other target candidate intentions except the target candidate intention that occur within the second preset time period after the sampling moment are set to the first label, enabling the model to learn whether other target candidate intentions occur in advance by the second preset time period, so that the trained model can predict in advance whether other target candidate intentions occur.
[0137] It should be noted that the duration of the third preset time period can be set according to actual needs. The duration of the third preset time period is K minutes, where K is a positive integer, and K minutes can be set to 20 minutes, 25 minutes, or 30 minutes. Assuming that the duration of the third preset time period is K minutes, the sampling time range of the sample data is: from the starting moment of the target scenario to the moment corresponding to K minutes before the occurrence moment of the historical user behavior event corresponding to the target candidate intention.
[0138] It is worth noting that the sampling moments are all between the starting moment and the ending moment of the target scenario on the same day. If the moment corresponding to K minutes before the occurrence moment of the historical user behavior event corresponding to the target candidate intention is earlier than the starting moment of the target scenario on the same day, no sampling is performed.
[0139] Exemplarily, on each of the Y days within the past N days, the historical user behavior events corresponding to any target candidate intention have not occurred. The training sample data set further includes: the sample data collected in the target scenario on each of the Y days. At each sampling moment, the labels corresponding to multiple target candidate intentions are the second label, where Y is less than N.
[0140] Specifically, traverse each of the Y days within the past N days. On each of the Y days within the past N days, the historical user behavior events corresponding to any target candidate intention have not occurred. Then, sample data is collected in the target scenario on each of the Y days. At each sampling moment, the labels corresponding to multiple target candidate intentions are the second label, indicating that multiple target candidate intentions do not occur at this sampling moment.
[0141] Next, taking the construction of the training sample data set for the work commute scenario as an example, the construction process of the training sample data set will be described.
[0142] Assume that the multiple target candidate intentions corresponding to the user's work commute scenario include: listening to music, taking the subway, reading WeChat, and driving by oneself.
[0143] First, determine the time window range of the samples according to the target scenario. Since the work commute scenario occurs on weekdays, the past N weekdays can be used as the time window range of the samples, and historical user behavior events within the past N weekdays are selected to construct the sample data set.
[0144] Secondly, traverse each day within the time window to construct sample data.
[0145] For each day within the time window, determine the specific time range for sampling within each day through the sampling start time and end time corresponding to the target scenario or the start event and end event corresponding to the target scenario, that is, determine the time period corresponding to the work commute scenario within each day of the time window.
[0146] See Figure 6 , for each day within the time window, if no historical user behavior events corresponding to any of the target candidate intents occur within the time period corresponding to the work commute scenario on a certain day, then sample A sample data at preset time intervals within the time period corresponding to the work commute scenario on that day. At each sampling moment, the label of each target candidate intent is 0, that is, the label of each target candidate intent is the second label.
[0147] For each day within the time window, if one or more historical user behavior events corresponding to the target candidate intents occur within the time period corresponding to the work commute scenario on a certain day, then for each occurring target candidate intent, sample data is collected within two time periods.
[0148] (1) Collect sample data within the first preset time period before the occurrence of each historical user behavior event corresponding to the target candidate intent. As Figure 7 shown, assume that the duration of the first preset time period is D minutes and the duration of the second preset time period is L minutes. Taking the historical user behavior event corresponding to the self-driving intent occurring within the time period corresponding to the work commute scenario on a certain day as an example, randomly sample B sample data within the time period from the moment corresponding to K minutes before the occurrence moment of the first historical user behavior event corresponding to the self-driving intent to the occurrence moment of the first historical user behavior event corresponding to the self-driving intent. At each sampling moment, the label of the self-driving intent is 1. The labels of other target candidate intents are determined by whether other target candidate intents will occur within L minutes in the future at this sampling moment. If other target candidate intents occur, the labels of other target candidate intents are 1, otherwise, the labels of other target candidate intents are 0.
[0149] (2) Collect sample data within the third preset time period before the occurrence of each historical user behavior event corresponding to the target candidate intent. The third preset time period is before the first preset time period. As Figure 7As shown in the figure, assume that the duration of the third preset time period is K minutes. Taking the historical user behavior events corresponding to the occurrence of the self-driving intention within the time period corresponding to a certain day's work commute scenario as an example, B sample data are randomly sampled within the time period from the starting moment corresponding to the work commute scenario to the moment K minutes before the occurrence moment of the first historical user behavior event corresponding to the self-driving intention. At each sampling moment, the label of the self-driving intention is 0. The labels of other target candidate intentions are determined by whether other target candidate intentions will occur within the next L minutes from this sampling moment. If other target candidate intentions occur, the label of the other target candidate intention is 1; otherwise, the label of the other target candidate intention is 0.
[0150] The sample construction method in this embodiment can accurately capture the occurrence time of target candidate intentions in advance, while reducing the interference to users caused by premature prediction.
[0151] Step 130: Train a multi-intention prediction model according to the training sample data set.
[0152] After obtaining the training sample data set, train the model to be trained according to the training sample data set to obtain a multi-intention prediction model. The multi-intention prediction model is used to predict the occurrence probability of each target candidate intention among multiple target candidate intentions in the target scenario.
[0153] It should be noted that the model to be trained can be a deep neural network model, a binary classification model, a convolutional neural network model, a long short-term memory neural network model, etc., which is not limited in this embodiment.
[0154] In this embodiment, by positioning multiple target candidate intentions of the user to the dimension of the target scenario, a unified sample is constructed for multiple target candidate intentions in the target scenario, and a model is trained using the unified sample. The obtained model can predict the occurrence probability of multiple target candidate intentions in this target scenario, without separately constructing samples for each target candidate intention and separately training models using the constructed samples, thus avoiding the repetitive sampling operation at the same sampling moment for different intentions, and at the same time avoiding training the model multiple times, which can save manpower and material resources and reduce costs.
[0155] Exemplarily, after determining multiple target candidate intents of a user according to historical user behavior events that occurred in a target scenario, it further includes: generating a test sample data set in the target scenario according to the historical user behavior events corresponding to each target candidate intent among the multiple target candidate intents. The test sample data set is sampled at a preset time interval in the target scenario within the past M days. Each test sample data includes: the sampling moment, and the labels of the multiple target candidate intents at the sampling moment. The past M days and the past N days do not include the same day. At each sampling moment, if the historical user behavior event corresponding to the target candidate intent occurs within the second preset time period after the sampling moment, the label corresponding to the target candidate intent is the first label; otherwise, it is the second label. After training a multi-intent prediction model according to the training sample data set, it further includes: testing the multi-intent prediction model according to the test sample data set to obtain a multi-intent prediction model that meets the preset requirements.
[0156] Specifically, after determining multiple target candidate intents of a user in a target scenario, a test sample data set in the target scenario is further generated. After the model training is completed using the training sample data set, the trained multi-intent prediction model is tested using the test sample data set to obtain the occurrence probability of each target candidate intent. According to the occurrence probability of each target candidate intent obtained from the test, and the label of each target candidate intent in the test sample, the recall rate and precision rate of the test sample data set are calculated, etc. If both the recall rate and the precision rate reach the preset threshold, it indicates that the multi-intent prediction model meets the preset requirements and the multi-intent prediction model training is successful. At this time, the electronic device saves the successfully trained multi-intent prediction model. If any one of the recall rate and the precision rate does not reach the preset threshold, it indicates that the multi-intent prediction model does not meet the preset requirements, and the currently trained multi-intent prediction model is abandoned. After obtaining a multi-intent prediction model that meets the preset requirements, the multi-intent prediction model that meets the preset requirements can be called for intent prediction, and it is determined whether the user has the corresponding intent and recommended according to the prediction result.
[0157] In this embodiment, when constructing the test sample data set, first, determine the time window range of the samples. Taking the commuting-to-work scenario as an example, since the commuting-to-work scenario occurs on weekdays, the past M weekdays can be used as the time window range of the samples. Select historical user behavior events within the past M weekdays to construct the sample data set. The past M days and the past N days do not include the same day. Secondly, traverse each day within the time window to construct the training sample data. At the time period corresponding to the target scenario on each weekday, sample at a preset time interval. At each sampling moment, the label of each target candidate intention is determined by whether the target candidate intention will occur within the next L minutes from this sampling moment. If the target candidate intention occurs, the label of the target candidate intention is 1; otherwise, the label of the target candidate intention is 0. In this embodiment, sampling at a preset time interval is to achieve the effect of simulating real-time inference, and the preset time interval can be set according to needs.
[0158] The embodiment of the present application also provides a method for training a multi-intention prediction model, as Figure 8 shown, including:
[0159] Step S210: Determine multiple target candidate intentions of the user according to the historical user behavior events that occur in the target scenario.
[0160] Step S220: Generate a training sample data set for the target scenario according to the historical user behavior events corresponding to each target candidate intention among the multiple target candidate intentions.
[0161] Step S230: For the sampling moment corresponding to each sample data in the training sample data set, determine the historical behavior sequence and / or historical spatial trajectory sequence of the user within the fourth preset time period before the sampling moment.
[0162] Step S240: Train a multi-intention prediction model according to the training sample data set, the historical behavior sequence and / or historical spatial trajectory sequence within the fourth preset time period before the sampling moment corresponding to each sample data in the training sample data set.
[0163] Specifically, considering the user's personalized experience, there is generally a series of behavior sequences and / or spatial trajectory sequences before a certain target candidate intention occurs. When training, the model learns the user's historical behavior sequence and / or historical spatial trajectory sequence, and can learn the user's more accurate behavior patterns. In this way, when predicting, the model will make a judgment by combining the current moment, the user's behavior sequence and / or the user's spatial trajectory before the current moment. That is to say, the model makes predictions from multiple dimensions of time, behavior sequence and / or spatial trajectory sequence, rather than only from the dimension of time, which can improve the prediction accuracy.
[0164] Exemplarily, for each sampling moment corresponding to a sample data in the training sample dataset, determine the historical behavior sequence of the user within the fourth preset time period before the sampling moment, including: for each sampling moment corresponding to a sample data in the training sample dataset, obtain multiple historical behavior records within the fourth preset time period before the sampling moment, and each historical behavior record includes: the name of the historical user behavior event and the occurrence moment of the historical user behavior event; merge the Q historical behavior records that occur later into a historical behavior sequence according to the occurrence moment of the historical user behavior event, where Q is a positive integer.
[0165] In this embodiment, for each sampling moment corresponding to a sample data in the training sample dataset, a historical behavior sequence is determined.
[0166] For each sampling moment corresponding to a sample data, determine multiple historical behavior records according to the historical user behavior events within the fourth preset time period before the sampling moment, and each historical behavior record includes: the name of the historical user behavior event and the occurrence moment of the historical user behavior event. Merge the Q historical behavior records that occur later into a historical behavior sequence according to the occurrence moment of the historical user behavior event, where Q is a positive integer.
[0167] In an example, extract the occurrence moment for the historical user behavior event, and filter out the historical user behavior events whose occurrence moments are within the fourth preset time period of the sampling moment. Assuming the duration of the fourth preset time period is H minutes, then it is required that the occurrence moment of the historical user behavior event is within the first H minutes before the sampling moment. Implementably, the H minutes can be set according to actual needs, for example, it can be 30 minutes, 40 minutes, etc.
[0168] Establish a dictionary to save the name key of the filtered historical user behavior event and the occurrence moment value of the historical user behavior event. For the historical user behavior events that appear multiple times within the fourth preset time period, only take the last record that meets the conditions (i.e., the record with the latest occurrence moment).
[0169] The dictionary includes multiple keys and the values corresponding to each key. Sort the dictionary according to the value at the occurrence time, and determine the last Q key historical user behavior events. If Q is 5, the last 5 keys in the order of occurrence of the historical user behavior events are last_1_event, last_2_event, last_3_event, last_4_event, last_5_event. If not, fill in 'NULL'. Here, Q is a positive integer and is an adjustable parameter that can be set according to actual needs. For example, Q can be 5 or 6, etc. Merge the last 5 historical behavior records according to the occurrence time of the historical user behavior events into a historical behavior sequence. When merging, merge according to the sequence of the occurrence time of the historical user behavior events, so as to obtain the historical behavior sequence of the user at this sampling moment.
[0170] Perform the above operations for each sampling moment corresponding to the sample data, and the historical behavior sequence of the user at each sampling moment can be obtained.
[0171] Exemplarily, for each sampling moment corresponding to the sample data in the training sample dataset, obtain the historical spatial trajectory sequence of the user within the fourth preset time period before the sampling moment, including: for each sampling moment corresponding to the sample data in the training sample dataset, obtain multiple base station connection records within the fourth preset time period before the sampling moment. Each base station connection record includes: the connection time with the base station and the identification code of the base station; merge the last P base station connection records according to the connection time with the base station into a historical spatial trajectory sequence, where P is a positive integer.
[0172] In this embodiment, for each sampling moment corresponding to the sample data, generate the historical spatial trajectory sequence at each sampling moment according to multiple base station connection records within the fourth preset time period before the sampling moment.
[0173] For each sampling moment corresponding to the sample data, summarize the identification code cellid of the base station received when the electronic device is connected to the base station within the fourth preset time period before the sampling moment. For the multiple base station identification codes cellid that appear repeatedly within the fourth preset time period, only retain the last record (i.e., the record with the latest occurrence time), and delete other records. Assume that the duration of the fourth preset time period is H minutes, then it is required that the connection time of the electronic device with the base station is within the first H minutes before the sampling moment. Implementably, H minutes can be set according to actual needs, for example, it can be 30 minutes, 40 minutes, etc.
[0174] Sort the P base station connection records that occurred within the first H minutes before the sampling moment in the order of the connection times with the base stations. If P is 10, then the identification codes cellid of the last 10 base stations are arranged in the order of the connection times with the base stations as last_1_cell, last_2_cell, last_3_cell, last_4_cell, last_5_cell, last_6_cell, last_7_cell, last_8_cell, last_9_cell, last_10_cell. If there are none, fill in 'NULL'. After that, merge the identification codes cellid of the last 10 base stations that occurred in sequence to obtain the historical spatial trajectory sequence at this sampling moment.
[0175] Perform the above operations for each sampling moment corresponding to each sample data, and the historical spatial trajectory sequence of the user at each sampling moment can be obtained.
[0176] Exemplarily, according to the training sample data set, the historical behavior sequence and / or historical spatial trajectory sequence within the fourth preset time period before the sampling moment corresponding to each sample data in the training sample data set, a multi-intent prediction model is trained, including: performing hash processing on the historical behavior sequence and / or historical spatial trajectory sequence within the fourth preset time period before the sampling moment corresponding to each sample data in the training sample data set to obtain historical behavior sequence feature values and / or historical spatial trajectory feature values; training a multi-intent prediction model according to the training sample data set and the historical behavior sequence feature values and / or historical spatial trajectory feature values within the fourth preset time period before the sampling moment corresponding to each sample data in the training sample data set.
[0177] Specifically, after obtaining the historical behavior sequence and / or historical spatial trajectory sequence within the fourth preset time period before the sampling moment corresponding to each sample data in the training sample data set, first perform hash processing on the historical behavior sequence and / or historical spatial trajectory sequence to obtain historical behavior sequence feature values and / or historical spatial trajectory feature values. By converting the historical behavior sequence and / or historical spatial trajectory sequence into historical behavior sequence feature values and / or historical spatial trajectory feature values recognizable by the model, it is convenient for the model to learn the deep behavior patterns of users.
[0178] The input of the hash processing is: the historical behavior sequence and / or historical spatial trajectory sequence, and the output is: an R-dimensional embedding vector. R can be set according to actual needs. For example, R can be set to 5, then the output is a 5-dimensional embedding vector.
[0179] During the hashing process, for each element in the historical behavior sequence and / or historical spatial trajectory sequence, it is first transformed into an integer-type number T using a hashing method. Then, the remainder operation is performed on the dimension value R of the preset output vector using the integer-type number T to obtain the remainder G, and the remainder G also represents the index position of the R-dimensional vector. For example, if R is 5, the index positions of the R-dimensional vector can be represented as 0, 1, 2, 3, 4. The remainder obtained by taking the remainder of the remainder G by 5 is also 0, 1, 2, 3, 4, and the remainder and the index position correspond one by one. After determining the remainder, the index position is determined, and the remainder is assigned at the index position in a preset manner. The preset manner is: if the remainder G ≥ 0, it is assigned 1; if the remainder G < 0, it is assigned -1. After the remainder G is assigned in the preset manner and superimposed at the corresponding index position, and the remainder is taken for each element in a historical behavior sequence and superimposed at the corresponding index position after being assigned in the preset manner, an R-dimensional embedding vector corresponding to the historical behavior sequence can be obtained.
[0180] After performing the above hashing process on each historical behavior sequence and / or each historical spatial trajectory sequence, an R-dimensional embedding vector corresponding to each historical behavior sequence and / or each historical spatial trajectory sequence is obtained.
[0181] It should be noted that during the process of training the multi-intent prediction model based on the training sample data set, the sampling moment corresponding to each sample data in the training sample data set needs to be first converted into a time-type feature, and the model learns based on the time-type feature. The time-type features include but are not limited to: the current hour segment, day of the week, time difference feature, hour-minute cross feature, etc. Among them, the current hour segment is: the time of a day is divided into time segments. For example, starting from 0 o'clock, every two hours of the day is used as a time segment, and it is divided into 12 hour segments, and each hour segment is represented by the numbers 1 to 12. The current hour segment is determined according to the sampling moment. The day of the week is: Monday to Sunday can be represented by the numbers 1 to 7, and after determining the date to which the sampling moment belongs, it can be represented by a number which day of the week the sampling moment belongs to. The time difference feature is: the time difference between the sampling moment and the occurrence moment of the historical user behavior event that the user is concerned about. The historical user behavior event mentioned here can be the historical user behavior event corresponding to the user's target candidate intent, or other historical user behavior events. The hour-minute cross feature is: the feature obtained by splicing the hour and minute of the sampling moment into strings respectively.
[0182] Exemplarily, during the process of training the multi-intent prediction model based on the training sample dataset, frequency type features can also be determined according to the sampling moments corresponding to each sample data in the training sample dataset, and the model also learns based on the frequency type features. The frequency type features include but are not limited to: the occurrence frequency of historical user behavior events that the user is concerned about in the past F minutes since the sampling moment, the occurrence frequency of historical user behavior events that the user is concerned about in the past S hours since the sampling moment, and the occurrence frequency of historical user behavior events that the user is concerned about in the past J days since the sampling moment. The historical user behavior events that the user is concerned about here can be historical user behavior events corresponding to the target candidate intents of the user, or other historical user behavior events. Based on the frequency type features, the model can learn the degree of association between the target candidate intents that occur in the target scenario and the historical user behavior events that the user is concerned about.
[0183] As Figure 9 shown in a multi-intent recommendation method according to an embodiment of the present application, which is applied to an electronic device and specifically includes:
[0184] Step S310: Predict whether the target scenario is about to be triggered or detect whether the target scenario has been triggered. If it is predicted that the target scenario is about to be triggered, or it is detected that the target scenario has been triggered, step S320 is executed; otherwise, return to step S310.
[0185] Step S320: Determine whether there is an effective model. If there is an effective model, step S330 is executed; if there is no effective model, step S360 (recommend a preset multiple target candidate intents) is executed.
[0186] In this embodiment, the corresponding relationship between the target scenario and the model can be preset in advance, and by looking up this corresponding relationship, it can be determined whether there is an available model in the target scenario. If there is an effective model, then step S330 is executed. If there is no effective model, intents can be recommended to the user according to the preset policy process. For example, recommend a preset multiple target candidate intents.
[0187] Step S330: Obtain multiple target candidate intents of the user in the target scenario.
[0188] Since the time period in which the target scenario occurs is relatively fixed or there will be landmark events before and after the time period in which the scenario occurs. Therefore, when it is detected that the current moment reaches the starting moment of the target scenario, it is determined that the target scenario is triggered, or when it is detected that a landmark event before the time period in which the target scenario occurs occurs, it is determined that the target scenario is triggered. When it is determined that the target scenario is triggered, multiple target candidate intents of the user in the target scenario are obtained.
[0189] Step S340: Input the multiple target candidate intents into the model obtained by training with the multi-intent prediction model training method, and predict the occurrence probability of each target candidate intent among the multiple target candidate intents in the target scenario.
[0190] Input the multiple target candidate intents of the user in the target scenario into the multi-intent prediction model obtained by training with the multi-intent prediction model training method described in any of the above embodiments, and predict the occurrence probability of each target candidate intent among the multiple target candidate intents in the target scenario.
[0191] Step S350: Recommend the target candidate intents to the user according to the occurrence probability of each target candidate intent among the multiple target candidate intents in the target scenario, and the occurrence probability of the recommended target candidate intent is greater than or equal to the preset probability value.
[0192] For example, assume that the target scenario is the commuting-to-work scenario, and the multiple target candidate intents in the commuting-to-work scenario include: listening to music intent, driving by oneself intent, swiping short videos intent, taking the subway intent. The model obtained by training with the method described in the above embodiments predicts that the occurrence probability of the listening to music intent in the commuting-to-work scenario is 70%, the occurrence probability of the driving by oneself intent is 80%, the occurrence probability of the swiping short videos intent is 30%, and the occurrence probability of the taking the subway intent is 20%. Assume that the preset probability value is 50%, and when the occurrence probability of the target candidate intent is greater than or equal to 50%, recommend the target candidate intent to the user. Then, the target candidate intents recommended to the user in the commuting-to-work scenario are the listening to music intent and the driving by oneself intent.
[0193] As Figure 10 shown is another multi-intent recommendation method according to an embodiment of the present application, which is applied to an electronic device and specifically includes:
[0194] Step S410: Predict whether the target scenario is about to be triggered or detect whether the target scenario has been triggered. If it is predicted that the target scenario is about to be triggered, or it is detected that the target scenario has been triggered, execute Step S420; otherwise, return to Step S410.
[0195] Step S420: Determine whether there is an effective model. If there is an effective model, execute Step S430; if there is no effective model, execute Step S460 (recommend a preset multiple target candidate intents).
[0196] In this embodiment, the corresponding relationship between the target scenario and the model can be preset in advance, and by looking up this corresponding relationship, it is determined whether there is an available model in the target scenario. If there is an effective model, then execute Step S430. If there is no effective model, the intent can be recommended to the user according to the preset policy process. For example, recommend a preset multiple target candidate intents.
[0197] Step S430: When it is detected that the target scenario is triggered, obtain multiple target candidate intents of the user in the target scenario, as well as the historical behavior sequence and / or historical spatial trajectory sequence of the user within the sixth preset time period before the current moment.
[0198] Since the time period in which the target scenario occurs is relatively fixed or there are landmark events before and after the time period in which the scenario occurs. Therefore, it can be determined that the target scenario is triggered when it is detected that the current moment reaches the start time of the target scenario, or when it is detected that a landmark event before the time period in which the target scenario occurs occurs. When it is determined that the target scenario is triggered, obtain multiple target candidate intents of the user in the target scenario, and obtain the historical behavior sequence and / or historical spatial trajectory sequence of the user within the sixth preset time period before the current moment. The sixth preset time period can be set as needed. For example, the duration of the sixth preset time period can be 3 minutes, 5 minutes, etc.
[0199] Step S440: Input the multiple target candidate intents, the historical behavior sequence and / or historical spatial trajectory sequence into the model trained by the multi-intent prediction model training method, and predict the occurrence probability of each target candidate intent among the multiple target candidate intents in the target scenario.
[0200] Considering the user's personalized experience, there is generally a series of behavior sequences and / or spatial trajectory sequences before a certain target candidate intent occurs. When training, the model learns the user's historical behavior sequence and / or historical spatial trajectory sequence, and can learn the user's more accurate behavior patterns. In this way, when predicting, the model will make a judgment by combining the current moment, the historical behavior sequence and / or historical spatial trajectory sequence of the user within the sixth preset time period before the current moment at the same time. That is to say, the model makes predictions from multiple dimensions of time, behavior sequence and / or spatial trajectory sequence at the same time, rather than only from the dimension of time, which can improve the prediction accuracy.
[0201] Step S450: Recommend target candidate intents to the user according to the occurrence probability of each target candidate intent among the multiple target candidate intents in the target scenario, and the occurrence probability of the recommended target candidate intent is greater than or equal to the preset probability value.
[0202] For example, assume that the target scenario is the commuting-to-work scenario. In the commuting-to-work scenario, multiple target candidate intents include: the intent to listen to music, the intent to drive by oneself, the intent to brush short videos, and the intent to take the subway. The probabilities of occurrence of the intent to listen to music, the intent to drive by oneself, the intent to brush short videos, and the intent to take the subway in the commuting-to-work scenario predicted by the model trained according to the method described in the above embodiments are 70%, 80%, 30%, and 20% respectively. Assume that the preset probability value is 50%. When the probability of occurrence of the target candidate intent is greater than or equal to 50%, the target candidate intent is recommended to the user. Then, the target candidate intents recommended to the user in the commuting-to-work scenario are the intent to listen to music and the intent to drive by oneself.
[0203] Figure 11 FIG. is a schematic diagram of a recommended interface for providing target candidate intents to be recommended to the user. Exemplarily, in the locked screen state of the electronic device, services related to the target candidate intents to be recommended can be displayed in the message notification on the locked screen interface. Figure 11 In (a), the playing interface 501 of the music APP and the navigation interface 502 of the navigation APP are shown in the message notification. After the user clicks the message notification and unlocks the device, the electronic device can directly jump to the application interface corresponding to the service related to the target candidate intent to be recommended. Exemplarily, in the unlocked state of the electronic device, services related to the target candidate intents to be recommended can be floatingly displayed in the message notification at the top of the main screen interface. Figure 11 In (b), the playing interface 601 of the music APP and the navigation interface 602 of the navigation APP are shown in the message notification at the top of the main screen interface. After the user clicks the message notification, the electronic device can also directly jump to the application interface corresponding to the service related to the target candidate intent to be recommended. Exemplarily, in the unlocked state of the electronic device, apps related to the target candidate intents to be recommended can be floatingly displayed in the message notification at the top of the main screen interface. Figure 11 In (c), the music APP 701 and the navigation APP 702 are shown in the message notification at the top of the main screen interface. In the embodiments of the present application, the specific display method of the target candidate intent to be recommended is not limited.
[0204] It should be understood that the above examples are for helping those skilled in the art to understand the embodiments of the present application, rather than limiting the embodiments of the present application to the specific values or specific scenarios illustrated. Those skilled in the art can obviously make various equivalent modifications or changes according to the above examples, and such modifications or changes also fall within the scope of the embodiments of the present application.
[0205] The electronic device provided in this embodiment is used to execute the above multi-intent prediction model training method or the above multi-intent recommendation method, and thus can achieve the same effect as the above implementation methods.
[0206] In the case of adopting an integrated unit, the electronic device may further include a processing module, a storage module, and a communication module. Among them, the processing module may be used to control and manage the operations of the electronic device. The storage module may be used to support the electronic device in executing stored program codes, data, etc. The communication module may be used to support the communication of the electronic device with other devices.
[0207] Among them, the processing module may be a processor or a controller. It may implement or execute various exemplary logic blocks, modules, and circuits described in connection with the disclosure of the present application. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, and so on. The storage module may be a memory. The communication module may specifically be a device for interacting with other electronic devices, such as a radio frequency circuit, a Bluetooth chip, a Wi-Fi chip, etc.
[0208] In one embodiment, when the processing module is a processor and the storage module is a memory, the electronic device involved in this embodiment may be a device having Figure 3 the structure shown.
[0209] This embodiment also provides a computer storage medium. Computer instructions are stored in the computer storage medium. When the computer instructions run on the electronic device, the electronic device is caused to execute the above-related method steps to implement the multi-intent prediction model training method in the above embodiment or the multi-intent recommendation method in the above embodiment.
[0210] This embodiment also provides a computer program product. When the computer program product runs on a computer, the computer is caused to execute the above-related steps to implement the multi-intent prediction model training method in the above embodiment or the multi-intent recommendation method in the above embodiment.
[0211] In addition, an embodiment of the present application also provides a device. This device may specifically be a chip, a component, or a module. The device may include a processor and a memory connected to each other. Among them, the memory is used to store computer execution instructions. When the device runs, the processor may execute the computer execution instructions stored in the memory so that the chip executes the multi-intent prediction model training method in each of the above method embodiments.
[0212] Among them, the electronic device, computer storage medium, computer program product, or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be elaborated here.
[0213] Through the description of the above embodiments, those skilled in the art can understand that for the convenience and conciseness of description, only the division of the above function modules is used as an example. In actual applications, the above functions can be allocated to different function modules according to needs, that is, the internal structure of the device is divided into different function modules to complete all or part of the functions described above.
[0214] In several embodiments provided by the present application, it should be understood that the disclosed device and method can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of the device or unit can be in electrical, mechanical or other forms.
[0215] The units described as separate components may or may not be physically separated. The components displayed as units may be one physical unit or multiple physical units, that is, they can be located in one place or distributed to multiple different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0216] In addition, the functional units in each embodiment of the present application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.
[0217] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on such an understanding, the technical solution of the embodiments of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The software product is stored in a storage medium and includes several instructions to enable a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods in the various embodiments of the present application. The foregoing storage medium includes: USB flash drive, mobile hard disk, read only memory (ROM), random access memory (RAM), magnetic disk or optical disc and other various media that can store program codes.
[0218] It should be understood that the above is only to help those skilled in the art better understand the embodiments of the present application, rather than to limit the scope of the embodiments of the present application. Those skilled in the art can obviously make various equivalent modifications or changes according to the above examples. For example, in the various embodiments of the above detection method, some steps may not be necessary, or some steps may be newly added, etc. Or any combination of any two or any number of the above embodiments. Such modified, changed or combined solutions also fall within the scope of the embodiments of the present application.
[0219] It should also be understood that the above description of the embodiments of the present application focuses on emphasizing the differences between the various embodiments. The same or similar parts not mentioned can be referred to each other. For the sake of brevity, they will not be elaborated here.
[0220] It should also be understood that the magnitudes of the serial numbers of the above processes do not mean the order of execution. The order of execution of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
[0221] It should also be understood that in the embodiments of the present application, "predetermined" and "predefined" can be implemented by pre-saving corresponding codes, tables or other means that can be used to indicate relevant information in a device (for example, including an electronic device). The present application does not limit its specific implementation manner.
[0222] It should also be understood that the division of the manners, situations, categories and embodiments in the embodiments of the present application is only for the convenience of description and should not constitute a special limitation. The features in various manners, categories, situations and embodiments can be combined without conflict.
[0223] It should also be understood that in the various embodiments of the present application, if there is no special description and logical conflict, the terms and / or descriptions between different embodiments are consistent and can be referred to each other. The technical features in different embodiments can be combined to form new embodiments according to their internal logical relationships.
[0224] Finally, it should be noted that the above are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any change or replacement within the technical scope disclosed in the present application should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method for training a multi-intention prediction model, characterized in that Applied to an electronic device, the method includes: Determine multiple target candidate intents of a user according to historical user behavior events that occurred in a target scenario, where the historical user behavior events occurred within the past N days; Generate a training sample data set in the target scenario according to the historical user behavior events corresponding to each of the multiple target candidate intents. Each sample data in the training sample data set includes: the sampling moment corresponding to the sample data, and the labels of the multiple target candidate intents at the sampling moment. If the label is a first label, it indicates that the target candidate intent occurred at the sampling moment. If the label is a second label, it indicates that the target candidate intent did not occur at the sampling moment; Train a multi-intent prediction model according to the training sample data set. The multi-intent prediction model is used to predict the occurrence probability of each of the multiple target candidate intents in the target scenario.
2. The multi-intention prediction model training method according to claim 1, wherein The training sample data set includes: sample data collected within a first preset time period before the historical user behavior event corresponding to each of the target candidate intents; At each sampling moment, if the historical user behavior events corresponding to other target candidate intents except the target candidate intent occur within a second preset time period after the sampling moment, the labels corresponding to the other target candidate intents are the first label, otherwise they are the second label.
3. The multi-intention prediction model training method according to claim 2, wherein The training sample data set further includes: sample data collected within a third preset time period before the historical user behavior event corresponding to each of the target candidate intents, where the third preset time period is before the first preset time period; At each sampling moment, if the historical user behavior events corresponding to other target candidate intents except the target candidate intent occur within a second preset time period after the sampling moment, the labels corresponding to the other target candidate intents are the first label, otherwise they are the second label.
4. The multi-intention prediction model training method according to claim 2 or 3, characterized in that, On each of the Y days within the past N days, the historical user behavior events corresponding to any of the target candidate intents did not occur. The training sample data set further includes: sample data collected in the target scenario on each of the Y days. At each sampling moment, the labels corresponding to the multiple target candidate intents are the second label, where Y is less than N.
5. The multi-intention prediction model training method according to any one of claims 1 to 4, characterized in that The training the multi-intent prediction model according to the training sample data set includes: For the sampling moment corresponding to each sample data in the training sample data set, determine the historical behavior sequence and / or historical spatial trajectory sequence of the user within a fourth preset time period before the sampling moment; Train the multi-intent prediction model according to the training sample data set, the historical behavior sequence and / or the historical spatial trajectory sequence within the fourth preset time period before the sampling moment corresponding to each sample data in the training sample data set.
6. The multi-intention prediction model training method according to claim 5, wherein Training the multi-intent prediction model according to the training sample data set, the historical behavior sequence and / or the historical spatial trajectory sequence within a fourth preset time period before the sampling time corresponding to each sample data in the training sample data set, includes: Performing hashing processing on the historical behavior sequence and / or the historical spatial trajectory sequence within a fourth preset time period before the sampling time corresponding to each sample data in the training sample data set to obtain historical behavior sequence feature values and / or historical spatial trajectory feature values; Training the multi-intent prediction model according to the training sample data set, and the historical behavior sequence feature values and / or the historical spatial trajectory feature values within a fourth preset time period before the sampling time corresponding to each sample data in the training sample data set.
7. The method for training a multi-intention prediction model according to claim 5 or 6, characterized in that For each sampling time corresponding to each sample data in the training sample data set, determining the historical behavior sequence of the user within a fourth preset time period before the sampling time, includes: For each sampling time corresponding to each sample data in the training sample data set, obtaining multiple historical behavior records within the fourth preset time period before the sampling time, each historical behavior record includes: the name of the historical user behavior event, and the occurrence time of the historical user behavior event; Merging the Q historical behavior records that occur later into a historical behavior sequence according to the occurrence time of the historical user behavior event, where Q is a positive integer.
8. The multi-intention prediction model training method according to claim 5 or 6, characterized in that, For each sampling time corresponding to each sample data in the training sample data set, obtaining the historical spatial trajectory sequence of the user within a fourth preset time period before the sampling time, includes: For each sampling time corresponding to each sample data in the training sample data set, obtaining multiple base station connection records within the fourth preset time period before the sampling time, each base station connection record includes: the connection time with the base station, and the identification code of the base station; Merging the P base station connection records that occur later into a historical spatial trajectory sequence according to the connection time with the base station, where P is a positive integer.
9. The multi-intention prediction model training method according to any one of claims 1 to 8, characterized in that Determining multiple target candidate intents of the user according to the historical user behavior events that occur in the target scenario, includes: Obtaining multiple initial candidate intents in the target scenario; Counting the occurrence frequency of each initial candidate intent among the multiple initial candidate intents in the target scenario within a fifth preset time period; Determining the initial candidate intents with the frequency greater than or equal to the preset frequency as the target candidate intents of the user.
10. The multi-intention prediction model training method according to any one of claims 1 to 9, characterized in that, After determining multiple target candidate intents of the user according to the historical user behavior events that occur in the target scenario, further includes: Generate a test sample data set for the target scenario according to the historical user behavior events corresponding to each of the multiple target candidate intents. The test sample data set is sampled at a preset time interval in the target scenario within the past M days. Each test sample data includes: the sampling moment, and the labels of the multiple target candidate intents at the sampling moment. The past M days and the past N days do not include the same day. At each sampling moment, if the historical user behavior event corresponding to the target candidate intent occurs within the second preset time period after the sampling moment, the label corresponding to the target candidate intent is the first label, otherwise it is the second label. After training the multi-intent prediction model according to the training sample data set, it further includes: Test the multi-intent prediction model according to the test sample data set to obtain the multi-intent prediction model that meets the preset requirements.
11. A multi-intention recommendation method, characterized in that, Applied to an electronic device, it includes: In the case of predicting that the target scenario is about to be triggered or detecting that the target scenario has been triggered, obtain multiple target candidate intents of the user in the target scenario. Input the multiple target candidate intents into the model trained by the method described in any one of claims 1 to 4, 9 and 10 above to predict the occurrence probability of each of the multiple target candidate intents in the target scenario. Recommend target candidate intents to the user according to the occurrence probability of each of the multiple target candidate intents in the target scenario. The occurrence probability of the recommended target candidate intent is greater than or equal to the preset probability value.
12. A multi-intention recommendation method, characterized in that, Applied to an electronic device, it includes: In the case of predicting that the target scenario is about to be triggered or detecting that the target scenario has been triggered, obtain multiple target candidate intents of the user in the target scenario, as well as the historical behavior sequence and / or historical spatial trajectory sequence of the user within the sixth preset time period before the current moment. Input the multiple target candidate intents, the historical behavior sequence and / or the historical spatial trajectory sequence into the model trained by the method described in any one of claims 5 to 8 above to predict the occurrence probability of each of the multiple target candidate intents in the target scenario. Recommend target candidate intents to the user according to the occurrence probability of each of the multiple target candidate intents in the target scenario. The occurrence probability of the recommended target candidate intent is greater than or equal to the preset probability value.
13. An electronic device, characterized in that, The electronic device includes a memory and a processor. The memory is used to store instructions. When the instructions are executed by the processor, the electronic device executes the multi-intent prediction model training method described in any one of claims 1 to 10, or executes the multi-intent recommendation method described in claim 11 or 12.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and the computer program includes program instructions. When the program instructions are executed, the multi-intention prediction model training method described in any one of claims 1 to 10 is implemented, or the multi-intention recommendation method described in claim 11 or 12 is implemented.
15. A computer program product, characterized in that, The computer program product includes: computer program code, and when the computer program code runs on a computer, it causes the computer to execute the multi-intention prediction model training method described in any one of claims 1 to 10, or execute the multi-intention recommendation method described in claim 11 or 12.
Citation Information
Patent Citations
User intention prediction method and device, electronic equipment and storage medium
CN108446374A
Model training method and system and sequence data prediction method and system
CN110097193A
Training method and device of intention determination model
CN113343028A
Data recommendation method and device based on machine learning model, apparatus and medium
CN113779414A
Sequence recommendation method based on user multi-intention evolution
CN114491248A