Video comment processing methods and equipment
By combining a training vector generation model with a clustering algorithm, semantic vectors are generated using the differences in comment text between the same video and another video. This solves the problem of low accuracy in video comment topics and improves the ability to identify hot comment topics.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING ZITIAO NETWORK TECH CO LTD
- Filing Date
- 2021-08-26
- Publication Date
- 2026-07-03
AI Technical Summary
In existing technologies, the semantic vector generation method for video comment text is unsupervised, resulting in poor accuracy of trending comment topics.
By training a vector generation model, semantic vectors are generated using the differences between comment texts of the same video and comment texts of another video, and then clustering algorithms are used to determine hot comment topics.
It improved the accuracy of trending comment topics, especially the ability to identify negative comment topics.
Smart Images

Figure CN115730063B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer processing technology, and in particular to a video comment processing method and apparatus. Background Technology
[0002] With the rapid development of electronic devices, their functions are becoming increasingly powerful. Electronic devices can run applications with video playback capabilities, allowing users to play and comment on videos. Application providers typically need to analyze and statistically analyze these comments to identify trending comment topics within their applications.
[0003] Therefore, improving the accuracy of trending topics in online commentary is an urgent problem to be solved. Summary of the Invention
[0004] This disclosure provides a video comment processing method and device that can improve the accuracy of trending comment topics.
[0005] In a first aspect, embodiments of this disclosure provide a video comment processing method, including:
[0006] Get at least two comment texts for the video;
[0007] A semantic vector for each comment text is generated using a vector generation model. The vector generation model is pre-trained using multiple sets of training samples. Each set of training samples includes a first comment text, a second comment text, and a third comment text. The first and second comment texts are for the same video, and the third comment text is for another video. During the training process, a loss value is determined based on the semantic vectors corresponding to the first, second, and third comment texts generated by the vector generation model, and the vector generation model is adjusted based on the loss value until the vector generation model converges.
[0008] Cluster the at least two comment texts based on the semantic vectors to obtain at least one cluster;
[0009] Hot topic comments are determined based on the aforementioned clusters.
[0010] Secondly, embodiments of this disclosure provide a video comment processing apparatus, comprising:
[0011] The comment text retrieval module is used to retrieve at least two comment texts for the video;
[0012] A semantic vector generation module is used to generate semantic vectors for each comment text through a vector generation model. The vector generation model is pre-trained using multiple sets of training samples. Each set of training samples includes a first comment text, a second comment text, and a third comment text. The first and second comment texts are for the same video, and the third comment text is for another video. During the training process, a loss value is determined based on the semantic vectors corresponding to the first, second, and third comment texts generated by the vector generation model, and the vector generation model is adjusted based on the loss value until the vector generation model converges.
[0013] A clustering module is used to cluster the at least two comment texts based on the semantic vector to obtain at least one cluster.
[0014] The comment topic determination module is used to determine hot comment topics based on the aforementioned clusters.
[0015] Thirdly, embodiments of this disclosure provide an electronic device, including: at least one processor and a memory;
[0016] The memory stores computer-executed instructions;
[0017] The at least one processor executes computer execution instructions stored in the memory, causing the electronic device to perform the method as described in the first aspect.
[0018] Fourthly, embodiments of this disclosure provide a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, cause a computing device to implement the method described in the first aspect.
[0019] Fifthly, embodiments of this disclosure provide a computer program for implementing the method as described in the first aspect.
[0020] This disclosure provides a method and apparatus for video comment processing. The method includes: acquiring at least two comment texts for a video; generating a semantic vector for each comment text using a vector generation model, wherein the vector generation model is pre-trained using multiple sets of training samples: a first comment text, a second comment text, and a third comment text, wherein the first and second comment texts pertain to the same video, and the third comment text pertains to another video; during training, determining loss values based on the semantic vectors corresponding to the first, second, and third comment texts generated by the vector generation model, and adjusting the vector generation model based on the loss values until the vector generation model converges; clustering the at least two comment texts based on the semantic vectors to obtain at least one cluster; and determining hot comment topics based on the clusters. This disclosure can accurately represent the semantic vectors of comment texts, thereby improving the accuracy of hot comment topics. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a diagram illustrating the process of obtaining trending comment topics.
[0023] Figure 2 This is a flowchart of the steps of a video comment processing method provided in an embodiment of this disclosure;
[0024] Figure 3 This is a schematic diagram of the input and output of a vector generation model provided in an embodiment of this disclosure;
[0025] Figure 4 This is a structural block diagram of a video comment processing device provided in an embodiment of this disclosure;
[0026] Figure 5 This is a structural block diagram of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0028] This disclosure can be applied to the process of obtaining trending comment topics, where trending comment topics can be popular comment topics, that is, topics with the most comments. Figure 1 This is a diagram illustrating the process of obtaining trending comment topics. (See reference...) Figure 1 As shown, maintenance personnel can operate the video management device to request trending comment topics. The video management device generates a topic retrieval request and sends it to the server. The server determines the trending comment topics based on the comment text and sends them back to the video management device. The video management device can then display the trending comment topics.
[0029] It should be noted that the maintenance personnel can specify one or more videos in the video management device to obtain the trending comment topics for those videos. Alternatively, they can choose not to specify any videos and obtain the trending comment topics for all videos.
[0030] The video management device can be a personal computer, mobile phone, tablet computer, etc.
[0031] The server stores the comment text, which is the text used to comment on the videos provided by the application; it is the text entered by the user. In other words, the server is the storage device corresponding to the application, and the application is the application that provides video functionality; it can also be called a video application.
[0032] In the process of obtaining the aforementioned trending comment topics, the server can first represent each comment text as a vector, so that different vectors represent different comment texts; this vector can be called the semantic vector of the comment text. Then, the semantic vectors of the comment texts are clustered, grouping comment texts with high similarity into a single cluster, with each cluster corresponding to a topic. Finally, the topics corresponding to the clusters with the most comment texts can be identified as trending comment topics.
[0033] However, the aforementioned process of generating vector representations of comment texts is achieved through unsupervised training. This means that semantic vectors are generated based on the similarity of the comment text expressions; comment texts with the same expression have the same semantic vector, while those with different expressions have different semantic vectors. However, in video comment texts, different expressions may represent the same semantic meaning. Therefore, the semantic vectors generated using unsupervised methods cannot accurately represent the semantics of the comment text, resulting in poor accuracy in generating trending comment topics.
[0034] To address the aforementioned technical issues, the applicant, after studying video comment texts, discovered that comment texts from the same video typically exhibit high semantic relevance, while comment texts from different videos generally have low semantic relevance. Based on this finding, embodiments of this disclosure can train a vector generation model using training samples comprised of a first comment text, a second comment text, and a third comment text. Since the first and second comment texts are from the same video, and the third comment text is from another video, the training process is supervised by the degree of difference between the first and second comment texts, as well as the degree of difference between the first and third comment texts. In this way, the vector generation model can combine whether the comment text refers to the same video to generate semantic vectors; the semantic vectors of comment texts from the same video have high relevance, while the semantic vectors of comment texts from different videos have poor relevance. Embodiments of this disclosure can improve the accuracy of semantic vectors in representing comment texts, thereby improving the accuracy of identifying trending comment topics.
[0035] The technical solutions of the present disclosure and how the technical solutions of the present disclosure solve the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of the present disclosure will now be described with reference to the accompanying drawings.
[0036] Figure 2 This is a flowchart illustrating the steps of a video comment processing method provided in an embodiment of this disclosure. (Refer to...) Figure 2 As shown, the comment processing methods for this video include:
[0037] S101: Retrieve at least two comment texts for the video.
[0038] The at least two comment texts can be for the same video or for different videos. When the user specifies a video, the at least two comment texts are for at least one video specified by the user. When the user does not specify a video, the at least two comment texts can be all comment texts available on the server.
[0039] S102: Generate semantic vectors for each comment text using a vector generation model. The vector generation model is pre-trained using multiple sets of training samples. Each set of training samples includes a first comment text, a second comment text, and a third comment text. The first and second comment texts are for the same video, and the third comment text is for another video. During training, the loss value is determined based on the semantic vectors corresponding to the first, second, and third comment texts generated by the vector generation model, and the vector generation model is adjusted based on the loss value until the vector generation model converges.
[0040] Understandably, each comment text can be input into a vector generation model to obtain the semantic vector of that comment text.
[0041] In this embodiment of the disclosure, the time difference between the publication of two comment texts for the same video is less than or equal to a preset duration threshold; that is, the time difference between the publication of the first comment text and the second comment text is less than or equal to the preset duration threshold. This embodiment of the disclosure considers comment texts with a time difference less than or equal to the preset duration threshold to be semantically similar.
[0042] The posting time difference refers to the time difference between posting two comment texts, where the posting time is the time when the user comments on the video.
[0043] The above vector generation model was obtained through multiple rounds of iterative training. The training process specifically includes the following steps:
[0044] First, in each round of iterative training, for each comment text in each training sample, a semantic vector of the comment text is generated through a vector generation model, which is a convolutional neural network for text. Then, if the loss value does not meet the preset convergence condition, the parameters of the vector generation model are adjusted for the next round of iterative training. Finally, if the loss value meets the preset convergence condition, the training ends, and the vector generation model is used as the trained vector generation model.
[0045] The vector generation model can be constructed from the TextCNN (text convolutional neural networks) model. Figure 3 This is a schematic diagram illustrating the input and output of a vector generation model provided in an embodiment of this disclosure. (Refer to...) Figure 3 As shown, the vector generation model consists of three TextCNN models. The parameters are shared between TextCNN1 and TextCNN2, and between TextCNN1 and TextCNN3, allowing the vector generation model to fully utilize the information from all the comment text in a training sample. It can be understood that the three TextCNN models in the vector generation model form a Siamese network.
[0046] from Figure 3 As can be seen, for each training sample, the first comment text can be input into TextCNN1 to obtain the semantic vector V1 of the first comment text, the second comment text can be input into TextCNN2 to obtain the semantic vector V2 of the second comment text, and the third comment text can be input into TextCNN3 to obtain the semantic vector V3 of the third comment text.
[0047] from Figure 3It can also be seen that if N sets of training samples are used in each round of training iteration, N sets of semantic vectors can be obtained, each set of semantic vectors including semantic vector V1, semantic vector V2, and semantic vector V3. Therefore, the N sets of semantic vectors can be input into the loss function to obtain the loss value of this round of iteration.
[0048] The aforementioned loss value is determined by the difference between the first Euclidean distance and the second Euclidean distance. The first Euclidean distance is the Euclidean distance between the semantic vectors of the first comment text and the second comment text, and the second Euclidean distance is the Euclidean distance between the semantic vectors of the first comment text and the semantic vectors of the third comment text.
[0049] Corresponding to the above loss values, the triplet loss function can be used to calculate the loss value. Specifically, the loss value can be calculated using the following formula:
[0050]
[0051] Where LOSS is the loss value, N is the number of training samples in each iteration, and V1 n V2 is the semantic vector corresponding to the first comment text in the nth training sample. n V3 is the semantic vector corresponding to the second comment text in the nth training sample. n Let α be the semantic vector corresponding to the third comment text in the nth training sample, where α is a small constant. It's V1 n and V2 n The Euclidean distance between them V1 n and V3 n The Euclidean distance between them.
[0052] It should be noted that α above is and The minimum difference between them.
[0053] The subscript + in the above formula is used to indicate that, in When greater than 0, For the loss value, in When the value is less than or equal to 0, the loss value is 0.
[0054] S103: Cluster at least two comment texts based on semantic vectors to obtain at least one cluster.
[0055] Clustering involves grouping comment texts with high semantic vector similarity into a single cluster. In other words, multiple comment texts within the same cluster have high semantic vector similarity, while multiple comment texts within different clusters have low semantic vector similarity.
[0056] In this embodiment of the disclosure, existing clustering algorithms can be used to cluster the comment text to obtain at least one cluster. For example, k-means clustering algorithm. This embodiment of the disclosure does not limit the clustering algorithm.
[0057] It should be noted that the complexity of the clustering process depends on the number of comment texts. The larger the number of comment texts, the higher the complexity of the clustering process; conversely, the smaller the number of comment texts, the lower the complexity of the clustering process.
[0058] Based on the above principles, to reduce the complexity of the clustering process, this embodiment filters the comment text before clustering to reduce the number of comment texts. Furthermore, considering that comment texts that negatively impact video applications typically express negative emotions, this embodiment can cluster only comment texts with negative emotions, resulting in trending comment topics that are also negative.
[0059] Specifically, the sentiment parameter of each comment text can be predicted, which represents the degree of negative emotion in the comment text; and the comment texts with sentiment parameters greater than or equal to a preset sentiment threshold are clustered according to the semantic vector to obtain at least one cluster.
[0060] The sentiment parameter is a numerical representation of the negative emotions expressed in the comment text. A larger sentiment parameter indicates a higher level of negative emotion, while a smaller sentiment parameter indicates a lower level of negative emotion.
[0061] In this embodiment of the disclosure, sentiment parameters can be predicted using a sentiment prediction model. Specifically, the comment text can be input into the sentiment prediction model to obtain the sentiment parameters of the comment text. The sentiment prediction model can be a neural network model, such as the ERNIE (enhanced language representation with informative entities) model.
[0062] The aforementioned sentiment prediction model is pre-trained using the following training samples: comment text and sentiment parameters used for supervised training (referred to as sample sentiment parameters).
[0063] The emotion parameters used for supervised training can be manually labeled. Specifically, the process of training the emotion prediction model can include the following main steps: First, initialize the parameters of the ERNIE model; then, train the ERNIE model through multiple rounds of iterative training; if the loss value meets the preset condition after one round of iterative training, stop training and use the ERNIE model at this time as the trained emotion prediction model; if the loss value does not meet the preset condition after one round of iterative training, adjust the parameters of the ERNIE model to perform the next round of iterative training until the loss value meets the preset condition.
[0064] In each iteration of training, the comment text from each training sample is input into the ERNIE model to predict the sentiment parameters of the comment text (called training sentiment parameters). Then, the training sentiment parameters and the sample sentiment parameters corresponding to the comment text are input into the loss function to obtain the loss value for this iteration of training. The loss function can be an existing sum-of-squares loss function, cross-entropy loss function, etc., and this embodiment of the disclosure is not limited to it.
[0065] The loss value meets the preset conditions if it does not continuously decrease during multiple training iterations, or if it is less than or equal to a preset threshold. The loss value does not meet the preset conditions if it continuously decreases during multiple training iterations and is greater than the preset threshold.
[0066] S104: Determine trending comment topics based on category clusters.
[0067] In one example of this embodiment, the hot comment topics are one or more words that appear most frequently in one or more clusters. The one or more clusters can be referred to as target clusters, which include at least one of the following: clusters where the number of comment texts is greater than or equal to a preset threshold, and clusters where the most frequently occurring words match preset keywords.
[0068] The most frequently occurring word within a category is the most frequently occurring word across all comment texts included in that category. Preset keywords can be keywords pre-configured by maintenance personnel in the video management equipment.
[0069] Once a trending comment topic is identified, a trending topic alert can be triggered. This allows maintenance personnel to analyze and investigate the relevant categories for that trending comment topic to avoid any negative impact.
[0070] Corresponding to the video comment processing method in the above embodiments, Figure 4 This is a structural block diagram of a video comment processing apparatus provided in an embodiment of this disclosure. For ease of explanation, only the parts relevant to the embodiments of this disclosure are shown. (Refer to...) Figure 4The comment processing device 200 for the aforementioned video includes: a comment text acquisition module 201, a semantic vector generation module 202, a clustering module 203, and a comment topic determination module 204.
[0071] The comment text acquisition module 201 is used to acquire at least two comment texts for the video.
[0072] The semantic vector generation module 202 is used to generate a semantic vector for each comment text through a vector generation model. The vector generation model is pre-trained using multiple sets of training samples. Each set of training samples includes a first comment text, a second comment text, and a third comment text. The first comment text and the second comment text refer to the same video, and the third comment text refers to another video. During the training process, a loss value is determined based on the semantic vectors corresponding to the first comment text, the second comment text, and the third comment text generated by the vector generation model, and the vector generation model is adjusted based on the loss value until the vector generation model converges.
[0073] Clustering module 203 is used to cluster the at least two comment texts according to the semantic vector to obtain at least one cluster.
[0074] The comment topic determination module 204 is used to determine hot comment topics based on the clusters.
[0075] Optionally, the clustering module 203 described above is also used for:
[0076] Predict the sentiment parameter of each comment text, the sentiment parameter being used to represent the degree of negative sentiment of the comment text; cluster the comment texts whose sentiment parameter is greater than or equal to a preset sentiment threshold according to the semantic vector to obtain at least one cluster.
[0077] Optionally, the emotion parameters are predicted by an emotion prediction model, which is pre-trained using the following training samples: comment text and emotion parameters used for supervised training.
[0078] Optionally, the above-mentioned comment topic determination module 204 is also used for:
[0079] The hot comment topics are determined based on the comment texts included in the target cluster. The target cluster includes at least one of the following: a cluster with a number of comment texts greater than or equal to a preset number threshold, or a cluster where the most frequently occurring word matches a preset keyword. In this case, the hot comment topic is the word that appears most frequently in the target cluster.
[0080] Optionally, the loss value used by the vector generation model during training is determined by the difference between a first Euclidean distance and a second Euclidean distance. The first Euclidean distance is the Euclidean distance between the semantic vector of the first comment text and the semantic vector of the second comment text, and the second Euclidean distance is the Euclidean distance between the semantic vector of the first comment text and the semantic vector of the third comment text.
[0081] Optionally, the vector generation model is trained using the following modules:
[0082] A semantic vector generation module is used to generate a semantic vector of each comment text for each training sample in each round of training iteration, using the vector generation model, wherein the vector generation model is a text-specific convolutional neural network.
[0083] The next iteration module is used to adjust the parameters of the vector generation model to perform the next round of iterative training if the loss value does not meet the preset convergence condition.
[0084] The training termination module is used to terminate training if the loss value meets a preset convergence condition, and to use the vector generation model as the trained vector generation model.
[0085] Optionally, the time difference between the publication of two comment texts for the same video is less than or equal to a preset duration threshold.
[0086] The video comment processing device provided in this embodiment can be used to perform the above-mentioned... Figure 2 The technical solutions of the method embodiments shown are similar in implementation principle and technical effect, and will not be described again here.
[0087] Figure 5 This is a structural block diagram of an electronic device provided in an embodiment of the present disclosure. The electronic device 600 includes a memory 602 and at least one processor 601.
[0088] Among them, memory 602 stores computer-executed instructions.
[0089] At least one processor 601 executes computer execution instructions stored in memory 602, causing electronic device 601 to perform the aforementioned functions. Figure 2 The method in the middle.
[0090] In addition, the electronic device may also include a receiver 603 and a transmitter 604, wherein the receiver 603 is used to receive information from other devices or equipment and forward it to the processor 601, and the transmitter 604 is used to send information to other devices or equipment.
[0091] In a first example of the first aspect, embodiments of this disclosure provide a video comment processing method, including:
[0092] Get at least two comment texts for the video;
[0093] A semantic vector for each comment text is generated using a vector generation model. The vector generation model is pre-trained using multiple sets of training samples. Each set of training samples includes a first comment text, a second comment text, and a third comment text. The first and second comment texts are for the same video, and the third comment text is for another video. During the training process, a loss value is determined based on the semantic vectors corresponding to the first, second, and third comment texts generated by the vector generation model, and the vector generation model is adjusted based on the loss value until the vector generation model converges.
[0094] Cluster the at least two comment texts based on the semantic vectors to obtain at least one cluster;
[0095] Hot topic comments are determined based on the aforementioned clusters.
[0096] Based on the first example of the first aspect, in the second example of the first aspect, the step of clustering the at least two comment texts according to the semantic vector to obtain at least one cluster includes:
[0097] Predict a sentiment parameter for each of the comment texts, the sentiment parameter being used to represent the degree of negative sentiment of the comment text;
[0098] Based on the semantic vector, the comment texts whose emotion parameters are greater than or equal to a preset emotion threshold are clustered to obtain at least one cluster.
[0099] Based on the second example of the first aspect, in the third example of the first aspect, the emotion parameter is predicted by an emotion prediction model, which is pre-trained using the following training samples: comment text and emotion parameters used for supervised training.
[0100] Based on the first example of the first aspect, in the fourth example of the first aspect, the step of determining the hot comment topics according to the cluster includes:
[0101] The hot comment topics are determined based on the comment texts included in the target cluster. The target cluster includes at least one of the following: a cluster with a number of comment texts greater than or equal to a preset number threshold, or a cluster where the most frequently occurring word matches a preset keyword. In this case, the hot comment topic is the word that appears most frequently in the target cluster.
[0102] Based on any one of the first to fourth examples of the first aspect, in the fifth example of the first aspect, the loss value used by the vector generation model during training is determined by the difference between a first Euclidean distance and a second Euclidean distance, wherein the first Euclidean distance is the Euclidean distance between the semantic vector of the first comment text and the semantic vector of the second comment text, and the second Euclidean distance is the Euclidean distance between the semantic vector of the first comment text and the semantic vector of the third comment text.
[0103] Based on the fifth example of the first aspect, in the sixth example of the first aspect, the vector generation model is trained through the following steps:
[0104] In each round of training iteration, for each comment text of each training sample, a semantic vector of the comment text is generated by the vector generation model, which is a convolutional neural network for text.
[0105] If the loss value does not meet the preset convergence condition, the parameters of the vector generation model are adjusted to perform the next round of iterative training.
[0106] If the loss value satisfies the preset convergence condition, then the training ends, and the vector generation model is used as the trained vector generation model.
[0107] Based on any one of the first to fourth examples of the first aspect, in the seventh example of the first aspect, the time difference between the publication of the two comment texts for the same video is less than or equal to a preset duration threshold.
[0108] In a first example of the second aspect, a video comment processing apparatus is provided, comprising:
[0109] The comment text retrieval module is used to retrieve at least two comment texts for the video;
[0110] A semantic vector generation module is used to generate semantic vectors for each comment text through a vector generation model. The vector generation model is pre-trained using multiple sets of training samples. Each set of training samples includes a first comment text, a second comment text, and a third comment text. The first and second comment texts are for the same video, and the third comment text is for another video. During the training process, a loss value is determined based on the semantic vectors corresponding to the first, second, and third comment texts generated by the vector generation model, and the vector generation model is adjusted based on the loss value until the vector generation model converges.
[0111] A clustering module is used to cluster the at least two comment texts based on the semantic vector to obtain at least one cluster.
[0112] The comment topic determination module is used to determine hot comment topics based on the aforementioned clusters.
[0113] Based on the first example of the second aspect, in the second example of the second aspect, the clustering module is further used for:
[0114] Predict a sentiment parameter for each of the comment texts, the sentiment parameter being used to represent the degree of negative sentiment of the comment text;
[0115] Based on the semantic vector, the comment texts whose emotion parameters are greater than or equal to a preset emotion threshold are clustered to obtain at least one cluster.
[0116] Based on the second example of the second aspect, in the third example of the second aspect, the emotion parameter is predicted by an emotion prediction model, which is pre-trained using the following training samples: comment text and emotion parameters used for supervised training.
[0117] Based on the first example of the second aspect, in the fourth example of the second aspect, the comment topic determination module is also used for:
[0118] The hot comment topics are determined based on the comment texts included in the target cluster. The target cluster includes at least one of the following: a cluster with a number of comment texts greater than or equal to a preset number threshold, or a cluster where the most frequently occurring word matches a preset keyword. In this case, the hot comment topic is the word that appears most frequently in the target cluster.
[0119] Based on any one of the first to fourth examples of the second aspect, in the fifth example of the second aspect, the loss value used by the vector generation model during training is determined by the difference between a first Euclidean distance and a second Euclidean distance, wherein the first Euclidean distance is the Euclidean distance between the semantic vector of the first comment text and the semantic vector of the second comment text, and the second Euclidean distance is the Euclidean distance between the semantic vector of the first comment text and the semantic vector of the third comment text.
[0120] Based on the fifth example of the second aspect, in the sixth example of the second aspect, the vector generation model is trained through the following modules:
[0121] A semantic vector generation module is used to generate a semantic vector of each comment text for each training sample in each round of training iterations, using the vector generation model, wherein the vector generation model is a text-specific convolutional neural network.
[0122] The next iteration module is used to adjust the parameters of the vector generation model to perform the next iteration training if the loss value does not meet the preset convergence condition.
[0123] The training termination module is used to terminate training if the loss value meets a preset convergence condition, and to use the vector generation model as the trained vector generation model.
[0124] Based on any one of the first to fourth examples of the second aspect, in the seventh example of the second aspect, the time difference between the publication of the two comment texts for the same video is less than or equal to a preset duration threshold.
[0125] Thirdly, according to one or more embodiments of the present disclosure, an electronic device is provided, comprising: at least one processor and a memory;
[0126] The memory stores computer-executed instructions;
[0127] The at least one processor executes computer execution instructions stored in the memory, causing the electronic device to implement the method described in any of the first aspects.
[0128] Fourthly, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, the computer-readable storage medium storing computer-executable instructions that, when executed by a processor, cause a computing device to implement the method described in any one of the first aspects.
[0129] Fifthly, according to one or more embodiments of the present disclosure, a computer program is provided for implementing the method described in any of the first aspects.
[0130] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0131] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0132] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A method for processing video comments, characterized in that, The method includes: Get at least two comment texts for the video; A semantic vector for each comment text is generated using a vector generation model. This model is pre-trained using multiple sets of training samples. Each set includes a first comment text, a second comment text, and a third comment text. The first and second comment texts relate to the same video, while the third comment text relates to another video. During training, a loss value is determined based on the semantic vectors corresponding to the first, second, and third comment texts generated by the vector generation model. The vector generation model is then adjusted based on these loss values until it converges. The loss value used during training is determined by the difference between a first Euclidean distance and a second Euclidean distance. The first Euclidean distance is the Euclidean distance between the semantic vectors of the first and second comment texts, and the second Euclidean distance is the Euclidean distance between the semantic vectors of the first and third comment texts. Cluster the at least two comment texts based on the semantic vectors to obtain at least one cluster; Hot topic comments are determined based on the aforementioned clusters.
2. The method according to claim 1, characterized in that, The step of clustering the at least two comment texts based on the semantic vector to obtain at least one cluster includes: Predict a sentiment parameter for each of the comment texts, the sentiment parameter being used to represent the degree of negative sentiment of the comment text; Based on the semantic vector, the comment texts whose emotion parameters are greater than or equal to a preset emotion threshold are clustered to obtain at least one cluster.
3. The method according to claim 2, characterized in that, The emotion parameters are predicted by an emotion prediction model, which is pre-trained using the following training samples: comment text and emotion parameters used for supervised training.
4. The method according to claim 1, characterized in that, The step of determining trending comment topics based on the clusters includes: The hot comment topics are determined based on the comment texts included in the target cluster. The target cluster includes at least one of the following: a cluster with a number of comment texts greater than or equal to a preset number threshold, or a cluster where the most frequently occurring word matches a preset keyword. In this case, the hot comment topic is the word that appears most frequently in the target cluster.
5. The method according to claim 1, characterized in that, The vector generation model is trained through the following steps: In each round of training iteration, for each comment text of each training sample, a semantic vector of the comment text is generated by the vector generation model, which is a convolutional neural network for text. If the loss value does not meet the preset convergence condition, the parameters of the vector generation model are adjusted to perform the next round of iterative training. If the loss value satisfies the preset convergence condition, then the training ends, and the vector generation model is used as the trained vector generation model.
6. The method according to any one of claims 1 to 4, characterized in that, The time difference between the publication of two comment texts for the same video is less than or equal to a preset duration threshold.
7. A video comment processing device, characterized in that, include: The comment text retrieval module is used to retrieve at least two comment texts for the video; A semantic vector generation module is used to generate semantic vectors for each comment text using a vector generation model. The vector generation model is pre-trained using multiple sets of training samples. Each set of training samples includes a first comment text, a second comment text, and a third comment text. The first and second comment texts refer to the same video, while the third comment text refers to another video. During training, a loss value is determined based on the semantic vectors corresponding to the first, second, and third comment texts generated by the vector generation model. The vector generation model is then adjusted based on the loss value until it converges. The loss value used by the vector generation model during training is determined by the difference between a first Euclidean distance and a second Euclidean distance. The first Euclidean distance is the Euclidean distance between the semantic vectors of the first and second comment texts, and the second Euclidean distance is the Euclidean distance between the semantic vectors of the first and third comment texts. A clustering module is used to cluster the at least two comment texts based on the semantic vector to obtain at least one cluster. The comment topic determination module is used to determine hot comment topics based on the aforementioned clusters.
8. An electronic device, characterized in that, include: At least one processor and memory; The memory stores computer-executed instructions; The at least one processor executes computer execution instructions stored in the memory, causing the electronic device to perform the method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, cause a computing device to implement the method as described in any one of claims 1 to 6.
10. A computer program, characterized in that, The computer program is used to implement the method as described in any one of claims 1 to 6.