Methods, apparatus, devices and computer-readable media for classifying comments
By acquiring contextual information from the comment section, generating combined semantics, and calculating classification indices, the problem of accurately identifying and classifying uncivilized language in the comment section is solved, thereby improving the management of the comment section and the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANGHAI BILIBILI TECH CO LTD
- Filing Date
- 2023-09-25
- Publication Date
- 2026-07-17
AI Technical Summary
Existing technologies struggle to accurately identify and categorize uncivilized comments, such as those containing coded language, in comment sections, impacting the management order and user experience.
By acquiring the combined semantics of the target comment, its parent comment, and the root comment, a classification index is generated. The classification of the comment is determined by the similarity between the combined semantics and the reference semantics. Classification is performed in response to the total classification index exceeding a threshold.
It improves the accuracy of comment categorization, effectively identifies and handles uncivilized remarks, and maintains the management order and user experience of the comment section.
Smart Images

Figure CN117370555B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and more particularly to a method, apparatus, electronic device, and computer-readable medium for classifying and commenting. Background Technology
[0002] With the advent of the internet age, online interaction and communication have greatly enriched people's lives. For example, after reading articles or watching videos, or in online communities, people can express their opinions and post comments in relevant comment sections. This allows people to interact through comment sections, enabling content interaction such as information sharing and discussion of viewpoints. Therefore, how to provide a better interactive experience in comment sections is a matter of concern and urgent need. Summary of the Invention
[0003] This application provides a method, apparatus, electronic device, and computer-readable storage medium for classifying comments, which can determine the comment context by utilizing parent comments and root comments in the comment context, at least in the presence of a comment context, and classify comments based on the comment context, so as to more accurately classify comments.
[0004] One aspect of this application provides a method for classifying comments, comprising: acquiring a target comment and historical comments associated with the target comment, the historical comments including the parent comments and / or root comments of the target comment; if the historical comments are successfully acquired, generating a set of combined semantics for the target comment based on the combination of the target comment and the historical comments; generating a classification index corresponding to each combined semantic in the set of combined semantics, wherein the classification index is determined based on the similarity between the combined semantics and the reference semantics of the target classification; and in response to determining that the total classification index based on the sum of the various classification indices exceeds a first preset threshold, classifying the target comment and the historical comments into the target classification.
[0005] In another aspect, this application provides an apparatus for classifying comments, comprising: an acquisition module configured to acquire historical comments associated with a target comment, wherein the historical comments are parent comments and / or root comments of the target comment; a first generation module configured to, if the historical comments are successfully acquired, generate a set of combined semantics for the target comment based on a combination of the target comment and the historical comments; a second generation module configured to generate a classification index corresponding to each combined semantic in the set of combined semantics, wherein the classification index is determined based on the similarity between the combined semantics and a reference semantic of the target classification; and a first classification module configured to, in response to determining that the total classification index based on the sum of the individual classification indices exceeds a first preset threshold, classify the target comment and the historical comments into a target classification.
[0006] In another aspect of this application, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the above-described method of classifying and commenting.
[0007] Another aspect of this application provides a computer-readable storage medium having computer program instructions stored thereon, which can be executed by a processor to implement the above-described method of classifying and commenting.
[0008] The solution provided in this application involves obtaining a target comment and historical comments associated with the target comment, where historical comments include the target comment's parent comments and / or root comments. If historical comments are successfully obtained, a set of combined semantics for the target comment is generated based on the combination of the target comment and historical comments. A classification index is generated for each combined semantic indices, where the classification index is determined based on the similarity between the combined semantics and the reference semantics of the target classification. In response to the sum of the various classification indices indicating that the total classification index exceeds a first preset threshold, the target comment and historical comments are classified into the target classification. Thus, at least in the presence of a comment context, the parent and root comments in the comment context can be used to determine the comment context, and the comment can be classified based on the comment context to more accurately classify the comment. Attached Figure Description
[0009] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0010] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:
[0011] Figure 1 A schematic diagram illustrating the process of classifying reviews according to an embodiment of this application;
[0012] Figure 2 A schematic diagram illustrating the process of generating classification indices according to an embodiment of this application;
[0013] Figure 3 A schematic diagram of the structure of a device for classifying reviews provided in an embodiment of this application;
[0014] Figure 4 This is a schematic diagram of the structure of an electronic device suitable for implementing the solutions in the embodiments of this application.
[0015] The same or similar reference numerals in the accompanying drawings represent the same or similar parts. Detailed Implementation
[0016] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0017] In a typical configuration of this application, the terminal and the service network devices each include one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0018] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0019] Computer-readable media include permanent and non-permanent, removable and non-removable media, which can store information by any method or technology. Information can be computer program instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, read-only optical disc (CD-ROM), digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0020] As explained above, providing a better interactive experience in the comment section is a noteworthy and urgent need. In practice, some users may post uncivil or unfriendly remarks in the comment section, disrupting its management order and affecting the quality of content and user experience. For example, multiple users may interactively post uncivil or unfriendly remarks to criticize or mock others; this behavior can be termed "argumentative" behavior. The existence of such "argumentative" behavior negatively impacts the order of use in the comment section and affects the user experience of other users.
[0021] To address the aforementioned issues, some solutions classify comments based on their textual content and semantic information when and / or after a user posts a comment, determining whether it contains specific content. For example, comments containing specific content can be categorized as requiring management and review, or as needing to be blocked or removed. Correspondingly, appropriate measures can be taken based on the comment's classification. For instance, a comment might be classified into the first category because it contains specific content. Comments in the first category can then be optimized through methods such as blocking, refusing posting, and deleting / editing to achieve comment management. This helps maintain order and civility in the comment section.
[0022] However, in this approach, users or other users may rewrite comments by splitting sentences or using homophones or code words to interfere with detection, making it difficult to accurately categorize comments. This is especially true in scenarios where multiple users post comments and engage in interactive discussions, where some interactive language that falls under the category of code words makes it even more difficult to accurately categorize comments.
[0023] For example, in the case of "argumentation," unlike ordinary single-sentence Natural Language Processing (NLP) binary classification tasks, whether a comment incites conflict is usually strongly correlated with the topic and atmosphere of the discussion in the current comment section. For instance, when the comment content is "black hole," it seems like a normal comment. However, when combined with the preceding comment, "The amount of XX around here is YY tens of thousands," the word "black hole" will trigger a series of associations for the user, thus leading to "argumentation." This can bring some negative community experience to the user and is not conducive to the positive development of the community and comment section. However, it is very difficult to discover whether a comment has the intention of "argumentation" simply by looking at the word "black hole."
[0024] This application provides a method for classifying comments. The method acquires a target comment and historical comments associated with the target comment, the historical comments including the target comment's parent comments and / or root comments. If the historical comments are successfully acquired, a set of combined semantics is generated based on the combination of the target comment and the historical comments. A classification index is generated for each combined semantic indices, where the classification index is determined based on the similarity between the combined semantics and the reference semantics of the target classification. In response to the sum of the classification indices indicating that the total classification index exceeds a first preset threshold, the target comment and the historical comments are classified into the target classification. Therefore, at least in the presence of a comment context, the parent and root comments in the comment context can be used to determine the comment context, and the comments can be classified based on the comment context to achieve more accurate comment classification.
[0025] In practical scenarios, the execution entity of this method can be a user device, a device formed by integrating a user device and a network device through a network, or an application running on the aforementioned devices. User devices include, but are not limited to, various terminal devices such as computers, mobile phones, tablets, smartwatches, and wristbands. Network devices include, but are not limited to, network hosts, single network servers, multiple network server sets, or cloud computing-based computer sets, which can be used to implement some processing functions when setting an alarm clock. Here, the cloud consists of a large number of hosts or network servers based on cloud computing. Cloud computing is a type of distributed computing, consisting of a virtual computer composed of a group of loosely coupled computer sets.
[0026] The following will detail the process of the classification and commenting method provided in this application. Figure 1 The flowchart 100 of the method for classifying reviews provided in this application embodiment is illustrated. Flowchart 100 includes at least the following processing steps:
[0027] Step S101: Obtain the target comment and the historical comments associated with the target comment.
[0028] In embodiments of this application, the target comment is a comment that is expected to be evaluated, such as a comment already posted by a user in a comment section, or a comment submitted by a user that is expected to be posted. In some embodiments, a comment may include multiple levels. Sub-comments that continue to be posted for a comment can be subordinate comments of that comment. For example, the comment to which the currently posted comment refers can be determined by the "@" instruction. Thus, the specified comment can be called the parent comment of the currently posted comment (or, the comment that is directly referenced), and correspondingly, the currently posted comment is a sub-comment of the specified comment. For example, if comment C references comment B by using the @ instruction when it is posted, then comment B can be the parent comment of comment C, and comment C is a sub-comment of comment B. Further, if there is a multi-level referencing relationship, then the comment at the highest level in the referencing relationship can be called the root comment of other comments. For example, if comment C references comment B, and comment D references comment C, then in such a referencing relationship, comment B is at the highest level of the referencing relationship, and comment B can be called the root comment of comment C and comment D. Typically, for ease of reading, comment groups can be determined based on root comments to present a group of comments. For example, multiple display areas can be configured for the comment section, with each display area used to present a unique group of comments.
[0029] Furthermore, after identifying the target comment, historical comments associated with the target comment can be identified. Historical comments include the target comment's parent comments and / or root comments, that is, the parent comments and / or root comments of the target comment that have already been published. In some embodiments, if there is only one level of referencing relationship between comments (e.g., only comment C refers to comment B), the target comment's parent comments and root comments may point to the same comment.
[0030] In some embodiments, historical comments include comments that are referenced to the target comment in the comment section and / or within a preset range of comment floor numbers. Specifically, historical comments associated with the target comment can be determined based on the posting location of the target comment (e.g., the comment floor number of the target comment). In comment section A, the comment floor number of the target comment is 10. Other comments posted in response to floor 10 include, for example, comments that reference floor 10 to reply to it, comments in other floors referenced by floor 10, and comments in a certain range of floors 10 (e.g., floors 5-15), etc. In some embodiments, to facilitate user interaction, sub-comment sections can also be set up for the comment section. For example, a sub-comment section can be set up for floor 10 in the main comment section. Floor numbers can be reassigned in the sub-comment section using numbers such as floor 10.1, floor 10.2, etc. In this case, the relationship between comments can also be determined by the content in the sub-comment that indicates the floor number in the main comment section, thereby identifying historical comments associated with the target comment.
[0031] For example, to mark sub-comments of a comment, the style of the comment floor numbers (or numbers, sequences) can be as follows: For comments belonging to the root comment, they can be numbered based on a first logic (e.g., the first published root comment can be numbered 1, the first published root comment can be numbered 2). For comments under the root comment, they can be numbered based on a second logic. For example, for the first published root comment (i.e., comment number 1), the comments under it can be numbered sequentially based on the order of publication as 1.1, 1.2, and so on. Similarly, comments at the next lower level can be numbered sequentially based on reference relationships and publication order as 1.1.1, 1.1.2, and so on. Thus, the relationships between comments can be represented by numbers. For example, the root comment of comment number 1.1.1 is comment number 1, and its parent comment is comment number 1.1.
[0032] In some embodiments, relationships between comments can also be determined based on their posting location in a similar manner. For example, if the target comment is found to be posted in a sub-comment section of comment B, then comment B can be determined to be at least one of the root comment and parent comment of the target comment. Further, it can be determined whether the target comment's posting location is a sub-comment section of another comment (e.g., comment C) within the sub-comment section of comment B. If so, then comment B is determined to be only the root comment of the target comment, while comment C is the parent comment of the target comment. Thus, relationships between comments can be determined definitively based on their posting location.
[0033] It should be understood that when the target comment is in a pending state, the available or desired location for publishing the target comment can be used as the publishing location to obtain historical comments in a similar way, which will not be repeated here.
[0034] In some embodiments, the triggering method for step S101 can be, for example, upon receiving a retrieval instruction, i.e., instructing the retrieval of the target comment and the historical comments associated with the target comment. In some embodiments, the triggering method can also be, for example, a query instruction, such as instructing a query to find whether there are historical comments that meet the requirements based on the target comment. Accordingly, if there are historical comments that meet the requirements, the historical comments are retrieved. If not, a feedback message can be used to indicate, for example, that the retrieval failed and no historical comments were retrieved.
[0035] For ease of understanding, please refer to the example provided. Figure 2 . Figure 2 The flowchart 200 for generating classification indices provided in an embodiment of this application is illustrated. Figure 2 In this context, the target comment could be comment 213. Based on its citation relationship (e.g., @commentC), it can be determined that comment 212 is the parent comment of comment 212. Furthermore, based on the citation relationship of comment 212, it can be determined that comment B is the root comment of comment D.
[0036] Step S102: If historical comments are successfully retrieved, a set of combined semantics for the target comment is generated based on the combination of the target comment and historical comments.
[0037] In the embodiments of this application, upon successfully obtaining historical comments, the target comment and historical comments can be combined, and then the text content of the target comment and the text content of the historical comments in the combination can be extracted respectively. Further, the two extracted text contents are combined to obtain the combined text content. Typically, the text content of the historical comments can be placed before the text content of the target comment to form a combination that better conforms to the citation relationship and contextual logic. Further, semantic recognition is performed on the combined text content to generate combined semantics for the target comment. Similarly, if multiple historical comments exist, corresponding combined semantics can be generated based on the combination of each historical comment with the target comment. In this case, a set of combined semantics can be obtained based on the obtained combined semantics.
[0038] In some embodiments, the combination of target comments and historical comments is constructed based on a semantic graph structure. The nodes in the semantic graph structure include a first node corresponding to the target comment and a second node corresponding to the historical comment, and edges in the semantic graph structure are used to connect the first node and the second node. Specifically, to better analyze comments based on the relationships between them, combinations of target comments and historical comments can also be constructed based on a semantic graph structure. The nodes in the semantic graph can be target comments and historical comments (for ease of description, the node associated with the target comment can be called the first node, and the node associated with the historical comment can be called the second node). Furthermore, the combinations can be described based on the connections between the first node and the second node (or, the edges in the semantic graph structure). In some scenarios, such a semantic graph structure can also be called a graph neural network, thereby enabling comments under the same post to be modeled as a graph structure for easier analysis.
[0039] For example, you can continue to refer to Figure 2 A semantic graph 220 can be constructed, in which node 223 can indicate the target comment (e.g., comment 213). Based on the semantic graph 220, the nodes corresponding to the historical comments of node 223 can be determined as nodes 221 and 222.
[0040] In some embodiments, text content can also be processed based on a normalization method, so that the processing result is used as combined semantics.
[0041] Step S103: Generate classification indices corresponding to each combination of semantics in a set of combined semantics.
[0042] In embodiments of this application, for each combined semantic unit in a set of combined semantic units, a classification index corresponding to each combined semantic unit is determined based on the similarity between each combined semantic unit and a reference semantic unit. This allows for a quantitative evaluation of whether a semantic unit (or, in other words, the comment corresponding to the semantic unit) can be categorized into a specific category using the classification index. In some embodiments, at least one comment category can be preset, and after determining the comment category, a corresponding reference semantic unit is set based on the category. For example, for category A, a corresponding reference semantic unit A-1 can be configured. Thus, if the similarity between the determined semantic unit and the reference semantic unit meets the requirements (e.g., the similarity reaches a credible standard), the combined comment unit corresponding to the combined semantic unit can be categorized into the corresponding category. For example, for categories requiring manual review and management, or for blocking and deletion, the reference semantic unit can be pre-determined to be, for example, a semantic unit belonging to personal attacks, unfriendly remarks, etc. For example, a classification index can be generated based on the similarity between the textual representation of the combined semantic unit and the textual representation of the reference semantic unit. In some embodiments, to facilitate the determination of the aforementioned similarity value, the combined semantic unit and the reference semantic unit can be vectorized to facilitate the determination of the similarity using vector comparison (e.g., cosine similarity). It should be understood that there can be multiple reference semantics to facilitate modeling for various scenarios within the same category, leading to more accurate identification and classification. For ease of understanding, the presence of "argumentative" content in comments can be used as an example of a target category. It should be understood that this is merely an illustrative example for ease of understanding and is not intended to be limiting. In practice, specific categories and target categories can be determined based on scenarios such as whether comments discuss the same target topic or a specific topic.
[0043] In some embodiments, the combined semantics in a set of combined semantics include: semantic vectors obtained by processing a semantic structure graph; and generating a corresponding classification index for a semantic combination, including: generating a vector similarity between the semantic vector and a reference vector of a reference semantic; and using the vector similarity as the classification index corresponding to the semantic combination. Specifically, when using a semantic graph structure to store target comments, historical comments, and their relationship, the semantic structure graph can be processed to obtain semantic vectors. In some embodiments, a graph convolution network (GCN) can be used to model the vector representation of the comments. Furthermore, the reference semantics can be processed in a similar manner to obtain corresponding reference vectors. Thus, the vector similarity between the semantic vector and the reference vector of the reference semantic can be used as the classification index corresponding to the semantic combination, improving the computational quality of the classification index.
[0044] In some embodiments, the similarity score can be directly used as the classification index score. For example, if the similarity is 50%, the classification index can be set to 50 points. In some embodiments, generating the classification index corresponding to the combined semantics includes: determining the numerical range in which the similarity between the combined semantics and the reference semantics of the target classification falls; and determining the classification corresponding to the combined semantics based on the preset index value associated with the numerical range. Specifically, the classification index can also be determined based on the range in which the similarity score falls by presetting multiple numerical ranges and configuring the corresponding classification index values for the associated numerical ranges. For example, if the similarity falls within the range of [0.4, 0.5], the 50 points associated with the range of [0.4, 0.5] can be used as the classification index. Thus, by using the method of setting preset index values with associated numerical ranges, the method of setting the classification index value can be adjusted to improve computational efficiency.
[0045] For example, you can continue to refer to Figure 2 Combinatorial semantics 231 can be generated based on the combination of nodes 221 and 223, and combinational semantics 232 can be generated based on the combination of nodes 222 and 223. Furthermore, a classification index 251 is generated based on the comparison between combinational semantics 231 and reference semantics 240, and a classification index 252 is generated based on the comparison between combinational semantics 232 and reference semantics 240.
[0046] Step S104: In response to the determination that the total classification index exceeds a first preset threshold based on the sum of the various classification indices, the target comment and historical comments are classified into the target category.
[0047] In embodiments of this application, after determining the classification index corresponding to each combined semantic in a set of combined semantics, the total classification index can be determined based on the sum of these classification indices. If the total classification index exceeds a first preset threshold, the target comment and historical comments can be classified into the target category. In some embodiments, when generating the total classification index, all classification indices can be added together at once to obtain the total classification index. In some embodiments, a method such as continuous addition can also be used to reduce the use of computing resources. For example, based on the continuous addition of each classification index, if the value obtained based on the currently added classification index exceeds the first preset threshold, then it can be determined that the total classification index exceeds the first preset threshold. In some embodiments, the actual value of the first preset threshold can be comprehensively determined based on factors such as type, classification accuracy, and the total number of target and historical comments. For example, for type A, the value of its corresponding first preset threshold may correspond to the value of the first preset threshold corresponding to type B. In a specific scenario, this can be understood as the classification threshold corresponding to type A being lower than that of type B. For example, when the total number of target comments and historical comments is a first number, the corresponding first preset threshold value may be higher than the first preset threshold value when the total number of target comments and historical comments is a second number (the second number is higher than the first number). This allows for dynamic configuration of the first preset threshold based on scenario requirements. In some embodiments, during the determination of the total classification index, the corresponding reference weight can also be determined based on the relationship between historical comments and target comments to better reflect the actual situation and improve classification accuracy. For example, historical comments whose post numbers are close to the target comment's post number may have a higher weight than historical comments whose post numbers are far from the target comment's post number. For example, in the case of a target comment combined with multiple historical comments, the higher the number of historical comments included in the combination, the higher the corresponding classification index weight may be.
[0048] In some embodiments, the response can also occur when the classification index includes a target classification index, classifying the target comment and the historical comments associated with the target classification index (which may be referred to as first historical comments for convenience) into the target category. This allows for classification by monitoring individual classification indices when a highly credible combination of semantics exists, or a combination of the target comment and the first historical comment. Specifically, if the classification index includes a target classification index exceeding a second preset threshold, i.e., a set of combined semantics contains a combination of semantics with an associated classification index higher than the second preset threshold, then the target comment and historical comments corresponding to the target classification index can be considered (or, with high confidence, considered) to meet the similarity requirement with the reference semantics; that is, the combined semantics can be considered as the reference semantics or a variation of the reference semantics. Thus, classification can be implemented for each specific comment combination to achieve simultaneous classification and labeling of the whole (multiple comment combinations) and the part (single comment combination).
[0049] In some embodiments, in response to the requirement that the number of target combined semantics in a set of combined semantics meets a preset quantity threshold, wherein the classification index corresponding to the target combined semantic is between a second preset threshold and a third preset threshold, and the value indicated by the third preset threshold is lower than the second preset threshold, the target comment and the second historical comment associated with the target combined semantic are classified into the target category. Specifically, the third preset threshold can also be configured in association with the second preset threshold. It should be understood that the value indicated by the third preset threshold should be lower than the second preset threshold. Further, in a set of combined semantics, the number of target combined semantics whose corresponding classification index is between a first preset threshold and a second preset threshold (i.e., the classification index meets the second preset threshold but does not reach the first preset threshold) can be determined. If this number exceeds the preset quantity threshold, the target comment and the historical comment associated with the target combined semantic (for ease of description, such historical comment can be described as the second historical comment) are classified into the target category. This avoids situations where users try to evade detection by using vague (or words that cannot be accurately recognized or understood by the system) words (e.g., self-created words) and then continue to "compete" (e.g., using vague words to increase the difficulty of being identified as a reference semantic), thus improving the accuracy of recognition and classification.
[0050] In some embodiments, after the target comments and historical comments are categorized, associated information can also be provided. This information facilitates confirmation and indicates the categorization results, and enables the final determination of comment categories. For example, when categorizing a comment combination as belonging to a category with "opposition," multiple comments belonging to the "opposition" category can be simultaneously marked. This facilitates human understanding and verification, for example, in cases where subsequent manual review is required.
[0051] In some embodiments, a response can also be initiated after comments are categorized to execute processing strategies based on the categorization results. For example, for comment groups categorized as online arguments, actions such as deleting comments or notifying relevant users can be taken to maintain the comment section environment. For instance, in response to a target comment and historical comments (referred to as third historical comments for convenience) being categorized into the target category, a first user who provided the target comment and a second user who provided the third historical comment can be identified. Furthermore, alert messages can be sent to the first and second users (e.g., informing them that their comments may not meet posting requirements, requesting rectification or deletion, and indicating potential penalties, etc.) to warn and urge the relevant users. Thus, after completing the categorization of comments, relevant users are automatically notified and alerted to further "purify" the comment section and maintain its order.
[0052] In addition, in some embodiments, the target comment may be preprocessed to determine whether it can be independently classified. For example, after obtaining the target comment, a comparison between the semantics of the target comment and the reference semantics is used to determine whether the target comment can be independently classified into the target category. For example, after generating an independent classification index for the target comment by comparing it with the reference semantics, if the independent classification index exceeds a fourth preset threshold, the target comment can be classified into the target category. It should be understood that the independent classification of the target comment can be performed independently of or simultaneously with the above-described process of classification based on a combination of the target comment and historical comments. For example, if the acquisition of historical comments fails, an independent classification index for the target comment can be generated, and in response to the independent classification index exceeding the fourth preset threshold, the target comment can be classified into the target category.
[0053] Alternatively, the process of classifying based on a combination of target comments and historical comments can be performed simultaneously. For example, if a target comment is not determined to belong to the target category based on a combination of target comments and historical comments, a similar confirmation can be made regarding whether the target comment can be independently classified into the target category; this will not be repeated here.
[0054] Subsequently, the method for classifying comments provided in this application obtains a target comment and historical comments associated with the target comment, the historical comments including the target comment's parent comments and / or root comments; if the historical comments are successfully obtained, a set of combined semantics for the target comment is generated based on the combination of the target comment and the historical comments; a classification index is generated for each combined semantic in the set of combined semantics, wherein the classification index is determined based on the similarity between the combined semantics and the reference semantics of the target classification; and in response to the determination that the total classification index based on the sum of the various classification indices exceeds a first preset threshold, the target comment and the historical comments are classified into the target classification. Thus, at least in the presence of a comment context, the parent comments and root comments in the comment context can be used to determine the comment context, and the comments can be classified based on the comment context to more accurately classify the comments.
[0055] This application also provides an apparatus for categorizing reviews, the structure of which is as follows: Figure 3 The apparatus 300 shown includes: an acquisition module 310 configured to acquire historical comments associated with a target comment, wherein the historical comments are the parent comments and / or root comments of the target comment; a first generation module 320 configured to, if the historical comments are successfully acquired, generate a set of combined semantics for the target comment based on the combination of the target comment and the historical comments; a second generation module 330 configured to generate a classification index corresponding to each combined semantic in the set of combined semantics, wherein the classification index is determined based on the similarity between the combined semantics and the reference semantics of the target classification; and a first classification module 340 configured to, in response to determining that the total classification index based on the sum of the various classification indices exceeds a first preset threshold, classify the target comment and the historical comments into the target classification.
[0056] In some embodiments, generating a classification index corresponding to the combined semantics includes: determining the numerical range into which the similarity between the combined semantics and the reference semantics of the target classification falls; and determining the classification index corresponding to the combined semantics based on a preset index value associated with the numerical range.
[0057] In some embodiments, the apparatus 300 further includes a second classification module configured to classify a target review and a first historical review associated with the target classification index into a target category in response to the inclusion of a target classification index in the classification index, wherein the target classification index exceeds a second preset threshold.
[0058] In some embodiments, the apparatus 300 further includes: a third classification module configured to respond to a requirement that the number of target combined semantics present in a set of combined semantics meets a preset quantity threshold, wherein the classification index corresponding to the target combined semantics is between a second preset threshold and a third preset threshold, and the value indicated by the third preset threshold is lower than the second preset threshold; classifying the target comments and the second historical comments associated with the target combined semantics into a target category.
[0059] In some embodiments, historical comments include comments that are related to the target comment in the comment section in terms of comment post number and / or comments within a preset range of comment post numbers.
[0060] In some embodiments, the combination of target comments and historical comments is constructed based on a semantic graph structure. The nodes in the semantic graph structure include a first node corresponding to the target comment and a second node corresponding to the historical comment. The edges in the semantic graph structure are used to connect the first node and the second node.
[0061] In some embodiments, the combined semantics in a set of combined semantics include: a semantic vector obtained by processing a semantic structure graph; and generating a corresponding classification index for a semantic combination, including: generating a vector similarity between the semantic vector and a reference vector of a reference semantic; and using the vector similarity as the classification index corresponding to the semantic combination.
[0062] In some embodiments, the apparatus 300 further includes: a sending module configured to, in response to the target comment and the third historical comment being classified into the target category; determine a first user who provided the target comment and a second user who provided the third historical comment; and send alert information to the first user and the second user.
[0063] In some embodiments, the apparatus 300 further includes: a fourth classification module configured to generate an independent classification index for the target comment if historical comment retrieval fails, wherein the independent classification index is determined based on the semantics of the target comment and its similarity to reference semantics; and to classify the target comment into the target category in response to the independent classification index exceeding a fourth preset threshold.
[0064] Furthermore, based on the same inventive concept, this application also provides an electronic device. The method corresponding to this electronic device can be the classification and commenting method in the foregoing embodiments, and its problem-solving principle is similar to that method. The electronic device provided in this application includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the methods and / or technical solutions of the foregoing embodiments of this application.
[0065] Electronic devices can be user devices, or devices composed of user devices and network devices integrated through a network, or applications running on the aforementioned devices. User devices include, but are not limited to, various terminal devices such as computers, mobile phones, tablets, smartwatches, and wristbands. Network devices include, but are not limited to, network hosts, single network servers, multiple network server sets, or cloud computing-based computer sets, and can be used to implement some processing functions when setting an alarm clock. Here, the cloud consists of a large number of hosts or network servers based on cloud computing. Cloud computing is a type of distributed computing, consisting of a virtual computer composed of a group of loosely coupled computer sets.
[0066] Figure 4 The diagram illustrates the structure of an apparatus 400 suitable for implementing the methods and / or technical solutions in the embodiments of this application. The apparatus 400 includes a central processing unit (CPU) 401, which can perform various appropriate actions and processes based on a program stored in a read-only memory (ROM) 402 or a program loaded from a storage portion 408 into a random access memory (RAM) 403. The RAM 403 also stores various programs and data required for system operation. The CPU 401, ROM 402, and RAM 403 are interconnected via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0067] The following components are connected to I / O interface 405: an input section 406 including a keyboard, mouse, touchscreen, microphone, infrared sensor, etc.; an output section 407 including a cathode ray tube (CRT), liquid crystal display (LCD), LED display, OLED display, etc., and speakers, etc.; a storage section 408 including one or more computer-readable media such as hard disk, optical disk, magnetic disk, semiconductor memory, etc.; and a communication section 409 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 409 performs communication processing via a network such as the Internet.
[0068] In particular, the methods and / or embodiments in this application can be implemented as computer software programs. For example, the embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowchart. When the computer program is executed by the central processing unit (CPU) 401, it performs the functions defined in the methods of this application.
[0069] Another embodiment of this application provides a computer-readable storage medium having computer program instructions stored thereon, which can be executed by a processor to implement the methods and / or technical solutions of any one or more embodiments of this application described above.
[0070] Specifically, this embodiment may employ any combination of one or more computer-readable media. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device.
[0071] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including—but not limited to—electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.
[0072] The program code contained on a computer-readable medium may be transmitted using any suitable medium, including—but not limited to—wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0073] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof. Programming languages include object-oriented programming languages—such as Java, Smalltalk, and C++—as well as conventional procedural programming languages—such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0074] The flowcharts or block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of devices, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-specific system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0075] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0076] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or page components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.
[0077] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0078] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in a combination of hardware and software functional units.
[0079] The integrated units implemented as software functional units described above can be stored in a computer-readable storage medium. These software functional units, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute partial steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0080] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
[0081] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in a device claim may also be implemented by a single unit or device through software or hardware. The terms "first," "second," etc., are used to indicate names and do not indicate any specific order.
Claims
1. A method for classifying comments, characterized in that, include: Retrieve the target comment and the historical comments associated with the target comment, the historical comments including the parent comments and / or root comments of the target comment; If the historical comments are successfully retrieved, based on the combination of the target comment and the historical comments, a set of combined semantics for the target comment is generated, including: extracting the text content of the target comment and the text content of the historical comments from the combination of the target comment and the historical comments respectively; combining the two extracted text contents to obtain the combined text content; and performing semantic recognition on the combined text content to generate combined semantics for the target comment. Generate a classification index corresponding to each of the combined semantics in the set of combined semantics, wherein the classification index is determined based on the similarity between the combined semantics and the reference semantics of the target classification; A total classification index is determined based on the sum of the various classification indices; in response to the total classification index exceeding a first preset threshold, the target comment and the historical comments are classified into the target category.
2. The method according to claim 1, characterized in that, Generate classification indices corresponding to combined semantics, including: Determine the numerical range into which the similarity between the combined semantics and the reference semantics of the target classification falls; Based on the preset index value associated with the numerical range, a classification index corresponding to the combined semantics is determined.
3. The method according to claim 1, characterized in that, Also includes: In response to the inclusion of a target classification index in the classification index, the target comment and a first historical comment associated with the target classification index are classified into the target category, wherein the target classification index exceeds a second preset threshold.
4. The method according to claim 3, characterized in that, Also includes: In response to the requirement that the number of target combined semantics in the set of combined semantics meets the requirement of a preset number threshold, wherein the classification index corresponding to the target combined semantics is between the second preset threshold and the third preset threshold, and the value indicated by the third preset threshold is lower than the second preset threshold; The target comment and the second historical comment associated with the target combined semantics are classified as the target category.
5. The method according to claim 1, characterized in that, The historical comments include comments that are related to the target comment in the comment section by their comment floor number and / or comments within a preset range of the comment floor number.
6. The method according to claim 1, characterized in that, The combination of the target comment and the historical comments is built based on a semantic graph structure. The nodes in the semantic graph structure include a first node corresponding to the target comment and a second node corresponding to the historical comments. The edges in the semantic graph structure are used to connect the first node and the second node.
7. The method according to claim 6, characterized in that, The combined semantics in the set of combined semantics include: semantic vectors obtained by processing the semantic graph structure; and For each of the combined semantics, a corresponding classification index is generated, including: Generate the vector similarity between the semantic vector and the reference vector of the reference semantics; The vector similarity is used as the classification index corresponding to the combined semantics.
8. The method according to claim 1, characterized in that, Also includes: In response to the target comment and the third historical comment being categorized into the target category; Identify the first user who provided the target comment and the second user who provided the third historical comment; as well as Send warning messages to the first user and the second user.
9. The method according to claim 1, characterized in that, Also includes: If the retrieval of historical comments fails, an independent classification index for the target comment is generated, wherein the independent classification index is determined based on the semantics of the target comment and its similarity to the reference semantics; In response to the independent classification index exceeding a fourth preset threshold, the target comment is classified into the target category.
10. A device for classifying comments, characterized in that, include: The acquisition module is configured to acquire historical comments associated with the target comment, wherein the historical comments are the parent comments and / or root comments of the target comment; The first generation module is configured to, if the historical comments are successfully acquired, generate a set of combined semantics for the target comment based on the combination of the target comment and the historical comments, including: extracting the text content of the target comment and the text content of the historical comments from the combination of the target comment and the historical comments respectively; combining the two extracted text contents to obtain combined text content; and performing semantic recognition on the combined text content to generate combined semantics for the target comment. The second generation module is configured to generate a classification index corresponding to each of the combined semantics in the set of combined semantics, wherein the classification index is determined based on the similarity between the combined semantics and the reference semantics of the target classification; and The first classification module is configured to determine a total classification index based on the sum of the various classification indices; in response to the total classification index exceeding a first preset threshold, the target comment and the historical comments are classified into the target category.
11. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 9.
12. A computer-readable medium having stored thereon computer program instructions that can be executed by a processor to implement the method as described in any one of claims 1 to 9.