CN112733043B - Comment recommendation method and device - Google Patents

Comment recommendation method and device Download PDF

Info

Publication number
CN112733043B
CN112733043B CN202110337269.9A CN202110337269A CN112733043B CN 112733043 B CN112733043 B CN 112733043B CN 202110337269 A CN202110337269 A CN 202110337269A CN 112733043 B CN112733043 B CN 112733043B
Authority
CN
China
Prior art keywords
comment
text
recommendation
target
exposure
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110337269.9A
Other languages
Chinese (zh)
Other versions
CN112733043A (en
Inventor
王皓
周宇超
黄义棚
刘智静
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202110337269.9A priority Critical patent/CN112733043B/en
Publication of CN112733043A publication Critical patent/CN112733043A/en
Application granted granted Critical
Publication of CN112733043B publication Critical patent/CN112733043B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9535Search customisation based on user profiles and personalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/194Calculation of difference between files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • General Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Computing Systems (AREA)
  • Molecular Biology (AREA)
  • Evolutionary Computation (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Biophysics (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application relates to a comment recommendation method and device, wherein the method comprises the following steps: acquiring a to-be-sent comment text submitted by a user aiming at a comment object; calling a target comment prediction model to predict the to-be-sent comment text to obtain a corresponding first comment recommendation score, wherein the target comment prediction model comprises a corresponding relation between the comment text and a preset comment recommendation score; when a comment pulling request of a user is received, acquiring a current comment list of the comment object; and adding the to-be-published comment text to the current comment list based on the first comment recommendation score to obtain a target comment list responding to the comment pulling request. According to the method and the device, the natural language processing technology is combined, accurate recommendation of the newly published high-quality comments can be achieved on the premise that the comment quality of the comment area is relatively high, and certain exposure and interaction of the newly published high-quality comments can be guaranteed, so that the willingness of a user to participate in comments is improved.

Description

Comment recommendation method and device
Technical Field
The application relates to the technical field of internet, in particular to a comment recommendation method and device.
Background
With the rapid development of internet technology, besides traditional broadcasting and television, the internet becomes a more important information-obtaining propagation channel, people are used to obtain information from the internet and often used to make relevant comments, share hearts or experiences on the internet, meanwhile, user comments themselves also become important information, and people can obtain more information close to needs from comments made by other users.
The comment ordering of the existing media scene is usually obtained by ordering the interactive popularity (such as user's active approval and reply) of the existing comments, but in practice, it is found that the above manner can cause that the newly published comments in the later period are difficult to obtain exposure opportunities, so that the high-quality comments are possibly buried in the comment area, and further the willingness of the user to participate in the comments is reduced.
Disclosure of Invention
The technical problem to be solved by the present application is to provide a comment recommendation method, device, equipment and storage medium, which can solve the above problems in the related art.
In order to solve the technical problem, in one aspect, the present application provides a comment recommendation method, including: acquiring a to-be-sent comment text submitted by a user aiming at a comment object; calling a target comment prediction model to predict the to-be-sent comment text to obtain a corresponding first comment recommendation score, wherein the target comment prediction model comprises a corresponding relation between the comment text and a preset comment recommendation score; when a comment pulling request of a user is received, acquiring a current comment list of the comment object; and adding the to-be-published comment text to the current comment list based on the first comment recommendation score to obtain a target comment list responding to the comment pulling request.
In another aspect, the present application provides a comment recommending apparatus, including: the to-be-sent comment text acquisition module is used for acquiring a to-be-sent comment text submitted by a user aiming at the comment object; the comment recommendation score prediction module is used for calling a target comment prediction model to predict the to-be-sent comment text to obtain a corresponding first comment recommendation score, wherein the target comment prediction model comprises a corresponding relation between the comment text and a preset comment recommendation score; the current comment list acquisition module is used for acquiring a current comment list of the comment object when a comment pull request of a user is received; and the target comment list generation module is used for adding the to-be-published comment text into the current comment list based on the first comment recommendation score to obtain a target comment list responding to the comment pulling request.
In another aspect, the present application provides an electronic device comprising a processor and a memory, wherein at least one instruction, at least one program, set of codes, or set of instructions is stored in the memory, and wherein the at least one instruction, the at least one program, the set of codes, or the set of instructions is loaded by the processor and performs the method as described above.
In another aspect, the present application provides a computer storage medium having stored therein at least one instruction, at least one program, set of codes, or set of instructions that is loaded by a processor and performs a method as described above.
In another aspect, the present application provides a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the method provided in the various alternative embodiments described above.
In the embodiment of the application, a to-be-sent comment text submitted by a user for a comment object is acquired, a target comment prediction model is called to predict the to-be-sent comment text, a corresponding first comment recommendation score is acquired, when a comment pulling request of the user is received, a current comment list of the comment object is acquired, the to-be-sent comment text is added to the current comment list based on the first comment recommendation score, and a target comment list responding to the comment pulling request is acquired. Therefore, the position of the text of the comment to be published in the target comment list can be determined according to the level of the recommendation score of the first comment, so that high-quality comments accumulated in early exposure can be avoided from being eliminated, newly published high-quality comments can obtain certain exposure and interaction and cannot be buried in the comment area, namely, the newly published high-quality comments can obtain certain exposure and interaction on the premise that the comment quality of the comment area is relatively high, and the intention of users for participating in comments is improved.
Drawings
In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a diagram of a hardware environment provided by an embodiment of the present application;
FIG. 2 is a flow chart of a comment recommendation method provided by an embodiment of the present application;
fig. 3 is a flowchart of a method for adding a to-be-sent comment text to a current comment list based on a first comment recommendation score in a comment recommendation method provided in an embodiment of the present application;
fig. 4 is an application scenario diagram provided in an embodiment of the present application;
fig. 5 is a flowchart of a method for selecting a target comment text from a comment recommendation pool based on a comment recommendation score of each comment text in the comment recommendation pool in the comment recommendation method provided in the embodiment of the present application;
fig. 6 is a flowchart of another method for adding a pending comment text to a current comment list based on a first comment recommendation score in a comment recommendation method provided in an embodiment of the present application;
fig. 7 is a flowchart of a method for removing comment texts in a comment recommendation pool in a comment recommendation method provided in an embodiment of the present application;
fig. 8 is a flowchart of another method for selecting a target comment text from a comment recommendation pool based on a comment recommendation score of each comment text in the comment recommendation pool in the comment recommendation method provided in the embodiment of the present application;
FIG. 9 is a schematic diagram of a method for updating a target comment prediction model in a comment recommendation method provided in an embodiment of the present application;
FIG. 10 is a schematic structural diagram of a target comment prediction model provided by an embodiment of the present application;
FIG. 11 is a flowchart of a particular embodiment of a comment recommendation method provided by an embodiment of the present application;
fig. 12 is a schematic structural diagram of a comment recommending apparatus provided in an embodiment of the present application;
fig. 13 is a schematic structural diagram of a comment recommending apparatus provided in an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, the present application will be further described in detail with reference to the accompanying drawings. It is to be understood that the described embodiments are merely a few embodiments of the present application and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or server that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Artificial Intelligence (AI) is a theory, method, technique and application system that uses a digital computer or a machine controlled by a digital computer to simulate, extend and expand human Intelligence, perceive the environment, acquire knowledge and use the knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technique of computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a manner similar to human intelligence. Artificial intelligence is the research of the design principle and the realization method of various intelligent machines, so that the machines have the functions of perception, reasoning and decision making.
The artificial intelligence technology is a comprehensive subject and relates to the field of extensive technology, namely the technology of a hardware level and the technology of a software level. The artificial intelligence infrastructure generally includes technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.
Natural Language Processing (NLP) is an important direction in the fields of computer science and artificial intelligence. It studies various theories and methods that enable efficient communication between humans and computers using natural language. Natural language processing is a science integrating linguistics, computer science and mathematics. Therefore, the research in this field will involve natural language, i.e. the language that people use everyday, so it is closely related to the research of linguistics. Natural language processing techniques typically include text processing, semantic understanding, machine translation, robotic question and answer, knowledge mapping, and the like.
Optionally, in the embodiment of the present application, the comment recommendation method may be applied to a hardware environment formed by the server 101 and the user terminal 102 shown in fig. 1. The server 101 may obtain the to-be-sent comment text submitted on the user terminal 102, may execute the comment recommendation method provided in the embodiment of the present application, and sends the target comment list to the user terminal 102 after generating the target comment list.
The server 101 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a network service, cloud communication, a middleware service, a domain name service, a security service, a CDN, a big data and artificial intelligence platform, and the like. The terminal may be, but is not limited to, a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and the like. The terminal and the server may be directly or indirectly connected through wired or wireless communication, and the application is not limited herein.
As shown in fig. 1, a server 101 and a user terminal 102 are connected to each other through a network, which includes but is not limited to: a wide area network, a metropolitan area network, or a local area network.
As a possible implementation manner, both the server 101 and the user terminal 102 may be node devices in a blockchain system, and can share the acquired and generated information to other node devices in the blockchain system, so as to implement information sharing among multiple node devices. The multiple node devices in the block chain system can be configured with the same block chain, the block chain is composed of multiple blocks, and the adjacent blocks have an association relationship, so that data in any block can be detected by the next block when being tampered, the data in the block chain can be prevented from being tampered, and the safety and reliability of the data in the block chain are ensured.
The comment ordering of the existing media scene is usually obtained by ordering the interactive popularity (such as user's active approval and reply) of the existing comments, but in practice, it is found that the comments which are published first can obtain longer exposure time and thus higher interaction amount, so that the comments which are published first gather at the head of the comment area, and the comments which are newly published later are difficult to obtain exposure opportunities, so that the high-quality comments are possibly buried in the comment area, and further the willingness of the user to participate in the comments is reduced.
In order to solve the above problem, if the comments in the comment area are attenuated in time, that is, the longer a comment is from being published in a certain attenuation period, the lower the recommendation weight of the comment is, so that part of new comments can be exposed.
But the time decay factor is difficult to control. If the amplitude of the allowable time attenuation is larger, the high-quality comments accumulated by the previous exposure are eliminated, and the overall quality of the head comment area is reduced; if the amplitude of the allowable attenuation is small, it is difficult to expose a new comment, and the problem of the fixation of the head comment area still remains.
Based on this, the scheme provided by the embodiment of the present application relates to an artificial intelligence natural language processing technology, and a comment recommendation method provided by the embodiment of the present application is described below, as shown in fig. 2, the method includes:
step S201: acquiring a to-be-sent comment text submitted by a user aiming at a comment object;
in the embodiment of the application, the comment object mainly refers to content that a user has published on a network platform, such as a published video or an article. The to-be-sent comment text is information generated when the user carries out comment operation on the comment object.
The text to be tabulated and commented can be an English text or a Chinese text, and the embodiment of the application is not particularly limited in this respect.
Step S203: calling a target comment prediction model to predict the to-be-sent comment text to obtain a corresponding first comment recommendation score, wherein the target comment prediction model comprises a corresponding relation between the comment text and a preset comment recommendation score;
in the embodiment of the application, an initial comment prediction model can be established in advance, the initial comment prediction model comprises a semantic coding network layer, and a training text set (comprising a plurality of training comment texts) and corresponding comment recommendation labels thereof can be used for training the initial comment prediction model, so that the target comment recommendation model comprising the corresponding relation between the comment texts and the preset comment recommendation labels is obtained.
The first comment recommendation score can be used for representing the user interaction degree of the to-be-issued form comment text after being issued, namely representing the comment quality of the to-be-issued form comment text. It can be understood that the higher the first comment recommendation score is, the higher the interaction degree between the user and the comment text is after the to-be-published comment text is published, for example, the to-be-published comment text can receive more praise and/or reply from the user, and the higher the comment quality of the to-be-published comment text is also described; the lower the first comment recommendation score is, the lower the interaction degree between the user and the comment text is after the to-be-published comment text is published, and if the to-be-published comment text can receive fewer praise and/or reply from the user, the lower the comment quality of the to-be-published comment text is.
The comment recommendation score label may be specifically determined in the following manner: acquiring interaction data (including praise, reply, forwarding and the like aiming at the training comment texts) and total exposure times of each piece of training comment texts, and determining comment recommendation marks of the training comment texts based on the ratio of the interaction data to the total exposure times (namely, interaction in a single exposure).
For example, the total exposure number of a certain training comment text is 10000, the number of praise is 100, the number of reply times is 100, the interaction data is 200, and the comment recommendation score label corresponding to the training comment text may be set to 0.02.
It should be noted that, after a comment text is pulled once by any user, the comment text is exposed once, and the total exposure number of a certain comment text is the total number of times that the comment text is pulled and exposed by all users on the network. For example, if the comment text 1 is pulled once by the user a, once by the user B, and once by the user C, the total number of exposures of the comment text 1 is 3.
Moreover, after the user pulls the comment text, the user does not necessarily interact with the comment text, for example, only the user a approves the comment text 1, and the user B and the user C neither approve nor comment the comment text 1, the interaction data is 1; for another example, if the user a has both liked and commented on the comment text 1, and the user B and the user C have neither liked nor commented on the comment text 1, the interaction data is 2.
In practical application, because the base number of users is huge, the total exposure times are also larger, under a normal condition, the ratio of the interactive data to the total exposure times can be several thousandth, even if the quality of the comment text is better, therefore, under a normal condition, for each training comment text, the ratio of the interactive data to the total exposure times is between 0 and 1, and if the ratio of the interactive data to the total exposure times is directly adopted as a comment recommendation sub-label, the comment recommendation sub-label is also between 0 and 1.
Certainly, for some special situations, for example, when a large number of users pull a popular comment text, the users approve the popular comment text and comment the popular comment text, so that the ratio of the interactive data to the exposure times of the popular comment text is greater than 1, at this time, the normalization processing can be performed on the ratio of the interactive data to the exposure times of each training comment text, and the value after the normalization processing is used as a comment recommendation sub-label, so that the convergence speed of the initial comment prediction model can be increased.
Step S205: when a comment pulling request of a user is received, acquiring a current comment list of the comment object;
in the embodiment of the present application, one or more published comment texts may be included in the current comment list.
Step S207: and adding the to-be-published comment text to the current comment list based on the first comment recommendation score to obtain a target comment list responding to the comment pulling request.
In the embodiment of the present application, the target comment list includes both the pending comment text and each published comment text in the current comment list.
The arrangement position of the to-be-sent comment text in the target comment list is determined by the level of the first comment recommendation score, namely when the first comment recommendation score is high, the position in the target comment list which is relatively front is obtained, and when the first comment recommendation score is low, the position in the target comment list which is relatively rear is obtained.
In the embodiment of the application, a to-be-sent comment text submitted by a user for a comment object is acquired, a target comment prediction model is called to predict the to-be-sent comment text, a corresponding first comment recommendation score is acquired, when a comment pulling request of the user is received, a current comment list of the comment object is acquired, the to-be-sent comment text is added to the current comment list based on the first comment recommendation score, and a target comment list responding to the comment pulling request is acquired. Therefore, the position of the text of the comment to be published in the target comment list can be determined according to the level of the recommendation score of the first comment, so that high-quality comments accumulated in early exposure can be avoided from being eliminated, newly published high-quality comments can obtain certain exposure and interaction and cannot be buried in the comment area, namely, on the premise that the comment quality of the comment area is relatively high, the newly published high-quality comments can obtain certain exposure and interaction, help businesses to discover more high-quality comments, and enable users to effectively communicate through the comment area, the feedback of other users is received, the willingness of the users to participate in comments is further stimulated, and the stickiness of the users to products is increased.
In some embodiments, as shown in fig. 3, the adding the to-be-published comment text to the current comment list based on the first comment recommendation score, and obtaining the target comment list in response to the comment pull request may include:
step S301: when the first comment recommendation score is larger than or equal to a preset recommendation score, adding the to-be-issued comment text into a comment recommendation pool;
step S303: selecting a target comment text from the comment recommendation pool based on the comment recommendation score of each comment text in the comment recommendation pool;
step S305: and inserting the target comment text into a preset recommendation position in the current comment list to obtain a target comment list responding to the comment pulling request.
In the embodiment of the application, the preset recommendation score can be set based on the requirements of users, when the first comment recommendation score is greater than or equal to the preset recommendation score, the to-be-published comment text corresponding to the first comment recommendation score is a comment text with relatively good quality, that is, the comment text with more user interactions can be obtained after publication, so that the part of comment text with relatively good quality is added into a comment recommendation pool, and the process is also equivalent to preliminary screening of the to-be-published comment text.
The target comment text may be one or more comment texts in the comment recommendation pool. The preset recommendation position may be a position closer to the specified position in the target comment list, as shown in fig. 4, a position 3 rd comment in the target comment list may be set as the preset recommendation position, and thus, the target comment text may be set at the position closer to the specified position in the target comment list, so that the exposure chance of the target comment text is increased.
In practical application, every time a user issues a comment, the online system pushes the comment to the model, the recommendation score is calculated by using the model, only comments with higher scores are stored for the same comment object such as the same article, and the comments with low scores do not enter a new comment recommendation pool. In this way, one or more target comment texts can be selected from the new comment recommendation pool, and the target comment texts are inserted into the preset recommendation position. In the actual online operation process, the preset recommendation position and the number of the target comment texts can be dynamically adjusted.
In a specific embodiment, the current comment list may further include a hot comment area, the hot comment area is located at the top of the current comment list, the preset recommendation position is located at a position behind the hot comment area and adjacent to the hot comment area, and after one or more target comment texts are obtained, the target comment texts are inserted into the preset recommendation position, so that the target comment list is obtained.
For example, the hot comment area contains two hot comments, and after a certain target comment text a is inserted into the preset recommendation position, the target comment text a will be located at the 3 rd position in the target comment list.
In the embodiment of the application, a preset recommendation position is preset, and the to-be-sent comment text with the comment recommendation score larger than or equal to the preset recommendation score is inserted into the preset recommendation position, so that a certain exposure and interaction can be obtained for newly-issued high-quality comments on the premise that the comment quality of a comment area is relatively high, and the willingness of a user to participate in comments is improved.
In some embodiments, in step S203, the comment texts may be sorted based on the comment recommendation scores of the comment texts in the comment recommendation pool, and one or more of the comment texts sorted at the top may be determined as the target comment text. However, this selection method easily causes that most of the comment texts in the comment recommendation pool are difficult to be selected as the target comment texts, and the part of the comment texts may actually be the comment texts with better quality. Based on this, as shown in fig. 5, the selecting a target comment text from the comment recommendation pool based on the comment recommendation score of each comment text in the comment recommendation pool (i.e., step S203) may include:
step S501: calculating the exposure probability of each comment text in the comment recommendation pool based on the comment recommendation score of each comment text in the comment recommendation pool;
step S503: and selecting a target comment text from the comment recommendation pool according to the exposure probability of each comment text in the comment recommendation pool.
Specifically, the exposure probability p of the ith comment text in the comment recommendation pooliThe calculation formula of (c) can be as follows:
Figure 961777DEST_PATH_IMAGE001
wherein s isiRecommending scores, s for the comments of the ith comment text in the comment recommendation pooljRecommending comments of jth comment text in the comment poolAnd recommending the scores, wherein n is the total number of the comment texts in the comment recommending pool.
In practical application, a target comment text is selected from the comment recommendation pool based on the exposure probability of each comment text in the comment recommendation pool, so that the comment texts in the comment recommendation pool can obtain a certain exposure chance based on the comment recommendation scores. Thus, when the comment recommendation of some comment texts is low (such as ranked in the third last place) but the actual quality is good, a large amount of user interaction can be obtained in one or a few exposures by virtue of the good quality of the comment texts, and accordingly the comment texts can occupy the position which is relatively front in the comment list. Namely, by the embodiment of the application, the comment texts with low comment recommendation scores but good actual quality can be prevented from being buried, and the reliability of comment recommendation is improved.
In some embodiments, as shown in fig. 6, the adding the to-be-published comment text to the current comment list based on the first comment recommendation score to obtain a target comment list in response to the comment pull request may further include:
step S601: acquiring user interaction information and a second comment recommendation score of each published comment text in the current comment list;
step S603: determining the recommendation degree of each published comment text in the current comment list based on the user interaction information and the second comment recommendation score;
step S605: determining the recommendation degree of the to-be-published comment text based on the first comment recommendation score;
step S607: and sequencing the to-be-published comment text and each published comment text based on the recommendation degree to obtain a target comment list responding to the comment pulling request.
In the embodiment of the application, the user interaction information of the published comment text refers to interaction data such as praise and comment data for the published comment text, and the second comment recommendation score refers to a recommendation score obtained by predicting the published comment text through the target comment prediction model before publication.
Specifically, the user interaction information, the second comment recommendation score and the first comment recommendation score may be normalized by using an existing normalization method to obtain corresponding normalized values, the normalized values of the published comment texts are weighted and summed according to a preset weighting value to obtain recommendation values corresponding to the published comment texts, and the normalized values of the to-be-published comment texts are weighted and summed according to a preset weighting value to obtain recommendation values corresponding to the to-be-published comment texts.
The user interaction information and the comment recommendation score can be set with different preset weighted values according to requirements, for example, a first preset weighted value of the user interaction information can be set to 0.4, and a second preset weighted value of the comment recommendation score can be set to 0.6.
The process of normalization may be that the features of a single comment text may be divided into two features: the method comprises the steps that firstly, the user interaction information and the comment recommendation score are subjected to logarithmic processing respectively, then, the user interaction information and the comment recommendation score are subjected to normalization processing by using a minimum maximum value method, and corresponding normalization values are obtained.
For example, the 2 nd characteristic value (i.e. comment recommendation score) of all comment texts (including each published comment text and pending comment text) is subjected to logarithmic processing, and a corresponding logarithmic value is obtained; then, the log value of the 2 nd characteristic value of a single comment text such as the to-be-sent-form comment text is subjected to maximum and minimum value processing, and a normalized value corresponding to the 2 nd characteristic value (namely, the first comment recommendation score) of the to-be-sent-form comment text can be obtained. It is understood that after the normalization process, the unification of the dimensions of the plurality of feature values can be achieved.
Of course, in the embodiment of the present application, multiple feature values of the comment text may also be normalized by other existing normalization methods, which is not described herein again.
In the embodiment of the application, all comment texts can be sorted according to the sequence of the recommendation degrees from high to low, and the calculation of the recommendation degrees combines the user interaction information and the comment recommendation into two characteristic dimensions, so that high-quality comments accumulated in the earlier stage can be prevented from sinking into the bottom, and the newly published comment texts can have enough exposure opportunities.
In some embodiments, as shown in fig. 7, the method may further include:
step S701: recording each exposure of each comment text in the comment recommendation pool;
step S703: and removing the comment text with the exposure times meeting the preset exposure conditions from the comment recommendation pool.
In this embodiment of the application, the preset exposure condition may be set to be that the exposure number within a preset time period needs to be greater than or equal to a preset exposure number, for example, the exposure number within approximately 24 hours needs to be greater than or equal to a certain exposure number, so that when the exposure number within the preset time period of any comment text is greater than or equal to the preset exposure number, it may be determined that the exposure of any comment text satisfies the preset exposure condition, and the corresponding comment text is removed from the comment recommendation pool.
In step S703, specifically, when the exposure of any comment text in the comment recommendation pool meets a preset exposure condition, the corresponding comment text may be immediately removed from the comment recommendation pool.
Of course, when the exposure of any comment text in the comment recommendation pool meets a preset exposure condition, the corresponding comment text may not be immediately removed from the comment recommendation pool, but when some other specific conditions are met at the same time, the corresponding comment text is removed from the comment recommendation pool.
For example, when the exposure of any comment text in the comment recommendation pool meets a preset exposure condition and a comment pull request of a user is received, the corresponding comment text can be removed from the comment recommendation pool.
For another example, when the exposure of any comment text in the comment recommendation pool meets a preset exposure condition and a new comment text is available for the comment recommendation pool, the corresponding comment recommendation text may be removed from the comment recommendation pool.
For another example, when the number of the comment texts satisfying the preset exposure condition in the comment recommendation pool reaches a predetermined storage number, the corresponding comment recommendation text may be removed from the comment recommendation pool. The preset storage quantity can be set according to actual requirements, for example, the preset storage quantity is set to be 10, when the number of the comment texts meeting the preset exposure condition in the comment recommendation pool reaches 10, the corresponding comment recommendation texts are removed from the comment recommendation pool, and therefore the comment recommendation texts meeting the preset exposure condition can be removed in batches.
In practical application, when the exposure of any comment text meets a preset exposure condition, it indicates that more exposure opportunities have been given to the comment text, and if the comment text is indeed a text with better quality, more interactive operations of the user should be obtained after multiple exposures, for example, more praise and comments of the user are obtained, and accordingly, the comment text can occupy a position in the comment list that is earlier, so that the user can still find the comment text in the comment list more easily even after the comment text is removed from the comment recommendation pool; on the contrary, if the comment text is actually text with poor quality, no matter how many additional exposure opportunities are added, the interactive operation of the user is not effectively increased, and even the exposure opportunities of the rest comment text are occupied. According to the method and the device, the comment texts with the exposure meeting the preset exposure conditions are removed from the comment recommendation pool, so that the exposure opportunities of each time can be reasonably utilized on the basis of ensuring that the newly issued high-quality comments can obtain certain exposure and interaction, and the comment recommendation effectiveness is improved.
Under some special conditions, for example, under the condition that comment texts with exposure times meeting preset exposure conditions are removed from a recommendation pool, more and more low-score comment texts are deposited in the comment recommendation pool, when the number of the low-score comment texts is gradually increased, the overall exposure probability of the low-score texts in the comment recommendation pool is gradually greater than that of the high-score texts in the recommendation pool, and therefore when a user pulls, the probability of randomly returning the comment texts with lower scores in the comment recommendation pool is greater, and the user is not benefited to obtain high-quality comments.
For example, before the text with high exposure frequency is removed, the comment recommendation pool comprises 5 comment texts with comment recommendations of 90 points, 89 points, 88 points, 83 points and 80 points, because the comment text with comment recommendation of 90 points has higher exposure probability and has higher exposure frequency, so that the comment text with comment recommendation of 90 points is easier to remove from the comment recommendation pool, the comment text with comment recommendation of 90 points is assumed to be removed from the comment recommendation pool, and at the same time, two new comment texts are newly added into the comment recommendation pool, and considering the randomness of the comment classification of the comment text, the comment text with recommendation of one comment text of the two new comment texts is assumed to be higher 90 points and recommendation of one comment text is lower 81 points, so that the comment recommendation pool will comprise 6 comment texts with comment recommendations of 90 points, 89 points, 88 points, 83 points, 81 points and 80 points, obviously, the proportion of the low-score texts in the comment recommendation pool (3 low scores in 6, namely, the proportion of 50%) is improved compared with the previous operation (2 low scores in 5, namely, the proportion of 40%), and if the operations of removing the high-exposure comment texts and the new comment texts are continued, the proportion of the low-score texts in the comment recommendation pool is also continuously increased, so that the overall exposure probability of the low-score texts in the comment recommendation pool is gradually greater than that of the high-score texts in the pool, when the user pulls, the comment texts with the low scores in the comment recommendation pool are always randomly returned, and the user is not favorable for obtaining the high-quality comments.
Based on this, in some embodiments, as shown in fig. 8, the selecting a target comment text from the comment recommendation pool based on the comment recommendation score of each comment text in the comment recommendation pool (i.e., step S203) may further include:
step S801: based on the comment recommendation score of each comment text in the comment recommendation pool, sequencing each comment text in the comment recommendation pool from high to low according to the comment recommendation score;
step S803: determining the comment texts with the preset number as pre-selected comment texts;
step S805: calculating the exposure probability of each pre-selected comment text based on the comment recommendation score of the pre-selected comment text;
step S807: and selecting target comment texts from the pre-selected comment texts according to the exposure probability of each piece of pre-selected comment text.
Specifically, the exposure probability p of the ith pre-selected comment textiThe calculation formula of (c) can be as follows:
Figure 672113DEST_PATH_IMAGE002
wherein s isiRecommending scores, s for comments of ith pre-selected comment textjAnd the comment recommendation score of the jth pre-selected comment text is obtained, and n is the total number of the pre-selected comment texts determined from the comment recommendation pool.
In practical application, by determining the comment texts with the previous preset names (for example, the previous 50 names) in the comment recommendation pool as the pre-selected comment texts, and selecting a target comment text from the pre-selected comment texts based on the exposure probability of each pre-selected comment text, on one hand, the comment texts ranked in a preset ranking in the comment recommendation pool can all obtain a certain exposure opportunity based on the comment recommendation scores thereof, for example, when the preset name is set as the top 50, the comment texts with the comment recommendations in the top 50 in the comment recommendation pool can all obtain a certain exposure opportunity, for example, when the comment recommendation scores of some comment texts are low (such as the comment recommendation ranked at 49 th), but the actual quality is good, a large amount of user interaction can be obtained in one or a few exposures depending on the good quality of the comment texts, and accordingly the comment texts can occupy the position which is more front in the comment list; on the other hand, the total exposure probability of the high-grade texts in the comment recommendation pool is greater than that of the low-grade texts in the comment recommendation pool, the problem that the low-grade comment texts in the comment recommendation pool are always returned randomly when the user pulls is avoided, and therefore the user can obtain high-quality comments. In some embodiments, as shown in fig. 9, the method may further include:
step S901: regularly pulling a historical high-exposure comment text, and historical interaction data and historical exposure data corresponding to the historical high-exposure comment text;
step S903: based on the historical interaction data and the historical exposure data, calculating a historical comment recommendation score corresponding to the historical high-exposure comment text;
step S905: and updating the target comment prediction model by taking the historical high-exposure comment text as the input of the target comment prediction model and taking the historical comment recommendation score as the output of the target comment prediction model.
In this embodiment of the application, the historical high-exposure comment text may refer to a comment text that has been published and has been pulled by a user for a number of times greater than or equal to a certain pulling number threshold, the historical high-exposure comment text may be one or multiple, the historical interaction data corresponding to the historical high-exposure comment text may include praise and reply for the historical high-exposure comment text, and the historical exposure data corresponding to the historical high-exposure comment text may include the historical total exposure number of the historical high-exposure comment text.
The calculation method of the historical comment recommendation score is similar to that in step S203, that is, the historical comment recommendation score of the historical high-exposure comment text can be determined based on the ratio of the historical interaction data to the historical total exposure times. Similarly, in order to accelerate the convergence of the model, the normalization process in step S203 may also be performed on the calculated history comment recommendation score, and details are not repeated here.
In the embodiment of the application, the historical high-exposure comment text is determined based on the comment recommendation score alone or based on two characteristics of user interaction information and the comment recommendation score at the same time, and the probability reflects the characteristics of the high-quality comment text, so that the target comment prediction model is retrained by using the historical high-exposure comment text and the corresponding historical interaction data and historical exposure data thereof, the updated target comment prediction model can identify the high-quality comment text more accurately, and the comment recommendation accuracy is improved.
In some embodiments, before the step of calling the target comment prediction model to predict the to-be-sent comment text to obtain the corresponding first comment recommendation score, the method may further include:
the method comprises the following steps: constructing an initial comment prediction model, wherein the initial comment prediction model comprises a semantic coding network layer, and the semantic coding network layer comprises a first semantic coding sub-network and a second semantic coding sub-network which are arranged in parallel;
step two: acquiring a training text set, wherein the training text set comprises a plurality of training text pairs and corresponding comment recommendation sub-labels, and each training text pair comprises a training title text and a training comment text;
step three: and training the initial comment prediction model by taking the training title text as the input of the first semantic coding sub-network, the training comment text as the input of the second semantic coding sub-network and the comment recommendation label as the output of the initial comment prediction model to obtain the target comment prediction model.
In this embodiment, the first semantic coding sub-network and the second semantic coding sub-network may be BERT neural networks, which are transform-based pre-training neural networks proposed by google, and generate a pre-training parameter set by performing unsupervised training using a large amount of basic corpora. According to different application scenes, such as a scene of more Chinese comments in use, the BERT neural network can be a Chinese spoken BERT model pre-trained by using Chinese comment corpus.
Because the BERT neural network adopts a plurality of layers of transformers to carry out bidirectional learning on the text, and the transformers adopt a one-time reading mode to extract the text, the context relationship among words in the text can be more accurately learned, the context can be more deeply understood, namely, the context can be more deeply understood by a bidirectional trained language model than a unidirectional language model, and the text can be accurately subjected to feature extraction.
Of course, the first semantic coding sub-Network and the second semantic coding sub-Network may be other similar Networks such as TextCNN (text classification model based on convolutional Neural Network), RNN (Recurrent Neural Network), other classes of transform models, and the BERT Neural Network may also use other modes such as sentence to input the mode, which is not limited in this application.
The training caption text in step two may refer to a comment object such as a caption of an article, and the training comment text may refer to a published comment text for a comment object such as a comment after an article.
In the embodiment of the application, by constructing an initial comment prediction model comprising a first semantic coding sub-network and a second semantic coding sub-network, training the initial comment prediction model by taking a training title text as the input of the first semantic coding sub-network, a training comment text as the input of the second semantic coding sub-network and the comment recommendation label as the output of the initial comment prediction model, the trained target comment prediction model can simultaneously comprise the corresponding relation among the title of the comment object, the comment text and the preset comment recommendation score, therefore, when the target comment prediction model is used, the to-be-sent comment text can be predicted based on the title of the comment object and the to-be-sent comment text of the object, and the comment recommendation accuracy is improved.
In some embodiments, the training the initial comment prediction model with the training caption text as the input of the first semantic coding sub-network, the training comment text as the input of the second semantic coding sub-network, and the comment recommendation score as the output of the initial comment prediction model to obtain the target comment prediction model may include:
the method comprises the following steps: coding the training caption text by using the first semantic coding sub-network to obtain an initial caption text feature vector sequence; coding the training comment text by utilizing the second semantic coding sub-network to obtain an initial comment text characteristic vector sequence;
step two: processing the initial title text feature vector sequence to obtain a corresponding first attention weight; processing the initial comment text feature vector sequence to obtain a corresponding second attention weight;
step three: performing matrix multiplication operation on the first attention weight and the initial title text feature vector sequence to obtain a first intermediate feature vector sequence; performing matrix multiplication operation on the second attention weight and the initial comment text feature vector sequence to obtain a second intermediate feature vector sequence;
step four: performing fusion processing on the first intermediate feature vector sequence and the second intermediate feature vector sequence to obtain a fusion feature vector sequence;
step five: predicting the training comment text based on the fusion feature vector sequence to obtain a prediction score;
step six: and adjusting model parameters of the initial comment prediction model based on the prediction scores and the comment recommendation scores to obtain the target comment prediction model.
In a specific embodiment, as shown in fig. 10, the initial comment prediction model includes a first semantic coding sub-network 1001, a second semantic coding sub-network 1002, an attention layer 1003, a first multiplication unit 1004, a second multiplication unit 1005, a full connection layer 1006, and a classifier (not shown), the first semantic coding sub-network and the second semantic coding sub-network are arranged in parallel, the attention layer is connected to the first semantic coding sub-network and the second semantic coding sub-network, respectively, the first multiplication unit and the second multiplication unit are arranged in parallel, the first multiplication unit and the second multiplication unit are connected to the attention layer, respectively, and the full connection layer is connected to the first multiplication unit and the second multiplication unit, respectively.
As shown, the embodiment of the present application first pairs the training caption text (sequence length) using a first semantic coding sub-network
Figure 39641DEST_PATH_IMAGE003
) Coding to obtain initial title text feature vector sequence A (with size of
Figure 281266DEST_PATH_IMAGE004
) And using the second semantic coding subnetwork to encode the training comment text (sequence length)
Figure 556390DEST_PATH_IMAGE005
) Coding to obtain an initial comment text feature vector sequence B (with the size of
Figure 386811DEST_PATH_IMAGE006
)。
After the initial title text feature vector sequence and the initial comment text feature vector sequence are obtained, the initial title text feature vector sequence and the initial comment text feature vector sequence are respectively input into the attention layer, and first attention weights corresponding to the initial title text feature vector sequence are respectively obtained
Figure 721978DEST_PATH_IMAGE007
Figure 388583DEST_PATH_IMAGE008
Figure 467397DEST_PATH_IMAGE009
And a second attention weight corresponding to the initial sequence of comment text feature vectors
Figure 152325DEST_PATH_IMAGE010
Figure 923972DEST_PATH_IMAGE011
Which isIn (1),
Figure 874610DEST_PATH_IMAGE012
representing the computation of a tensor (e.g. tensor)
Figure 694799DEST_PATH_IMAGE013
) A is an initial title text feature vector sequence, B is an initial comment text feature vector sequence, and W is a parameter matrix.
Then, the first attention weight and the initial heading text feature vector sequence are subjected to matrix multiplication (namely, matrix multiplication is carried out by the first multiplication unit
Figure 47283DEST_PATH_IMAGE014
) Obtaining a first intermediate feature vector sequence
Figure 176782DEST_PATH_IMAGE015
(ii) a And performing matrix multiplication operation on the second attention weight and the initial comment text feature vector sequence by using the second multiplication operation unit (namely, performing matrix multiplication operation on the second attention weight and the initial comment text feature vector sequence
Figure 614716DEST_PATH_IMAGE016
) Obtaining a second intermediate feature vector sequence
Figure 973017DEST_PATH_IMAGE017
According to the method and the device, the attention mechanism is combined into the natural language processing task, the initial comment prediction model of the attention mechanism is combined to pay high attention to the feature information of the specific target in the training process, network parameters can be effectively adjusted according to different targets, and more hidden feature information can be mined.
Attention mechanisms stem from the study of human vision. In cognitive science, humans selectively focus on a portion of all information while ignoring other visible information due to bottlenecks in information processing. The above mechanism is commonly referred to as an attention mechanism. Attention mechanism is a brain signal processing mechanism unique to human vision. Human vision obtains a target area needing important attention, namely an attention focus, by rapidly scanning a global image, and then more attention resources are put into the area to obtain more detailed information of the target needing attention and suppress other useless information.
It can be seen that the attention mechanism has two main aspects: firstly, determining which part of the input needs to be concerned; the second is to allocate limited information processing resources to important parts. The attention mechanism in deep learning is similar to the selective visual attention mechanism of human beings in nature, and the core goal is to select more critical information for the current task from a plurality of information.
And after the first intermediate feature vector sequence and the second intermediate feature vector sequence are obtained, carrying out fusion processing on the first intermediate feature vector sequence and the second intermediate feature vector sequence by using a full connection layer to obtain a fusion feature vector sequence.
Specifically, the concat () method may be used to perform a splicing process on the first intermediate feature vector sequence and the second intermediate feature vector sequence, and the spliced result may be obtained
Figure 445586DEST_PATH_IMAGE018
Then, the spliced eigenvector sequence is processed by linear transformation, i.e. the spliced eigenvector sequence is multiplied by a weight coefficient
Figure 559036DEST_PATH_IMAGE019
And adding an offset value
Figure 671217DEST_PATH_IMAGE020
Obtaining the transformed fusion feature vector sequence
Figure 833208DEST_PATH_IMAGE021
After the fusion feature vector sequence is obtained, inputting the fusion feature vector sequence into a classifier, and predicting the training comment text by using the classifier to obtain a prediction score, wherein the formula is as follows:
Figure 894705DEST_PATH_IMAGE022
after the prediction score corresponding to the training comment text is obtained, adjusting the model parameters of the initial comment prediction model based on the prediction score and the comment recommendation score label to obtain the target comment prediction model.
Specifically, an AdamW loss function may be used to determine whether the initial review prediction model converges, and the formula of the loss function may be as follows:
Figure 366006DEST_PATH_IMAGE023
wherein s is a real prediction score, s' is a preset comment recommendation score, and p is a low-quality comment flag bit, and is a hyper-parameter determined artificially according to a specific strategy hit by the low-quality comment flag bit. When the comment text used in the training is a low-quality comment text judged by a machine or a human, p is greater than 0; when the comment text is normal comment text, p =0, and the penalty item has no influence on the loss function.
It should be noted that, when the initial comment prediction model is trained, a larger learning rate may be set, and when the target comment prediction model is obtained and updated on line, a smaller number of iterations and a smaller learning rate may be set.
In the embodiment of the application, by using the initial comment prediction model, training a title text as an input of the first semantic coding sub-network, training a comment text as an input of the second semantic coding sub-network, and training the initial comment prediction model by using the comment recommendation score label as an output of the initial comment prediction model, a target comment prediction model obtained through training can simultaneously include a corresponding relationship among a title of a comment object, the comment text and a preset comment recommendation score, so that when the target comment prediction model is used, the to-be-issued-form comment text can be predicted simultaneously based on the title of the comment object and the to-be-issued-form comment text of the object, and the comment recommendation accuracy is increased.
To further illustrate the above embodiments of the present application, as shown in fig. 11, the present application further provides a specific embodiment, and the method may include:
step S1101: extracting historical high-exposure comment texts and historical interaction data and historical exposure data corresponding to the historical high-exposure comment texts regularly from an interaction data storage;
step S1102: updating a target comment prediction model based on the historical high-exposure comment text, the historical interaction data and the historical exposure data;
specifically, referring to the embodiment shown in fig. 9, a historical comment recommendation score corresponding to the historical high-exposure comment text is calculated based on the historical interaction data and the historical exposure data, and then the historical high-exposure comment text is used as the input of the target comment prediction model, and the historical comment recommendation score is used as the output of the target comment prediction model, so as to update the target comment prediction model.
In the embodiment of the application, the target comment prediction model is retrained by using the historical high-exposure comment text and the corresponding historical interaction data and historical exposure data thereof, so that the updated target comment prediction model can more accurately identify the high-quality comment text, and the comment recommendation accuracy is improved.
Step S1103: inputting the comments made by the user into the updated target comment prediction model;
step S1104: outputting a comment recommendation score corresponding to a user published comment through the target comment prediction model;
step S1105: when the comment recommendation score of the user published comments is larger than or equal to the preset recommendation score, storing the user published comments into a comment recommendation pool;
step S1106: acquiring the exposure times of each comment text in the comment recommendation pool from an interactive data storage;
step S1107: removing the comment texts with exposure times meeting preset exposure conditions in the comment recommendation pool;
it should be noted that the sequence of steps S1106, S1107 and S1105 is not limited, and steps S1106 and S1107 may be performed synchronously with step S1105, that is, when the user issues a comment and stores the comment into the comment recommendation pool, the operation of removing the comment text from the comment recommendation pool may also be performed simultaneously.
In the embodiment of the application, the comment text with the exposure meeting the preset exposure condition is removed from the comment recommendation pool, so that the exposure opportunity of each time can be reasonably utilized on the basis of ensuring that the newly issued high-quality comment can obtain certain exposure and interaction, and the comment recommendation effectiveness is improved.
Step S1108: when a comment pulling request of a user is received, obtaining a high-grade comment text with a preset ranking (such as the previous 50) of the current article from the comment recommendation pool;
step S1109: inputting high-score comment texts with preset names in the next and previous preset times of the current article into a random returning device to obtain target comment texts which are returned randomly;
the random returner may calculate an exposure probability of each comment text based on the comment recommendation score of each comment text input therein, and select a target comment text from the comment texts input therein based on the exposure probability of each comment text.
For example, when the top 50 high-score comment texts of the current article are input into the random returner, the random returner may calculate the exposure probabilities of the 50 comment texts based on the comment recommendation scores of the 50 comment texts input therein, respectively, and may select the target comment text from the 50 comment texts based on the exposure probabilities of the 50 comment texts.
Therefore, on one hand, the comment texts ranked in the preset ranking in the comment recommendation pool can obtain a certain exposure opportunity based on the comment recommendation scores of the comment texts, for example, when the preset ranking is the top 50, the comment texts with the comment recommendation scores in the top 50 in the comment recommendation pool can obtain a certain exposure opportunity, for example, when the comment recommendation scores of some comment texts are lower (such as ranked at position 49) but the actual quality is better, a large amount of user interaction can be obtained in one or several times of exposure depending on the better quality of the comment texts, and accordingly, the comment texts can occupy the position closer to the front in the comment list; on the other hand, under the condition that the exposure times removed from the comment recommendation pool meet the preset exposure condition, the total exposure probability of the high-grade texts in the comment recommendation pool can be larger than that of the low-grade texts in the comment recommendation pool, the problem that the comment texts with low grades are always randomly returned to the comment recommendation pool when the user pulls is avoided, and therefore the user can obtain high-quality comments.
Step S1110: splicing the target comment text with the high-heat comment list to obtain a target recommendation list, and pushing the target recommendation list to a user;
step S1111: acquiring interaction data and exposure data of a user and the target recommendation list;
step S1112: the interaction data and exposure data of the user are stored in an interaction data store.
In step S1112, by storing the relevant data in the interaction data store, on one hand, the exposure times of each comment text in the comment recommendation pool can be conveniently obtained from the interaction data store, so as to remove the comment text from the comment recommendation pool based on the exposure times; on the other hand, the interaction data stored in the interaction data storage becomes the historical interaction data in step S1101, and the exposure data stored in the interaction data storage becomes the historical exposure data in step S1101, so that the target comment prediction model is updated through the historical interaction data and the historical exposure data in the following process. Through the embodiment of the application, the condition that the high-quality comments accumulated in the previous exposure are eliminated can be avoided, the newly published high-quality comments can obtain certain exposure and interaction and cannot be buried in the comment area, namely, on the premise that the comment quality of the comment area is relatively high is guaranteed, the newly published high-quality comments can obtain certain exposure and interaction, so that the service can be helped to discover more high-quality comments, the users can effectively communicate through the comment area, the feedback of other users is received, the willingness of the users to participate in the comments is further stimulated, and the stickiness of the users to products is increased.
Technical details not described in detail in the above embodiments may be referred to a method provided in any of the embodiments of the present application.
An embodiment of the present application further provides a comment recommending apparatus 1200, please refer to fig. 12, where the apparatus 1200 may include:
a to-be-issued form comment text acquisition module 1210, configured to acquire a to-be-issued form comment text submitted by a user for a comment object;
the comment recommendation score prediction module 1220 is configured to invoke a target comment prediction model to predict the to-be-issued comment text to obtain a corresponding first comment recommendation score, where the target comment prediction model includes a correspondence between the comment text and a preset comment recommendation score;
a current comment list obtaining module 1230, configured to obtain a current comment list of the comment object when a comment pull request of a user is received;
and the target comment list generating module 1240 is configured to add the to-be-published comment text to the current comment list based on the first comment recommendation score, so as to obtain a target comment list responding to the comment pull request.
In some embodiments, the target comment list generation module may include:
the to-be-sent comment text adding submodule is used for adding the to-be-sent comment text into a comment recommendation pool when the first comment recommendation score is larger than or equal to a preset recommendation score;
the target comment text selecting submodule is used for selecting a target comment text from the comment recommendation pool based on the comment recommendation score of each comment text in the comment recommendation pool;
and the target comment list generation submodule is used for inserting the target comment text into a preset recommendation position in the current comment list to obtain a target comment list responding to the comment pulling request.
In some embodiments, the target comment list generation module may further include:
the current comment list information acquisition submodule is used for acquiring user interaction information and second comment recommendation scores of each published comment text in the current comment list;
a recommended degree determining submodule of the published comment text, configured to determine a recommended degree of each published comment text in the current comment list based on the user interaction information and the second comment recommendation score;
the recommendation degree determining submodule of the to-be-published comment text is used for determining the recommendation degree of the to-be-published comment text based on the first comment recommendation score;
the target comment list submodule is further configured to sort the to-be-published comment text and each published comment text based on the recommendation degree, so as to obtain a target comment list responding to the comment pulling request.
In some embodiments, the target comment text selection sub-module may include:
the exposure probability calculation unit is used for calculating the exposure probability of each comment text based on the comment recommendation score of each comment text in the comment recommendation pool;
and the target comment text determining unit is used for selecting a target comment text from the comment recommendation pool according to the exposure probability of each comment text in the comment recommendation pool.
In some embodiments, the apparatus may further comprise: the exposure recording module is used for recording each exposure of each comment text in the comment recommendation pool;
and the comment text removing module is used for removing the comment text with the exposure times meeting the preset exposure conditions from the comment recommendation pool.
In some embodiments, the target comment text selection sub-module may include: the ranking calculation unit is used for sequencing each comment text in the comment recommendation pool from high to low according to the comment recommendation score based on the comment recommendation score of each comment text in the comment recommendation pool;
the pre-selection comment text determining unit is used for determining the pre-set number of comment texts as pre-selection comment texts;
the exposure probability calculation unit is further used for calculating the exposure probability of each pre-selected comment text based on the comment recommendation score of the pre-selected comment text;
the target comment text determination unit is further used for selecting a target comment text from the pre-selected comment texts according to the exposure probability of each pre-selected comment text.
In some embodiments, the apparatus may further comprise:
the historical data pulling module is used for periodically pulling historical high-exposure comment texts and historical interaction data and historical exposure data corresponding to the historical high-exposure comment texts;
the historical comment recommendation score calculation module is used for calculating a historical comment recommendation score corresponding to the historical high-exposure comment text based on the historical interaction data and the historical exposure data;
and the target comment prediction model updating module is used for updating the target comment prediction model by taking the historical high-exposure comment text as the input of the target comment prediction model and taking the historical comment recommendation score as the output of the target comment prediction model.
In some embodiments, the apparatus may further comprise:
the initial comment prediction model construction module is used for constructing an initial comment prediction model, the initial comment prediction model comprises a semantic coding network layer, and the semantic coding network layer comprises a first semantic coding sub-network and a second semantic coding sub-network which are arranged in parallel;
the training text set acquisition module is used for acquiring a training text set, wherein the training text set comprises a plurality of training text pairs and corresponding comment recommendation sub-labels, and each training text pair comprises a training title text and a training comment text;
and the training module is used for training the initial comment prediction model by taking the training title text as the input of the first semantic coding sub-network, the training comment text as the input of the second semantic coding sub-network and the comment recommendation label as the output of the initial comment prediction model to obtain the target comment prediction model.
In some embodiments, the training module may include:
the first training sub-module is used for coding the training title text by utilizing the first semantic coding sub-network to obtain an initial title text feature vector sequence; coding the training comment text by utilizing the second semantic coding sub-network to obtain an initial comment text characteristic vector sequence;
the second training submodule is used for processing the initial title text feature vector sequence to obtain a corresponding first attention weight; processing the initial comment text feature vector sequence to obtain a corresponding second attention weight;
the third training submodule is used for carrying out matrix multiplication operation on the first attention weight and the initial title text feature vector sequence to obtain a first intermediate feature vector sequence; performing matrix multiplication operation on the second attention weight and the initial comment text feature vector sequence by using the second multiplication operation unit to obtain a second intermediate feature vector sequence;
the fourth training submodule is used for carrying out fusion processing on the first intermediate characteristic vector sequence and the second intermediate characteristic vector sequence to obtain a fusion characteristic vector sequence;
the fifth training submodule is used for predicting the training comment text based on the fusion feature vector sequence to obtain a prediction score;
and the sixth training submodule is used for adjusting the model parameters of the initial comment prediction model based on the prediction scores and the comment recommendation score labels to obtain the target comment prediction model.
Embodiments of the present application further provide a computer-readable storage medium, where at least one instruction, at least one program, a code set, or a set of instructions is stored in the storage medium, and the at least one instruction, the at least one program, the code set, or the set of instructions is loaded by a processor and executes any one of the methods described above in this embodiment.
Embodiments of the present application further provide an electronic device, whose structure is shown in fig. 13, where the device 1300 may have a relatively large difference due to different configurations or performances, and may include one or more Central Processing Units (CPUs) 1322 (e.g., one or more processors) and a memory 1332, and one or more storage media 1330 (e.g., one or more mass storage devices) storing applications 1342 or data 1344. Memory 1332 and storage medium 1330 may be, among other things, transitory or persistent storage. The program stored on the storage medium 1330 may include one or more modules (not shown), each of which may include a sequence of instructions operating on a device. Still further, central processor 1322 may be disposed in communication with storage medium 1330 such that a sequence of instruction operations in storage medium 1330 is executed on device 1300. The device 1300 may also include one or more power supplies 1326, one or more wired or wireless network interfaces 1350, one or more input-output interfaces 1358, and/or one or more operating systems 1341, such as Windows Server (TM), among others. Any of the methods described above in this embodiment can be implemented based on the apparatus shown in fig. 13.
The present specification provides method steps as described in the examples or flowcharts, but may include more or fewer steps based on routine or non-inventive labor. The steps and sequences recited in the embodiments are but one manner of performing the steps in a multitude of sequences and do not represent a unique order of performance. In the actual system or interrupted product execution, the method according to the embodiment or the figures can be executed sequentially or in parallel (for example, in the context of parallel processors or multi-threaded processing).
The configurations shown in the present embodiment are only partial configurations related to the present application, and do not constitute a limitation on the devices to which the present application is applied, and a specific device may include more or less components than those shown, or combine some components, or have an arrangement of different components. It should be understood that the methods, apparatuses, and the like disclosed in the embodiments may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a division of one logic function, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or unit modules.
Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Embodiments of the present application also provide a computer program product or a computer program comprising computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to execute the comment recommendation method provided in the above-described various alternative embodiments.
Those of skill would further appreciate that the various illustrative components and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (10)

1. A comment recommendation method, characterized in that the method comprises:
acquiring a to-be-sent comment text submitted by a user aiming at a comment object;
calling a target comment prediction model to predict the to-be-sent form comment text to obtain a corresponding first comment recommendation score, wherein the first comment recommendation score represents a comment recommendation score of the to-be-sent form comment text after being published, the target comment prediction model is obtained through training of a training comment text and a comment recommendation score corresponding to the training comment text, and the comment recommendation score represents a ratio of interactive data of the training comment text to total exposure times;
when a comment pulling request of a user is received, acquiring a current comment list of the comment object;
when the first comment recommendation score is larger than or equal to a preset recommendation score, adding the to-be-issued comment text into a comment recommendation pool;
selecting a target comment text from the comment recommendation pool based on the comment recommendation score of each comment text in the comment recommendation pool;
inserting the target comment text into a preset recommendation position in the current comment list to obtain a target comment list responding to the comment pulling request;
selecting a target comment text from the comment recommendation pool based on the comment recommendation score of each comment text in the comment recommendation pool, wherein the selecting of the target comment text from the comment recommendation pool comprises the following steps:
calculating the exposure probability of each comment text in the comment recommendation pool based on the comment recommendation score of each comment text in the comment recommendation pool; selecting a target comment text from the comment recommendation pool according to the exposure probability of each comment text in the comment recommendation pool; or calculating the exposure probability of the preselected comment text based on the comment recommendation score of the preselected comment text; and selecting a target comment text from the pre-selected comment texts according to the exposure probability of the pre-selected comment texts.
2. The comment recommendation method of claim 1, further comprising:
recording each exposure of each comment text in the comment recommendation pool;
and removing the comment text with the exposure times meeting the preset exposure conditions from the comment recommendation pool.
3. The comment recommendation method of claim 1, wherein before calculating the exposure probability of a preselected comment text based on a comment recommendation score of the preselected comment text, the method further comprises:
based on the comment recommendation score of each comment text in the comment recommendation pool, sequencing each comment text in the comment recommendation pool from high to low according to the comment recommendation score;
and determining the previous preset number of comment texts as the preselected comment texts.
4. The comment recommendation method of claim 1, wherein the inserting the target comment text into a preset recommendation position in the current comment list to obtain a target comment list in response to the comment pull request comprises:
acquiring user interaction information and a second comment recommendation score of each published comment text in the current comment list;
determining the recommendation degree of each published comment text in the current comment list based on the user interaction information and the second comment recommendation score;
determining the recommendation degree of the target comment text based on the first comment recommendation score;
and sequencing the target comment texts and the published comment texts based on the recommendation degree to obtain a target comment list responding to the comment pulling request.
5. The comment recommendation method of claim 1, further comprising:
regularly pulling a historical high-exposure comment text, and historical interaction data and historical exposure data corresponding to the historical high-exposure comment text;
based on the historical interaction data and the historical exposure data, calculating a historical comment recommendation score corresponding to the historical high-exposure comment text;
and updating the target comment prediction model by taking the historical high-exposure comment text as the input of the target comment prediction model and taking the historical comment recommendation score as the output of the target comment prediction model.
6. The comment recommendation method of claim 1, wherein before the step of calling the target comment prediction model to predict the to-be-published comment text to obtain the corresponding first comment recommendation score, the method further comprises:
constructing an initial comment prediction model, wherein the initial comment prediction model comprises a semantic coding network layer, and the semantic coding network layer comprises a first semantic coding sub-network and a second semantic coding sub-network which are arranged in parallel;
acquiring a training text set, wherein the training text set comprises a plurality of training text pairs and corresponding comment recommendation sub-labels, and each training text pair comprises a training title text and a training comment text;
and training the initial comment prediction model by taking the training title text as the input of the first semantic coding sub-network, the training comment text as the input of the second semantic coding sub-network and the comment recommendation label as the output of the initial comment prediction model to obtain the target comment prediction model.
7. The comment recommendation method of claim 6, wherein the training of the initial comment prediction model with the training caption text as an input of the first semantic coding sub-network, the training comment text as an input of the second semantic coding sub-network, and the comment recommendation score as an output of the initial comment prediction model to obtain the target comment prediction model comprises:
coding the training caption text by using the first semantic coding sub-network to obtain an initial caption text feature vector sequence; coding the training comment text by utilizing the second semantic coding sub-network to obtain an initial comment text characteristic vector sequence;
processing the initial title text feature vector sequence to obtain a corresponding first attention weight; processing the initial comment text feature vector sequence to obtain a corresponding second attention weight;
performing matrix multiplication operation on the first attention weight and the initial title text feature vector sequence to obtain a first intermediate feature vector sequence; performing matrix multiplication operation on the second attention weight and the initial comment text feature vector sequence by using a second multiplication operation unit to obtain a second intermediate feature vector sequence;
performing fusion processing on the first intermediate feature vector sequence and the second intermediate feature vector sequence to obtain a fusion feature vector sequence;
predicting the training comment text based on the fusion feature vector sequence to obtain a prediction score;
and adjusting model parameters of the initial comment prediction model based on the prediction scores and the comment recommendation scores to obtain the target comment prediction model.
8. A comment recommending apparatus, characterized in that the apparatus comprises:
the to-be-sent comment text acquisition module is used for acquiring a to-be-sent comment text submitted by a user aiming at the comment object;
the comment recommendation score prediction module is used for calling a target comment prediction model to predict the to-be-sent form comment text to obtain a corresponding first comment recommendation score, wherein the first comment recommendation score represents a comment recommendation score of the to-be-sent form comment text after publication, the target comment prediction model is obtained through training of a training comment text and a comment recommendation score label corresponding to the training comment text, and the comment recommendation score label represents a ratio of interactive data of the training comment text to total exposure times;
the current comment list acquisition module is used for acquiring a current comment list of the comment object when a comment pull request of a user is received;
the target comment list generation module is used for adding the to-be-sent comment text into a comment recommendation pool when the first comment recommendation score is larger than or equal to a preset recommendation score; selecting a target comment text from the comment recommendation pool based on the comment recommendation score of each comment text in the comment recommendation pool; inserting the target comment text into a preset recommendation position in the current comment list to obtain a target comment list responding to the comment pulling request;
selecting a target comment text from the comment recommendation pool based on the comment recommendation score of each comment text in the comment recommendation pool, wherein the selecting of the target comment text from the comment recommendation pool comprises the following steps: calculating the exposure probability of each comment text in the comment recommendation pool based on the comment recommendation score of each comment text in the comment recommendation pool; selecting a target comment text from the comment recommendation pool according to the exposure probability of each comment text in the comment recommendation pool; or calculating the exposure probability of the preselected comment text based on the comment recommendation score of the preselected comment text; and selecting a target comment text from the pre-selected comment texts according to the exposure probability of the pre-selected comment texts.
9. A computer storage medium having stored therein at least one instruction that is loaded by a processor and that executes a comment recommendation method as claimed in any one of claims 1 to 7.
10. An electronic device comprising a processor and a memory, the memory having stored therein at least one instruction that is loaded by the processor and that executes a comment recommendation method as claimed in any one of claims 1 to 7.
CN202110337269.9A 2021-03-30 2021-03-30 Comment recommendation method and device Active CN112733043B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110337269.9A CN112733043B (en) 2021-03-30 2021-03-30 Comment recommendation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110337269.9A CN112733043B (en) 2021-03-30 2021-03-30 Comment recommendation method and device

Publications (2)

Publication Number Publication Date
CN112733043A CN112733043A (en) 2021-04-30
CN112733043B true CN112733043B (en) 2021-07-23

Family

ID=75597097

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110337269.9A Active CN112733043B (en) 2021-03-30 2021-03-30 Comment recommendation method and device

Country Status (1)

Country Link
CN (1) CN112733043B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113361264A (en) * 2021-06-25 2021-09-07 上海哔哩哔哩科技有限公司 Data processing method and device
CN114139046B (en) * 2021-10-29 2023-03-24 北京达佳互联信息技术有限公司 Object recommendation method and device, electronic equipment and storage medium
CN114881020A (en) * 2022-07-12 2022-08-09 成都晓多科技有限公司 Comment quality identification model and method based on cross attention and door mechanism

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105493119A (en) * 2013-06-24 2016-04-13 朴吉珠 System for outputting linked advertisement on basis of smartphone
CN111046941A (en) * 2019-12-09 2020-04-21 腾讯科技(深圳)有限公司 Target comment detection method and device, electronic equipment and storage medium
CN111310079A (en) * 2020-02-14 2020-06-19 腾讯科技(深圳)有限公司 Comment information sorting method and device, storage medium and server

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107807936A (en) * 2016-09-09 2018-03-16 腾讯科技(深圳)有限公司 Comment information sort method and device
CN109271646B (en) * 2018-09-04 2022-07-08 腾讯科技(深圳)有限公司 Text translation method and device, readable storage medium and computer equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105493119A (en) * 2013-06-24 2016-04-13 朴吉珠 System for outputting linked advertisement on basis of smartphone
CN111046941A (en) * 2019-12-09 2020-04-21 腾讯科技(深圳)有限公司 Target comment detection method and device, electronic equipment and storage medium
CN111310079A (en) * 2020-02-14 2020-06-19 腾讯科技(深圳)有限公司 Comment information sorting method and device, storage medium and server

Also Published As

Publication number Publication date
CN112733043A (en) 2021-04-30

Similar Documents

Publication Publication Date Title
CN108959396B (en) Machine reading model training method and device and question and answer method and device
CN112733043B (en) Comment recommendation method and device
CN111897941B (en) Dialogue generation method, network training method, device, storage medium and equipment
CN110234018B (en) Multimedia content description generation method, training method, device, equipment and medium
CN111930894B (en) Long text matching method and device, storage medium and electronic equipment
CN111709493B (en) Object classification method, training device, object classification equipment and storage medium
CN113705811B (en) Model training method, device, computer program product and equipment
US11423307B2 (en) Taxonomy construction via graph-based cross-domain knowledge transfer
CN111898369A (en) Article title generation method, model training method and device and electronic equipment
CN112257841A (en) Data processing method, device and equipment in graph neural network and storage medium
CN110166802A (en) Barrage processing method, device and storage medium
CN113704460A (en) Text classification method and device, electronic equipment and storage medium
CN111444399B (en) Reply content generation method, device, equipment and readable storage medium
CN113761156A (en) Data processing method, device and medium for man-machine interaction conversation and electronic equipment
CN114490926A (en) Method and device for determining similar problems, storage medium and terminal
CN116610218A (en) AI digital person interaction method, device and system
CN113741759B (en) Comment information display method and device, computer equipment and storage medium
CN112149426B (en) Reading task processing method and related equipment
CN113761933A (en) Retrieval method, retrieval device, electronic equipment and readable storage medium
CN111897943A (en) Session record searching method and device, electronic equipment and storage medium
CN117649117B (en) Treatment scheme determining method and device and computer equipment
CN115249065A (en) Attention mechanism model training method, device, equipment and storage medium
CN114328805A (en) Text processing method, system, storage medium and terminal equipment
CN116681075A (en) Text recognition method and related equipment
CN117216223A (en) Dialogue text generation method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40041569

Country of ref document: HK