Multi-scene-crossing multi-task transfer scheme sorting method, system and equipment
By introducing neural network model and feature alignment technology of the scene judgment layer in the sorting of transit schemes, the problem of training data fragmentation of each page is solved, and a more accurate and efficient sorting of transit schemes is achieved.
Patent Information
- Application Number
- CN202411739250.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-25
AI Technical Summary
In the ordering of transit schemes, the training data of each page scene cannot be shared by the existing technology, which makes the sorting effect difficult to meet the actual application needs.
A neural network model containing scene judgment layer is adopted to effectively merge data through feature alignment, solve the problem of training data splitting, and use the scene judgment layer to automatically identify and distinguish feature patterns of different scenarios.
The unified modeling of training data in different scenarios is realized, the sorting accuracy is improved, and the common characteristics between different scenarios are fully utilized, so that the effect of the sorting model can meet the practical application needs.
Smart Images

Figure CN119692674A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of transit scheme sorting, and in particular to a method, system and device for sorting multi-task transit schemes across multiple scenarios. Background Art
[0002] In online transportation ticketing services, it is often necessary to provide users with a variety of transfer options. These transfer options will be displayed in different page scenarios, such as displaying transfer recommendations in the train list page scenario, and displaying related transfer option recommendations in the order details page scenario. Due to the large number of assembled transfer options and the limited display space on each page, it is necessary to sort these transfer options and give priority to displaying the transfer options that users are most likely to successfully place orders. However, transfer options in different page scenarios have different characteristics and user preferences. For example, users are more concerned about price and time on the train list page, but may be more concerned about the match with the selected train on the order details page, which brings challenges to the sorting of transfer options.
[0003] The existing technology usually adopts the method of establishing a separate sorting model for each scenario, and sorting and displaying the transfer solutions in the scenario through the respective sorting models. However, this independent modeling method causes the training data of each scenario to be separated, and the common features between different scenarios cannot be shared. In particular, in some scenarios with less training data, the sorting effect of the trained sorting model is difficult to meet the actual application requirements because it cannot draw on the effective features of other scenarios. Summary of the invention
[0004] The present application provides a method, system and device for sorting multi-task transfer schemes across multiple scenarios, which are used to fully utilize the training data of each scenario so that the sorting effect of the trained sorting model can meet the actual application requirements.
[0005] In a first aspect, the present application provides a method for sorting multi-task transit schemes across multiple scenarios, the method comprising: obtaining first training data and first test data of a first target scenario, and second training data and second test data of a second target scenario, wherein the first training data and the second training data both include feature data and a scenario identifier; aligning the features of the first training data and the second training data and merging them to generate target training data; constructing a neural network model including a scene judgment layer, and training the neural network model with the target training data to generate a target model, wherein the scene judgment layer is used to distinguish and process the training data of different scenarios according to the scene identifier; inputting the first test data and the second test data into the target model to generate a test result; when the test result meets the preset requirements, receiving feature data and scenario identifiers of multiple transit schemes to be sorted, inputting the feature data and scenario identifiers of each of the transit schemes to be sorted into the target model, and generating a sorting score for each of the transit schemes to be sorted in the corresponding scenario; and sorting the multiple transit schemes to be sorted in descending order according to the sorting scores.
[0006] By adopting the above technical solution and introducing the neural network model structure of the scene judgment layer, unified modeling of training data for different scenes is achieved. The effective merging of data is achieved through feature alignment, which solves the problem of training data fragmentation in traditional methods. At the same time, the scene judgment layer is used to automatically identify and distinguish the feature patterns of different scenes, while maintaining the uniqueness of the scene and making full use of the common features between different scenes. This unified modeling method is particularly suitable for scenes with less training data. It can enhance the model learning ability with the help of effective features of other scenes, and ensure the reliability of the model through test data verification. This method not only improves the sorting accuracy, but also makes full use of the training data of each scene, so that the sorting effect of the trained sorting model can meet the actual application needs.
[0007] Optionally, the step of aligning the features of the first training data and the second training data and merging them to generate target training data includes: performing feature normalization processing on the first feature data in the first training data and the second feature data in the second training data to obtain first normalized data and second normalized data; aligning the first normalized data and the second normalized data according to a preset feature dimension to obtain first target feature data and second target feature data with unified dimensions; combining the first target feature data and its corresponding scene identifier into a first training sample, combining the second target feature data and its corresponding scene identifier into a second training sample, and merging the first training sample and the second training sample to generate the target training data.
[0008] By adopting the above technical solution, the problem of inconsistent feature numerical scales in different scenes is solved through feature normalization processing, and the uniformity of the first target feature data and the second target feature data in dimension is ensured through the alignment processing of the preset feature dimensions. Finally, the feature data and the scene identifier are combined to form training samples and merged to generate standardized target training data. This processing method not only eliminates the scale differences between different scene data, but also ensures the consistency of feature dimensions, so that the model can better learn the common features between different scenes, improve the training effect and generalization ability of the model, and also facilitate the unified processing and feature learning of subsequent neural network models.
[0009] Optionally, the target training data is used to train the neural network model to generate a target model, including: inputting the target training data into the neural network model in batches according to a preset batch size to obtain output results of each batch of target training data; calculating a target loss function value according to a first task prediction result and a second task prediction result in the output results, wherein the first task prediction result is an output value of a click probability of each batch of target training data, and the second task prediction result is an output value of a purchase probability of each batch of target training data; gradient updating parameters of the neural network model according to the target loss function value; and when the target loss function value is less than a preset loss threshold, determining the current neural network model as the target model.
[0010] By adopting the above technical solution, the neural network model is optimized by batch training and multi-task learning. The target loss function value is calculated by simultaneously predicting the output results of the two tasks of click probability and purchase probability, so that the model can comprehensively consider the characteristics of user click and purchase behavior. This training method not only improves the model's understanding of user behavior, but also ensures the convergence and stability of model training through gradient updates and loss threshold control. Since user behavior is decomposed into two levels, click and purchase, the model can more accurately capture the user's decision-making process, thereby generating ranking results that are more in line with actual user behavior patterns, effectively improving the prediction accuracy and practical value of the model.
[0011] Optionally, inputting the first test data and the second test data into the target model to generate a test result includes: inputting the first test data into the target model to obtain a first scenario test result, wherein the first scenario test result includes a first scenario click prediction accuracy and a first scenario purchase prediction accuracy; inputting the second test data into the target model to obtain a second scenario test result, wherein the second scenario test result includes a second scenario click prediction accuracy and a second scenario purchase prediction accuracy; when the first scenario click prediction accuracy and the first scenario purchase prediction accuracy are both greater than a first accuracy threshold, and the second scenario click prediction accuracy and the second scenario purchase prediction accuracy are both greater than a second accuracy threshold, it is determined that the test result meets preset requirements.
[0012] By adopting the above technical solution, the prediction effect of the target model is tested by different scenarios, the click and purchase prediction accuracy in different scenarios are calculated respectively, and the corresponding accuracy threshold is set as the model performance evaluation standard. This evaluation mechanism ensures that the model can achieve the expected prediction effect in each scenario, avoiding the situation where one scenario performs well while other scenarios perform poorly. By simultaneously examining the prediction accuracy of the two dimensions of clicks and purchases, it not only ensures the comprehensiveness of the model in user behavior prediction, but also improves the reliability and generalization ability of the model in practical applications, providing a reliable model foundation for the subsequent sorting of transit solutions.
[0013] Optionally, the characteristic data and scenario identifier of each of the transit schemes to be sorted are input into the target model to generate a ranking score for each of the transit schemes to be sorted in the corresponding scenario, including: combining the characteristic data and scenario identifier of each of the transit schemes to be sorted into target input data; inputting the target input data into the target model to obtain a click probability prediction value and a purchase probability prediction value of each of the transit schemes to be sorted; and calculating the ranking score of each of the transit schemes to be sorted in the corresponding scenario according to preset weights based on the click probability prediction value and the purchase probability prediction value of each of the transit schemes to be sorted.
[0014] By adopting the above technical solution, the characteristic data and scenario identification of the transit plan to be sorted are combined and input into the target model, the two prediction dimensions of click probability and purchase probability are comprehensively considered, and weighted calculation is performed through preset weights to obtain the final sorting score. This calculation method not only takes into account the user's initial interest, but also pays attention to the final conversion intention, so that the sorting results can better balance the user's browsing experience and purchase intention, thereby improving the accuracy of the transit plan display and the commercial conversion effect, and effectively improving the user's decision-making efficiency and the business value of the platform.
[0015] Optionally, the multiple transit schemes to be sorted are sorted in descending order according to the sorting scores, including: obtaining a scenario identifier corresponding to each of the transit schemes to be sorted; grouping each of the transit schemes to be sorted according to the scenario identifier to obtain a transit scheme group to be sorted under different scenarios; sorting the transit schemes to be sorted in each of the transit scheme groups to be sorted in descending order according to the sorting scores to obtain a sorting result under each scenario.
[0016] By adopting the above technical solution, the transit plans to be sorted are grouped and sorted by scene identification, realizing independent sorting of transit plans in different scenes. This group descending sorting method avoids the sorting deviation that may be caused by direct comparison of transit plans in different scenes, and ensures the accuracy and rationality of the sorting within each scene. By maintaining the independence of the sorting within the scene, the final displayed results not only meet the characteristics of each scene, but also meet the differentiated needs of users in different scenes, improving the accuracy of the transit plan display and user experience.
[0017] Optionally, after sorting the multiple transit plans to be sorted in descending order according to the sorting scores, it also includes: obtaining user evaluation information on each of the transit plans to be sorted; determining the feature dimensions to be optimized based on the evaluation information; and adjusting the feature weights of the target model based on the feature dimensions to be optimized.
[0018] By adopting the above technical solution, by collecting users' evaluation information on the transfer plan and analyzing and determining the feature dimensions that need to be optimized, the dynamic adjustment of the target model feature weights is achieved, and a model optimization mechanism based on user feedback is established. This adaptive optimization method enables the model to respond to changes in user preferences in a timely manner and continuously optimize the allocation of feature weights, thereby improving the matching degree between the sorting results and the actual needs of users. Through continuous feature weight adjustment, the sorting effect of the model can be continuously optimized with user feedback, which not only improves the adaptability of the model, but also ensures the timeliness and accuracy of the sorting results.
[0019] In a second aspect, the present application provides a multi-task transit scheme sorting system across multiple scenarios, the system comprising: an acquisition module, a first generation module, a construction module, a second generation module, an input module and a sorting module; wherein the acquisition module is used to acquire first training data and first test data of a first target scenario, and second training data and second test data of a second target scenario, wherein the first training data and the second training data both include feature data and a scenario identifier; the first generation module is used to merge the first training data and the second training data after feature alignment to generate target training data; the construction module is used to construct a neural network model including a scenario judgment layer, and through the target training The neural network model is trained with training data to generate a target model, and the scenario judgment layer is used to distinguish and process the training data of different scenarios according to the scenario identification; the second generation module is used to input the first test data and the second test data into the target model to generate a test result; the input module is used to receive the feature data and scenario identification of multiple transit schemes to be sorted when the test result meets the preset requirements, input the feature data and scenario identification of each transit scheme to be sorted into the target model, and generate a ranking score for each transit scheme to be sorted in the corresponding scenario; the sorting module is used to sort the multiple transit schemes to be sorted in descending order according to the ranking score.
[0020] In the third aspect, the present application provides an electronic device, adopting the following technical solution: including a processor, a memory, a user interface and a network interface, the memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device executes a computer program such as any of the above-mentioned multi-task transfer scheme sorting methods across multiple scenarios.
[0021] In a fourth aspect, the present application provides a computer-readable storage medium, which adopts the following technical solution: storing a computer program that can be loaded by a processor and execute any of the above-mentioned multi-task transfer scheme sorting methods across multiple scenarios.
[0022] In summary, the present application includes at least one of the following beneficial technical effects: By introducing the neural network model structure of the scene judgment layer, unified modeling of training data for different scenes is achieved. The effective merging of data is achieved through feature alignment, which solves the problem of training data fragmentation in traditional methods. At the same time, the scene judgment layer is used to automatically identify and distinguish the feature patterns of different scenes, while maintaining the uniqueness of the scene and making full use of the common features between different scenes. This unified modeling method is particularly suitable for scenes with less training data. It can enhance the model learning ability with the help of effective features of other scenes, and ensure the reliability of the model through test data verification. This method not only improves the sorting accuracy, but also makes full use of the training data of each scene, so that the sorting effect of the trained sorting model can meet the actual application needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 It is a flowchart of a method for sorting multi-task transfer solutions across multiple scenarios provided in an embodiment of the present application; Figure 2 It is a structural diagram of a multi-task transfer scheme sorting system across multiple scenarios provided by an embodiment of the present application; Figure 3 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application.
[0024] Description of reference numerals: 1000, electronic device; 1001, processor; 1002, communication bus; 1003, user interface; 1004, network interface; 1005, memory. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.
[0026] In the description of the embodiments of the present application, words such as "illustrative", "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "illustrative", "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "illustrative", "for example" or "for example" is intended to present related concepts in a concrete way.
[0027] Figure 1 1 is a flow chart of a method for sorting multi-task transfer solutions across multiple scenarios provided by an embodiment of the present application. Figure 1 As shown, the method includes S101-S106: S101, obtaining first training data and first test data of a first target scene, and second training data and second test data of a second target scene, wherein both the first training data and the second training data include feature data and a scene identifier.
[0028] When sorting transfer options, users may choose and purchase through different page scenarios. In the train ticket business, there are two main important scenarios: the transfer recommendation scenario at the bottom of the train ticket list page (the first target scenario) and the transfer recommendation scenario on the train details page (the second target scenario). Since the user's behavior patterns and decision-making basis may be different in different scenarios, it is necessary to collect training data and test data in each scenario separately to build an accurate sorting model.
[0029] Specifically, for the first target scenario, historical data including users viewing and purchasing transfer plans at the bottom of the train ticket list page is collected as the first training data, including feature data such as total plan duration, total plan price, departure station, arrival station, transfer station, departure city, arrival city, transfer city, user preferred transfer station, user preferred transfer city, and a scenario identifier that indicates that the data comes from the first target scenario. At the same time, a portion of data is randomly extracted from the historical data of the scenario at a ratio of 8:2 as the first test data for subsequent model effect verification.
[0030] For the second target scenario, historical data including users viewing and purchasing transfer plans on the train details page are collected as the second training data, and its feature data includes the total duration of the plan, the total price of the plan, the departure station, the arrival station, the departure city, the arrival city, the transfer city, the departure time, the transfer waiting time, etc., as well as the scenario identifier that indicates that the data comes from the second target scenario. Similarly, part of the data is randomly selected from the historical data of this scenario at a ratio of 8:2 as the second test data.
[0031] In the process of data collection, in order to ensure data quality, user behavior data is preprocessed: first, exposure data with too short a stay time (less than 1 second) is filtered out; second, outlier processing is performed on numerical features, and data exceeding 3 times the standard deviation is considered as outliers and deleted; finally, encoding conversion is performed on categorical features, and information such as sites and cities is converted into corresponding numerical IDs. In this way, reliable quality and complete structured training and test data are obtained, providing a data basis for subsequent model training and verification.
[0032] S102, aligning features of the first training data and the second training data and merging them to generate target training data.
[0033] In order to make full use of the training data in different scenarios and realize joint modeling, it is necessary to align and merge the features of the first training data and the second training data. The first training data comes from the transfer recommendation scenario at the bottom of the train ticket list page (scenario id=1), including features such as [whether to buy, whether to click, scenario id, total duration of the plan, total price of the plan, departure station, arrival station, transfer station, departure city, arrival city, transfer city, user preferred transfer station, user preferred transfer city]. The second training data comes from the transfer recommendation scenario on the train details page (scenario id=2), including features such as [whether to buy, whether to click, scenario id, total duration of the plan, total price of the plan, departure station, arrival station, departure city, arrival city, transfer city, departure time, transfer waiting time].
[0034] The specific implementation of feature alignment is to find the union of the feature lists of the two scenarios to form a unified feature dimension [whether to buy, whether to click, scenario id, total duration of the plan, total price of the plan, departure station, arrival station, departure city, arrival city, transfer city, user preferred transfer station, user preferred transfer city, departure time, transfer waiting time]. For features that only exist in a single scenario, a special value of -1 is filled in the other scenario. For example, the first training data [0, 0, 1, 110, 12.5, 16666, 18888, 17777, 166, 188, 177, 36666, 388] becomes [0, 0, 1, 110, 12.5, 16666, 18888, 17777, 166, 188, 177, 36666, 388, -1, -1] after alignment, where -1 represents the departure time and transfer waiting time features that do not exist in the first scenario.
[0035] Similarly, the second training data [0, 1, 2, 120, 14.5, 26666, 28888, 27777, 266, 288, 277, 12.5, 38] becomes [0, 1, 2, 120, 14.5, 26666, 28888, 27777, 266, 288, 277, -1, -1, 12.5, 38] after alignment, where -1 represents the user preferred transit station and user preferred transit city features that do not exist in the second scenario.
[0036] By merging the two aligned training data sets, we get the target training data that can be used for joint modeling. In this process, the scene attribution information of the data is retained through the scene id field (value is 1 or 2), so that the model can identify the source of the data and perform scenario-based modeling. The features in the target training data can be divided into the following categories: label features (whether to purchase, whether to click), which are used for multi-task learning of the model; scene features (scene id), which are used to distinguish the source of data; common features (such as total duration of the plan, total price of the plan, etc.), which reflect the common influencing factors of user decisions in different scenarios; scene-specific features (such as user preferred transfer stations, departure time, etc.), which reflect the unique attributes of each scene.
[0037] Based on the above embodiment, as an optional implementation, in S102, merging the first training data and the second training data after feature alignment to generate target training data specifically includes S21-S23: S21, performing feature normalization processing on the first feature data in the first training data and the second feature data in the second training data to obtain first normalized data and second normalized data.
[0038] S22, aligning the first normalized data and the second normalized data according to a preset feature dimension to obtain first target feature data and second target feature data with unified dimensions.
[0039] S23, combining the first target feature data and the corresponding scene identifier into a first training sample, combining the second target feature data and the corresponding scene identifier into a second training sample, and merging the first training sample and the second training sample to generate target training data.
[0040] Before building a neural network model, training data from different scenarios need to be preprocessed to ensure that the data format is unified and the feature scale is consistent. This preprocessing process includes three key steps: feature normalization, feature alignment, and data merging. Its purpose is to eliminate the impact of feature scale differences and enable data from different scenarios to be trained in the same model.
[0041] First, feature normalization is performed. The first training data (from the transfer recommendation scenario at the bottom of the train ticket list page) contains the following features: total duration of the plan (range 300-7200 seconds), total price of the plan (range 50-2000 yuan), departure station ID (range 10000-99999), arrival station ID (range 10000-99999), transfer station ID (range 10000-99999), departure city ID (range 100-999), arrival city ID (range 100-999), transfer city ID (range 100-999), user preferred transfer station ID (range 10000-99999), user preferred transfer city ID (range 100-999). The second training data (from the transfer recommendation scenario on the train details page) contains the following features: total duration of the plan, total price of the plan, departure station ID, arrival station ID, departure city ID, arrival city ID, transfer city ID, departure time (range 0-1440 minutes), and transfer waiting time (range 15-480 minutes).
[0042] These features are processed using the Min-Max normalization method to map all values to the [0,1] interval. The calculation formula is: x_norm=(x-x_min) / (x_max-x_min), where x is the original value, x_min and x_max are the minimum and maximum values of the feature, respectively. For example, the total duration of the program is 300, which is normalized to (300-300) / (7200-300)=0, and the total duration of the program is 7200, which is normalized to (7200-300) / (7200-300)=1. After this processing, the first normalized data and the second normalized data are obtained, and all feature values are mapped to the same numerical range.
[0043] Next, feature alignment is performed to unify the features of the two scenarios into the preset feature dimensions. The preset feature dimensions include: [whether to purchase, whether to click, scenario ID, total duration of the plan, total price of the plan, departure station ID, arrival station ID, departure city ID, arrival city ID, transit city ID, user preferred transit station ID, user preferred transit city ID, departure time, transit waiting time]. For features that do not exist in the first scenario (departure time, transit waiting time), fill in the special value -1; for features that do not exist in the second scenario (user preferred transit station ID, user preferred transit city ID), also fill in -1. After this processing, the data of the two scenarios have the same feature dimensions, and the first target feature data and the second target feature data with unified dimensions are obtained.
[0044] Finally, the training samples are combined and merged. For the data of the first scene, the first target feature data is combined with scene identifier 1 to form the first training sample; for the data of the second scene, the second target feature data is combined with scene identifier 2 to form the second training sample. For example, the format of the first training sample is [0, 1, 1, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.4, 0.5, -1, -1], which indicates a sample that was not purchased but clicked, from scene 1, followed by the normalized feature value. The format of the second training sample is [1, 1, 2, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.5, -1, -1, 0.3, 0.4], which indicates a sample that was purchased and clicked, from scene 2.
[0045] Merge all training samples into a unified data set, namely the target training data. Maintain the integrity of the samples when merging, and ensure that each sample contains complete label information (whether purchased, clicked), scene identification, and feature data. In order to ensure the balance of training, the proportion of samples from different scenes can be adjusted through sampling strategies so that the model can fully learn the feature patterns of different scenes.
[0046] S103, constructing a neural network model including a scene judgment layer, and training the neural network model with target training data to generate a target model. The scene judgment layer is used to distinguish and process training data of different scenes according to scene identifiers.
[0047] In order to achieve multi-scenario, cross-domain, and multi-task joint modeling, the present invention constructs a neural network model including a scenario judgment layer (scenarioLayer). The core of this model is that it can process training data from different scenarios, learn specific feature patterns for each scenario, and jointly optimize multiple prediction tasks. The model mainly includes three core parts: a DNN structure exclusive to scenario one (train ticket list page), a DNN structure exclusive to scenario two (train details page), and a scenario judgment layer for scenario routing.
[0048] Scenario 1 exclusive DNN structure (list page scenario): DNN (Deep Neural Network) is a multi-layer artificial neural network. The DNN structure of scenario 1 specifically processes data from the train ticket list page: Input layer: receives features specific to the list page, such as: user browsing behavior on the list page, user preferred transfer station information, and list page display location features. Hidden layer: multiple neuron layers for feature conversion and extraction. Feature processing unit: specializes in processing feature patterns specific to the list page scenario.
[0049] Scenario 2 exclusive DNN structure (details page scenario): It is also a deep neural network structure, but it is optimized specifically for the train details page scenario: Input layer: Receives features specific to the details page, such as: specific train information, departure and arrival times, transfer waiting time, and fare information. Hidden layer: Multiple neuron layers for feature transformation. Feature processing unit: Specialized in processing feature patterns specific to the details page scenario.
[0050] The input of the neural network model is the target training data after feature alignment and merging, and its structure is [Y1, Y2, C1, X1, X2, ..., Xp], where Y1 indicates whether to buy the label, Y2 indicates whether to click the label, C1 indicates the scene identifier (1 indicates the transfer recommendation scene at the bottom of the train ticket list page, 2 indicates the transfer recommendation scene on the train details page), and Xp indicates the aligned feature dimension. The model designs two prediction tasks: task 1 is to predict the exposure click probability, and task 2 is to predict the exposure purchase probability. These two tasks correspond to the Y2 and Y1 labels respectively.
[0051] The scenario layer (scenarioLayer) is a key component of the model. Its function is to divert data to the feature processing path of the corresponding scene according to the scene identifier C1 in the input data. When C1=1, the model activates the feature processing unit of scene 1 and its exclusive DNN network structure, which contains: Feature processing unit: focuses on the scene features of the list page (such as user preference transfer stations).
[0052] Exclusive DNN structure: Input layer: receives the processed list page features; First hidden layer: used to extract user preference features; Second hidden layer: performs feature combination and conversion; Feature fusion layer: integrates the feature expression of the list page scene.
[0053] When C1=2, the feature processing unit of scene 2 and its exclusive DNN network structure are activated, which includes: Feature processing unit: focuses on processing the unique features of the details page scene (such as departure time, transfer waiting time).
[0054] Exclusive DNN structure: Input layer: receiving processed details page features; first hidden layer: extracting time-related features; second hidden layer: learning transit feature patterns; feature fusion layer: integrating feature expressions of details page scenarios. This design enables the model to perform differentiated modeling based on the characteristics of different scenarios. Each scenario is equipped with an independent feature processing unit and an exclusive DNN network structure to better capture scenario-specific data patterns and feature relationships. Through this specialized structural design, the model can more accurately learn user behavior characteristics in different scenarios and improve prediction results.
[0055] The model training process adopts a multi-task learning framework, and the loss function is defined as loss=alogloss(task1)+blogloss(task2), where logloss represents the logarithmic loss function, which is used to measure the difference between the predicted value and the true label. Parameters a and b are task weight coefficients, ranging from 0 to 1, which are used to balance the importance of the two tasks. In this embodiment, since purchase prediction (task2) can more directly reflect business value than click prediction (task1), b>a is set.
[0056] In order to optimize the model training effect, key hyperparameters are set: learning rate (LEARNING_RATE) controls the step size of each parameter update, and dropout_rate is used to prevent model overfitting. During training, the target training data is first randomly shuffled (shuffle), and then input into the model in small batches (batch). Each batch of data contains samples from two scenes to ensure that the model can learn the characteristic patterns of different scenes at the same time. Positive samples include data that has been exposed and clicked (corresponding to task1) and data that has been exposed and purchased (corresponding to task2), and negative samples include data that has been exposed but not clicked and data that has been exposed but not purchased.
[0057] The output layer of the model uses the sigmoid activation function to map the prediction results to between 0 and 1, representing the click probability and purchase probability respectively. The model parameters are updated through the back propagation algorithm until the loss function converges to a lower level. At this time, the model structure and parameters are saved to obtain the target model file M.
[0058] Based on the above embodiment, as an optional implementation, in S103, training the neural network model by using the target training data, and generating the target model specifically includes S31-S34: S31, input the target training data into the neural network model in batches according to the preset batch size, and obtain the output results of each batch of target training data.
[0059] S32, calculating the target loss function value according to the first task prediction result and the second task prediction result in the output result, wherein the first task prediction result is the click probability output value of each batch of target training data, and the second task prediction result is the purchase probability output value of each batch of target training data.
[0060] S33, performing gradient update on the parameters of the neural network model according to the target loss function value.
[0061] S34, when the target loss function value is less than a preset loss threshold, the current neural network model is determined as the target model.
[0062] During model training, the target training data is first divided into batches according to the preset batch size (batch_size=256). Each batch of data contains 256 training samples, each of which contains feature data, scene identifiers, and label values (whether clicked, whether purchased). The reason for using batch training instead of full batch training is: on the one hand, it can reduce memory usage, and on the other hand, introducing randomness helps the model escape from the local optimal solution.
[0063] For each batch of data, the prediction result is obtained through the forward propagation of the neural network model. The model structure includes a shared underlying feature extraction network and two task-specific prediction heads. The underlying network consists of three fully connected layers with 256, 128, and 64 nodes, using the ReLU activation function; the two prediction heads each contain a fully connected layer (32 nodes) and an output layer, and the output layer uses the Sigmoid activation function to obtain the probability value. For example, after a batch of data is processed by the model, the click probability prediction value P_click and the purchase probability prediction value P_purchase are obtained, both of which have a value range of [0,1].
[0064] The target loss function value is calculated based on the prediction results, and the weighted multi-task loss function is used: Loss = α*L_click+(1-α)*L_purchase, where α is the task weight coefficient (set to 0.4), L_click and L_purchase are the binary cross entropy losses of the click task and the purchase task respectively. The calculation formula of the binary cross entropy loss is: L=-[y*log(p)+(1-y)*log(1-p)], where y is the true label and p is the predicted probability. For example, for a sample that is actually clicked (y_click=1) but not purchased (y_purchase=0), if the model predicts P_click=0.8 and P_purchase=0.3, the loss value of the sample is: Loss=0.4*(-log(0.8))+0.6*(-log(0.7))=0.286.
[0065] According to the calculated loss function value, the Adam optimizer is used to update the parameters. The Adam operator combines the advantages of the momentum method and the adaptive learning rate, and the initial value of the learning rate is set to 0.001. The parameter update formula is: θ_new=θ_old-η*g, where θ represents the model parameters, η is the learning rate, and g is the gradient of the loss function with respect to the parameters. In order to prevent overfitting, L2 regularization (coefficient λ=0.0001) and Dropout (discard rate 0.2) and other techniques are also applied during the training process.
[0066] The model training adopts an early stopping strategy. When the target loss function value on the validation set is less than the preset loss threshold of 0.35 for 5 consecutive epochs, or the loss value does not decrease significantly (the change is less than 0.001) for 10 consecutive epochs, the training process is terminated and the current model is saved as the target model. This strategy ensures that the model achieves sufficiently good performance and avoids the overfitting problem caused by excessive training.
[0067] In actual training, the model showed good convergence characteristics: the training set loss value dropped rapidly from the initial 0.693 (the loss corresponding to random initialization) to 0.342 in the 15th epoch, and then stabilized; the validation set loss value showed a similar trend, and finally stabilized at around 0.348. At the same time, the model achieved good prediction results in both tasks: the AUC for click prediction reached 0.82, and the AUC for purchase prediction reached 0.75, and it performed stably in different scenarios.
[0068] S104, inputting the first test data and the second test data into the target model to generate a test result.
[0069] In order to verify the prediction effect of the target model in different scenarios, the first test data and the second test data are input into the trained target model for testing. The first test data comes from the transfer recommendation scenario at the bottom of the train ticket list page, and the second test data comes from the transfer recommendation scenario on the train details page. These two sets of test data need to be first feature aligned in the same way as the training data.
[0070] The feature alignment process is consistent with the training data processing method, converting the test data into a unified feature format [whether to buy, whether to click, scenario id, total duration of the plan, total price of the plan, departure station, arrival station, departure city, arrival city, transfer city, user preferred transfer station, user preferred transfer city, departure time, transfer waiting time]. For the missing features in the first test data (such as departure time and transfer waiting time), fill in the special value -1; for the missing features in the second test data (such as user preferred transfer station and user preferred transfer city), also fill in -1. This ensures that the feature dimensions of the test data are consistent with those during training.
[0071] Input the aligned test data into the target model M, and the model will automatically identify the scenario identifier of the data (scenario id = 1 or 2) through the scenario judgment layer (scenarioLayer) and select the corresponding feature processing path. For each test data, the model outputs two prediction values: click probability prediction value (P_click) and purchase probability prediction value (P_purchase). Both prediction values are between 0 and 1, reflecting the model's judgment on whether the user will click and purchase the transfer plan.
[0072] The test results are evaluated using multiple indicators: AUC (Area Under Curve) is used to evaluate the classification performance of the model, and the AUC values of click prediction and purchase prediction are calculated respectively; GAUC (Group AUC) takes into account user group information and can better reflect the personalized recommendation effect; Precision and Recall are used to evaluate the accuracy and completeness of the model prediction. For example, after a test data [0, 1, 1, 120, 13.5, 16666, 18888, 166, 188, 177, 36666, 388, -1, -1] is input into the model, the prediction results P_click=0.75, P_purchase=0.35 are obtained, which means that the model predicts that the transfer plan has a 75% chance of being clicked and a 35% chance of being purchased.
[0073] Based on the above embodiment, as an optional implementation, in S104, the first test data and the second test data are input into the target model, and the generation of the test results specifically includes S41-S43: S41, inputting the first test data into the target model to obtain a first scenario test result, wherein the first scenario test result includes a first scenario click prediction accuracy and a first scenario purchase prediction accuracy.
[0074] S42, inputting the second test data into the target model to obtain a second scenario test result, wherein the second scenario test result includes a second scenario click prediction accuracy and a second scenario purchase prediction accuracy.
[0075] S43, when the first scenario click prediction accuracy and the first scenario purchase prediction accuracy are both greater than the first accuracy threshold, and the second scenario click prediction accuracy and the second scenario purchase prediction accuracy are both greater than the second accuracy threshold, it is determined that the test result meets the preset requirements.
[0076] When testing the model, we first use an independent first test data set to evaluate the performance of the model in the transfer recommendation scenario (scenario ID = 1) below the train ticket list page. The test data contains 10,000 samples, each of which contains the same feature dimensions as the training data, as well as real click labels and purchase labels. These test data are input into the trained target model, and the model outputs the predicted click probability (P_click) and purchase probability (P_purchase) of each sample. By comparing the predicted probability with the threshold of 0.5, a binary classification prediction result can be obtained. For example, when P_click>0.5, it is judged to be clicked, and when P_purchase>0.5, it is judged to be purchased.
[0077] The prediction accuracy of the first scenario is evaluated using multiple indicators: the click prediction accuracy (Accuracy_click) is calculated by dividing the number of correctly predicted samples by the total number of samples; it also includes precision, recall, and F1 score. Taking click prediction as an example, assuming that the model correctly predicted 8,200 samples out of 10,000 test data, the click prediction accuracy is 82%. The purchase prediction accuracy is calculated in the same way. Assuming that 7,800 samples are correctly predicted, the purchase prediction accuracy is 78%. These indicators together constitute the test results of the first scenario.
[0078] Next, the second test data set is used to evaluate the performance of the model in the transfer recommendation scenario (scenario ID = 2) on the train details page. The test data size is also 10,000 samples, and the same evaluation method is used to calculate the click prediction accuracy and purchase prediction accuracy of the second scenario. Assume that the click prediction accuracy of the second scenario is 80% and the purchase prediction accuracy is 76%. These indicators constitute the test results of the second scenario.
[0079] In order to determine whether the model meets the business requirements, two accuracy thresholds are set: the first accuracy threshold (applicable to the first scenario) is set to 75%, and the second accuracy threshold (applicable to the second scenario) is set to 73%. Only when the click and purchase prediction accuracy of the two scenarios exceeds their respective thresholds, the test results are considered to meet the preset requirements. In the above example, the click prediction accuracy (82%) and purchase prediction accuracy (78%) of the first scenario are both higher than the first accuracy threshold (75%), and the click prediction accuracy (80%) and purchase prediction accuracy (76%) of the second scenario are also higher than the second accuracy threshold (73%), so it can be determined that the test results meet the preset requirements.
[0080] S105, when the test results meet the preset requirements, receiving the characteristic data and scenario identifiers of multiple transit plans to be sorted, inputting the characteristic data and scenario identifier of each transit plan to be sorted into the target model, and generating a sorting score for each transit plan to be sorted in the corresponding scenario.
[0081] After verifying that the target model meets the preset effect requirements, the present invention applies the model to the transit plan sorting in the actual business scenario. The preset requirements include the key indicators of the model on the test set: the click prediction AUC is not less than 0.75, the purchase prediction AUC is not less than 0.70, and the GAUC indicator is improved by not less than 3% compared with the baseline model. When the test results meet these requirements, the model can be applied to online sorting.
[0082] In actual applications, the system receives data on multiple transfer options to be sorted. For example, for the transfer recommendation scenario at the bottom of the train ticket list page (scenario ID = 1), a request may contain 10 candidate transfer options, each of which contains feature data [total duration of the plan, total price of the plan, departure station, arrival station, transfer station, departure city, arrival city, transfer city, user preferred transfer station, user preferred transfer city]; for the transfer recommendation scenario on the train details page (scenario ID = 2), the feature data of the candidate options are [total duration of the plan, total price of the plan, departure station, arrival station, departure city, arrival city, transfer city, departure time, transfer waiting time].
[0083] In order to keep the format consistent with the training data, the feature data of the scheme to be sorted needs to be standardized. First, feature alignment is performed to convert the features of each scheme into a unified format and fill the missing features with a special value of -1. For example, the scenario data [110, 12.5, 16666, 18888, 17777, 166, 188, 177, 36666, 388] of scenario 1 is converted to [110, 12.5, 16666, 18888, 17777, 166, 188, 177, 36666, 388, -1, -1], and the scenario data [120, 14.5, 26666, 28888, 27777, 266, 288, 277, 12.5, 38] of scenario 2 is converted to [120, 14.5, 26666, 28888, 27777, 266, 288, 277, -1, -1, 12.5, 38].
[0084] The aligned feature data and the corresponding scene identifier are input into the target model. The model identifies the data source through the scene judgment layer, selects the corresponding feature processing path, and outputs the click probability prediction value (P_click) and purchase probability prediction value (P_purchase) of each solution. The calculation formula of the ranking score is score = w1P_click+w2P_purchase, where w1 and w2 are weight coefficients used to balance the importance of click-through rate and conversion rate. In this embodiment, considering that purchase conversion has greater direct value to the business, w1=0.3 and w2=0.7 are set.
[0085] For example, there are three candidate solutions in a request. The model predicts that: Solution 1 has P_click=0.8, P_purchase=0.4, and score1=0.80.3+0.40.7=0.52; Solution 2 has P_click=0.6, P_purchase=0.5, and score2=0.60.3+0.50.7=0.53; Solution 3 has P_click=0.7, P_purchase=0.3, and score3=0.70.3+0.30.7=0.42. According to the score size, the three solutions are ranked as follows: Solution 2> Solution 1> Solution 3.
[0086] Based on the above embodiment, as an optional implementation, in S105, the characteristic data and scenario identifier of each transit solution to be sorted are input into the target model, and the ranking score of each transit solution to be sorted in the corresponding scenario is generated, which specifically includes S51-S53: S51, combining the feature data and scenario identifier of each transit plan to be sorted into target input data.
[0087] S52, inputting the target input data into the target model to obtain the click probability prediction value and the purchase probability prediction value of each transfer solution to be sorted.
[0088] S53, based on the click probability prediction value and the purchase probability prediction value of each transit solution to be sorted, the ranking score of each transit solution to be sorted in the corresponding scenario is calculated according to the preset weight.
[0089] Before sorting the transfer plans, you first need to build the target input data. Each transfer plan to be sorted contains multiple feature dimensions: basic features such as total plan duration, total plan price, departure station ID, arrival station ID, departure city ID, arrival city ID, transfer city ID, and other features that may be included depending on the scenario. For example, for a transfer plan from the transfer recommendation scenario (scenario ID = 1) at the bottom of the train ticket list page, its feature data may be: [5400, 680, 23456, 34567, 245, 356, 289, 45678, 478], indicating specific information such as a total duration of 5400 seconds and a total price of 680 yuan. When combining the target input data, these original features need to be normalized in the same way as in the training phase to ensure the consistency of data distribution.
[0090] Combine the processed feature data with the corresponding scene identifier to form a complete target input data. For example, the above transfer plan may become [0.735, 0.412, 0.234, 0.456, 0.378, 0.467, 0.512, 0.345, 0.623] after feature normalization, and add the scene identifier 1 to form a complete target input data. For the transfer plan of the transfer recommendation scene (scene identifier = 2) on the train details page, the same processing method is used, except that the value of some feature dimensions may be -1 (indicating that the feature does not exist in this scene).
[0091] Input the target input data into the trained target model, and the model will output two probability values: click probability prediction value P_click and purchase probability prediction value P_purchase. For example, a certain transfer plan is predicted by the model to have P_click=0.85 and P_purchase=0.42, which means that the model believes that the plan has an 85% probability of being clicked by the user and a 42% probability of being purchased by the user. These two probability values reflect the user's interest in the transfer plan at different levels.
[0092] Based on the predicted probability value, the final ranking score is calculated using the preset weights. The ranking score is calculated as follows: Score = β*P_click + (1-β)*P_purchase, where β is the weight coefficient of the click probability. In the transfer recommendation scenario below the train ticket list page, β is set to 0.7 because users are more inclined to browse and click; in the transfer recommendation scenario on the train details page, users have a stronger purchase intention, so β is set to 0.4. This differentiated weight setting can better adapt to the business characteristics of different scenarios.
[0093] Take a group of transit plans to be sorted as an example: the prediction results of plan A are P_click=0.85, P_purchase=0.42, the prediction results of plan B are P_click=0.72, P_purchase=0.58, and the prediction results of plan C are P_click=0.78, P_purchase=0.45. Assuming that these plans are all from the first scenario (β=0.7), their ranking scores are: Plan A: Score_A=0.7*0.85+0.3*0.42=0.721; Plan B: Score_B=0.7*0.72+0.3*0.58=0.678; Plan C: Score_C=0.7*0.78+0.3*0.45=0.681.
[0094] Based on the calculated ranking scores, we can get the final ranking result: Plan A> Plan C> Plan B.
[0095] S106, sorting the plurality of transit plans to be sorted in descending order according to the sorting scores.
[0096] After obtaining the ranking scores of each transit plan to be sorted, the present invention uses a descending sorting strategy to finally sort the plans to ensure that the optimal transit plan can be displayed to the user first. The ranking score (score) combines the information of the two prediction dimensions of click probability (P_click) and purchase probability (P_purchase). The higher the score, the more the plan meets the user's needs.
[0097] The sorting process is implemented using the QuickSort algorithm, which has a time complexity of O(nlogn) and can efficiently handle the sorting requirements of a large number of candidate solutions. Taking a group of candidate solutions as an example, assuming that there are 5 transfer solutions to be sorted, their feature data and scenario identifiers (scenario identifier = 1, indicating the recommended transfer scenario at the bottom of the train ticket list page) are input into the target model, and the prediction results and ranking scores are as follows: Solution 1 [P_click = 0.82, P_purchase = 0.45, score = 0.558], Solution 2 [P_click = 0.65, P_purchase = 0.52, score = 0.549], Solution 3 [P_click = 0.73, P_purchase = 0.38, score = 0.485], Solution 4 [P_click = 0.58, P_purchase = 0.55, score = 0.544], Solution 5 [P_click = 0.70, P_purchase = 0.48, score = 0.546]. Where score = 0.3P_click + 0.7P_purchase.
[0098] After sorting these solutions in descending order by score, the ranking results are: Solution 1 (score = 0.558) > Solution 2 (score = 0.549) > Solution 5 (score = 0.546) > Solution 4 (score = 0.544) > Solution 3 (score = 0.485). This ranking result reflects several important characteristics: First, Solution 1, which is ranked at the top, has both high click probability and purchase probability, indicating that it is a relatively balanced choice; second, although the purchase probability of Solution 4 (0.55) is slightly higher than that of Solution 5 (0.48), the click probability of Solution 5 (0.70) is significantly higher than that of Solution 4 (0.58), so after comprehensive consideration, Solution 5 is ranked higher; finally, although Solution 3 has a higher click probability, it is ranked last because of its low purchase probability and the purchase conversion accounts for a large proportion of the ranking weight (0.7).
[0099] In order to ensure the real-time and stability of the sorting results, the system adopts the following optimization measures during implementation: First, the heap sort algorithm is used to handle scenarios where Top-N results need to be returned, with a time complexity of O(nlogk), where k is the number of solutions that need to be returned; second, for solutions with the same score, the solution ID is introduced as the secondary sorting key to ensure the stability of the sorting results; finally, in high-concurrency scenarios, a multi-threaded parallel sorting strategy is adopted to improve system throughput.
[0100] The sorted transfer plan list is directly used for front-end display. In the transfer recommendation scenario at the bottom of the train ticket list page, the top three highest-scoring plans are usually displayed; in the transfer recommendation scenario on the train details page, the top five highest-scoring plans may be displayed. This descending sorting method based on the model prediction score ensures that the plan that best meets user needs can be displayed first, improving the efficiency of users finding suitable transfer plans.
[0101] Based on the above embodiment, as an optional implementation, in S106, sorting the plurality of transit solutions to be sorted in descending order according to the sorting scores specifically includes S61-S63: S61, obtaining the scene identifier corresponding to each transfer scheme to be sorted.
[0102] S62, grouping the transfer solutions to be sorted according to the scenario identifiers to obtain transfer solution groups to be sorted under different scenarios.
[0103] S63, sorting the transit plans to be sorted in each transit plan group to be sorted in descending order according to the sorting scores, to obtain a sorting result in each scenario.
[0104] Before sorting, you first need to obtain the scenario ID of each transfer plan to be sorted. The scenario ID is information that has been used when calculating the sorting score and can be directly extracted from the target input data. For example, there are 10 transfer plans to be sorted, 6 of which are from the recommended transfer scenarios at the bottom of the train ticket list page (scenario ID = 1), and 4 are from the recommended transfer scenarios on the train details page (scenario ID = 2). Each transfer plan contains its feature data, scenario ID, and the sorting score calculated by the model.
[0105] Based on the obtained scenario identifier, the transit solutions to be sorted are grouped. The grouping adopts a hash table structure, where the key is the scenario identifier and the value is the list of transit solutions under the scenario. According to the above example, two groups of transit solutions to be sorted are obtained after grouping: the first group contains 6 solutions from the list page scenario, and the second group contains 4 solutions from the details page scenario. The advantage of this grouping method is that although the ranking scores in different scenarios are calculated in the same way, due to differences in scenario characteristics and user behavior patterns, directly comparing the ranking scores across scenarios may lead to unreasonable sorting results.
[0106] For each transfer solution in each group, sort it in descending order according to the previously calculated ranking score. Take the transfer solution group of the first scenario (list page) as an example, assuming that the ranking scores of the 6 solutions are: Plan A1: 0.721 (click probability 0.85, purchase probability 0.42); Plan B1: 0.678 (click probability 0.72, purchase probability 0.58); Plan C1: 0.681 (click probability 0.78, purchase probability 0.45); Plan D1: 0.695 (click probability 0.80, purchase probability 0.48); Plan E1: 0.662 (click probability 0.70, purchase probability 0.55); Plan F1: 0.702 (click probability 0.82, purchase probability 0.44).
[0107] The order after sorting is: A1>F1>D1>C1>B1>E1. Sort the 4 solutions of the second scenario (details page) in the same way, assuming that their ranking scores are: Plan A2: 0.682 (click probability 0.75, purchase probability 0.62); Plan B2: 0.695 (click probability 0.72, purchase probability 0.68); Plan C2: 0.658 (click probability 0.68, purchase probability 0.64); Plan D2: 0.671 (click probability 0.70, purchase probability 0.65); the order after sorting is: B2>A2>D2>C2.
[0108] After sorting the plurality of transit schemes to be sorted in descending order according to the sorting scores, the method further includes: Obtain the user's evaluation information on each transit plan to be sorted; determine the feature dimensions to be optimized based on the evaluation information; and adjust the feature weights of the target model based on the feature dimensions to be optimized.
[0109] In order to continuously optimize the recommendation effect of the transfer plan and adapt to changes in user needs, the present invention designs a model optimization mechanism based on user feedback. The mechanism first collects user evaluation information through multiple channels, including users' explicit feedback (ratings, comments, label selections) and implicit feedback (clicks, browsing time, purchase behavior). For example, for a certain transfer plan, the system may collect evaluation information such as "rating 3 points, comments reflecting that the transfer waiting time is too long, and labels showing reasonable prices".
[0110] By analyzing the evaluation information, the system identifies the key feature dimensions that need to be optimized. For example, the analysis found that the negative reviews related to "transfer waiting time" accounted for as high as 40%, indicating that this feature dimension needs to be optimized; at the same time, it was found that the weight of the total price of the plan may be too high, affecting the role of other important factors. Based on this, the feature dimensions to be optimized include: transfer waiting time, total price of the plan, and total time of the plan.
[0111] The feature weights of the target model were adjusted accordingly, such as increasing the weight of the transit waiting time from 0.15 to 0.25, reducing the weight of the total price of the plan from 0.30 to 0.25, and adjusting the negative weight of the total time of the plan from -0.20 to -0.25. The effect after optimization was significant: the average user rating increased by 0.4 points, negative reviews decreased by 15%, and the click-through rate and purchase conversion rate increased by 25% and 18% respectively. At the same time, a regular automatic evaluation mechanism for feature weights was established to ensure that the model can continue to adapt to changes in user preferences and achieve dynamic optimization of recommendation effects.
[0112] Based on the above method, the present application also discloses a multi-task transfer scheme sorting system across multiple scenarios, such as Figure 2 As shown, Figure 2 : is a structural diagram of a multi-task transfer scheme sorting system across multiple scenarios provided by an embodiment of the present application, the system includes: an acquisition module, a first generation module, a construction module, a second generation module, an input module and a sorting module; wherein, An acquisition module is used to acquire first training data and first test data of a first target scene, and second training data and second test data of a second target scene, wherein the first training data and the second training data both include feature data and scene identification; a first generation module is used to merge the first training data and the second training data after feature alignment to generate target training data; a construction module is used to construct a neural network model including a scene judgment layer, and train the neural network model with the target training data to generate a target model, wherein the scene judgment layer is used to distinguish and process the training data of different scenes according to the scene identification; a second generation module is used to input the first test data and the second test data into the target model to generate a test result; an input module is used to receive feature data and scene identification of multiple transit schemes to be sorted when the test result meets the preset requirements, input the feature data and scene identification of each transit scheme to be sorted into the target model, and generate a sorting score for each transit scheme to be sorted in the corresponding scene; a sorting module is used to sort the multiple transit schemes to be sorted in descending order according to the sorting score.
[0113] It should be noted that: when the device provided in the above embodiment realizes its function, only the division of the above functional modules is used as an example. In actual application, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0114] See also Figure 3 , is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 3 As shown, the electronic device 1000 may include: at least one processor 1001 , at least one network interface 1004 , a user interface 1003 , a memory 1005 , and at least one communication bus 1002 .
[0115] The communication bus 1002 is used to realize the connection and communication between these components.
[0116] The user interface 1003 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 1003 may also include a standard wired interface and a wireless interface.
[0117] The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0118] Among them, the processor 1001 may include one or more processing cores. The processor 1001 uses various interfaces and lines to connect various parts in the entire server, and executes various functions of the server and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 1005, and calling data stored in the memory 1005. Optionally, the processor 1001 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 1001 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 1001, and it can be implemented separately through a chip.
[0119] Among them, the memory 1005 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 1005 includes a non-transitory computer-readable storage medium. The memory 1005 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 1005 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 1005 may optionally also be at least one storage device located away from the aforementioned processor 1001. As Figure 3 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an application program of a multi-task transfer scheme sorting method across multiple scenarios.
[0120] exist Figure 3In the electronic device 1000 shown, the user interface 1003 is mainly used to provide an input interface for the user and obtain data input by the user; and the processor 1001 can be used to call an application program stored in the memory 1005 for a multi-task transfer scheme sorting method across multiple scenarios. When executed by one or more processors, the electronic device executes one or more methods described in the above embodiments.
[0121] An electronic device readable storage medium stores instructions, which, when executed by one or more processors, enable the electronic device to execute one or more of the methods described in the above embodiments.
[0122] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required for the present application.
[0123] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0124] In the several embodiments provided in the present application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0125] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0126] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0127] 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 computer-readable memory. Based on this understanding, the technical solution of the present application, 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, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned memory includes: various media that can store program codes, such as USB flash drives, mobile hard drives, magnetic disks or optical disks.
[0128] The above is only an exemplary embodiment of the present disclosure, and the scope of the present disclosure cannot be limited thereto. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the specification and practicing the disclosure here, those skilled in the art will easily think of other embodiments of the present disclosure. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the technical field not recorded in the present disclosure. The description and examples are only regarded as exemplary, and the scope and spirit of the present disclosure are defined by the claims.
Claims
1. A method for sorting multi-task transfer solutions across multiple scenarios, characterized in that: The method comprises: Acquire first training data and first test data of a first target scene, and second training data and second test data of a second target scene, wherein both the first training data and the second training data include feature data and a scene identifier; Aligning features of the first training data and the second training data and merging them to generate target training data; Constructing a neural network model including a scene judgment layer, and training the neural network model with the target training data to generate a target model, wherein the scene judgment layer is used to distinguish and process the training data of different scenes according to the scene identification; Inputting the first test data and the second test data into the target model to generate a test result; When the test result meets the preset requirements, receiving the characteristic data and scenario identification of multiple transit schemes to be sorted, inputting the characteristic data and scenario identification of each transit scheme to be sorted into the target model, and generating the sorting score of each transit scheme to be sorted in the corresponding scenario; The multiple transit schemes to be sorted are sorted in descending order according to the sorting scores.
2. The method for sorting multi-task transfer solutions across multiple scenarios according to claim 1 is characterized in that: The step of aligning the features of the first training data and the second training data and merging them to generate target training data includes: Performing feature normalization processing on the first feature data in the first training data and the second feature data in the second training data to obtain first normalized data and second normalized data; Aligning the first normalized data and the second normalized data according to a preset feature dimension to obtain first target feature data and second target feature data with unified dimensions; The first target feature data and its corresponding scene identifier are combined into a first training sample, the second target feature data and its corresponding scene identifier are combined into a second training sample, and the first training sample and the second training sample are merged to generate the target training data.
3. The method for sorting multi-task transfer solutions across multiple scenarios according to claim 1 is characterized in that: The step of training the neural network model using the target training data to generate a target model includes: Inputting the target training data into the neural network model in batches according to a preset batch size to obtain output results of each batch of target training data; Calculate the target loss function value according to the first task prediction result and the second task prediction result in the output result, wherein the first task prediction result is the click probability output value of each batch of target training data, and the second task prediction result is the purchase probability output value of each batch of target training data; Performing gradient update on the parameters of the neural network model according to the target loss function value; When the target loss function value is less than a preset loss threshold, the current neural network model is determined as the target model.
4. The method for sorting multi-task transfer solutions across multiple scenarios according to claim 1, characterized in that: The step of inputting the first test data and the second test data into the target model to generate a test result includes: Inputting the first test data into the target model to obtain a first scenario test result, wherein the first scenario test result includes a first scenario click prediction accuracy rate and a first scenario purchase prediction accuracy rate; Inputting the second test data into the target model to obtain a second scenario test result, wherein the second scenario test result includes a second scenario click prediction accuracy rate and a second scenario purchase prediction accuracy rate; When the first scenario click prediction accuracy and the first scenario purchase prediction accuracy are both greater than a first accuracy threshold, and the second scenario click prediction accuracy and the second scenario purchase prediction accuracy are both greater than a second accuracy threshold, it is determined that the test result meets the preset requirements.
5. The method for sorting multi-task transfer solutions across multiple scenarios according to claim 1 is characterized in that: The step of inputting the characteristic data and the scenario identifier of each of the transit solutions to be sorted into the target model to generate a ranking score of each of the transit solutions to be sorted in the corresponding scenario includes: Combining the characteristic data and scenario identifier of each of the transit plans to be sorted into target input data; Inputting the target input data into the target model to obtain a click probability prediction value and a purchase probability prediction value of each of the transfer solutions to be sorted; Based on the click probability prediction value and the purchase probability prediction value of each of the transit plans to be sorted, the ranking score of each of the transit plans to be sorted in the corresponding scenario is calculated according to the preset weights.
6. The method for sorting multi-task transfer solutions across multiple scenarios according to claim 1 is characterized in that: The step of sorting the plurality of transit schemes to be sorted in descending order according to the sorting scores comprises: Obtaining the scene identifier corresponding to each of the transfer solutions to be sorted; The to-be-sorted transit solutions are grouped according to the scenario identifiers to obtain to-be-sorted transit solution groups under different scenarios; The transit schemes to be sorted in each of the transit scheme groups to be sorted are sorted in descending order according to the sorting scores to obtain a sorting result in each scenario.
7. The method for sorting multi-task transfer solutions across multiple scenarios according to claim 1 is characterized in that: After sorting the plurality of transit schemes to be sorted in descending order according to the sorting scores, the method further includes: Obtaining user evaluation information on each of the transit plans to be sorted; Determining the feature dimension to be optimized according to the evaluation information; The feature weights of the target model are adjusted according to the feature dimensions to be optimized.
8. A multi-task transfer scheme sorting system across multiple scenarios, characterized in that: The system comprises: an acquisition module, a first generation module, a construction module, a second generation module, an input module and a sorting module; wherein, The acquisition module is used to acquire first training data and first test data of a first target scene, and second training data and second test data of a second target scene, wherein the first training data and the second training data both include feature data and a scene identifier; The first generating module is used to merge the first training data and the second training data after feature alignment to generate target training data; The construction module is used to construct a neural network model including a scene judgment layer, and train the neural network model through the target training data to generate a target model, and the scene judgment layer is used to distinguish and process the training data of different scenes according to the scene identification; The second generating module is used to input the first test data and the second test data into the target model to generate a test result; The input module is used to receive the characteristic data and scenario identification of multiple transit schemes to be sorted when the test results meet the preset requirements, input the characteristic data and scenario identification of each transit scheme to be sorted into the target model, and generate a sorting score for each transit scheme to be sorted in the corresponding scenario; The sorting module is used to sort the multiple transit solutions to be sorted in descending order according to the sorting scores.
9. An electronic device, characterized in that: It includes a processor, a memory, a user interface and a network interface, the memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device executes the method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: A computer program is stored which can be loaded by a processor and execute the method according to any one of claims 1 to 7.
Citation Information
Cited By
Recommendation model training method, recommendation method and program for replacing traffic tickets
CN121145973A