A method and device for screening barrage text and an electronic device

By determining the target topic vector of the bullet screen text and calculating the matching degree, the problems of low efficiency and poor accuracy in bullet screen text filtering are solved, and efficient and accurate automated filtering is achieved.

CN117499747BActive Publication Date: 2026-11-06BEIJING QIYI CENTURY SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311372901.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-23
Publication Date
2026-11-06
Estimated Expiration
2043-10-23

AI Technical Summary

Technical Problem

In existing technologies, the filtering of bullet screen text is inefficient and suffers from missed detections and false detections, especially when multiple filtering sessions and manual intervention are required.

Method used

By acquiring the text of the bullet comments to be filtered, determining its target topic vector for the topic to be filtered, and calculating the matching degree based on the preset topic vector, if the preset conditions are met, it is determined as the target bullet comment text, and the matching degree is calculated using the preset topic model and cosine similarity.

Benefits of technology

It improves the efficiency and accuracy of bullet screen text filtering, reduces the possibility of missed or false detections, and achieves automated and efficient filtering.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117499747B_ABST
    Figure CN117499747B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a method and device for screening barrage text and electronic equipment, and relates to the technical field of data processing. The method comprises the following steps: obtaining a barrage text to be screened; determining a target theme vector of the barrage text to be screened for a theme to be screened; calculating a matching degree of the barrage text to be screened and the theme to be screened based on the target theme vector and a preset theme vector; and if the matching degree meets a preset matching condition, determining that the barrage text to be screened is a target barrage text meeting the theme to be screened. Compared with the prior art, the embodiment of the application can improve the efficiency and accuracy of text screening.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a method, apparatus and electronic device for filtering bullet screen text. Background Technology

[0002] With the rapid development of the internet, bullet comments have gradually become a new form of communication on social media and online video platforms. Bullet comments refer to the commentary-style subtitles that pop up on the screen when watching videos online or on video playback clients. These bullet comments allow users to interact and chat with each other. In some cases, it's necessary to filter bullet comments from the massive amount of data to select those related to specific text content. For example, if an operator is conducting an activity themed "Fun Facts about the Three Kingdoms" on a series of Three Kingdoms-themed films and television dramas, they need to select a batch of educational bullet comments related to the Three Kingdoms from the large number of comments and offer corresponding prizes to the senders.

[0003] In related technologies, bullet screen texts related to specific text content are filtered using preset keyword matching rules. These filtered bullet screen texts are then further filtered manually by operations personnel to determine which bullet screen texts are related to the specific text content. However, because this filtering method requires multiple rounds of filtering, the efficiency of text filtering is low, and manual filtering has a significant possibility of missed or incorrect detections. Summary of the Invention

[0004] The purpose of this application is to provide a method, apparatus, and electronic device for filtering bullet screen text, so as to improve the efficiency and accuracy of text filtering. The specific technical solution is as follows:

[0005] In a first aspect of this application, a method for filtering bullet screen text is provided, the method comprising:

[0006] Get the text of the bullet comments to be filtered;

[0007] Determine the target topic vector for the bullet screen text to be filtered in relation to the topic to be filtered; wherein, each element in the target topic vector corresponds to a subtopic of the topic to be filtered, and the element value of each element is used to characterize the degree of correlation between the subtopic corresponding to the element and the topic to be filtered for the bullet screen text to be filtered;

[0008] Based on the target topic vector and the preset topic vector, the matching degree between the bullet screen text to be filtered and the topic to be filtered is calculated; wherein, the preset topic vector is: a vector determined based on the descriptive text about the topic to be filtered, each element in the preset topic vector corresponds to a subtopic of the topic to be filtered, and the element value of each element is used to characterize the degree of association between the subtopic corresponding to the element and the topic to be filtered for the descriptive text;

[0009] If the matching degree meets the preset matching conditions, then the text to be filtered is determined to be the target text that meets the topic to be filtered.

[0010] Optionally, in one specific implementation, the method further includes:

[0011] Identify the user account that sent the target bullet screen text, and perform a preset reward operation on the user account.

[0012] Optionally, in one specific implementation, determining the target topic vector of the bullet screen text to be filtered for the topic to be filtered includes:

[0013] The text to be filtered is input into a preset topic model, and the output of the preset topic model is determined as the target topic vector of the text to be filtered for the topic to be filtered.

[0014] Optionally, in one specific implementation, calculating the matching degree between the bullet screen text to be filtered and the topic to be filtered based on the target topic vector and the preset topic vector includes:

[0015] Calculate the cosine similarity between the target topic vector and the preset topic vector, and determine the cosine similarity as the matching degree between the bullet screen text to be filtered and the topic to be filtered.

[0016] Optionally, in one specific implementation, obtaining the text of the bullet comments to be filtered includes:

[0017] Obtain the original bullet screen text and perform preset processing operations on the original bullet screen text to obtain the bullet screen text to be filtered;

[0018] The preset processing operations include at least one of the following: word segmentation, punctuation removal, stop word removal, part-of-speech tagging, and stemming.

[0019] In a second aspect provided in this application, a bullet screen text filtering device is also provided, the device comprising:

[0020] The text acquisition module is used to acquire the text of the bullet comments to be filtered.

[0021] The topic vector determination module is used to determine the target topic vector of the bullet screen text to be filtered for the topic to be filtered; wherein, each element in the target topic vector corresponds to a subtopic of the topic to be filtered, and the element value of each element is used to characterize the degree of correlation between the subtopic corresponding to the element and the topic to be filtered for the bullet screen text to be filtered;

[0022] The matching degree calculation module is used to calculate the matching degree between the bullet screen text to be filtered and the topic to be filtered based on the target topic vector and the preset topic vector; wherein, the preset topic vector is: a vector determined based on the descriptive text about the topic to be filtered, each element in the preset topic vector corresponds to a subtopic of the topic to be filtered, and the element value of each element is used to characterize the degree of association between the subtopic corresponding to the element and the topic to be filtered for the descriptive text;

[0023] The target bullet screen text determination module is used to determine the bullet screen text to be filtered as the target bullet screen text that satisfies the topic to be filtered if the matching degree meets the preset matching conditions.

[0024] Optionally, in one specific implementation, the apparatus further includes:

[0025] The reward operation module is used to determine the user account that sent the target bullet screen text and to perform a preset reward operation on the user account.

[0026] Optionally, in one specific implementation, the topic vector determination module is specifically used for:

[0027] The text to be filtered is input into a preset topic model, and the output of the preset topic model is determined as the target topic vector of the text to be filtered for the topic to be filtered.

[0028] Optionally, in one specific implementation, the matching degree calculation module is specifically used for:

[0029] Calculate the cosine similarity between the target topic vector and the preset topic vector, and determine the cosine similarity as the matching degree between the bullet screen text to be filtered and the topic to be filtered.

[0030] Optionally, in one specific implementation, the text acquisition module is specifically used for:

[0031] Obtain the original bullet screen text and perform preset processing operations on the original bullet screen text to obtain the bullet screen text to be filtered;

[0032] The preset processing operations include at least one of the following: word segmentation, punctuation removal, stop word removal, part-of-speech tagging, and stemming.

[0033] In a third aspect provided in the embodiments of this application, an electronic device is also provided, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; the memory is used to store computer programs; and the processor is used to implement any of the bullet screen text filtering methods provided in the first aspect when executing the program stored in the memory.

[0034] In another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored therein, and when the computer program is executed by a processor, it implements any of the bullet screen text filtering methods provided in the first aspect above.

[0035] In another aspect of the embodiments of this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the bullet screen text filtering methods provided in the first aspect above.

[0036] Applying the solution provided in this application, firstly, a preset topic vector is determined based on the descriptive text about the topic to be filtered. Each element in the preset topic vector corresponds to a subtopic of the topic to be filtered, and the element value of each element represents the degree of association between the subtopic corresponding to the element and the topic to be filtered for the sake of the descriptive text. Thus, after obtaining the bullet screen text to be filtered, the target topic vector of the obtained bullet screen text for the topic to be filtered can be determined. Each element in the target topic vector corresponds to a subtopic of the topic to be filtered, and the element value of each element represents the degree of association between the subtopic corresponding to the element and the topic to be filtered for the sake of the bullet screen text. Therefore, based on the target topic vector and the preset topic vector, the matching degree between the bullet screen text to be filtered and the topic to be filtered is calculated. Furthermore, when the calculated matching degree satisfies a preset matching condition, the bullet screen text to be filtered can be determined as the target bullet screen text that satisfies the topic to be filtered.

[0037] Based on this, the solution provided in this application's embodiments pre-determines a preset topic vector based on the descriptive text about the topic to be filtered. Thus, after determining the target topic vector for the bullet comment text to be filtered relative to the topic, the matching degree between the bullet comment text to be filtered and the topic to be filtered can be calculated based on the preset topic vector and the target topic vector. This determines whether the bullet comment text to be filtered is the target bullet comment text that satisfies the topic to be filtered. By calculating the matching degree between the bullet comment text to be filtered and the topic to be filtered, the possibility of missed or false detections in the text filtering process can be reduced, thereby improving the objectivity and accuracy of text filtering. Furthermore, automated text filtering can improve the efficiency of text filtering. Attached Figure Description

[0038] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.

[0039] Figure 1 A flowchart illustrating the first bullet screen text filtering method provided in this application embodiment;

[0040] Figure 2 A flowchart illustrating the second bullet screen text filtering method provided in this application embodiment;

[0041] Figure 3 A schematic diagram of the structure of a bullet screen text filtering device provided in an embodiment of this application;

[0042] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0043] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.

[0044] In related technologies, bullet screen texts related to specific text content are filtered using preset keyword matching rules. These filtered bullet screen texts are then further filtered manually by operations personnel to determine which bullet screen texts are related to the specific text content. However, because this filtering method requires multiple rounds of filtering, the efficiency of text filtering is low, and manual filtering has a significant possibility of missed or incorrect detections.

[0045] To address the aforementioned technical problems, this application provides a method for filtering bullet screen text.

[0046] This method is applicable to various application scenarios requiring text filtering. For example, filtering target comments that match the operational theme from bullet comments. Furthermore, this method can be applied to various electronic devices such as laptops, tablets, and desktop computers (hereinafter referred to as electronic devices). Therefore, this application does not limit the application scenarios or the executing entity of this method.

[0047] This application provides a method for filtering bullet screen text, which may include the following steps:

[0048] Get the text of the bullet comments to be filtered;

[0049] Determine the target topic vector for the bullet screen text to be filtered in relation to the topic to be filtered; wherein, each element in the target topic vector corresponds to a subtopic of the topic to be filtered, and the element value of each element is used to characterize the degree of correlation between the subtopic corresponding to the element and the topic to be filtered for the bullet screen text to be filtered;

[0050] Based on the target topic vector and the preset topic vector, the matching degree between the bullet screen text to be filtered and the topic to be filtered is calculated; wherein, the preset topic vector is: a vector determined based on the descriptive text about the topic to be filtered, each element in the preset topic vector corresponds to a subtopic of the topic to be filtered, and the element value of each element is used to characterize the degree of association between the subtopic corresponding to the element and the topic to be filtered for the descriptive text;

[0051] If the matching degree meets the preset matching conditions, then the text to be filtered is determined to be the target text that meets the topic to be filtered.

[0052] As can be seen from the above, applying the solution provided in this application, firstly, a preset topic vector is determined based on the descriptive text about the topic to be filtered. Each element in the preset topic vector corresponds to a subtopic of the topic to be filtered, and the element value of each element represents the degree of association between the subtopic corresponding to the element and the topic to be filtered for the descriptive text. Thus, after obtaining the bullet screen text to be filtered, the target topic vector of the obtained bullet screen text for the topic to be filtered can be determined. Each element in the target topic vector corresponds to a subtopic of the topic to be filtered, and the element value of each element represents the degree of association between the subtopic corresponding to the element and the topic to be filtered for the bullet screen text. Therefore, based on the target topic vector and the preset topic vector, the matching degree between the bullet screen text to be filtered and the topic to be filtered is calculated. Furthermore, when the calculated matching degree satisfies a preset matching condition, the bullet screen text to be filtered can be determined as the target bullet screen text that satisfies the topic to be filtered.

[0053] Based on this, the solution provided in this application's embodiments pre-determines a preset topic vector based on the descriptive text about the topic to be filtered. Thus, after determining the target topic vector for the bullet comment text to be filtered relative to the topic, the matching degree between the bullet comment text to be filtered and the topic to be filtered can be calculated based on the preset topic vector and the target topic vector. This determines whether the bullet comment text to be filtered is the target bullet comment text that satisfies the topic to be filtered. By calculating the matching degree between the bullet comment text to be filtered and the topic to be filtered, the possibility of missed or false detections in the text filtering process can be reduced, thereby improving the objectivity and accuracy of text filtering. Furthermore, automated text filtering can improve the efficiency of text filtering.

[0054] The following description, in conjunction with the accompanying drawings, details a method for filtering bullet screen text provided in an embodiment of this application.

[0055] Figure 1 This is a flowchart illustrating a bullet screen text filtering method provided in an embodiment of this application, as shown below. Figure 1 As shown, the method includes the following steps S101-S104:

[0056] S101: Get the text of the bullet comments to be filtered.

[0057] When performing text filtering, first, obtain the text of the bullet comments that need to be filtered.

[0058] For example, retrieve various novels from a novel database and filter them based on those related to history.

[0059] For example, in the bullet comment text of a certain video A, all bullet comment texts in video A can be obtained, and each bullet comment text related to the content presented in video A can be filtered.

[0060] Typically, before filtering bullet screen comments, it's necessary to pre-determine descriptive text for the topics to be filtered; in other words, the filtering direction needs to be determined. Therefore, after determining the descriptive text, the topics representing the filtering direction based on the descriptive text can be identified as the topics to be filtered.

[0061] Since a filtering direction can include multiple refined directions related to the descriptive text, after determining the topic to be filtered, multiple sub-topics under the topic to be filtered can be determined. Each sub-topic is used to represent a refined direction related to the descriptive text, that is, each sub-topic is related to the topic to be filtered.

[0062] For example, if the topic to be filtered is Women's Day, then the subtopics under this topic can include: International Women's Day, women's independence, Women's Day, economic independence, and ideological independence.

[0063] Therefore, each element can be used to represent a sub-topic of the topic to be screened, and the element value of each element can be used to represent the degree of correlation between the sub-topic and the topic to be screened, thereby obtaining a preset topic vector of the topic to be screened.

[0064] In this way, by vectorizing each subtopic of the topic to be filtered and digitizing the degree of correlation between each subtopic and the topic to be filtered, it is easier to filter the bullet screen text in the subsequent process.

[0065] Therefore, after obtaining the topic to be filtered and the preset topic vector of the topic to be filtered, it can be used as the execution basis of the bullet screen text filtering method provided in the embodiments of this application.

[0066] For example, with the rapid development of the internet, bullet comments have gradually become a new form of communication on social media and online video platforms. Over time, the text content included in bullet comments has expanded beyond simple evaluations of the video content to include evaluations of popular science knowledge related to the video's themes. Therefore, to incentivize bullet comment senders who provide such popular science text content—for example, with literary titles or access to special privileges—users can pre-set relevant topics to be filtered based on the video content. This allows for the selection of bullet comment text that matches these topics from a vast pool of text. In this way, when filtering bullet comments, the selection can be based on these specific topics.

[0067] In some cases, the original text of the bullet comments to be filtered may not be as standardized or adhere to strict word rules as texts such as documents or news articles. Therefore, the original bullet comment text may contain unnecessary descriptive text, such as modal particles and punctuation marks. To improve text filtering efficiency, the original bullet comment text can be pre-processed to obtain the final bullet comment text to be filtered.

[0068] Based on this, in one optional implementation, step S101 may include the following step 1011:

[0069] Step 1011: Obtain the original bullet screen text and perform preset processing operations on the original bullet screen text to obtain the bullet screen text to be filtered.

[0070] The preset processing operations include at least one of the following: word segmentation, punctuation removal, stop word removal, part-of-speech tagging, and stemming.

[0071] In this specific implementation, firstly, the original bullet screen text is obtained, and then the original bullet screen text is processed by pre-set operations to remove unnecessary descriptive text from the original bullet screen text, or to divide long texts with a large number of words, thereby obtaining the bullet screen text to be filtered.

[0072] Optionally, in some cases, the original bullet screen text may be a long text with a large number of characters. Therefore, in order to improve the efficiency of text filtering, the above-mentioned preset processing operations may include word segmentation. In this way, by segmenting the original bullet screen text, bullet screen text with fewer characters and shorter text content to be filtered can be obtained.

[0073] Optionally, after word segmentation, the segmented text needs to be stemmed to remove plural forms of some nouns or different tenses of some verbs. Therefore, the above-mentioned pre-defined processing operations may include stemming.

[0074] Optionally, since the bullet screen text filtering method provided in this application embodiment is based on text content, punctuation marks in the text will consume some computing resources during the text filtering process, thereby affecting the filtering efficiency. Therefore, the above-mentioned preset processing operation may include punctuation removal. In this way, after obtaining the original bullet screen text, all punctuation marks in the original bullet screen text can be removed.

[0075] Optionally, the text may contain unnecessary descriptive text, such as stop words like interjections. Based on this, the aforementioned preset processing operations can include stop word removal. Thus, after obtaining the original bullet screen text, all stop words in the original bullet screen text can be removed, thereby simplifying the text content of the original bullet screen text and obtaining the simplified bullet screen text to be filtered.

[0076] Stop words are words that are automatically filtered out before or after processing natural language data (or text) in information retrieval to save storage space and improve search efficiency. These stop words are manually entered and not automatically generated, forming a stop word list.

[0077] Therefore, optionally, a preset stop word list can be set in advance. In this way, after obtaining the original bullet screen text, the electronic device can remove stop words from the original bullet screen text based on the preset stop word list.

[0078] In some cases, the same word can have different meanings in different contexts. For example, the phrase "passed through" can be both a noun and a verb. For instance, in sentence 1, "Can you tell me what happened?", the phrase "passed through" is a noun, referring to the process of experiencing something; while in sentence 2, "Today I passed by your house.", the phrase "passed through" is a verb, meaning to pass by a certain place.

[0079] Therefore, optionally, to improve the accuracy of text filtering, the above-mentioned preset processing operations may include part-of-speech tagging. In this way, after obtaining the original bullet screen text, part-of-speech tagging can be performed on the text content included in the original bullet screen text, thereby facilitating the interpretation of the text content of the bullet screen text to be filtered during the subsequent text filtering process.

[0080] Optionally, the jieba library can be used to perform preset processing operations on the original bullet screen text to obtain the bullet screen text to be filtered.

[0081] S102: Determine the target topic vector for the bullet screen text to be filtered relative to the topic to be filtered.

[0082] In this context, each element in the target topic vector corresponds to a subtopic of the topic to be filtered, and the element value of each element is used to characterize the degree of correlation between the subtopic corresponding to the element and the topic to be filtered for the bullet screen text.

[0083] After obtaining the text of the bullet comments to be filtered, the target topic vector of the bullet comments to be filtered can be determined.

[0084] Because the text content of the bullet screen comments to be filtered varies, each bullet screen comment will have a broad filtering direction. Furthermore, within this filtering direction, there will be multiple more specific filtering directions related to the text content of the bullet screen comment to be filtered. Therefore, after obtaining the bullet screen comment to be filtered, multiple different sub-topics can be further identified within the aforementioned filtering direction. Each sub-topic represents a specific filtering direction related to that bullet screen comment to be filtered; that is, each sub-topic is associated with the aforementioned bullet screen comment to be filtered.

[0085] Therefore, each element can be used to represent a sub-topic of the above-mentioned bullet screen text to be filtered, and the element value of each element can be used to represent the degree of correlation between the sub-topic and the above-mentioned bullet screen text to be filtered, thereby obtaining the topic vector of the above-mentioned bullet screen text to be filtered.

[0086] For example, sentence 3 is "At the end of the Eastern Han Dynasty, various warlords led their troops to attack the traitor Dong Zhuo". The main theme of sentence 3 is the Three Kingdoms period. Under this theme, the sub-themes of sentence 3 can include: political intrigue, history, war, attack, novel, warlords and uprising.

[0087] In other words, the sub-themes mentioned above—political intrigue, history, war, conquest, novels, warlords, and uprisings—are related to the main theme: the Three Kingdoms period.

[0088] Furthermore, since it is necessary to determine whether the text to be filtered matches the topic to be filtered, each subtopic of the target topic vector of the determined text to be filtered is the same as each subtopic of the preset topic vector of the topic to be filtered.

[0089] In this way, after obtaining the various text subtopics related to the bullet screen text to be filtered, the text subtopics that are identical to the subtopics of the topic to be filtered can be identified as the respective subtopics of the bullet screen text for the topic to be filtered. Therefore, based on the degree of correlation between the identified subtopics and the topic to be filtered, the target topic vector of the bullet screen text for the topic to be filtered is determined.

[0090] In this context, each element in the target topic vector corresponds to a subtopic of the topic to be filtered, and the element value of each element is used to characterize the degree of correlation between the subtopic corresponding to the element and the topic to be filtered for the bullet screen text.

[0091] As exemplified, Table 1 shows a preset topic vector table for topics to be filtered, provided in an embodiment of this application. Table 2 shows a target topic vector for bullet screen text to be filtered, provided in an embodiment of this application.

[0092] Table 1

[0093]

[0094]

[0095] Table 2

[0096]

[0097] Based on Table 1 above, the sub-topics of the topics to be screened can be identified as: political intrigue, history, war, the Oath of the Peach Garden, novels, and warlords.

[0098] In other words, in the preset topic vector of the topics to be screened, the element "strategy" has a value of 0.4, indicating that the sub-topic "strategy" corresponding to the element "strategy" has a correlation of 0.4 with the topic to be screened, based on the descriptive text "Three Kingdoms trivia"; the element "history" has a value of 0.5, indicating that the sub-topic "history" corresponding to the element "history" has a correlation of 0.5 with the topic to be screened, based on the descriptive text "Three Kingdoms trivia"; and the element "war" has a value of 0.7, indicating that the sub-topic "war" corresponding to the element "war" has a correlation of 0.7 with the topic to be screened, based on the descriptive text "Three Kingdoms trivia". The correlation degree is 0.7; the element value corresponding to the element "Oath of the Peach Garden" is 0.9, indicating that the correlation degree between the sub-topic "Oath of the Peach Garden" and the topic to be screened is 0.9 for the text describing "Three Kingdoms trivia"; the element value corresponding to the element "novel" is 0.2, indicating that the correlation degree between the sub-topic "novel" and the topic to be screened is 0.2 for the text describing "Three Kingdoms trivia"; the element value corresponding to the element "warlord" is 0.1, indicating that the correlation degree between the sub-topic "warlord" and the topic to be screened is 0.1 for the text describing "Three Kingdoms trivia".

[0099] In the target topic vector of the text to be filtered for the topic to be filtered, the element "strategy" has a value of 0.5, indicating that the subtopic "strategy" corresponding to the descriptive text "Three Kingdoms trivia" has a correlation of 0.5 with the topic to be filtered; the element "history" has a value of 0.3, indicating that the subtopic "history" corresponding to the descriptive text "Three Kingdoms trivia" has a correlation of 0.3 with the topic to be filtered; and the element "war" has a value of 0.6, indicating that the subtopic "war" corresponding to the descriptive text "Three Kingdoms trivia" has a correlation with the topic to be filtered. The correlation degree is 0.6; the element value corresponding to the element "Oath of the Peach Garden" is 0.1, indicating that the correlation degree between the sub-topic "Oath of the Peach Garden" and the topic to be screened is 0.1 for the descriptive text "Trivia about the Three Kingdoms"; the element value corresponding to the element "Novel" is 0.3, indicating that the correlation degree between the sub-topic "Novel" and the topic to be screened is 0.3 for the descriptive text "Trivia about the Three Kingdoms"; the element value corresponding to the element "Hero" is 0.5, indicating that the correlation degree between the sub-topic "Hero" and the topic to be screened is 0.5 for the descriptive text "Trivia about the Three Kingdoms".

[0100] In other words, the subtopic of the topic to be filtered corresponding to each element of the preset topic vector of the topic to be filtered is the same as the subtopic of the topic to be filtered corresponding to each element of the target topic vector of the bullet screen text to be filtered, but the element value of each element of the preset topic vector is not necessarily the same as the element value of each element of the target topic vector.

[0101] Optionally, in one specific implementation, step S102 above, determining the target topic vector of the bullet screen text to be filtered relative to the topic to be filtered, may include the following step 1021:

[0102] Step 1021: Input the text to be filtered into the preset topic model, and determine the output of the preset topic model as the target topic vector of the text to be filtered for the topic to be filtered.

[0103] The preset topic model is trained based on multiple training samples. Each training sample includes: a topic to be screened and a target topic vector for the topic to be screened. Each sample element in the target topic vector corresponds to a sample subtopic of the topic to be screened, and the sample element value of each sample element is used to characterize the degree of correlation between the sample subtopic corresponding to the sample element and the topic to be screened for the text to be screened.

[0104] In this specific implementation, the obtained bullet screen text to be filtered can be input into a preset topic model. In this way, the preset topic model can determine the target topic vector of the bullet screen text to be filtered for the topic to be filtered based on the text content of the bullet screen text to be filtered.

[0105] Optionally, the above-mentioned preset topic model is the BTM (Biterm Topic Model) topic model.

[0106] The aforementioned preset topic model is trained based on multiple training samples. Each training sample includes: a topic to be screened, and a target topic vector for the topic to be screened.

[0107] Each sample element in the target sample topic vector above corresponds to a sample subtopic of the sample topic to be screened, and the sample element value of each sample element is used to characterize the degree of correlation between the sample subtopic corresponding to the sample element and the sample topic to be screened for the sample text to be screened.

[0108] After obtaining the sample topics to be filtered, you can set multiple sample subtopics of the sample topics to be filtered, as well as the correlation value between each sample subtopic and the sample topics to be filtered.

[0109] For example, if the topic of the sample to be screened is trivia about the Three Kingdoms, then multiple sample subtopics can be set for this topic: political intrigue, history, war, the Oath of the Peach Garden, novels, and warlords.

[0110] The correlation values ​​between the sub-topic "Power Strategies" and the aforementioned sample topics are set as follows: 0.4 for "Power Strategies"; 0.5 for "History"; 0.7 for "War"; 0.4 for "Oath of the Peach Garden"; 0.3 for "Novel"; and 0.1 for "Heroic Figures".

[0111] Thus, the target sample topic vectors corresponding to the above-mentioned sample topics to be screened can be determined to include: element: intrigue, with an element value of 0.4; element: history, with an element value of 0.5; element: war, with an element value of 0.7; element: the Oath of the Peach Garden, with an element value of 0.4; element: novel, with an element value of 0.3; element: warlord, with an element value of 0.1.

[0112] In this way, the aforementioned sample topics to be screened, along with the target sample topic vectors for those sample topics, can be used as training samples to train the initial model. Thus, after training with a large number of training samples, the aforementioned preset topic model can be obtained.

[0113] In the process of training the aforementioned preset topic model, the electronic device used for model training can pre-build an initial model, and then input the aforementioned training samples into the processing model for training, thereby obtaining the preset topic model.

[0114] During training, the initial model can learn the text features of each training sample. After learning from a large number of training samples, the initial model gradually establishes the correspondence between text features and topic vectors, thereby obtaining the preset topic model.

[0115] Training can be stopped once the initial model meets the preset conditions, and the preset topic model can be obtained.

[0116] Optionally, in order to improve the accuracy of topic recognition of the trained preset topic model, the model parameters of the preset topic model can be optimized and adjusted using a preset optimization algorithm during the training process.

[0117] The aforementioned preset optimization algorithm can be a backpropagation algorithm or an optimization algorithm. This application does not specifically limit the specific algorithms used.

[0118] Backpropagation (BP), short for "error backpropagation," is a common method used in conjunction with optimization methods (such as gradient descent) to train artificial neural networks. This method calculates the gradient of the loss function over all weights in the network. This gradient is then fed back to the optimization method to update the weights and minimize the loss function.

[0119] The so-called optimization method (also known as the operations research method) has been developed in recent decades. It mainly uses mathematical methods to study the optimization paths and schemes of various systems, providing decision-makers with a basis for scientific decision-making.

[0120] Optionally, the preset topic vectors of the topics to be screened can be determined using the aforementioned preset topic model. The specific process is the same as the specific implementation of step 1021 above, and will not be repeated here.

[0121] S103: Based on the target topic vector and the preset topic vector, calculate the matching degree between the bullet screen text to be filtered and the topic to be filtered; wherein, the preset topic vector is: a vector determined based on the descriptive text about the topic to be filtered, each element in the preset topic vector corresponds to a subtopic of the topic to be filtered, and the element value of each element is used to characterize the degree of association between the subtopic corresponding to the element and the topic to be filtered for the descriptive text.

[0122] S104: If the matching degree meets the preset matching conditions, then the text to be filtered is determined to be the target text that meets the topic to be filtered.

[0123] When calculating the matching degree between the bullet screen text to be filtered and the topic to be filtered, each sub-topic of the topic to be filtered and the degree of association between each sub-topic and the topic to be filtered can be determined in advance, thereby determining the preset topic vector of the topic to be filtered.

[0124] After obtaining the target topic vector, the matching degree between the above-mentioned bullet screen text and the topic to be selected can be calculated using the pre-determined preset topic vector. Thus, when the matching degree meets the preset matching conditions, the above-mentioned bullet screen text can be determined as the target bullet screen text that meets the topic to be selected.

[0125] In this way, by calculating the matching degree between the text to be filtered and the topic to be filtered, and judging whether the text to be filtered is the target text that meets the above-mentioned topic, the objectivity and accuracy of text filtering can be improved.

[0126] Furthermore, when faced with a massive amount of bullet screen text to be filtered, it is only necessary to use a preset topic model to determine the target topic vector for each bullet screen text to be filtered relative to the topic to be filtered. Then, by calculating the matching degree between the bullet screen text to be filtered and the topic to be filtered, it can be determined whether the bullet screen text to be filtered is the target bullet screen text that satisfies the above-mentioned topic to be filtered, which can further improve the efficiency of text filtering.

[0127] Optionally, in one specific implementation, step S103 above may include the following step 1031:

[0128] Step 1031: Calculate the cosine similarity between the target topic vector and the preset topic vector, and determine the cosine similarity as the matching degree between the bullet screen text to be filtered and the topic to be filtered.

[0129] In this specific implementation, after obtaining the target topic vector and the preset topic vector, the cosine similarity between the target topic vector and the preset topic vector can be calculated. Thus, the obtained cosine similarity is determined as the matching degree between the bullet screen text to be filtered and the topic to be filtered.

[0130] For example, the cosine similarity formula is used to calculate the cosine similarity between the target topic vector and the preset topic vector.

[0131] cosine_similarity(A,B)=(A·B) / ( || A || · || B || )

[0132] Where A represents the preset topic vector, and B represents the target topic vector. || A || The modulus representing the preset topic vector, || B || The modulus of the target topic vector is represented by cosine_similarity(A, B), which represents the cosine similarity between the target topic vector and the preset topic vector.

[0133] Accordingly, the aforementioned preset matching conditions include a preset matching degree. Thus, step S104 may include the following step 1041:

[0134] Step 1041: If the matching degree is not less than the preset matching degree, then the text to be filtered is determined to be the target text that meets the topic to be filtered.

[0135] In this specific implementation, the determination of whether the above-mentioned bullet screen text to be filtered is a target bullet screen text that meets the topic to be filtered is determined by comparing the numerical relationship between the determined matching degree and the preset matching degree.

[0136] If the determined matching degree is not less than the preset matching degree, it indicates that the text to be filtered has a high degree of similarity to the topic to be filtered. At this time, the text to be filtered can be determined as the target text that meets the topic to be filtered.

[0137] If the determined matching degree is less than the preset matching degree, it indicates that the similarity between the text to be filtered and the topic to be filtered is low. In this case, the text to be filtered cannot be determined as the target text that meets the topic to be filtered.

[0138] As time has progressed, the text content included in bullet comments has expanded beyond simple evaluations of the video content to include evaluations of scientific knowledge related to the video's themes. Therefore, to incentivize bullet commenters who send such text content containing scientific knowledge, rewards such as literary titles or access to special privileges could be offered.

[0139] Based on this, in one optional implementation, such as Figure 2 As shown in the embodiment of this application, a method for filtering bullet screen text may further include the following step S105:

[0140] S105: Determine the user account that sent the target bullet screen text and perform the preset reward operation for the user account.

[0141] In this specific implementation, after determining the target bullet screen text that meets the topic to be filtered, the user account that sent the target bullet screen text can be determined, and then a preset reward operation can be performed on the determined user account.

[0142] In some cases, video playback software developers can pre-set different reward points for user account login time and video viewing time using that user account in order to improve the user experience. In this way, as the user account's reward points increase, the user account level will also continuously improve.

[0143] Therefore, optionally, after determining the user account to which the target bullet screen text is sent, preset reward points can be distributed to that user account. Thus, after the user account's reward points are updated, if the updated reward points reach the point value corresponding to the next preset level of the user account's current level, the user account's level can be raised to the aforementioned next preset level.

[0144] Optionally, after determining the user account that sent the target bullet screen text, the user account's current level can be directly upgraded to the next preset level.

[0145] In some cases, to increase user interest in video playback software, after identifying the user account that sent the target bullet screen text, a preset physical reward can be given to the user of that account, such as a mascot doll of the video playback software.

[0146] Optionally, after determining the user account that sent the target bullet screen text, the user information associated with that user account can be obtained. Then, the user information and the preset physical reward can be sent to a designated staff member, so that the designated staff member, upon receiving the user information and the preset physical reward, can send the physical reward to the address information indicated by the user information.

[0147] Optionally, in order to protect the user information of the user account, after identifying the user account that sent the target bullet screen text, a preset reward notification message and permission information for obtaining the user information associated with the user account can be sent to that user account. Thus, after receiving the consent information from the user account, the user information associated with the user account can be obtained.

[0148] As can be seen from the above, applying the solution provided in this application, firstly, a preset topic vector is determined based on the descriptive text about the topic to be filtered. Each element in the preset topic vector corresponds to a subtopic of the topic to be filtered, and the element value of each element represents the degree of association between the subtopic corresponding to the element and the topic to be filtered for the descriptive text. Thus, after obtaining the bullet screen text to be filtered, the target topic vector of the obtained bullet screen text for the topic to be filtered can be determined. Each element in the target topic vector corresponds to a subtopic of the topic to be filtered, and the element value of each element represents the degree of association between the subtopic corresponding to the element and the topic to be filtered for the bullet screen text. Therefore, based on the target topic vector and the preset topic vector, the matching degree between the bullet screen text to be filtered and the topic to be filtered is calculated. Furthermore, when the calculated matching degree satisfies a preset matching condition, the bullet screen text to be filtered can be determined as the target bullet screen text that satisfies the topic to be filtered.

[0149] Based on this, the solution provided in this application's embodiments pre-determines a preset topic vector based on the descriptive text about the topic to be filtered. Thus, after determining the target topic vector for the bullet comment text to be filtered relative to the topic, the matching degree between the bullet comment text to be filtered and the topic to be filtered can be calculated based on the preset topic vector and the target topic vector. This determines whether the bullet comment text to be filtered is the target bullet comment text that satisfies the topic to be filtered. By calculating the matching degree between the bullet comment text to be filtered and the topic to be filtered, the possibility of missed or false detections in the text filtering process can be reduced, thereby improving the objectivity and accuracy of text filtering. Furthermore, automated text filtering can improve the efficiency of text filtering.

[0150] Corresponding to the bullet screen text filtering method provided in the above embodiments of this application, this application also provides a bullet screen text filtering device.

[0151] Figure 3 This is a schematic diagram of the structure of a bullet screen text filtering device provided in an embodiment of this application, as shown below. Figure 3 As shown, the device may include the following modules:

[0152] The text acquisition module 310 is used to acquire the text of the bullet comments to be filtered.

[0153] The topic vector determination module 320 is used to determine the target topic vector of the bullet screen text to be filtered for the topic to be filtered; wherein, each element in the target topic vector corresponds to a subtopic of the topic to be filtered, and the element value of each element is used to characterize the degree of correlation between the subtopic corresponding to the element and the topic to be filtered for the bullet screen text to be filtered;

[0154] The matching degree calculation module 330 is used to calculate the matching degree between the bullet screen text to be filtered and the topic to be filtered based on the target topic vector and the preset topic vector; wherein, the preset topic vector is: a vector determined based on the descriptive text about the topic to be filtered, each element in the preset topic vector corresponds to a subtopic of the topic to be filtered, and the element value of each element is used to characterize the degree of association between the subtopic corresponding to the element and the topic to be filtered for the descriptive text;

[0155] The target bullet screen text determination module 340 is used to determine the bullet screen text to be filtered as the target bullet screen text that satisfies the topic to be filtered if the matching degree meets the preset matching conditions.

[0156] As can be seen from the above, applying the solution provided in this application, firstly, a preset topic vector is determined based on the descriptive text about the topic to be filtered. Each element in the preset topic vector corresponds to a subtopic of the topic to be filtered, and the element value of each element represents the degree of association between the subtopic corresponding to the element and the topic to be filtered for the descriptive text. Thus, after obtaining the bullet screen text to be filtered, the target topic vector of the obtained bullet screen text for the topic to be filtered can be determined. Each element in the target topic vector corresponds to a subtopic of the topic to be filtered, and the element value of each element represents the degree of association between the subtopic corresponding to the element and the topic to be filtered for the bullet screen text. Therefore, based on the target topic vector and the preset topic vector, the matching degree between the bullet screen text to be filtered and the topic to be filtered is calculated. Furthermore, when the calculated matching degree satisfies a preset matching condition, the bullet screen text to be filtered can be determined as the target bullet screen text that satisfies the topic to be filtered.

[0157] Based on this, the solution provided in this application's embodiments pre-determines a preset topic vector based on the descriptive text about the topic to be filtered. Thus, after determining the target topic vector for the bullet comment text to be filtered relative to the topic, the matching degree between the bullet comment text to be filtered and the topic to be filtered can be calculated based on the preset topic vector and the target topic vector. This determines whether the bullet comment text to be filtered is the target bullet comment text that satisfies the topic to be filtered. By calculating the matching degree between the bullet comment text to be filtered and the topic to be filtered, the possibility of missed or false detections in the text filtering process can be reduced, thereby improving the objectivity and accuracy of text filtering. Furthermore, automated text filtering can improve the efficiency of text filtering.

[0158] Optionally, in one specific implementation, the apparatus further includes:

[0159] The reward operation module is used to determine the user account that sent the target bullet screen text and to perform a preset reward operation on the user account.

[0160] Optionally, in one specific implementation, the topic vector determination module 320 is specifically used for:

[0161] The text to be filtered is input into a preset topic model, and the output of the preset topic model is determined as the target topic vector of the text to be filtered for the topic to be filtered.

[0162] Optionally, in one specific implementation, the matching degree calculation module 330 is specifically used for:

[0163] Calculate the cosine similarity between the target topic vector and the preset topic vector, and determine the cosine similarity as the matching degree between the bullet screen text to be filtered and the topic to be filtered.

[0164] Optionally, in one specific implementation, the text acquisition module 310 is specifically used for:

[0165] Obtain the original bullet screen text and perform preset processing operations on the original bullet screen text to obtain the bullet screen text to be filtered;

[0166] The preset processing operations include at least one of the following: word segmentation, punctuation removal, stop word removal, part-of-speech tagging, and stemming.

[0167] Corresponding to the bullet screen text filtering method provided in the above embodiments of this application, this application also provides an electronic device, such as... Figure 4 As shown, it includes a processor 401, a communication interface 402, a memory 403, and a communication bus 404, wherein the processor 401, the communication interface 402, and the memory 403 communicate with each other through the communication bus 404.

[0168] Memory 403 is used to store computer programs;

[0169] When the processor 401 executes the program stored in the memory 403, it implements the steps of any of the bullet screen text filtering methods provided in the embodiments of this application.

[0170] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.

[0171] The communication interface is used for communication between the aforementioned terminal and other devices.

[0172] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0173] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0174] In another embodiment provided in this application, a computer-readable storage medium is also provided, wherein a computer program is stored therein, and when the computer program is executed by a processor, it implements the bullet screen text filtering method described in any of the above embodiments.

[0175] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the bullet screen text filtering methods described in the above embodiments.

[0176] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).

[0177] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0178] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device embodiments, electronic device embodiments, computer-readable storage medium embodiments, and computer program product embodiments are basically similar to the method embodiments, and therefore the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0179] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.

Claims

1. A method for filtering bullet screen text, characterized in that, The method includes: Get the text of the bullet comments to be filtered; Determine the target topic vector for the bullet screen text to be filtered in relation to the topic to be filtered; wherein, each element in the target topic vector corresponds to a subtopic of the topic to be filtered, and the element value of each element is used to characterize the degree of correlation between the subtopic corresponding to the element and the topic to be filtered for the bullet screen text to be filtered; Based on the target topic vector and the preset topic vector, the matching degree between the bullet screen text to be filtered and the topic to be filtered is calculated; wherein, the preset topic vector is: a vector determined based on the descriptive text about the topic to be filtered, each element in the preset topic vector corresponds to a subtopic of the topic to be filtered, and the element value of each element is used to characterize the degree of association between the subtopic corresponding to the element and the topic to be filtered for the descriptive text; the subtopic of the topic to be filtered corresponding to each element in the preset topic vector is the same as the subtopic of the topic to be filtered corresponding to each element in the target topic vector; If the matching degree meets the preset matching conditions, then the text to be filtered is determined to be the target text that meets the topic to be filtered.

2. The method according to claim 1, characterized in that, The method further includes: Identify the user account that sent the target bullet screen text, and perform a preset reward operation on the user account.

3. The method according to claim 1, characterized in that, Determining the target topic vector of the bullet screen text to be filtered for the topic to be filtered includes: The text to be filtered is input into a preset topic model, and the output of the preset topic model is determined as the target topic vector of the text to be filtered for the topic to be filtered.

4. The method according to claim 1, characterized in that, The step of calculating the matching degree between the bullet screen text to be filtered and the topic to be filtered based on the target topic vector and the preset topic vector includes: Calculate the cosine similarity between the target topic vector and the preset topic vector, and determine the cosine similarity as the matching degree between the bullet screen text to be filtered and the topic to be filtered.

5. The method according to claim 1, characterized in that, The process of obtaining the text of the bullet comments to be filtered includes: Obtain the original bullet screen text and perform preset processing operations on the original bullet screen text to obtain the bullet screen text to be filtered; The preset processing operations include at least one of the following: word segmentation, punctuation removal, stop word removal, part-of-speech tagging, and stemming.

6. A bullet screen text filtering device, characterized in that, The device includes: The text acquisition module is used to acquire the text of the bullet comments to be filtered. The topic vector determination module is used to determine the target topic vector of the bullet screen text to be filtered for the topic to be filtered; wherein, each element in the target topic vector corresponds to a subtopic of the topic to be filtered, and the element value of each element is used to characterize the degree of correlation between the subtopic corresponding to the element and the topic to be filtered for the bullet screen text to be filtered; The matching degree calculation module is used to calculate the matching degree between the bullet screen text to be filtered and the topic to be filtered based on the target topic vector and the preset topic vector; wherein, the preset topic vector is: a vector determined based on the descriptive text about the topic to be filtered, each element in the preset topic vector corresponds to a subtopic of the topic to be filtered, and the element value of each element is used to characterize the degree of association between the subtopic corresponding to the element and the topic to be filtered for the descriptive text; the subtopic of the topic to be filtered corresponding to each element in the preset topic vector is the same as the subtopic of the topic to be filtered corresponding to each element in the target topic vector; The target bullet screen text determination module is used to determine the bullet screen text to be filtered as the target bullet screen text that satisfies the topic to be filtered if the matching degree meets the preset matching conditions.

7. The apparatus according to claim 6, characterized in that, The device further includes: The reward operation module is used to determine the user account that sent the target bullet screen text and to perform a preset reward operation on the user account.

8. The apparatus according to claim 6, characterized in that, The topic vector determination module is specifically used for: The text to be filtered is input into a preset topic model, and the output of the preset topic model is determined as the target topic vector of the text to be filtered for the topic to be filtered.

9. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the steps of the method described in any one of claims 1-5.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method described in any one of claims 1-5.

Citation Information

Patent Citations

  • Barrage display method and device

    CN109819280A

  • Unsupervised learning analysis method and system for emergency information relevancy

    CN112163071A