Bullet screen data processing method, device, equipment and storage medium

By calculating the similarity of barrage data for clustering and generating training samples, the problem of unsmooth barrage data and poor diversity in the existing technology is solved, and a high-quality data enhancement effect is achieved.

CN112417895BActive Publication Date: 2024-09-06GUANGZHOU BOGUAN TELECOMM TECH LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011481327.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-15
Publication Date
2024-09-06
Estimated Expiration
2040-12-15

AI Technical Summary

Technical Problem

In the existing technology, the barrage data processing method adopts a random method, resulting in unsmooth and poor diversity of generated data, and is limited by the size of the candidate vocabulary.

Method used

Clustering is performed by calculating the similarity between training barrage data to obtain multiple training data clusters, and the first and second target training samples are generated based on the combination of data in the clusters, which are used to train the processing model and the discriminant model, thereby generating sentences Smooth and diverse similar barrage data.

Benefits of technology

The generated barrage data statements are smooth, the data diversity is improved, the asymmetry of the BLEU algorithm is eliminated, high-quality training samples and models are obtained, and the data enhancement effect is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112417895B
    Figure CN112417895B
Patent Text Reader

Abstract

The present application provides a method, apparatus, device and storage medium for processing barrage data, which calculates the similarity between a preset number of acquired training barrage data, performs clustering according to the similarity to obtain multiple training barrage data clusters, obtains a first target training sample and a second target training sample according to the multiple training barrage data clusters, respectively, trains a processing model using the first target training sample, and trains a discriminant model using the second target training sample to obtain a trained processing model and a trained discriminant model, and outputs similar barrage data with high diversity, smooth sentences and close semantics to the current barrage data based on the obtained trained processing model and the trained discriminant model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of natural language processing technology, and in particular to a bullet comment data processing method, device, equipment and storage medium. Background Art

[0002] In the field of Natural Language Processing (NLP), the corpus database or model training of service robots requires a large amount of sample data. The quality and quantity of sample data affect the quality of the model or the quality of the corpus database.

[0003] The cost of labeling sample data is high, and data processing methods are usually used to expand sample data. Taking barrage data as an example, in the prior art, data enhancement methods such as random word replacement, random word order change, random word insertion, and random deletion are usually used. Among them, random word replacement refers to randomly selecting words in the barrage data and replacing them with words with similar meanings in the candidate library. Random word order change refers to randomly selecting words in the barrage data for position change. Random word insertion refers to randomly selecting a position in the barrage data to insert a word in the candidate library. Random deletion refers to randomly selecting a word in the barrage data and deleting it.

[0004] However, since the existing technology adopts a random method, the barrage data sentences obtained after data enhancement are not smooth. In addition, the random insertion or random word replacement method is limited by the size of the alternative vocabulary, resulting in poor diversity of barrage data. Summary of the invention

[0005] The present application provides a method, device, equipment and storage medium for processing barrage data. The barrage data sentences generated by the scheme are fluent, and there is no need to use an alternative database, thereby improving the diversity of barrage data.

[0006] In a first aspect, the present application provides a method for processing bullet commentary data, comprising:

[0007] Calculate the similarity between the acquired preset number of training bullet comment data;

[0008] Clustering is performed based on similarity to obtain multiple training bullet comment data clusters;

[0009] Obtain a first target training sample and a second target training sample respectively according to a plurality of training bullet commentary data clusters;

[0010] The processing model is trained using the first target training sample, and the discriminant model is trained using the second target training sample to obtain a trained processing model and a trained discriminant model.

[0011] Optionally, calculating the similarity between the acquired preset number of training bullet comment data specifically includes:

[0012] Obtaining a first bilingual translation quality evaluation index and a second bilingual translation quality evaluation index between any two training bullet commentary data;

[0013] The similarity between any two training bullet commentary data is calculated based on the first bilingual translation quality evaluation index and the second bilingual translation quality evaluation index;

[0014] Among them, the first bilingual translation quality evaluation index is obtained when one of the training barrage data is used as a reference standard, and the second bilingual translation quality evaluation index is obtained when the other training barrage data is used as a reference standard.

[0015] Optionally, calculating the similarity between any two training bullet commentary data according to the first bilingual translation quality evaluation index and the second bilingual translation quality evaluation index specifically includes:

[0016] The similarity between the two training bullet comment data is calculated according to the first formula, wherein the first formula is specifically:

[0017] d=0.5[unigram_blue(a,b)+unigram_blue(b,a)]

[0018] Among them, d represents similarity, a and b both represent training bullet comment data, and unigram_blue() represents the unigram bilingual translation quality assessment indicator algorithm.

[0019] Optionally, the second target training sample includes a positive training sample and a negative training sample; obtaining the second target training sample according to a plurality of training bullet comment data clusters specifically includes:

[0020] A positive training sample is obtained by combining two training bullet-message data in the same training bullet-message data cluster;

[0021] Obtain negative training samples by combining two training bullet-message data in different training bullet-message data clusters;

[0022] The discriminant model is trained using the second target training sample, including:

[0023] The pre-trained discriminant model is trained using positive training samples and negative training samples to obtain a trained discriminant model.

[0024] Optionally, the first target training sample includes an input sample and an output sample, and obtaining the first target training sample according to the plurality of training bullet commentary data clusters specifically includes:

[0025] Obtain input samples and output samples for two training bullet-message data combinations in the same training bullet-message data cluster;

[0026] The processing model is trained using the first target training sample, including:

[0027] The pre-trained processing model is trained using input samples and output samples to obtain a trained processing model.

[0028] Optionally, the trained processing model is used to obtain multiple similar barrage data corresponding to the current barrage data; the trained discriminant model is used to calculate the evaluation value of the similar barrage data, and the evaluation value is used to determine the output barrage data from the multiple similar barrages.

[0029] Optionally, the evaluation value is used to obtain a sampling probability after normalization, and the sampling probability is used to sample multiple similar bullet comments to obtain output bullet comment data.

[0030] In a second aspect, the present application provides a bullet screen data enhancement device, comprising:

[0031] A calculation module, used to calculate the similarity between the acquired preset number of training bullet comment data;

[0032] An acquisition module is used to cluster according to similarity to obtain multiple training bullet comment data clusters;

[0033] The acquisition module is also used to obtain a first target training sample and a second target training sample respectively according to a plurality of training bullet screen data clusters;

[0034] The acquisition module is also used to train the processing model using the first target training sample, and to train the discriminant model using the second target training sample, so as to obtain the trained processing model and the trained discriminant model.

[0035] In a third aspect, the present application provides an electronic device, including:

[0036] Memory, used to store programs;

[0037] The processor is used to execute the program stored in the memory. When the program is executed, the processor is used to execute the barrage data processing method involved in the first aspect and the optional scheme.

[0038] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions;

[0039] When the computer execution instruction is executed by the processor, it is used to implement the barrage data processing method involved in the first aspect and the optional scheme.

[0040] In the barrage data processing method, device, equipment and storage medium provided in the embodiments of the present application, the training barrage data are clustered according to the similarity between any two training barrage data to obtain multiple training barrage data clusters, and then the first target training sample and the second target training sample are determined according to the training barrage data clusters, the processing model is trained using the first target training sample, and the discrimination model is trained using the second target training sample, and similar barrage data with high diversity, smooth sentences and close semantics to the current barrage data can be output according to the obtained trained processing model and the trained discrimination model. In addition, according to the first BLEU calculated with one of the barrage data as the reference standard and the second BLEU calculated with the other barrage data as the reference standard, the similarity between the two barrage data is calculated, and then clustering is performed according to the calculated similarity, which can eliminate the asymmetry of the BLEU algorithm, thereby improving the clustering effect, and obtaining high-quality first target training samples and second training samples. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 An application scenario diagram of the bullet screen data processing method provided in an embodiment of the present application;

[0042] Figure 2 A flowchart of a method for processing bullet screen data provided by an embodiment of the present application;

[0043] Figure 3 A schematic diagram of the structure of a processing model provided in another embodiment of the present application;

[0044] Figure 4 A schematic diagram of the structure of a discrimination model provided in another embodiment of the present application;

[0045] Figure 5 A schematic diagram of the structure of a bullet screen data processing device provided in another embodiment of the present application;

[0046] Figure 6 A schematic diagram of the structure of an electronic device provided in another embodiment of the present application. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0048] The present application provides a barrage data processing method, device, equipment and storage medium, aiming to solve the problem that the barrage data generated by the existing barrage data processing method is not smooth and has low diversity. The inventive concept of the present application is: to calculate the similarity between any two training barrage data, to cluster the training barrage data according to the similarity to obtain multiple training barrage data clusters, and then to obtain the first target training sample for training the processing model and the second target training sample for training the discriminant model according to the training barrage data clusters, and according to the obtained trained processing model and trained discriminant model, similar barrage data with high diversity, smooth sentences and similar semantics to the current barrage data can be output.

[0049] The bullet screen data processing method provided in this application can be applied to model training or to provide a corpus database for a customer service robot. Figure 1 As shown, the server 101 runs the bullet screen data processing method provided in the embodiment of the present application before responding to the request of the client 102, and performs data enhancement on the locally stored corpus. The client 102 receives a user request input by a user, which can be generated based on the user input voice data or a user input sentence, for example: the user voice inputs "good morning". The user request is transmitted to the server 101, and the server 101 parses the user request, retrieves the corresponding sentence from the corpus and returns it to the client. After the client receives the corresponding sentence, it plays the corresponding sentence, for example: the client receives the sentence "good morning" from the server and plays the sentence.

[0050] The barrage data processing method provided in the embodiment of the present application can also be applied to other usage scenarios that require enhanced processing of the barrage data, and is not limited here.

[0051] like Figure 2 As shown, an embodiment of the present application provides a method for processing bullet screen data, and the method for processing bullet screen data includes the following steps:

[0052] S201, calculating the similarity between the acquired preset number of training bullet comment data.

[0053] Among them, the training barrage data is obtained according to the video barrage data or the live broadcast room barrage data.

[0054] For the video bullet comment data, the bullet comment data of a certain video is deduplicated to ensure that there are no duplicate bullet comments in the bullet comment data. Then the bullet comment data of the video is used as a set of training bullet comment data, and the similarity between any two training bullet comment data in the set of training bullet comment data is calculated.

[0055] For the live broadcast room barrage data, the barrage data of each live broadcast room can be summarized by day, and then the daily barrage data of each live broadcast room can be deduplicated to ensure that there are no repeated barrages in the summary results. The barrage data of any day in any live broadcast room is selected as a set of training barrage data, and the similarity between any two training barrage data in the set of training barrage data is calculated.

[0056] S202: Clustering is performed according to similarity to obtain a plurality of training bullet comment data clusters.

[0057] Among them, for a group of training barrage data, after obtaining the similarity between any two barrage data in the group of training barrage data, clustering processing is performed according to the similarity between any two barrage data to obtain multiple training barrage data clusters.

[0058] Here we take the density-based spatial clustering algorithm (DBSCAN) as an example to illustrate the clustering process. The number of training bullet comments is 50, and we can calculate similarity, and then The similarities are input into the DBSCAN model, and the cluster radius is set to 0.25 and the minimum number of clusters is set to 3.

[0059] S203, respectively obtaining a first target training sample and a second target training sample according to a plurality of training bullet commentary data clusters.

[0060] The training bullet-screen data are selected from a plurality of training bullet-screen data clusters as first target training samples and second target training samples. The first target training samples are used to train the processing model, and the second target training samples are used to train the discrimination model.

[0061] S204: Use the first target training sample to train the processing model, and use the second target training sample to train the discrimination model, so as to obtain a trained processing model and a trained discrimination model.

[0062] The first target training sample is used to train the processing model to obtain the trained processing model, and the second target training sample is used to train the discriminant model to obtain the trained discriminant model.

[0063] Both the processing model and the discriminant model are models for processing natural language. The trained processing model is used to process the current barrage data and output multiple similar barrage data corresponding to the current barrage data. Similar barrage data refers to barrage data with the same semantics as the current barrage data.

[0064] The trained discriminant model is used to calculate the evaluation value of similar barrage data, and the evaluation value is used to determine the output barrage data from multiple similar barrages.

[0065] The trained processing model is used to process the current barrage data, and similar barrage data with high diversity and smooth sentences are output. The trained discriminant model is used to calculate the evaluation value of the similar barrage data, so as to select the output barrage data with similar semantics to the current barrage data from multiple similar barrages according to the evaluation value of the similar barrage data.

[0066] It should be noted that the execution entity in the above steps S201-S204 can be a device such as a server or a computer, or a processing system composed of a server and a computer, and each step can correspond to the same execution entity or to different execution entities respectively, which is not specifically limited here.

[0067] In the barrage data processing method provided in the embodiment of the present application, the training barrage data are clustered according to the similarity between any two training barrage data to obtain multiple training barrage data clusters, and then the first target training sample and the second target training sample are determined according to the training barrage data clusters, the first target training sample is used to train the processing model, and the second target training sample is used to train the discriminant model, and based on the trained processing model and the trained discriminant model, similar barrage data with high diversity, smooth sentences and close semantics to the current barrage data can be output.

[0068] Another embodiment of the present application provides a method for processing bullet screen data, the method comprising the following steps:

[0069] S301, calculating the similarity between the acquired preset number of training bullet comment data.

[0070] Among them, the Bilingual Evaluation Understudy (BLEU) is generally used in machine translation tasks to calculate the similarity between the translated sentence and the original sentence. The higher the BLEU value, the higher the similarity between the translated sentence and the original sentence, and the higher the translation quality. BLEU is used in this application to evaluate the similarity between two bullet comments.

[0071] BLEU is asymmetric. The first BLEU calculated by taking sentence A as the original sentence and sentence B as the translated sentence is different from the first BLEU calculated by taking sentence B as the original sentence and sentence A as the translated sentence. In the data enhancement process, there is no order, that is, sentence A can be paraphrased as sentence B and sentence B can be paraphrased as sentence A. When using BLEU to evaluate the similarity between two bullet comments, it needs to be symmetric.

[0072] Therefore, for a set of training barrage data, the first BLEU and the second BLEU between any two training barrage data are obtained. The first BLEU is obtained when one of the two training barrage data is used as a reference standard, and the second BLEU is obtained when the other of the two training barrage data is used as a reference standard. Based on the first BLEU and the second BLEU, the similarity between any two training barrage data is calculated.

[0073] Preferably, the similarity between any two training bullet screen data is calculated according to the following formula.

[0074] d=0.5[unigram_blue(a,b)+unigram_blue(b,a)]

[0075] Where a and b both represent training bullet-screen data, and unigram_blue() represents the unigram bilingual translation quality evaluation index algorithm. unigram_blue(a,b) means that the unigram bilingual translation quality evaluation index between bullet-screen data a and bullet-screen data b is calculated using the training bullet-screen data b as the reference standard. unigram_blue(b,a) means that the unigram bilingual translation quality evaluation index between bullet-screen data a and bullet-screen data b is calculated using the training bullet-screen data a as the reference standard.

[0076] S302: Clustering is performed according to similarity to obtain multiple training bullet comment data clusters.

[0077] This step has been described in detail in the above embodiment and will not be repeated here.

[0078] S303 , respectively obtaining a first target training sample and a second target training sample according to a plurality of training bullet commentary data clusters.

[0079] The first target training sample includes an input sample and an output sample, and the input sample and the output sample are selected from multiple training bullet chat data clusters. Specifically, the input sample and the output sample are obtained by combining two training bullet chat data in the same training bullet chat data cluster. That is, two training bullet chat data are selected from the same training bullet chat data cluster, one of which is used as an input sample and the other is used as an output sample.

[0080] The second target training samples include positive training samples and negative training samples, and the positive training samples and negative training samples are selected from multiple training bullet-mugmug data clusters. Specifically, a positive training sample is obtained by combining two training bullet-mugmug data in the same training bullet-mugmug data cluster, and a negative training sample is obtained by combining two training bullet-mugmug data in different training bullet-mugmug data clusters. The positive training samples and the negative training samples are used to train the discriminant model.

[0081] When combining the training bullet screen data, you can follow d a [SEP]d b The training bullet comment data is combined in this way, and [SEP] represents the separator.

[0082] S304: Use the first target training sample to train the processing model, and use the second target training sample to train the discriminant model, so as to obtain a trained processing model and a trained discriminant model.

[0083] The pre-trained discriminant model is trained using positive training samples and negative training samples to obtain a trained discriminant model. The pre-trained processing model is trained using input samples and output samples to obtain a trained processing model.

[0084] When using positive training samples and negative training samples to train the discriminant model, the positive training samples are marked as 1 and the negative training samples are marked as 0. The positive training samples are used as the input of the discriminant model, and the labeled values ​​of the positive training samples are used as the output of the discriminant model. The negative training samples are used as the input of the discriminant model, and the labeled values ​​of the negative training samples are used as the output of the discriminant model.

[0085] Before training the processing model, the processing model can be pre-trained using text data from the Internet. Similarly, before training the discriminant model, the discriminant model can be pre-trained using text data from the Internet.

[0086] Pre-training the discriminant model and then training the pre-trained discriminant model using positive training samples and negative training samples can make the discriminant model converge quickly. Pre-training the processing model and then training the pre-trained processing model using input samples and output samples can make the processing model converge quickly.

[0087] like Figure 3 As shown in the figure, the processing model includes a GPT-2 model, a linear layer, and a regression layer. The GPT-2 model is first pre-trained using massive text data from the Internet, and then the input samples and output samples are used to train the GPT-2 model.

[0088] When using input samples and output samples to train the GPT-2 model, the input samples and output samples are concatenated using a separator to obtain the input data of the GPT-2 model. a [SEP]d b[SEP] format is sent to the GPT-2 model for processing. The GPT-2 model processes the input data and outputs similar bullet comment data bit by bit. The linear layer calculates the cross entropy of each word in the similar bullet comment data output by the GPT-2 model, and calculates the loss value of the GPT-2 model based on the cross entropy of each word. The loss value is used to optimize the parameters in GPT-2. The regression layer is used when predicting the current bullet comment data.

[0089] like Figure 4 As shown in Figure 1, the discriminant model includes the BERT model, the linear layer, and the regression layer. The BERT model is first pre-trained using massive text data from the Internet, and then the BERT model is trained using positive training samples and negative training samples.

[0090] When using positive training samples and negative training samples to train the BERT model, the positive training samples or negative training samples are input into the BERT model, and the BERT model outputs the category data of the training samples. The linear layer calculates the cross entropy of the category data output by the BERT model, and calculates the loss value of the BERT model based on the cross entropy of the category data, and uses the loss value to optimize the parameters in BERT. The regression layer is used when calculating the evaluation value of similar barrage data.

[0091] In the barrage data processing method provided in the embodiment of the present application, a symmetrical BLEU calculation is used to obtain the similarity between two training barrage data, so that most of the words in the barrage data in each training barrage data cluster are the same, that is, the barrage similarity in each training barrage data cluster is ensured to be high, and thus high-quality first target training samples and second training samples can be obtained. The first target training samples are used to train the processing model, and the second target training samples are used to train the discriminant model. The trained processing model and the trained discriminant model obtained can output similar barrage data with high diversity, smooth sentences, and close semantics to the current barrage data.

[0092] Another embodiment of the present application provides a method for processing bullet screen data, the method comprising the following steps:

[0093] S401. Process the current bullet comment data according to the trained processing model to obtain multiple similar bullet comment data.

[0094] Among them, the current barrage data refers to the barrage data that needs to be enhanced.

[0095] If the current barrage data is used to train the model, the already labeled barrage data can be used as the current barrage data. For example, the barrage data can be labeled according to the type of human mood represented by the barrage data, and barrage data such as "sad", "sad" and "sad" can be marked as one category, and barrage data such as "happy", "happy" and "glad" can be marked as another category. The barrage data in any category can be selected for data enhancement to increase the amount of barrage data in that category, and then the enhanced barrage data of that category can be used to train the model.

[0096] When it is necessary to enhance the barrage data in the corpus database of the service robot, any barrage data in the corpus database can be used as the current barrage data.

[0097] The current barrage data is used as input data of the trained processing model, and similar barrage data of the current barrage data is obtained after being processed by the processing model.

[0098] The trained processing model includes a trained GPT-2 model, a linear layer, and a regression layer. When the trained processing model is used to process the current barrage data, the GPT-2 model processes the current barrage data and outputs similar barrage data bit by bit, the linear layer calculates the cross entropy of each word in the similar barrage data output by the GPT-2 model, and the regression layer normalizes the cross entropy of each word in the similar barrage data to obtain the joint probability value of the similar barrage data. According to the joint probability value of the similar barrage data, the similar barrage data of the current barrage data is determined from the similar barrage data generated by the GPT-2 model.

[0099] S402: Calculate the evaluation value of each similar bullet comment data according to the trained discriminant model.

[0100] The similar bullet-screen data and the current bullet-screen data are used as input data of the discriminant model, and after being processed by the discriminant model, an evaluation value of the similar bullet-screen data can be output. The evaluation value is used to evaluate the semantic similarity between the similar bullet-screen data and the current bullet-screen data.

[0101] The trained discriminant model includes a trained BERT model, a linear layer, and a regression layer. When using the trained discriminant model to calculate the evaluation value of similar barrage data, the BERT model processes the similar barrage data and the current barrage data to output the category data of the similar barrage data, the linear layer calculates the cross entropy of the category data output by the BERT model, and the regression layer calculates the evaluation value of the similar barrage data based on the cross entropy of the category data.

[0102] S403: Determine output barrage data from a plurality of similar barrages according to the evaluation value.

[0103] The output bullet-screen data may be obtained in the following manner: normalizing the evaluation value of each similar bullet-screen data to obtain a sampling probability, and sampling similar bullet-screen data according to the sampling probability of similar bullet-screen data to obtain the output bullet-screen data.

[0104] For example, a sampling set can be constructed based on the sampling probability. The sampling set includes all similar bullet chat data, and the number of each similar bullet chat data is determined based on the sampling probability. That is, the number of similar bullet chat data corresponding to a high sampling probability is large, and the number of similar bullet chat data corresponding to a low sampling probability is small. The constructed sampling set is randomly sampled and the bullet chat data is output. This ensures that the probability of similar bullet chat data with the evaluation value being used as the output bullet chat data is high.

[0105] In the barrage data processing method provided in the embodiment of the present application, the current barrage data is processed using a trained processing model to output similar barrage data with high diversity and smooth sentences, and the evaluation value of the similar barrage data is calculated using a trained discriminant model to select output barrage data with semantic similarity to the current barrage data from multiple similar barrages according to the evaluation value of the similar barrage data. In addition, the sampling probability of similar barrage data is obtained according to the evaluation value of the similar barrage data, and then the similar barrage data is sampled to obtain the output barrage data, so that the diversity of the output barrage data is better.

[0106] like Figure 5 As shown, another embodiment of the present application provides a bullet chat data enhancement device 500, the device 500 comprising:

[0107] A calculation module 501 is used to calculate the similarity between the acquired preset number of training bullet comment data;

[0108] An acquisition module 502 is used to perform clustering according to similarity to obtain a plurality of training bullet comment data clusters;

[0109] The acquisition module 502 is further used to respectively obtain a first target training sample and a second target training sample according to a plurality of training bullet comment data clusters;

[0110] The acquisition module 502 is further used to train the processing model using the first target training sample, and to train the discriminant model using the second target training sample, so as to obtain a trained processing model and a trained discriminant model.

[0111] Optionally, the calculation module 501 is specifically used for:

[0112] Obtaining a first bilingual translation quality evaluation index and a second bilingual translation quality evaluation index between any two training bullet commentary data;

[0113] The similarity between any two training bullet commentary data is calculated based on the first bilingual translation quality evaluation index and the second bilingual translation quality evaluation index;

[0114] Among them, the first bilingual translation quality evaluation index is obtained when one of the training barrage data is used as a reference standard, and the second bilingual translation quality evaluation index is obtained when the other training barrage data is used as a reference standard.

[0115] Optionally, the calculation module 501 is specifically used for:

[0116] The similarity between the two training bullet comment data is calculated according to the first formula, wherein the first formula is specifically:

[0117] d=0.5[unigram_blue(a,b)+unigram_blue(b,a)]

[0118] Among them, d represents similarity, a and b both represent training bullet comment data, and unigram_blue() represents the unigram bilingual translation quality assessment indicator algorithm.

[0119] Optionally, the second target training sample includes a positive training sample and a negative training sample;

[0120] The acquisition module 502 is specifically used for:

[0121] A positive training sample is obtained by combining two training bullet-message data in the same training bullet-message data cluster;

[0122] Obtain negative training samples by combining two training bullet-message data in different training bullet-message data clusters;

[0123] The acquisition module 502 is specifically used for:

[0124] The pre-trained discriminant model is trained using positive training samples and negative training samples to obtain a trained discriminant model.

[0125] Optionally, the first target training sample includes an input sample and an output sample;

[0126] The acquisition module 502 is specifically used for:

[0127] Obtain input samples and output samples for two training bullet-message data combinations in the same training bullet-message data cluster;

[0128] The acquisition module 502 is specifically used for:

[0129] The pre-trained processing model is trained using input samples and output samples to obtain a trained processing model.

[0130] Optionally, the trained processing model is used to obtain multiple similar barrage data corresponding to the current barrage data; the trained discriminant model is used to calculate the evaluation value of the similar barrage data, and the evaluation value is used to determine the output barrage data from the multiple similar barrages.

[0131] Optionally, the evaluation value is used to obtain a sampling probability after normalization, and the sampling probability is used to sample multiple similar bullet comments to obtain output bullet comment data.

[0132] like Figure 6 As shown, an electronic device 600 provided in another embodiment of the present application includes: a transmitter 601, a receiver 602, a memory 603 and a processor 604.

[0133] The transmitter 601 is used to send instructions and data;

[0134] Receiver 602, for receiving instructions and data;

[0135] Memory 603, used to store computer-executable instructions;

[0136] The processor 604 is used to execute the computer-executable instructions stored in the memory to implement the various steps performed by the bullet screen data processing method in the above embodiment. For details, please refer to the relevant description in the above embodiment of the bullet screen data processing method.

[0137] Optionally, the memory 603 can be independent or integrated with the processor 604. When the memory 603 is independently provided, the electronic device further includes a bus for connecting the memory 603 and the processor 604.

[0138] An embodiment of the present application also provides a computer-readable storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the barrage data processing method executed by the electronic device as described above is implemented.

[0139] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for processing barrage data, characterized in that: include: Calculate the similarity between the acquired preset number of training bullet comment data; Clustering is performed according to the similarity to obtain a plurality of training bullet comment data clusters; Obtain a first target training sample and a second target training sample respectively according to a plurality of training bullet commentary data clusters; Using the first target training sample to train the processing model, and using the second target training sample to train the discriminant model, so as to obtain a trained processing model and a trained discriminant model; Calculate the similarity between the acquired preset number of training bullet comment data, specifically including: Obtaining a first bilingual translation quality evaluation index and a second bilingual translation quality evaluation index between any two training bullet commentary data; Calculate the similarity between any two training bullet comment data according to the first bilingual translation quality evaluation index and the second bilingual translation quality evaluation index; The first bilingual translation quality evaluation index is obtained by taking one of the training bullet-screen data as a reference standard, and the second bilingual translation quality evaluation index is obtained by taking another training bullet-screen data as a reference standard; Calculating the similarity between any two training bullet commentary data according to the first bilingual translation quality evaluation index and the second bilingual translation quality evaluation index specifically includes: The similarity between the two training bullet comment data is calculated according to the first formula, wherein the first formula is specifically: d =0.5[ unigram _ blue ( a , b )+ unigram_blue ( b , a )] in, d Indicates similarity, a and b Both represent training bullet screen data. unigram _ blue () represents the unary bilingual translation quality assessment index algorithm; The trained processing model is used to obtain multiple similar barrage data corresponding to the current barrage data; the trained discriminant model is used to calculate the evaluation value of the similar barrage data, and the evaluation value is used to determine the output barrage data from the multiple similar barrages.

2. The method according to claim 1, characterized in that The second target training samples include positive training samples and negative training samples; Obtaining a second target training sample according to the plurality of training bullet screen data clusters specifically includes: A positive training sample is obtained by combining two training bullet-message data in the same training bullet-message data cluster; Obtain negative training samples by combining two training bullet-message data in different training bullet-message data clusters; The adopting the second target training sample to train the discriminant model comprises: The pre-trained discriminant model is trained using the positive training samples and the negative training samples to obtain the trained discriminant model.

3. The method according to claim 1, characterized in that The first target training sample includes an input sample and an output sample, and obtaining the first target training sample according to the multiple training bullet commentary data clusters specifically includes: Obtain input samples and output samples for two training bullet-message data combinations in the same training bullet-message data cluster; The adopting the first target training sample to train the processing model comprises: The pre-trained processing model is trained using the input samples and the output samples to obtain the trained processing model.

4. The method according to claim 1, characterized in that: The evaluation value is used to obtain a sampling probability after normalization processing, and the sampling probability is used to sample the multiple similar barrages to obtain the output barrage data.

5. A bullet comment data processing device, characterized in that: include: A calculation module, used to calculate the similarity between the acquired preset number of training bullet comment data; An acquisition module, used for clustering according to the similarity to obtain multiple training bullet comment data clusters; The acquisition module is also used to obtain a first target training sample and a second target training sample respectively according to a plurality of training bullet screen data clusters; The acquisition module is also used to train the processing model using the first target training sample, and to train the discriminant model using the second target training sample, so as to obtain the trained processing model and the trained discriminant model; The calculation module is specifically used to obtain a first bilingual translation quality evaluation index and a second bilingual translation quality evaluation index between any two training bullet commentary data; Calculate the similarity between any two training bullet comment data according to the first bilingual translation quality evaluation index and the second bilingual translation quality evaluation index; The first bilingual translation quality evaluation index is obtained by taking one of the training bullet-screen data as a reference standard, and the second bilingual translation quality evaluation index is obtained by taking another training bullet-screen data as a reference standard; The calculation module is specifically used to calculate the similarity between two training bullet commentary data according to the first formula, wherein the first formula is specifically: d =0.5[ unigram _ blue ( a , b )+ unigram_blue ( b , a )] in, d Indicates similarity, a and b Both represent training bullet screen data. unigram _ blue () represents the unary bilingual translation quality assessment index algorithm; The trained processing model is used to obtain multiple similar barrage data corresponding to the current barrage data; the trained discriminant model is used to calculate the evaluation value of the similar barrage data, and the evaluation value is used to determine the output barrage data from the multiple similar barrages.

6. An electronic device, characterized in that: include: Memory, used to store programs; A processor is used to execute the program stored in the memory. When the program is executed, the processor is used to execute the barrage data processing method as described in any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions; When the computer-executable instructions are executed by the processor, they are used to implement the barrage data processing method as described in any one of claims 1 to 4.