Text processing method, device, electronic device and readable storage medium
By using user comment text and click-through rate prediction models to generate video recommendation reasons, the poor effect problem caused by single recommendation reasons in the prior art is solved, and the click-through rate and effect of video recommendations are improved.
Patent Information
- Application Number
- CN202011046024.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-28
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2040-09-28
AI Technical Summary
In the prior art, the generation of video recommendation reasons is relatively single, resulting in poor recommendation results and low click-through rate.
By obtaining the reasons for choosing recommendations based on the comment text generated by the user for the video, using the preset click-through rate prediction model, combining the text characteristics and user characteristics of the video, generating predicted click-through rate, and determining the target recommendation reason.
It improves the diversity and attractiveness of recommendation reasons, and improves the click-through rate and recommendation effect of video recommendations.
Smart Images

Figure CN112115300B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer technology, and in particular relates to a text processing method, device, electronic device and readable storage medium. Background Art
[0002] In video search or recommendation scenarios, the reason for video recommendation is important information to assist users in making decisions. Users can decide whether to watch the video based on the reason for recommendation displayed by the client for each video. Therefore, how to set accurate and reasonable reason for recommendation for videos has become a widely concerned issue.
[0003] In the prior art, templates are often used to directly extract relevant information of the video to be recommended to obtain recommendation reasons, such as the starring actors, genres, and plots, and the recommendation reasons are directly used for recommendation. In this way, the content of the generated recommendation reasons is relatively simple, which leads to poor recommendation effects when the recommendation is made based on the recommendation reasons, and a low click-through rate of the recommended video. Summary of the invention
[0004] The present invention provides a text processing method, device, electronic device and readable storage medium to solve the problem of poor effect when using recommendation reasons for recommendation.
[0005] According to a first aspect of the present invention, a text processing method is provided, the method comprising:
[0006] Obtaining the reasons for recommending the video according to the comment text generated by the user for the video;
[0007] Using a preset click rate prediction model, based on the text features of the candidate recommendation reason of the video and the user features of the user to be recommended, a predicted click rate corresponding to the candidate recommendation reason is generated;
[0008] The candidate recommendation reason whose corresponding predicted click rate meets the preset condition is determined as the target recommendation reason for the video.
[0009] According to a second aspect of the present invention, there is provided a text processing device, the device comprising:
[0010] A first acquisition module, used to acquire the candidate recommendation reason of the video according to the comment text generated by the user for the video;
[0011] A first generating module is used to generate a predicted click rate corresponding to the candidate recommendation reason by using a preset click rate prediction model according to the text features of the candidate recommendation reason of the video and the user features of the user to be recommended;
[0012] The first determination module is used to determine the candidate recommendation reason whose corresponding predicted click rate meets the preset condition as the target recommendation reason of the video.
[0013] In another aspect of the present invention, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer executes any of the above-described methods.
[0014] In yet another aspect of the present invention, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute any of the above-described methods.
[0015] Compared with the prior art, the present invention has the following advantages:
[0016] According to the comment text generated by the user for the video, the candidate recommendation reasons of the video are obtained, and the predicted click rate corresponding to the candidate recommendation reasons is determined by using the preset click rate prediction model according to the text features of the candidate recommendation reasons of the video and the user features of the user to be recommended. The candidate recommendation reasons whose corresponding predicted click rate meets the preset conditions are determined as the target recommendation reasons of the video. Since the comment text can reflect the user's true emotions towards the video in a diverse manner, in the embodiment of the present invention, selecting the target recommendation reason from the candidate recommendation reasons obtained according to the comment text generated by the user for the video can make the content of the selected target candidate recommendation reasons more diverse to a certain extent, and thus can improve the click rate when recommending the video using the target recommendation reason to a certain extent, thereby improving the recommendation effect.
[0017] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0019] Figure 1 is a flowchart of a text processing method provided by an embodiment of the present invention;
[0020] Figure 2 is a block diagram of a text processing device provided by an embodiment of the present invention;
[0021] Figure 3It is a structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0022] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.
[0023] Figure 1 is a flowchart of a text processing method provided by an embodiment of the present invention. Figure 1 As shown, the method may include:
[0024] Step 101: Obtain the candidate recommendation reasons for the video based on the comment text generated by the user for the video.
[0025] In an embodiment of the present invention, the video may be a video in a network platform. For example, a video in a video network platform. Specifically, the video may be a video that needs to be recommended to a user selected by the platform in a recommendation scenario, or a video that needs to be recommended to a user in a video search scenario and is recalled based on a search keyword input by a user.
[0026] The comment text generated by the user for the video can be determined based on the user-generated content (UGC, User Generated Content) generated by the user for the video. For example, the comment text can be the text posted by the user in the comment area corresponding to the video, the barrage sent during the video viewing process, the text added by the user when forwarding the video, and so on. Since UGC is often made by the user based on his or her own viewing experience, the content of UGC can often reflect the user's emotions, and the number of UGC is often large, and the user's emotions towards the video can be reflected in a diversified way through UGC. Accordingly, in an embodiment of the present invention, the candidate recommendation reasons for the video obtained based on the comment text generated by the user for the video can, to a certain extent, obtain candidate recommendation reasons that can reflect the user's real emotions and are diverse. And the recommendation reasons that can resonate with the user's emotions are often more attractive to users. Therefore, the method of obtaining the candidate recommendation reasons based on the comment text generated by the user for the video in the embodiment of the present invention can, to a certain extent, ensure that the target recommendation reasons subsequently selected from the candidate recommendation reasons have more diverse content and can be sufficiently attractive to users, and further ensure that when the target recommendation reasons are used for recommendation, users can be attracted to a greater extent to click, watch, and perform other operations on the video, thereby increasing user activity and the length of time spent on the video platform.
[0027] Step 102: using a preset click rate prediction model, according to the text features of the candidate recommendation reason of the video and the user features of the user to be recommended, generate a predicted click rate corresponding to the candidate recommendation reason.
[0028] In an embodiment of the present invention, the predicted click-through rate corresponding to the reason for recommendation to be selected is used to characterize the click-through rate of the video when the video is recommended with the reason for recommendation to be selected. The click-through rate refers to the ratio of the number of times a video is clicked to the number of times it is displayed, which can be used to reflect the degree of attention paid to the video by the user. Further, the user characteristics of the user to be recommended can be generated based on the user-related information of the user to be recommended. For example, the user-related information of the user to be recommended can be obtained first, wherein the user-related information can be information related to the user to be recommended, such as the user's age, gender, video viewing preference, etc., and then the user-related information can be vectorized to obtain the user characteristics. The text features of the reason for recommendation to be selected can be determined based on the words contained in the reason for recommendation to be selected, and the text features can reflect the text information contained in the reason for recommendation to be selected, and the text features can be obtained by vectorizing the words in the reason for recommendation to be selected. Further, the preset click-through rate prediction model can be a pre-trained model that can predict the click-through rate of the video when the video is recommended with the reason for recommendation to be selected based on the user characteristics of the user and the text features of the reason for recommendation to be selected. The higher the click-through rate, the more attractive the video is to the user, and the lower the click-through rate, the less attractive the video is to the user. That is, the predicted click-through rate corresponding to the candidate recommendation reason determined according to the preset click-through rate prediction model can represent the attractiveness of the candidate recommendation reason to the user.
[0029] Specifically, the text features of the video's candidate recommendation reason and the user features of the user to be recommended can be used as inputs to a preset click rate prediction model, and then the click rate output by the preset click rate prediction model is obtained as the predicted click rate corresponding to the candidate recommendation reason.
[0030] Step 103: Determine the candidate recommendation reason whose corresponding predicted click rate meets the preset condition as the target recommendation reason for the video.
[0031] In the embodiment of the present invention, the preset condition can be set according to actual needs. For example, the preset condition can be that the predicted click rate is greater than a preset click rate threshold, or that the click rate is the maximum. Further, if the corresponding predicted click rate meets the preset condition, it can be considered that the attractiveness of the candidate recommendation reason is large enough, and therefore, the candidate recommendation reason can be determined as the target recommendation reason.
[0032] In summary, the text processing method provided in the embodiment of the present invention obtains the candidate recommendation reasons of the video according to the comment text generated by the user for the video, and uses the preset click-through rate prediction model to determine the predicted click-through rate corresponding to the candidate recommendation reasons according to the text features of the candidate recommendation reasons of the video and the user features of the user to be recommended. The candidate recommendation reasons whose corresponding predicted click-through rates meet the preset conditions are determined as the target recommendation reasons of the video. Since the comment text can reflect the user's true emotions towards the video in a diverse manner, in the embodiment of the present invention, selecting the target recommendation reason from the candidate recommendation reasons obtained according to the comment text generated by the user for the video can make the content of the selected target candidate recommendation reasons more diverse to a certain extent, and thus can improve the click-through rate when recommending the video using the target recommendation reason to a certain extent, thereby improving the recommendation effect.
[0033] Furthermore, by selecting the candidate recommendation reason whose corresponding predicted click-through rate meets the preset conditions as the target recommendation reason through the click-through rate prediction model, the user's sensitivity to the selected target recommendation reason can be further enhanced, and to a greater extent, the target recommendation reason can be sufficiently attractive to the user, thereby ensuring the recommendation effect.
[0034] Optionally, in one implementation, only the barrage text can be selected as the comment text. Since the barrage text is often sent by the user in real time during the viewing process based on the viewing experience, it can reflect the user's stronger emotional tendency when sending it, and the number of words contained in the barrage is often less than the number of words in other comment texts, and a short number can express the complete meaning. Compared with the direct use of template extraction, which results in a similar expression form of the recommendation reasons and cannot reflect the emotional tendency, the embodiment of the present invention generates the recommendation reasons by using the barrage text in the comment text. To a certain extent, it can ensure that the recommendation reasons have emotional tendencies while ensuring that the language of the recommendation reasons is concise, and further ensure that the recommendation reasons bring emotional resonance to users and increase the degree of attraction to users.
[0035] Optionally, the following steps A to C may be used to obtain the candidate recommendation reasons for the video based on the comment text generated by the user for the video:
[0036] Step A: Filter candidate texts from the comment text according to the text length and the number of words contained in the comment text.
[0037] In an embodiment of the present invention, the text length of the comment text may be determined first. For example, the number of characters in the comment text may be determined, and the number of characters may be used as the text length. The comment text is segmented to obtain the words contained in the comment text. The number of these words is counted to obtain the number of words contained in the comment text.
[0038] Furthermore, a comment text whose text length is not greater than a preset length threshold and whose number of words is not less than a preset word number threshold can be determined as an alternative text. The preset length threshold can be determined based on the display position of the recommendation reason. For example, the text length of the longest recommendation reason that can be accommodated in the display position can be used as the preset length threshold. For example, the preset length threshold can be 16. The preset word number threshold can be set based on the minimum number of words required for the text to express the complete meaning. For example, the preset word number threshold can be 3.
[0039] In actual application scenarios, when making recommendations, multiple videos are often displayed on the page, and each video also needs to display information in addition to the recommendation reasons. Therefore, the size of the display position of the recommendation reasons is often limited. Accordingly, in an embodiment of the present invention, by filtering the alternative text according to the text length, it can be ensured that the candidate recommendation reasons subsequently generated based on the alternative text will not be too long, thereby ensuring that the target recommendation reasons selected from the candidate recommendation reasons can be displayed normally during display, thereby ensuring the display effect. Furthermore, when the number of words contained in the text is too small, the text often cannot convey the complete meaning. Therefore, in an embodiment of the present invention, by filtering the alternative text according to the number of words contained at the same time, it can be ensured that the candidate recommendation reasons subsequently generated based on the alternative text can all express the complete meaning, thereby ensuring the semantic completeness of the target recommendation reasons selected from the candidate recommendation reasons.
[0040] Step B: selecting target texts whose text quality meets preset quality requirements from the candidate texts.
[0041] Due to the large number of comment texts, for example, as the user usage time on the movie viewing platform increases, the comment texts produced by users on the movie viewing platform tend to grow at an explosive rate. This will result in the comment texts being mixed with poor quality content, where poor quality content can be comment texts with serious colloquialisms, syntactically incoherent, and with content that is not suitable for presentation, such as abusive content. Therefore, in an embodiment of the present invention, in the process of generating the reasons for the selected recommendations, a target text whose text quality meets the preset quality requirements can be screened from the candidate texts. This ensures the quality of the subsequently generated reasons for the selected recommendations.
[0042] Optionally, this step may include: detecting whether the alternative text meets at least one of a preset emotion requirement, a preset fluency requirement, a preset sensitive word requirement and a preset expression form requirement; if so, determining the alternative text as the target text.
[0043] Among them, the preset emotional requirement is that the emotional tendency corresponding to the alternative text is not negative; the preset fluency requirement is that the fluency of the alternative text is greater than the preset fluency threshold; the preset sensitive word requirement is that the preset sensitive words do not appear in the alternative text; the preset expression form requirement is that the expression form of the alternative text does not conform to the preset expression form of the illegal comment text.
[0044] Specifically, when detecting whether the candidate text meets the preset emotional requirements, the emotional tendency corresponding to the candidate text can be determined according to the preset emotional analysis model. Among them, the emotional tendency can include positive, neutral, and negative. The preset emotional analysis model can determine the emotional tendency according to the word features of the emotional words contained in the candidate text. If the emotional tendency corresponding to the candidate text is not negative, that is, it is positive or neutral, it can be determined that the candidate text meets the preset emotional requirements. In this way, based on the preset emotional requirements, screening from the perspective of emotional tendency can ensure that the emotional tendency of the subsequently generated recommendation reasons is not negative, and then it can avoid showing emotionally negative and unfriendly content to users. It should be noted that in the process of determining the emotional tendency, a series of emotional words and evaluation objects of emotional words can often be obtained. Accordingly, in an embodiment of the present invention, emotional words and evaluation objects of emotional words can also be stored for use in other operations.
[0045] When detecting whether the candidate text meets the preset fluency requirement, the fluency of the candidate text can be detected by a preset text fluency detection algorithm. Then the fluency of the candidate text is compared with the preset fluency threshold. If the fluency of the candidate text is greater than the preset fluency threshold, it can be considered that the candidate text meets the preset fluency requirement. In this way, screening from the perspective of semantic fluency based on the preset fluency requirement can ensure the fluency of the recommendation reasons generated subsequently.
[0046] Furthermore, when detecting whether the candidate text meets the preset sensitive word requirements, the words contained in the candidate text can be compared with the preset sensitive words respectively. If there are words matching the preset sensitive words, it can be considered that the preset sensitive words appear in the candidate text. If there are no words matching the preset sensitive words, it can be considered that the preset sensitive words do not appear in the candidate text, and the candidate text meets the preset sensitivity requirements. Among them, the preset sensitive words can be set according to banned words, for example, advertising words, pornographic, vulgar, and unhealthy words are set as preset sensitive words.
[0047] Furthermore, when detecting whether the alternative text meets the preset expression form requirements, the alternative text can be matched with the preset illegal comment text expression form. If the two match, it can be considered that the expression form of the alternative text meets the preset illegal comment text expression form. On the contrary, it can be considered that the expression form of the alternative text does not meet the preset illegal comment text expression form. Among them, the preset illegal comment text expression form can be determined based on spoilers, comparisons, water posts, explanations for specific pictures, and negative emotions. For example, the expression forms of comment texts of these categories can be counted as preset illegal comment text expression forms. For example, the expression form of comparison comment texts is often "far worse than XXX, not as good as XXX", and accordingly, this expression form can be determined as the preset illegal comment text expression form.
[0048] In the embodiment of the present invention, the quality of the target text can be further improved to a certain extent by filtering out unwanted content from the perspective of the expression form based on the preset expression form requirements. It should be noted that the preset illegal comment text expression form can also be extracted from the comment text expressing negative emotions, and the alternative text used to express negative emotions can be filtered according to the preset illegal comment text expression form. In this way, the negative emotion alternative text omitted in the screening process using the preset emotion requirements can be filtered out to a certain extent, thereby further improving the screening quality.
[0049] It should be noted that the more requirements the candidate text meets, the higher the quality of the candidate text can be considered. In order to ensure the quality of the generated recommendation reasons to the greatest extent, in an embodiment of the present invention, the candidate text can be determined as the target text when the candidate text meets all the above requirements. In this way, through sentiment tendency analysis, semantic coherence detection, filtering based on sensitive words, and screening according to the form of expression, it is possible to effectively control the text quality of the target text, thereby ensuring the quality of the target text. At the same time, through sentiment tendency analysis and filtering based on sensitive words, it is possible to ensure that the content conveyed by the target text is positive and uplifting, and avoid the problem that the selected target text conveys negative information, thereby affecting the subsequent recommendation effect.
[0050] Optionally, in order to further improve the text quality, the candidate text may be preprocessed; wherein the preprocessing operation includes at least one of the following operations: converting uppercase characters in the candidate text into lowercase characters, converting traditional characters into simplified characters, and converting half-width symbols into full-width symbols. In this way, the text may be made more standardized through preprocessing, thereby improving the text quality to a certain extent.
[0051] Step C: Generate the candidate recommendation reasons based on the target text.
[0052] Optionally, in this step, the target text may be used as the candidate recommendation reason. Since the target text is a high-quality text that has been screened layer by layer and has a certain emotional tendency, the target text can be directly used as the candidate recommendation reason. In this way, the candidate recommendation reason can be obtained without additional processing, which can improve the efficiency of generating the candidate recommendation reason to a certain extent. Alternatively, the target text can be used as the input of a preset text generation model, and the output of the preset text generation model is obtained as the candidate recommendation reason. Among them, the preset text generation model can be used to generate text similar to the target text content. The text similar to the target text content can be a text whose similarity with the target text is greater than a preset similarity threshold, and the preset similarity threshold can be set according to actual needs. Further, the preset text generation model can be a sequence-to-sequence (seq2seq) model, and the preset text generation model can include an encoder and a decoder. Among them, the encoder can contextually encode the target text, and then decode it through a decoder, and use the output of the decoder as the candidate recommendation reason. In this way, by first performing context encoding and then decoding by the decoder, it is possible to ensure that the output text has a similar context to the target text to a certain extent, thereby ensuring that the generated candidate recommendation reasons have similarities to the target text. In the embodiment of the present invention, the target text is further processed by a preset text generation model to generate candidate recommendation reasons. To a certain extent, when the expression form of the target text is not natural enough, the generated candidate recommendation reasons can be made more natural, thereby improving the effect of generating candidate recommendation reasons.
[0053] It should be noted that the number of reasons to be recommended can be set according to actual needs. For example, the number of reasons to be recommended can be set to the number of target texts. In this way, when multiple target texts are determined, the corresponding number of reasons to be recommended can be determined. Alternatively, the reasons to be recommended can be set to a preset number, for example, to 5. Accordingly, when the number of target texts is greater than the preset number, after the reasons to be recommended are generated according to the target texts, the reasons to be recommended can be discarded so that the number of remaining reasons to be recommended is the preset number. Among them, when the reasons to be recommended are discarded, the reasons to be recommended can be randomly selected and discarded. In the embodiment of the present invention, by controlling the number of reasons to be recommended by a preset number, it is possible to avoid generating too many reasons to be recommended, which brings too much calculation amount to the subsequent operation of selecting the target recommendation reason, thereby reducing the processing efficiency.
[0054] Optionally, the text processing method provided by the embodiment of the present invention can be implemented in the form of a service. In the case where it is necessary to generate a recommendation reason for a video, the caller can call the service by calling the HTTP interface. The caller can be a terminal used by the user, such as a mobile phone, a computer, and the like. The interface can be a real-time service interface. Since the response speed of the real-time service interface is relatively high, it can ensure that the caller can be responded to quickly, reducing time consumption, and then quickly returning the target recommendation reason to the caller. By way of example, the real-time service interface can be a service interface with a response delay of less than 15 milliseconds (ms).
[0055] Specifically, the caller can pass in at least one video identification (Identity, ID) through the interface, for example, pass in the ID of a video, or an ID list containing multiple video IDs. Accordingly, the method provided in the embodiment of the present invention may also include the steps of: receiving at least one video ID passed in by the caller; determining the video corresponding to the video identification as the video. Accordingly, after executing the above step 103, the following steps may be performed: returning the target recommendation reason to the caller. After the caller receives the returned target recommendation reason, it can directly use the target recommendation reason to recommend the video. In the embodiment of the present invention, the method of receiving the call and returning the target recommendation reason allows the caller to easily obtain the target recommendation reason for the video, thereby improving the efficiency of the caller in outputting the target recommendation reason to the user to a certain extent.
[0056] Optionally, the preset click rate prediction model in the embodiment of the present invention can be obtained through the following steps D to E:
[0057] Step D: construct training sample pairs based on the target click-through rate of sample users for sample videos, user characteristics of the sample users, and text characteristics of sample recommendation reasons; wherein the target click-through rate is used to characterize the click-through rate of the sample video when the sample video is recommended with the sample recommendation reason.
[0058] In the embodiment of the present invention, the sample user and the sample video may be users and videos in the network platform, respectively. For example, they may be users and videos in the video network platform. The sample recommendation reason may be the recommendation reason used by the sample video. The user feature of the sample user may be generated based on the user-related information of the sample user. For example, the user-related information of the sample user may be obtained first, wherein the user-related information may be information related to the sample user. For example, the user-related information may be the user's personal information, actor preference information, and video preference information. For example, the personal information may include age and gender. The video preference information may include the name of the favorite video, the category of the favorite video, the tag of the favorite video, and the channel to which the favorite video belongs. The actor preference information may include the name of the favorite actor, the type of video that the favorite actor often appears in, and so on. Then, the user-related information may be vectorized to obtain the user feature. Optionally, the user feature may include at least one of the personal information feature, the video preference feature, and the actor preference feature. Since these features can characterize to a certain extent what kind of video the user will be interested in, the user often clicks on the video when he is interested in the video. Therefore, in the embodiment of the present invention, using these user features as training data can, to a certain extent, enable the model to learn how to predict click-through rate in combination with user interests.
[0059] Furthermore, the sample recommendation reason may be a recommendation reason used in the sample video, and the text feature of the sample recommendation reason may be determined based on the words included in the sample recommendation reason. The text feature may reflect the text information contained in the sample recommendation reason. Specifically, the text feature may be obtained by vectorizing the words in the recommendation reason. Furthermore, the target click-through rate may represent the click-through rate of the sample video when the sample video is recommended with the sample recommendation reason, that is, the target click-through rate may represent the real attractiveness of the sample recommendation reason to the user to a certain extent.
[0060] Step E: training the initial click rate prediction model based on the training sample pairs to obtain the preset click rate prediction model.
[0061] In an embodiment of the present invention, the initial click rate prediction model can be selected and constructed according to actual needs. For example, the initial click rate prediction model can be a factorization machine (FM) model. During training, user features and text features can be used as sample features and input into the initial click rate prediction model, and the initial click rate prediction model can be iteratively trained until the loss value of the initial click rate prediction model meets the requirements, that is, the prediction accuracy of the initial click rate prediction model meets the requirements. Finally, the initial click rate prediction model with the prediction accuracy meeting the requirements can be used as the preset click rate prediction model.
[0062] The embodiment of the present invention constructs a training sample pair according to the target click rate of the sample video for the sample user, the user characteristics of the sample user and the text characteristics of the sample recommendation reason, wherein the target click rate is used to characterize the click rate of the sample video when the sample video is recommended with the sample recommendation reason. According to the training sample pair, the initial click rate prediction model is trained to obtain a preset click rate prediction model. Since the target click rate can represent the attractiveness of the sample user to a certain extent when the sample recommendation reason is used for recommendation, the preset click rate prediction model can learn to predict the click rate according to the user characteristics and text characteristics, that is, the ability to predict the attractiveness of the recommendation reason to the user. Then, the preset click rate prediction model can be used to select the recommendation reason with a higher attractiveness to the user based on the user situation. Compared with the method of directly selecting a fixed recommendation reason, the embodiment of the present invention can select a recommendation reason that is more suitable for the user, thereby improving the use effect of the recommendation reason and realizing personalized recommendation.
[0063] It should be noted that the process of training a preset click-through rate prediction model and the process of selecting target recommendation reasons using the preset click-through rate prediction model can be executed on the same device, or on different devices, and the embodiments of the present invention are not limited to this.
[0064] Furthermore, in the embodiment of the present invention, the sample recommendation reason of the sample video can be generated based on the comment text of the sample video. For example, it can be generated based on the barrage text of the sample video. Accordingly, before starting training, the embodiment of the present invention can: obtain the sample recommendation reason of the sample video based on the comment text of the sample video; recommend the sample video based on the sample recommendation reason of the sample video; and obtain the target click-through rate of the sample video after a preset duration of recommendation. In this way, the recommendation reason generated based on the comment text is used as the sample recommendation reason, and the click-through rate when recommended with the sample recommendation reason is collected as the target click-through rate. In this way, to a certain extent, the click-through rate prediction model that is subsequently trained using the sample recommendation reason and the target click-through rate can learn the ability to predict the click-through rate for the sample recommendation reason obtained from the comment text during the training process, thereby improving the prediction accuracy of the click-through rate prediction model.
[0065] Specifically, after the preset duration of recommendation, the operation of obtaining the target click rate of the sample video can be to obtain the click rate based on the actual click data statistics of the user on the sample video. The process of obtaining the sample recommendation reason of the sample video based on the comment text corresponding to the sample video can refer to the above process of obtaining the candidate recommendation reason, and the embodiment of the present invention will not be described in detail here.
[0066] Optionally, since the data volume of the real click rate of the sample video may be small, for example, when the sample video is just online, the data volume of the real click rate is often small. In order to ensure the training effect, in the embodiment of the present invention, the target click rate can be obtained by the following steps:
[0067] Step F: obtaining the number of likes and dislikes of the sample bullet text of the sample video by the sample users within a preset time period.
[0068] In this step, the preset duration can be set according to actual needs. For example, the preset duration can be 1 month, one week, and so on. The sample barrage text can be the barrage text corresponding to the sample video. Since users tend to like a barrage when they are interested in it, accordingly, the more attractive the barrage is to users, the more likes the barrage will attract, and the higher the number of likes in the number of likes and dislikes will be. Conversely, when users are not interested in a barrage, they tend to diss the barrage, accordingly, the less attractive the barrage is to users, the more diss the barrage will attract, and the higher the number of diss in the number of likes and dislikes will be.
[0069] It should be noted that, when obtaining user features of sample users, the embodiments of the present invention can obtain the portrait information of users who have liked or dissed the sample bullet text within a preset time period from a preset user portrait system, and obtain user features based on the portrait information. In this way, obtaining user features through portrait information in an existing user portrait system can improve the efficiency of obtaining user features to a certain extent.
[0070] Step G: Generate the target click-through rate according to the thumbs-down amount; the target click-through rate is positively correlated with the thumbs-up amount in the thumbs-down amount, and negatively correlated with the thumbs-down amount in the thumbs-down amount.
[0071] In this step, a higher target click rate can be set when the number of likes is higher and the number of dislikes is lower, and a lower target click rate can be set when the number of likes is lower and the number of dislikes is higher. For example, the number of likes can be input into a first preset function, the number of dislikes can be input into a second preset function, and then the sum of the outputs of the two preset functions can be determined as the target click rate. The first preset function is a function in which the dependent variable is positively correlated with the independent variable, and the second preset function is a function in which the dependent variable is negatively correlated with the independent variable.
[0072] Since users often post multiple bullet-screen texts while watching videos, and the number of likes and dislikes of the bullet-screen texts can indicate the attractiveness of the bullet-screen texts to users. The click-through rate is also determined by the attractiveness of the video to users. Therefore, in an embodiment of the present invention, by obtaining the number of likes and dislikes of the bullet-screen texts of the video and generating a target click-through rate, it is possible to ensure that more accurate click-through rate data can be generated in the absence of data, thereby ensuring the integrity of the training data. Furthermore, the number of likes can represent positive samples, and the number of dislikes can represent negative samples. Therefore, by generating the target click-through rate through the number of likes and dislikes, the target click-through rate can include both positive and negative sample dimensions, thereby improving the training effect when using the target click-through rate for training to a certain extent.
[0073] Optionally, the process of training an initial click-through rate prediction model according to the training sample set pair to obtain a preset click-through rate prediction model may include: inputting the user features and the text features as sample features into the initial click-through rate prediction model, and processing the sample features according to the initial click-through rate prediction model to generate a predicted click-through rate; calculating a loss value of the initial click-through rate prediction model based on the predicted click-through rate and the target click-through rate; if the loss value is not within a preset range, adjusting the initial click-through rate prediction model based on the loss value, and continuing to train the adjusted initial click-through rate prediction model until the loss value is within the preset range, and using the initial click-through rate prediction model as the preset click-through rate prediction model.
[0074] Specifically, the initial click-through rate prediction model may include a multi-layer structure, and each layer of the structure may implement different processing. The sample features are input into the initial click-through rate prediction model, and the initial click-through rate prediction model may process the sample features through the layers it includes, and finally, generate a predicted click-through rate. Then the predicted click-through rate and the target click-through rate may be input into the loss function, wherein the loss function may be pre-selected, for example, a cross entropy loss function. Further, if the loss value is not within the preset range, it may be considered that the processing capacity of the initial click-through rate prediction model is not sufficient to meet the click-through rate prediction requirements, and therefore, the parameters in the initial click-through rate prediction model may be adjusted, and then training may be continued to further optimize the initial click-through rate prediction model. Specifically, the parameters in the initial click-through rate prediction model may be adjusted based on the degree of error represented by the loss value, and training may be continued based on the adjusted initial click-through rate prediction model until the loss value is within the preset range, that is, when the processing capacity of the initial click-through rate prediction model meets the click-through rate prediction requirements, the initial click-through rate prediction model is used as the preset click-through rate prediction model, thereby ensuring the accuracy of the trained click-through rate prediction model.
[0075] Optionally, after generating the target recommendation reason, an operation of recommending the video to the user to be recommended according to the target recommendation reason may be performed. When recommending the video to the user to be recommended according to the target recommendation reason, the video information of the video and the target recommendation reason may be displayed to the user to be recommended. For example, the video information may include the name, starring role, type, etc. of the video. When specifically displayed, it may be displayed in the form of a push message.
[0076] Furthermore, after using the target recommendation reason for recommendation, testing can also be performed based on real data. For example, the click-through rate (CTR) and user click-through rate (UCTR) can be used as evaluation indicators to test on real data generated within a day. For example, the CTR and UCTR of the target recommendation reason personalized by the method of the embodiment of the present invention can be calculated within a day by the following calculation formula. And the CTR and UCTR of the recommendation reason directly extracted from the template or randomly generated recommendation reason when making a recommendation within a day.
[0077] CTR = total clicks / total impressions;
[0078] UCTR = user clicks / user impressions.
[0079] For example, Table 1 shows a comparison table of CTR and UCTR.
[0080] Distribution strategy CTR UCTR Random output 4.76% 12% Personalized output 4.99% 12.6%
[0081] Table 1
[0082] It can be seen that the CTR and UCTR when using personalized target recommendation reasons for recommendation are higher than the CTR and UCTR when using randomly generated recommendation reasons for recommendation.
[0083] Figure 2 is a block diagram of a text processing device provided by an embodiment of the present invention, such as Figure 2 As shown, the device 20 may include:
[0084] The first acquisition module 201 is used to acquire the candidate recommendation reason of the video according to the comment text generated by the user for the video;
[0085] The first generating module 202 is used to generate a predicted click rate corresponding to the candidate recommendation reason by using a preset click rate prediction model according to the text features of the candidate recommendation reason of the video and the user features of the user to be recommended;
[0086] The first determination module 203 is used to determine the candidate recommendation reason whose corresponding predicted click rate meets the preset condition as the target recommendation reason for the video.
[0087] Optionally, the first acquisition module 201 is specifically configured to:
[0088] Filtering candidate texts from the comment text according to the text length and the number of words contained in the comment text;
[0089] Selecting a target text whose text quality meets a preset quality requirement from the candidate texts;
[0090] The candidate recommendation reasons are generated according to the target text.
[0091] Optionally, the first acquisition module 201 is further specifically configured to:
[0092] Detecting whether the candidate text meets at least one of a preset emotion requirement, a preset fluency requirement, a preset sensitive word requirement, and a preset expression form requirement;
[0093] If so, determining the alternative text as the target text;
[0094] Among them, the preset emotional requirement is that the emotional tendency corresponding to the alternative text is not negative; the preset fluency requirement is that the fluency of the alternative text is greater than the preset fluency threshold; the preset sensitive word requirement is that the preset sensitive words do not appear in the alternative text; the preset expression form requirement is that the expression form of the alternative text does not conform to the preset expression form of the illegal comment text.
[0095] Optionally, the comment text includes barrage text, text posted by the user in the comment area corresponding to the video and / or text added by the user when forwarding the video.
[0096] The first acquisition module 201 is further specifically configured to:
[0097] The target text is used as the candidate recommendation reason, or the target text is used as the input of a preset text generation model, and the output of the preset text generation model is obtained as the candidate recommendation reason; the preset text generation model is used to generate text with content similar to the target text.
[0098] Optionally, the device 20 further includes:
[0099] A receiving module, used for receiving at least one video identifier passed in by a caller;
[0100] A second determination module, configured to determine the video corresponding to the video identifier as the video;
[0101] The return module is used to return the target recommendation reason to the caller after determining the candidate recommendation reason whose corresponding predicted click rate meets the preset condition as the target recommendation reason of the video.
[0102] Optionally, the preset click rate prediction model is obtained by the steps performed by the following modules:
[0103] A construction module, used to construct a training sample pair according to a target click rate of a sample user for a sample video, user characteristics of the sample user, and text characteristics of a sample recommendation reason; wherein the target click rate is used to represent the click rate of the sample video when the sample video is recommended with the sample recommendation reason;
[0104] The training module is used to train the initial click rate prediction model according to the training sample pairs to obtain the preset click rate prediction model.
[0105] Optionally, the target click rate is obtained by the steps performed by the following modules:
[0106] The second acquisition module is used to obtain the number of likes and dislikes of the sample bullet text of the sample video by the sample user within a preset time period;
[0107] The second generating module is used to generate the target click-through rate according to the up and down amount; the target click-through rate is positively correlated with the up amount in the up and down amount, and negatively correlated with the down amount in the up and down amount.
[0108] Optionally, the user characteristics include at least one of personal information characteristics, video preference characteristics, and actor preference characteristics.
[0109] Optionally, the training module is specifically used for:
[0110] Inputting the user features and the text features as sample features into the initial click rate prediction model, and processing the sample features according to the initial click rate prediction model to generate a predicted click rate;
[0111] Based on the predicted click-through rate and the target click-through rate, calculating a loss value of the initial click-through rate prediction model;
[0112] If the loss value is not within the preset range, the initial click-through rate prediction model is adjusted based on the loss value, and the adjusted initial click-through rate prediction model continues to be trained until the loss value is within the preset range, and the initial click-through rate prediction model is used as the preset click-through rate prediction model.
[0113] In summary, the text processing device provided in the embodiment of the present invention obtains the candidate recommendation reasons of the video according to the comment text generated by the user for the video, and uses the preset click-through rate prediction model to determine the predicted click-through rate corresponding to the candidate recommendation reasons according to the text features of the candidate recommendation reasons of the video and the user features of the user to be recommended. The candidate recommendation reasons whose corresponding predicted click-through rates meet the preset conditions are determined as the target recommendation reasons of the video. Since the comment text can reflect the user's true emotions towards the video in a diverse manner, in the embodiment of the present invention, selecting the target recommendation reason from the candidate recommendation reasons obtained according to the comment text generated by the user for the video can make the content of the selected target candidate recommendation reasons more diverse to a certain extent, and thus can improve the click-through rate when recommending the video using the target recommendation reason to a certain extent, thereby improving the recommendation effect.
[0114] As for the above-mentioned device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0115] The embodiment of the present invention further provides an electronic device, such as Figure 3 As shown, it includes a processor 301, a communication interface 302, a memory 303 and a communication bus 304, wherein the processor 301, the communication interface 302, and the memory 303 communicate with each other through the communication bus 304.
[0116] Memory 303, used for storing computer programs;
[0117] The processor 301 is used to execute the program stored in the memory 303 to implement the following steps:
[0118] Obtaining the reasons for recommending the video according to the comment text generated by the user for the video;
[0119] Using a preset click rate prediction model, based on the text features of the candidate recommendation reason of the video and the user features of the user to be recommended, a predicted click rate corresponding to the candidate recommendation reason is generated;
[0120] The candidate recommendation reason whose corresponding predicted click rate meets the preset condition is determined as the target recommendation reason for the video.
[0121] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0122] The communication interface is used for communication between the above terminal and other devices.
[0123] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0124] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be 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.
[0125] In another embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium stores instructions. When the instructions are executed on a computer, the computer executes the text processing method described in any one of the above embodiments.
[0126] In another embodiment of the present invention, a computer program product including instructions is provided. When the computer program product is run on a computer, the computer executes the text processing method described in any one of the above embodiments.
[0127] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.
[0128] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0129] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0130] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A text processing method, characterized in that: The method comprises: According to the comment text generated by the user for the video, the candidate recommendation reason of the video is obtained; the video is a video recommended to the user selected by the platform in the recommendation scenario, or a video recommended to the user recalled according to the search keyword input by the user in the video search scenario; Using a preset click rate prediction model, based on the text features of the candidate recommendation reason of the video and the user features of the user to be recommended, a predicted click rate corresponding to the candidate recommendation reason is generated; Determine the candidate recommendation reason whose corresponding predicted click rate meets the preset condition as the target recommendation reason for the video; The predicted click-through rate corresponding to the candidate recommendation reason is used to represent the click-through rate of the video when the video is recommended with the candidate recommendation reason; the target recommendation reason is used to recommend the video with the target recommendation reason to attract users to watch the video; The preset click rate prediction model is obtained through the following steps: Constructing training sample pairs according to the target click-through rate of sample users for sample videos, user characteristics of the sample users, and text characteristics of sample recommendation reasons; wherein the target click-through rate is used to characterize the click-through rate of the sample video when the sample video is recommended with the sample recommendation reason; The initial click rate prediction model is trained according to the training sample pairs to obtain the preset click rate prediction model.
2. The method according to claim 1, characterized in that: The step of obtaining the candidate recommendation reason for the video according to the comment text generated by the user for the video includes: Filtering candidate texts from the comment text according to the text length and the number of words contained in the comment text; Selecting a target text whose text quality meets a preset quality requirement from the candidate texts; The candidate recommendation reasons are generated according to the target text.
3. The method according to claim 2, characterized in that The step of selecting a target text whose text quality meets a preset quality requirement from the candidate texts includes: Detecting whether the candidate text meets at least one of a preset emotion requirement, a preset fluency requirement, a preset sensitive word requirement, and a preset expression form requirement; If so, determining the alternative text as the target text; Among them, the preset emotional requirement is that the emotional tendency corresponding to the alternative text is not negative; the preset fluency requirement is that the fluency of the alternative text is greater than the preset fluency threshold; the preset sensitive word requirement is that the preset sensitive words do not appear in the alternative text; the preset expression form requirement is that the expression form of the alternative text does not conform to the preset expression form of the illegal comment text.
4. The method according to claim 2, characterized in that: The step of generating the candidate recommendation reason according to the target text includes: The target text is used as the candidate recommendation reason, or the target text is used as the input of a preset text generation model, and the output of the preset text generation model is obtained as the candidate recommendation reason; the preset text generation model is used to generate text with content similar to the target text.
5. The method according to claim 1, characterized in that: The comment text includes barrage text, text posted by the user in the comment area corresponding to the video and / or text added by the user when forwarding the video.
6. The method according to claim 1, characterized in that Before obtaining the candidate recommendation reason for the video according to the comment text generated by the user for the video, the method further includes: receiving at least one video identifier passed in by the caller; determining the video corresponding to the video identifier as the video; After determining the candidate recommendation reason whose corresponding predicted click rate meets the preset condition as the target recommendation reason for the video, the method further includes: returning the target recommendation reason to the caller.
7. The method according to claim 1, characterized in that The target click rate is obtained by the following steps: Obtaining the number of likes and dislikes of the sample bullet text of the sample video by the sample user within a preset time period; The target click-through rate is generated according to the thumbs-down amount; the target click-through rate is positively correlated with the thumbs-up amount in the thumbs-down amount, and negatively correlated with the thumbs-down amount in the thumbs-down amount.
8. The method according to claim 1, characterized in that The user characteristics include at least one of personal information characteristics, video preference characteristics, and actor preference characteristics.
9. The method according to claim 1, characterized in that: The step of training the initial click rate prediction model according to the training sample pairs to obtain the preset click rate prediction model includes: Inputting the user features and the text features as sample features into the initial click rate prediction model, and processing the sample features according to the initial click rate prediction model to generate a predicted click rate; Based on the predicted click-through rate and the target click-through rate, calculating a loss value of the initial click-through rate prediction model; If the loss value is not within the preset range, the initial click-through rate prediction model is adjusted based on the loss value, and the adjusted initial click-through rate prediction model continues to be trained until the loss value is within the preset range, and the initial click-through rate prediction model is used as the preset click-through rate prediction model.
10. A text processing device, characterized in that: The device comprises: The first acquisition module is used to acquire the candidate recommendation reason of the video according to the comment text generated by the user for the video; the video is a video recommended to the user selected by the platform in the recommendation scenario, or a video recommended to the user recalled according to the search keyword input by the user in the video search scenario; A first generating module is used to generate a predicted click rate corresponding to the candidate recommendation reason by using a preset click rate prediction model according to the text features of the candidate recommendation reason of the video and the user features of the user to be recommended; The first determination module is used to determine the candidate recommendation reason whose corresponding predicted click rate meets the preset condition as the target recommendation reason of the video; the predicted click rate corresponding to the candidate recommendation reason is used to represent the click rate of the video when the video is recommended with the candidate recommendation reason; the target recommendation reason is used to recommend the video using the target recommendation reason to attract users to watch the video; The preset click rate prediction model is obtained by the steps performed by the following modules: Constructing training sample pairs according to the target click-through rate of sample users for sample videos, user characteristics of the sample users, and text characteristics of sample recommendation reasons; wherein the target click-through rate is used to characterize the click-through rate of the sample video when the sample video is recommended with the sample recommendation reason; The initial click rate prediction model is trained according to the training sample pairs to obtain the preset click rate prediction model.
11. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing any of the methods described in claims 1-9 when executing a program stored in a memory.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Video recommendation reason generating system and method
CN104216883A
Recommending system and method with static and dynamic recommending reasons automatically combined
CN104216885A
Recommendation reason generation method and device
CN107609960A
Video recommendation method and device, server and storage medium
CN109996122A
Intelligent recommendation method and device based on internet television platform
CN110337012A
