Recall text recommendation method, device, equipment and storage medium

By constructing a loss function that combines negative samples similar to positive samples with user profiles to train the model, the problem of inconsistency between online and offline data in the recall model is solved, and the accuracy and diversity of recalled text recommendations are improved.

CN114610865BActive Publication Date: 2024-11-08PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210241295.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-11
Publication Date
2024-11-08
Estimated Expiration
2042-03-11

AI Technical Summary

Technical Problem

Existing recall models directly reuse exposures that were not clicked as negative samples during training, leading to inconsistencies between online and offline results and low model prediction accuracy.

Method used

Construct negative samples similar to positive samples, including random negative samples and augmented negative samples, and combine them with user profiles to train the prediction model through a loss function, thereby improving the model's ability to judge various types of data.

Benefits of technology

It improved the model's recognition accuracy, retrieved diverse and accurate texts to supply the upper-level ranking model, solved the inconsistency between online and offline methods, and improved recommendation performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114610865B_ABST
    Figure CN114610865B_ABST
Patent Text Reader

Abstract

The present invention relates to the fields of artificial intelligence and digital medicine, and discloses a recall text recommendation method, device, equipment and storage medium. The method includes: obtaining historical texts and user behavior logs of each historical text; determining as a positive sample according to the user behavior log, selecting historical texts similar to the positive sample as a negative sample, and constructing a training sample according to the positive sample and the negative sample; obtaining a user portrait, inputting the user portrait and the training sample into a preset prediction model, obtaining an output result, calculating a loss function according to the output result and training the prediction model based on the loss function, and obtaining a target prediction model; obtaining a text to be tested, inputting the user portrait and the text to be tested into the target prediction model, outputting a prediction result, and recommending a recall text based on the prediction result. In the above manner, the present invention can solve the problem of online and offline inconsistency and low model prediction accuracy caused by directly reusing exposure without clicks as negative samples.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence and digital medical technology, and in particular to a recall text recommendation method, device, equipment and storage medium. Background Art

[0002] At present, the recommendation system in the industry is generally divided into three layers: indexing, recalling, and sorting. Among them, the sorting layer mainly sorts a small part (usually hundreds of levels) of highly relevant content that has been screened by the recall layer, and selects content that can be used for final recommendation display. The recall layer faces a large amount of relevant and irrelevant data, and needs to recall diverse and accurate content from the index layer within a limited response time to supply the upper ranking layer.

[0003] At the same time, in the current recall model training process, the more common sample construction method is often to reuse the mode in the sorting model to directly use the exposure clicks in the behavior log as positive samples and the exposure non-clicks as negative samples; but this method ignores the fact that the recall is actually facing a massive amount of all index data of varying quality, rather than a small amount of relatively relevant data after a round of selection, that is, this method is prone to inconsistency between online data and offline training data. Therefore, in this mode, the offline indicators related to the offline model are often very high, but the online effect is not ideal.

[0004] In summary, compared with the ranking layer, which is the last link in the recommendation chain and has sufficient training data and clear optimization goals, the recall layer faces greater difficulties and challenges in training sample construction, feature engineering, algorithm model design, indexing efficiency, etc. Summary of the invention

[0005] The present invention provides a recall text recommendation method, device, equipment and storage medium, which can solve the problems of online and offline inconsistency and low model prediction accuracy caused by directly reusing exposure without clicks as negative samples.

[0006] In order to solve the above technical problems, a technical solution adopted by the present invention is to provide a recall text recommendation method, comprising:

[0007] Obtain historical texts and user behavior logs for each of the historical texts;

[0008] Determine the historical texts of exposure and click in the user behavior log as positive samples, select the historical texts similar to the positive samples from the remaining texts after removing the positive samples from the historical texts as negative samples, and construct training samples based on the positive samples and the negative samples;

[0009] Obtaining a user portrait, inputting the user portrait and the training sample into a preset prediction model to obtain an output result, calculating a loss function according to the output result, and training the prediction model based on the loss function to obtain a target prediction model;

[0010] The text to be tested is obtained, the user portrait and the text to be tested are input into the target prediction model, features are extracted for the text to be tested and the user portrait respectively, prediction is performed according to the feature extraction results, and a recall text is recommended from the text to be tested based on the prediction results.

[0011] According to an embodiment of the present invention, determining the historical text of exposure and click in the user behavior log as a positive sample, selecting the historical text similar to the positive sample as a negative sample from the remaining text after removing the positive sample from the historical text, and constructing a training sample according to the positive sample and the negative sample includes:

[0012] Obtaining label information of the positive sample, and selecting historical samples with the same label information as random negative samples from the remaining text after removing the positive sample from the historical text;

[0013] Extracting features from each of the historical texts based on a preset recognition model to obtain feature vectors corresponding to each of the historical texts, calculating the similarity between each of the feature vectors, and selecting the historical text with a higher similarity to the positive sample as an enhanced negative sample according to the similarity calculation result;

[0014] The negative sample is constructed by combining the random negative sample and the enhanced negative sample in a preset ratio.

[0015] According to an embodiment of the present invention, the step of obtaining the label information of the positive sample and selecting a historical sample having the same label information as a random negative sample from the remaining text after removing the positive sample from the historical text comprises:

[0016] Obtaining label information of the positive sample, and selecting a historical sample having the same label information as a target sample from the remaining text after removing the positive sample from the historical text;

[0017] The exposure times of each target sample are obtained from the historical log of the target sample, the probability that the target sample becomes a random negative sample is calculated according to the exposure times, and the random negative sample is determined according to the probability.

[0018] According to an embodiment of the present invention, the extracting features of each of the historical texts based on a preset recognition model to obtain feature vectors corresponding to each of the historical texts, calculating the similarity between the feature vectors, and selecting the historical text having a higher similarity to the positive sample as an enhanced negative sample according to the similarity calculation result includes:

[0019] Extracting key information from each of the historical texts based on the recognition model;

[0020] Acquire the title information and summary information of each of the historical texts, and perform splicing processing on the tag information, summary information and key information of the same historical text;

[0021] Inputting the splicing processing result into the recognition model, performing feature extraction on the splicing processing result, and obtaining feature vectors corresponding to each of the historical texts;

[0022] The similarity between the feature vectors is calculated, and the historical text having a higher similarity with the positive sample is selected as an enhanced negative sample according to the similarity calculation result.

[0023] According to an embodiment of the present invention, the acquiring of the user portrait, inputting the user portrait and the training sample into a preset prediction model, obtaining an output result, calculating a loss function according to the output result and training the prediction model based on the loss function, and obtaining the target prediction model includes:

[0024] Obtaining a user portrait, taking the user portrait and the training data as inputs of a preset prediction model, extracting user features based on the user portrait to obtain a user feature vector, and extracting text features based on the training data to obtain a text feature vector;

[0025] Calculating a first loss function according to the text feature vector, and calculating a second loss function according to the user feature vector and the text feature vector;

[0026] Calculate a total loss function according to the first loss function and the second loss function;

[0027] The prediction model is trained based on the total loss function, and the parameters are adjusted using the gradient descent method to obtain the target prediction model.

[0028] According to one embodiment of the present invention, the first loss function is calculated according to the following formula:

[0029] Among them, C s and C T Represents the covariance matrix of text features, and d represents the dimension of the features.

[0030] According to one embodiment of the present invention, the second loss function is calculated according to the following formula:

[0031] Among them, u is the user feature, d + is the text feature of the positive sample, d — is the text feature of the negative sample, <u,d + > is the similarity between the user features and the text features of the positive sample, <u,d — > is the similarity between the user features and the text features of the negative samples.

[0032] In order to solve the above technical problems, another technical solution adopted by the present invention is to provide a recall text recommendation device, comprising:

[0033] An acquisition module, used to acquire historical texts and user behavior logs of each historical text;

[0034] A construction module, configured to determine the historical texts of exposure and click in the user behavior log as positive samples, select the historical texts similar to the positive samples from the remaining texts after removing the positive samples from the historical texts as negative samples, and construct training samples based on the positive samples and the negative samples;

[0035] A training module, used to obtain a user portrait, input the user portrait and the training sample into a preset prediction model to obtain an output result, calculate a loss function according to the output result, and train the prediction model based on the loss function to obtain a target prediction model;

[0036] The recommendation module is used to obtain the text to be tested, input the user portrait and the text to be tested into the target prediction model, extract features from the text to be tested and the user portrait respectively and make predictions based on the feature extraction results, and recommend recall text from the text to be tested based on the prediction results.

[0037] In order to solve the above technical problems, another technical solution adopted by the present invention is: to provide a computer device, including: a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor implements the recall text recommendation method when executing the computer program.

[0038] In order to solve the above technical problem, another technical solution adopted by the present invention is: providing a computer storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the above recall text recommendation method is implemented.

[0039] The beneficial effects of the present invention are as follows: by constructing negative samples similar to positive samples to improve the model's judgment of various data, combining them with user portraits, calculating the loss function based on the model output results, and training the model through the loss function, the accuracy of model recognition can be improved, and diverse and accurate texts can be recalled to supply the upper-level sorting model to improve the recommendation performance, solving the problems of online and offline inconsistency and low model prediction accuracy caused by directly reusing exposed but not clicked texts as negative samples. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 is a flowchart of a recall text recommendation method according to an embodiment of the present invention;

[0041] Figure 2 is a flowchart of step S102 in the recall text recommendation method according to an embodiment of the present invention;

[0042] Figure 3 is a flowchart of step S201 in the recall text recommendation method according to an embodiment of the present invention;

[0043] Figure 4 is a flow chart of step S202 in the recall text recommendation method according to an embodiment of the present invention;

[0044] Figure 5 is a flowchart of step S103 in the recall text recommendation method according to an embodiment of the present invention;

[0045] Figure 6 is a structural schematic diagram of a recall text recommendation device according to an embodiment of the present invention;

[0046] Figure 7 is a schematic diagram of the structure of a computer device according to an embodiment of the present invention;

[0047] Figure 8 It is a schematic diagram of the structure of a computer storage medium according to an embodiment of the present invention. DETAILED DESCRIPTION

[0048] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0049] The terms "first", "second" and "third" in the present invention are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first", "second" and "third" can explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "multiple" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined. All directional indications (such as up, down, left, right, front, back...) in the embodiments of the present invention are only used to explain the relative position relationship, movement, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication also changes accordingly. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices.

[0050] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0051] The embodiments of the present invention can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0052] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0053] Figure 1 FIG. 1 is a flow chart of a method for recommending a recall text according to an embodiment of the present invention. It should be noted that the method of the present invention is not limited to the method of recommending a recall text according to an embodiment of the present invention if the results are substantially the same. Figure 1 The process sequence shown is limited. Figure 1 As shown, the method comprises the steps of:

[0054] Step S101: Obtain historical texts and user behavior logs of each historical text.

[0055] In step S101, the historical text includes the text of exposure click and exposure not click, and the information recorded in the user behavior log includes but is not limited to the user operation of exposure click and the user operation of exposure not click. In the medical data recommendation scenario, the historical text can be medical data, such as personal health records, prescriptions, examination reports and other data. Each historical text contains label information, which can be used for text mounting classification. For example, historical text A belongs to a first-level department, such as pediatrics, psychiatry, etc.

[0056] Step S102: determine the historical texts of exposure and click in the user behavior log as positive samples, select the historical texts similar to the positive samples as negative samples from the remaining texts after removing the positive samples, and construct training samples based on the positive samples and negative samples.

[0057] In step S102, a common sample construction method uses exposure clicks in the behavior history log as positive samples, and exposure without clicks as negative samples. This embodiment is expected to alleviate the problem of inconsistency between online and offline data faced by the prediction model. For positive samples, historical texts with records of user exposure clicks in the user behavior log are still selected as positive samples, and for negative samples, historical texts similar to positive samples are selected from the remaining texts after removing the positive samples as negative samples.

[0058] In an achievable embodiment, the negative sample includes two parts, a random negative sample and an enhanced negative sample. The random negative sample is a historical text with the same label as the positive sample selected from the remaining text, and the enhanced negative sample is a historical text with a high similarity to the positive sample. The training sample of this embodiment is a sample pair formed by splicing the positive sample and the negative sample. For example, there are 2 positive samples, namely positive sample A and positive sample B, and there are 21 negative samples corresponding to the positive sample A (including 20 random negative samples and 1 enhanced negative sample), and there are also 21 negative samples corresponding to the positive sample B (including 20 random negative samples and 1 enhanced negative sample). Then, the positive sample A is spliced ​​with the corresponding 21 negative samples to form training data a, and the positive sample B is spliced ​​with the corresponding 21 negative samples to form training data b. The training data a and b are two different training samples.

[0059] Step S103: Obtain a user portrait, input the user portrait and training samples into a preset prediction model, obtain an output result, calculate a loss function according to the output result, and train the prediction model based on the loss function to obtain a target prediction model.

[0060] In step S103, the user portrait of this embodiment is related to the user behavior log and the user's preference. The prediction model of this embodiment is a double-tower model, and the input of the double-tower model includes two ends, one end corresponds to user features, and the other end corresponds to text features. User features include but are not limited to age, gender, ID information, etc., and text features include but are not limited to author, disease, drug, department, etc. The user portrait and training samples are input from both sides of the prediction model respectively, and the two sides use the DNN network to output feature vectors for user features and text features respectively, and the inner product of the two feature vectors is calculated in the last layer. The loss function of this embodiment includes two parts, one part is calculated based on the output result of user features, and the other part is calculated based on the output result of user features and the output result of text features.

[0061] Step S104: Obtain the text to be tested, input the user portrait and the text to be tested into the target prediction model, perform feature extraction on the text to be tested and the user portrait respectively, perform prediction based on the feature extraction results, and recommend recall text from the text to be tested based on the prediction results.

[0062] In step S104, the user portrait and the text to be tested are input from both sides of the target prediction model, and the DNN network is used to output feature vectors for user features and text features on both sides, and the inner product of the two feature vectors is calculated as the output in the last layer. In this embodiment, the content of the text to be tested in the default database does not change much, and there is no need to predict the text features in real time. Therefore, after predicting the text features of the text to be tested using the item side of the target prediction model, the prediction results are stored in Redis; during online prediction, the user features are predicted based on the user portrait through the user side of the target prediction model, and the similarity between the text features and the user features is calculated online, the similarity calculation results are sorted, and the recall text is recommended based on the similarity calculation results within the preset ranking.

[0063] The recall text recommendation method of the embodiment of the present invention constructs negative samples similar to positive samples to improve the model's judgment of various data, combines them with user portraits, calculates the loss function based on the model output results, and trains the model through the loss function. It can improve the accuracy of model recognition, recall diverse and accurate texts to supply the upper-level sorting model to improve the recommendation performance, and solves the problems of online and offline inconsistency and low model prediction accuracy caused by directly reusing exposed but not clicked texts as negative samples.

[0064] In one possible embodiment, see Figure 2 , step S102 further includes the following steps:

[0065] Step S201: Obtain label information of positive samples, and select historical samples with the same label information as random negative samples from the remaining text after removing the positive samples from the historical text.

[0066] In step S201, label information can be used for text mounting classification, for example, positive sample A belongs to a first-level department, such as pediatrics, psychiatry, etc. The remaining text after the positive sample is removed from the historical text can contain the same label information or different label information. For example, there are several historical negative samples with the same department as the positive sample in the remaining text, and there are also several historical negative samples with different departments from the positive sample. Then, n historical negative samples with the same department as the positive sample are selected from the remaining text as random negative samples.

[0067] Step S202: extract features from each historical text based on a preset recognition model, obtain feature vectors corresponding to each historical text, calculate the similarity between each pair of feature vectors, and select historical texts with higher similarity to positive samples as enhanced negative samples based on the similarity calculation results.

[0068] In step S202, the model trained using random negative samples can often only learn coarse-grained differences. In order to help the model learn fine-grained differences, this embodiment also selects a portion of historical texts that have a certain degree of similarity with the positive samples as negative samples to help the model learn some detailed differences. The recognition model of this embodiment is a NER (Named Entity Recognition) model. Based on the recognition model, the feature vectors of each historical text are obtained, the similarity between the feature vectors is calculated, the similarity calculation results related to the feature vectors of the positive samples are selected and sorted, and the historical texts corresponding to the similarity calculation results within the preset ranking range are selected as enhanced negative samples. The preset ranking is not the first ranking nor the last ranking. For example, the preset ranking is 10-15.

[0069] Step S203: construct negative samples using random negative samples and enhanced negative samples according to a preset ratio.

[0070] In step S203, when constructing negative samples, if there are too many random negative samples, the model will not be able to learn subtle differences, and if there are too many enhanced negative samples, the model will be "blinded by one leaf", causing the model to lose basic judgment when facing massive data online. Therefore, it is more appropriate to maintain a certain ratio between random negative samples and enhanced negative samples. The preset ratio in this embodiment is 20:1.

[0071] In one possible embodiment, see Figure 3 , step S201 further includes the following steps:

[0072] Step S301: Obtain label information of positive samples, and select historical samples with the same label information as target samples from the remaining text after removing the positive samples from the historical text.

[0073] Step S302: Obtain the exposure times of each target sample from the historical log of the target sample, calculate the probability that the target sample becomes a random negative sample according to the exposure times, and determine the random negative sample according to the probability.

[0074] In this embodiment, considering that in the recommendation scenario, a small number of popular contents often account for most of the exposure and clicks, it is necessary to do moderate oversampling according to the popularity when sampling negative samples, so as to offset the influence of popular contents on positive samples as much as possible. Specifically, referring to the sampling method of Word2vec in NLP, the probability of a certain content being selected as a negative sample is proportional to the number of exposures. The probability of the target sample of this embodiment becoming a random negative sample is the ratio of the number of exposures of each target sample to the weighted sum of the number of exposures of all target samples. This embodiment determines the target sample whose probability is greater than the preset threshold as a random negative sample.

[0075] The calculation formula for the probability of a target sample becoming a random negative sample is as follows:

[0076] Among them, f(w) represents the number of exposures of each target sample, then Represents the weighted sum of the exposure times of all target samples.

[0077] This embodiment constructs negative samples based on oversampled random negative samples and enhanced negative samples based on similarity calculation to improve the model's judgment of various data, and can solve the problem of online and offline inconsistency caused by directly reusing exposed but unclicked images as negative samples.

[0078] In one possible embodiment, see Figure 4 , step S202 further includes the following steps:

[0079] Step S401: extract key information from each historical text based on the recognition model.

[0080] All the texts in the medical field text library to be recommended are often highly professional, long in content, and contain a lot of interference information (such as the age and gender of the case, and the dosage of the drug). Therefore, the NER model based on BERT+CRF is used to extract the key information of the historical text (including disease / drug / diagnosis information, etc.).

[0081] Step S402: Acquire the title information and summary information of each historical text, and concatenate the tag information, summary information and key information of the same historical text.

[0082] Step S403: Input the splicing processing result into the recognition model, perform feature extraction on the splicing processing result, and obtain feature vectors corresponding to each historical text.

[0083] This embodiment concatenates the title, summary information and key information of the same historical text as the input of the NER model; uses the output of the hidden layer of the BERT model part of the model as the vector representation of the historical text, and this embodiment uses the average value of the output of the last two layers of the BERT model part as the vector representation of the historical text of the sentence.

[0084] Step S404: Calculate the similarity between each pair of feature vectors, and select historical texts with higher similarity to the positive sample as enhanced negative samples according to the similarity calculation results.

[0085] The similarity in this embodiment is cosine similarity. In the similarity calculation results, the calculation results related to the positive sample are selected and sorted, and the historical texts corresponding to the similarity calculation results within the preset ranking range are selected as enhanced negative samples. The preset ranking is not the first ranking nor the last ranking, for example, the preset ranking is 10-15.

[0086] In one possible embodiment, see Figure 5 , step S103 further includes the following steps:

[0087] Step S501: Obtain a user portrait, use the user portrait and training data as inputs of a preset prediction model, extract user features based on the user portrait to obtain a user feature vector, and extract text features based on the training data to obtain a text feature vector.

[0088] Step S502: Calculate a first loss function according to the text feature vector, and calculate a second loss function according to the user feature vector and the text feature vector.

[0089] The first loss function is calculated according to the following formula:

[0090] Among them, C s and C T represents the covariance matrix of text features, and d represents the dimension of the features. For example, C s is the covariance matrix of the text features corresponding to the labels with the top 10% of the historical text quantity, C T It is the covariance matrix of text features corresponding to the labels with the last 10% of the historical text quantity.

[0091] The second loss function is calculated according to the following formula:

[0092] Among them, u is the user feature, d +is the text feature of the positive sample, d — is the text feature of the negative sample, <u,d + > is the similarity between the user features and the text features of the positive sample, <u,d — > is the similarity between the user features and the text features of the negative samples.

[0093] Step S503: Calculate the total loss function according to the first loss function and the second loss function.

[0094] The total loss function is the sum of the first loss function and the second loss function. The calculation formula of the total loss function is as follows:

[0095] loss = l bpr +γ*l CORAL , where γ is the weight coefficient between [0,1], l bpr is the second loss function, l CORAL is the first loss function.

[0096] This embodiment introduces CORAL loss in transfer learning in view of the large differences between departments in the candidate set data. It can transfer the information learned from the content of departments with high frequency to the content of departments with low frequency, reduce the differences between the data, and improve the model's recognition ability for low-frequency data.

[0097] Step S504: Train the prediction model based on the total loss function, and adjust the parameters using the gradient descent method to obtain the target prediction model.

[0098] Figure 6 Schematic diagram of the structure of the recall text recommendation device according to an embodiment of the present invention. Figure 6 As shown, the device 60 includes an acquisition module 61 , a construction module 62 , a training module 63 and a recommendation module 64 .

[0099] The acquisition module 61 is used to acquire historical texts and user behavior logs of each historical text;

[0100] The construction module 62 is used to determine the historical texts of exposure and click in the user behavior log as positive samples, select the historical texts similar to the positive samples as negative samples from the remaining texts after removing the positive samples from the historical texts, and construct training samples based on the positive samples and the negative samples;

[0101] The training module 63 is used to obtain a user portrait, input the user portrait and the training sample into a preset prediction model, obtain an output result, calculate a loss function according to the output result, and train the prediction model based on the loss function to obtain a target prediction model;

[0102] The recommendation module 64 is used to obtain the text to be tested, input the user portrait and the text to be tested into the target prediction model, extract features from the text to be tested and the user portrait respectively and make predictions based on the feature extraction results, and recommend recall text from the text to be tested based on the prediction results.

[0103] See also Figure 7 , Figure 7 FIG. 1 is a schematic diagram of the structure of a computer device according to an embodiment of the present invention. Figure 7 As shown, the computer device 70 includes a processor 71 and a memory 72 coupled to the processor 71 .

[0104] The memory 72 stores program instructions for implementing the recall text recommendation method described in any of the above embodiments.

[0105] The processor 71 is used to execute program instructions stored in the memory 72 to recommend recall texts.

[0106] The processor 71 may also be referred to as a CPU (Central Processing Unit). The processor 71 may be an integrated circuit chip having signal processing capabilities. The processor 71 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0107] See also Figure 8 , Figure 8 Schematic diagram of the structure of the computer storage medium of the embodiment of the present invention. The computer storage medium of the embodiment of the present invention stores a program file 81 that can implement all the above methods, wherein the program file 81 can be stored in the above computer storage medium in the form of a software product, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned computer storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes, or terminal devices such as computers, servers, mobile phones, tablets, etc.

[0108] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and 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 an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0109] In addition, each functional unit in each embodiment of the present invention 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.

[0110] The above are only implementation modes of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A recall text recommendation method, It is characterized in that include: Obtain historical texts and user behavior logs for each of the historical texts; Determine the historical texts of exposure and click in the user behavior log as positive samples, select the historical texts similar to the positive samples from the remaining texts after removing the positive samples from the historical texts as negative samples, and construct training samples based on the positive samples and the negative samples; Obtaining a user portrait, inputting the user portrait and the training sample into a preset prediction model to obtain an output result, calculating a loss function according to the output result and training the prediction model based on the loss function to obtain a target prediction model, including: Obtaining a user portrait, taking the user portrait and the training data as inputs of a preset prediction model, extracting user features based on the user portrait to obtain a user feature vector, and extracting text features based on the training data to obtain a text feature vector; Calculating a first loss function according to the text feature vector, and calculating a second loss function according to the user feature vector and the text feature vector; Calculate a total loss function according to the first loss function and the second loss function; The prediction model is trained based on the total loss function, and the parameters are adjusted using the gradient descent method to obtain a target prediction model; The first loss function is calculated according to the following formula: Among them, C s and C T Represents the covariance matrix of text features, and d represents the dimension of the features; The second loss function is calculated according to the following formula: Among them, u is the user feature, d + is the text feature of the positive sample, d — is the text feature of the negative sample, <u,d + > is the similarity between the user features and the text features of the positive sample, <u,d — > is the similarity between user features and text features of negative samples; The text to be tested is obtained, the user portrait and the text to be tested are input into the target prediction model, features are extracted for the text to be tested and the user portrait respectively, prediction is performed according to the feature extraction results, and a recall text is recommended from the text to be tested based on the prediction results.

2. The recall text recommendation method according to claim 1, It is characterized in that The step of determining the historical text of exposure and click in the user behavior log as a positive sample, selecting the historical text similar to the positive sample as a negative sample from the remaining text after removing the positive sample from the historical text, and constructing a training sample according to the positive sample and the negative sample comprises: Obtaining label information of the positive sample, and selecting historical samples with the same label information as random negative samples from the remaining text after removing the positive sample from the historical text; Extracting features from each of the historical texts based on a preset recognition model to obtain feature vectors corresponding to each of the historical texts, calculating the similarity between each of the feature vectors, and selecting the historical text with a higher similarity to the positive sample as an enhanced negative sample according to the similarity calculation result; The negative sample is constructed by combining the random negative sample and the enhanced negative sample in a preset ratio.

3. The recall text recommendation method according to claim 2, It is characterized in that The step of obtaining the label information of the positive sample and selecting a historical sample having the same label information as a random negative sample from the remaining text after removing the positive sample from the historical text comprises: Obtaining label information of the positive sample, and selecting a historical sample having the same label information as a target sample from the remaining text after removing the positive sample from the historical text; The exposure times of each target sample are obtained from the historical log of the target sample, the probability that the target sample becomes a random negative sample is calculated according to the exposure times, and the random negative sample is determined according to the probability.

4. The recall text recommendation method according to claim 2, It is characterized in that The extracting features of each of the historical texts based on a preset recognition model to obtain feature vectors corresponding to each of the historical texts, calculating the similarity between each of the feature vectors, and selecting the historical text having a higher similarity to the positive sample as an enhanced negative sample according to the similarity calculation result includes: Extracting key information from each of the historical texts based on the recognition model; Acquire the title information and summary information of each of the historical texts, and perform splicing processing on the tag information, summary information and key information of the same historical text; Inputting the splicing processing result into the recognition model, performing feature extraction on the splicing processing result, and obtaining feature vectors corresponding to each of the historical texts; The similarity between the feature vectors is calculated, and the historical text having a higher similarity with the positive sample is selected as an enhanced negative sample according to the similarity calculation result.

5. A recall text recommendation device, It is characterized in that include: An acquisition module, used to acquire historical texts and user behavior logs of each historical text; A construction module, configured to determine the historical texts of exposure and click in the user behavior log as positive samples, select the historical texts similar to the positive samples from the remaining texts after removing the positive samples from the historical texts as negative samples, and construct training samples based on the positive samples and the negative samples; A training module is used to obtain a user portrait, input the user portrait and the training sample into a preset prediction model to obtain an output result, calculate a loss function according to the output result, and train the prediction model based on the loss function to obtain a target prediction model, including: include: Obtaining a user portrait, taking the user portrait and the training data as inputs of a preset prediction model, extracting user features based on the user portrait to obtain a user feature vector, and extracting text features based on the training data to obtain a text feature vector; Calculating a first loss function according to the text feature vector, and calculating a second loss function according to the user feature vector and the text feature vector; Calculate a total loss function according to the first loss function and the second loss function; The prediction model is trained based on the total loss function, and the parameters are adjusted using the gradient descent method to obtain a target prediction model; The first loss function is calculated according to the following formula: Among them, C s and C T Represents the covariance matrix of text features, and d represents the dimension of the features; The second loss function is calculated according to the following formula: Among them, u is the user feature, d + is the text feature of the positive sample, d — is the text feature of the negative sample, <u,d + > is the similarity between the user features and the text features of the positive sample, <u,d — > is the similarity between user features and text features of negative samples; The recommendation module is used to obtain the text to be tested, input the user portrait and the text to be tested into the target prediction model, extract features of the text to be tested and the user portrait respectively and make predictions based on the feature extraction results, and recommend recall text from the text to be tested based on the prediction results.

6. A computer device, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the recall text recommendation method according to any one of claims 1 to 4 when executing the computer program.

7. A computer storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the recall text recommendation method according to any one of claims 1 to 4 is implemented.