Social media comment data processing method and device, equipment and storage medium

By constructing a data relationship tree of social media comment data and converting it into the target data format, the output deviation problem of large models in social media comment data annotation is solved, and more accurate and stable annotation results are achieved.

CN120688480APending Publication Date: 2025-09-23BEIJING XUEDIRUANJIAN DEVELOPMENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510772888.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-10
Publication Date
2025-09-23

AI Technical Summary

Technical Problem

In the existing technology, when using large models to annotate social media comment data, improper data input format leads to output deviation or errors.

Method used

By constructing a data relationship tree of social media comment data and converting it into the target data format to adapt to the data annotation model, including data cleaning, comment grouping and context relationship construction, we ensure that the data format meets the input requirements of the large model.

Benefits of technology

It improves the large model's understanding of the context of social media comment data, enhances the accuracy and stability of annotation results, and improves analysis efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120688480A_ABST
    Figure CN120688480A_ABST
Patent Text Reader

Abstract

The invention provides a social media comment data processing method and device, equipment and a storage medium, and relates to the field of data processing. The method comprises the steps of obtaining social media comment data to be labeled; constructing a data relation tree between the original post and the comment based on the social media comment data, wherein the data relation tree represents a context relation between the original post and the comment; converting the data format of the social media comment data into a target data format based on the data relation tree, wherein the target data format is a format matched with a data annotation model for data annotation; and inputting the social media comment data in the target data format into a data annotation model, and outputting an annotation result of the social media comment data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing, and in particular to a method, apparatus, computer device, and readable storage medium for processing social media comment data. Background Art

[0002] In the business and social media sectors, comment analysis is crucial for understanding user feedback, market trends, and product improvements. However, due to the free nature of comment responses on social media, analyzing individual commenters is often difficult. Comprehensively analyzing a commenter requires distinguishing their own comments and considering the context of their responses. Furthermore, the user information that requires attention during analysis is often multifaceted. On the one hand, it's necessary to extract personal user information, while on the other hand, it's necessary to focus on user evaluations of products. Among related technologies, large models and their prompt engineering (Prompt), with their massive parameters and pre-trained data, can efficiently handle complex language tasks, providing more efficient solutions for social media comment analysis and more intelligent decision support for businesses and users.

[0003] While large models using Prompt to automatically label data are highly efficient, there are also significant factors that can affect the accuracy of the results. For example, the data input format is crucial to the labeling results; an incorrect format can lead to deviations or errors in the large model's output. Summary of the Invention

[0004] In view of this, the present application provides a method, apparatus, computer device and readable storage medium for processing social media comment data, which solves the problem of output deviation or error when using large models to annotate social media comment data in the related art.

[0005] In a first aspect, an embodiment of the present application provides a method for processing social media comment data, comprising:

[0006] Obtain social media comment data to be annotated;

[0007] Based on social media comment data, a data relationship tree is constructed between the original post and the comments. The data relationship tree represents the contextual relationship between the original post and the comments.

[0008] Based on the data relationship tree, the data format of social media comment data is converted into the target data format. The target data format is a format that is adapted to the data annotation model for data annotation.

[0009] Input the social media comment data in the target data format into the data annotation model and output the annotation results of the social media comment data.

[0010] The above method according to the embodiment of the present application may also have the following additional technical features:

[0011] In the above technical solution, optionally, before constructing a data relationship tree between the original post and the comments based on the social media comment data, the method further includes:

[0012] Perform data cleaning on social media comment data;

[0013] Among them, the data cleaning method includes at least one of the following: removing original posts and their corresponding comment content that do not contain specific keywords in the social media comment data, removing comment content in the social media comment data whose number of words or characters is less than a first preset number, and removing comment content in the social media comment data whose number of words or characters is greater than a second preset number, where the second preset number is greater than the first preset number.

[0014] In any of the above technical solutions, optionally, the social media comment data includes the original post ID, comment ID, comment time, and comment relationship;

[0015] Build a data relationship tree between original posts and comments based on social media comment data, including:

[0016] The original post ID is used as the root node, the comment ID as the child node, and the hierarchical relationship is constructed by combining the comment time and comment relationship corresponding to each comment ID to obtain a data relationship tree.

[0017] In any of the above technical solutions, optionally, the social media comment data also includes the original post content, commenter ID, and comment content;

[0018] The data format of social media comment data is converted into the target data format based on the data relationship tree, including:

[0019] Convert comment ID to comment order, and convert commenter ID to commenter order;

[0020] Based on the order of comments, the order of commentators, and the content of comments, the data relationship tree is converted into comment association data; wherein the comment association data includes the first-level comments and n-level comments of the original post, where n is an integer greater than 1;

[0021] Group the n-level comments of the original post according to the first-level comments to obtain multiple comment groups. One comment group includes the first-level comments and the n-level comments under the first-level comments.

[0022] The original post content of each comment group is spliced ​​to obtain social media comment data in the target data format.

[0023] In any of the above technical solutions, optionally, based on the order of comments, the order of commentators, and the content of comments, the data relationship tree is converted into comment association data, including:

[0024] The first-level child nodes of the data relationship tree are used as first-level comments, and the n-level child nodes of the data relationship tree are used as n-level comments;

[0025] Based on the order of comments, order of reviewers, and content of comments, the data content of first-level comments and the data content of n-level comments are constructed;

[0026] Based on the hierarchical relationship of the data relationship tree, the association relationship between the first-level comments and the n-level comments, as well as the association relationship between the n-level comments, is constructed.

[0027] In any of the above technical solutions, optionally, the data format of the first-level comments is: j :p i -nan: Comment content, where u j represents the jth reviewer, p i Indicates the comment ID of the i-th comment, "nan" indicates no parent comment, "-" indicates a connector, and i and j are integers;

[0028] The data format of n-level comments is: j’ :p i’ -u j” :p i” : Comment content, where u j’ represents the j'th reviewer, u j” represents the j'th reviewer, p i’ Indicates the comment ID of the i'th comment, p i” Indicates the comment ID of the i'th comment, "-" is a connector, and i', j', i", and j" are integers.

[0029] In any of the above technical solutions, optionally, the method further includes:

[0030] Determine a first target comment group in which the number of comment IDs among the plurality of comment groups is less than a first preset number;

[0031] At least two first target review groups are merged.

[0032] In any of the above technical solutions, optionally, the method further includes:

[0033] Determine a second target review group in which the number of review IDs in the plurality of review groups is greater than a second preset number, the second preset number being greater than the first preset number;

[0034] dividing the second target comment group into a plurality of sub-comment groups according to a third preset number, where the third preset number is smaller than the second preset number;

[0035] For each sub-comment group, keep the first and last comments of the sub-comment group;

[0036] The first comment and the last comment of each sub-comment group are used as the third target comment group, and the second target comment group is updated using the third target comment group.

[0037] In any of the above technical solutions, optionally, the original post content of each comment group is spliced ​​to obtain social media comment data in the target data format, including:

[0038] Mark the target content in the original post content to obtain the marking result;

[0039] The labeling results are spliced ​​at the beginning of each comment group to obtain the social media comment data in the target data format.

[0040] In a second aspect, an embodiment of the present application provides a device for processing social media comment data, comprising:

[0041] A data acquisition module is used to obtain social media comment data to be annotated;

[0042] A relationship tree construction module is used to construct a data relationship tree between the original post and the comments based on social media comment data. The data relationship tree represents the contextual relationship between the original post and the comments.

[0043] A format conversion module is used to convert the data format of social media comment data into a target data format based on the data relationship tree. The target data format is a format that is adapted to the data annotation model for data annotation.

[0044] The annotation module is used to input social media comment data in the target data format into the data annotation model and output the annotation results of the social media comment data.

[0045] In a third aspect, an embodiment of the present application provides a computer device comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the method of the first aspect are implemented.

[0046] In a fourth aspect, an embodiment of the present application provides a readable storage medium, which stores a program or instruction. When the program or instruction is executed by a processor, the steps of the method of the first aspect are implemented.

[0047] The social media comment data processing method, apparatus, computer device, and readable storage medium of the embodiments of the present application convert the acquired social media comment data into a target data format that is more suitable for the data annotation model before automatically annotating the social media comment data through a large model, thereby enhancing the data annotation model's understanding of the context of the social media comment data and improving the accuracy and stability of the model's output.

[0048] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0050] Figure 1 One of the flowcharts of the method for processing social media comment data according to an embodiment of the present application is shown;

[0051] Figure 2 A second flow chart of a method for processing social media comment data according to an embodiment of the present application is shown;

[0052] Figure 3 A schematic diagram showing a relationship tree of an embodiment of the present application is shown;

[0053] Figure 4 A structural block diagram of a device for processing social media comment data according to an embodiment of the present application is shown;

[0054] Figure 5 A structural block diagram of a computer device according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0055] The following will be combined with the accompanying drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the embodiments described are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field are within the scope of protection of this application.

[0056] The terms "first," "second," and the like in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of this application can be implemented in an order other than that illustrated or described herein, and that the objects distinguished by "first," "second," and the like are generally of the same type, and do not limit the number of objects; for example, the first object can be one or more. In addition, the term "and / or" in the specification and claims refers to at least one of the connected objects, and the character " / " generally indicates that the objects connected are in an "or" relationship.

[0057] The following, in conjunction with the accompanying drawings, describes in detail the method, apparatus, computer device, and readable storage medium for processing social media comment data provided by the embodiments of the present application through specific embodiments and their application scenarios. The following embodiments and features of the embodiments may be combined with each other unless there is any conflict.

[0058] The present application embodiment provides a method for processing social media comment data, such as Figure 1 As shown, the method includes:

[0059] Step 101: Obtain social media comment data to be annotated.

[0060] In this step, the original social media comment data to be annotated is obtained. The social media comment data at least includes: original post ID, original post content, comment ID, commenter ID, comment content, comment time, comment relationship and other information.

[0061] Step 102: construct a data relationship tree between the original post and the comments based on the social media comment data, where the data relationship tree represents the contextual relationship between the original post and the comments.

[0062] In this step, a data relationship tree between the original post and the comments is constructed, and the contextual relationship between the original post and the comments is represented by the data relationship tree.

[0063] In one embodiment of the present application, social media comment data includes the original post ID, comment ID, comment time, and comment relationship;

[0064] Build a data relationship tree between original posts and comments based on social media comment data, including:

[0065] The original post ID is used as the root node, the comment ID as the child node, and the hierarchical relationship is constructed by combining the comment time and comment relationship corresponding to each comment ID to obtain a data relationship tree.

[0066] In this embodiment, the original post is taken as the root node, each comment is taken as a child node, and the comment time and comment relationship of the comment are used to construct a hierarchical relationship of nodes at all levels. The comments that directly reply to the original post are first-level child nodes, the comments that reply to the first-level child nodes are second-level child nodes, the comments that reply to the second-level child nodes are third-level child nodes, and so on. Figure 3 The data relationship tree shown in the figure is used to recover the contextual relationship of social media comment data.

[0067] In one embodiment of the present application, before constructing a data relationship tree between original posts and comments based on the social media comment data, the method further comprises: performing data cleaning on the social media comment data;

[0068] The data cleaning method includes at least one of the following: removing original posts and their corresponding comment content that do not contain specific keywords in the social media comment data, removing comment content in the social media comment data whose number of words or characters is less than a first preset number, and removing comment content in the social media comment data whose number of words or characters is greater than a second preset number, where the second preset number is greater than the first preset number.

[0069] In this embodiment, data without specific keywords in the acquired raw social media comment data is cleared, that is, original posts and their corresponding comments without specific keywords are removed. Specific keywords can be words related to products or brands, and can be set by the user.

[0070] The system removes comments with fewer than a first preset number of words or characters from the raw social media comment data, specifically removing extremely short comments. This prevents inaccurate model analysis caused by information being too short to provide sufficient context for the model input. Furthermore, it removes comments with more than a second preset number of words or characters from the raw social media comment data, specifically removing extremely long comments, thereby shortening the model input length.

[0071] In the embodiment of the present application, by cleaning the acquired raw social media comment data and removing comments that do not contain specific keywords or are too long or too short, it is possible to improve data quality, reduce noise interference, and enhance the accuracy and efficiency of analysis results.

[0072] Step 103: Convert the data format of the social media comment data into a target data format based on the data relationship tree. The target data format is a format adapted to the data annotation model for data annotation.

[0073] In this step, the social media comment data is converted to a target format suitable for annotation using the data annotation model. The data annotation model, a large model incorporating prompt engineering techniques, is capable of annotating social media comment data, and achieves superior annotation results for social media comment data in the target format.

[0074] Step 104 : Input the social media comment data in the target data format into the data annotation model, and output the annotation results of the social media comment data.

[0075] In this step, after the data format of the social media comment data is converted into the target data format, the social media comment data is input into the data annotation model, and the data annotation model outputs the annotation results of the social media comment data. In the embodiment of the present application, by combining a large model with prompt engineering technology, it is possible to understand the judgment logic and output content of various annotation tasks based on natural language, making data annotation more convenient and the output more interpretable, thereby improving the comment analysis effect of social media comment data and ensuring that users' feedback on corporate products can be accurately understood. In addition, the large model's extra-long input window can receive a large amount of text input at a time, and can execute analysis tasks for multiple users at a time, thereby improving the analysis efficiency of social media comment data.

[0076] In an embodiment of the present application, before automatically annotating social media comment data through a large model, the acquired social media comment data is converted into a target data format that is more suitable for the data annotation model to achieve data structuring, thereby enhancing the data annotation model's understanding of the context of social media comment data and improving the accuracy and stability of the model's output.

[0077] In one embodiment of the present application, the social media comment data also includes the original post content, commentator ID, and comment content. Step 102 of the above embodiment, converting the data format of the social media comment data into the target data format based on the data relationship tree, specifically includes:

[0078] Step 1021 : Convert the comment ID into comment order, and convert the commentator ID into commentator order.

[0079] In this step, the comment ID and commentator ID in the social media comment data are replaced with a shortened representation. The comment ID is replaced with the comment order p, indicating the comment number of the comment with that ID, and the commentator ID is replaced with the comment order u, indicating the user ID number of the user with that ID. Each user ID is unique. This operation desensitizes user information and reduces interference from irrelevant information in the comments, allowing the model to focus more on the comment content itself.

[0080] Step 1022 : Based on the order of comments, order of commentators, and comment content, the data relationship tree is converted into comment association data; wherein the comment association data includes the first-level comments and n-level comments of the original post, where n is an integer greater than 1.

[0081] The tree-like relationship format is too complex for large models, making it difficult for them to understand the relationships between data. In order to enable large models to more clearly identify the relevant context of comments while also reducing data complexity, this application converts the data relationship tree into comment-related data, where the comment-related data includes the first-level comments and n-level comments of the original post, where n is an integer greater than 1.

[0082] In one embodiment of the present application, based on the order of comments, the order of reviewers, and the content of the comments, the data relationship tree is converted into comment association data, including:

[0083] The first-level child nodes of the data relationship tree are used as first-level comments, and the n-level child nodes of the data relationship tree are used as n-level comments;

[0084] Based on the order of comments, order of reviewers, and content of comments, the data content of first-level comments and the data content of n-level comments are constructed;

[0085] Based on the hierarchical relationship of the data relationship tree, the association relationship between the first-level comments and the n-level comments, as well as the association relationship between the n-level comments, is constructed.

[0086] Among them, the data format of the first-level comment is: "u j :p i -nan: comment content", where u j 、p i ,nan, and comment content are all first-level comment data content, u j represents the jth reviewer, p i The comment ID of the i-th comment. "nan" indicates no parent comment, which indicates a first-level comment. ":" is the connector for the commenter ID, comment ID, and comment content, and "-" is the connector for relationships. i and j are integers. A comment with the form u1:p1-nan:comment content indicates a direct reply from the first commenter to the original post, and its comment ID is p1. A comment with the form u2:p6-nan:comment content indicates a direct reply from the second commenter to the original post, and its comment ID is p6.

[0087] The data format of n-level comments is: "u j’ :p i’ -u j” :p i” :Comment content", where u j’、p i’ 、u j” 、p i” , the comment content is the data content of n-level comments, u j’ represents the j'th reviewer, u j” represents the j'th reviewer, p i’ Indicates the comment ID of the i'th comment, p i” Represents the comment ID of the i'th comment, ":" is the connector of the commentator ID, comment ID, and comment content, and "-" is the connector of the association relationship. i', j', i", and j" are integers. If a comment is: u1:p1-u3:p2:comment content, it means that commentator u3 replies to u1's comment p1, and the comment ID of this comment is p2. If a comment is: u1:p4-u3:p5:comment content, it means that commentator u3 replies to u1's comment p4, and the comment ID of this comment is p5.

[0088] Through the above approach, the integrity of the contextual information of social media comment data is ensured, which can enhance the model's recognition of the association and contextual relationships of social media comments.

[0089] Step 1023 , grouping the n-level comments of the original post according to the first-level comments to obtain multiple comment groups, where one comment group includes the first-level comment and the n-level comments under the first-level comment.

[0090] The number of comments under an original post is not fixed. If there are too many comments, the input may exceed the maximum acceptable length of the model. In the embodiment of the present application, the comments under the original post are grouped to obtain multiple comment groups. When inputting the model, different comment groups are input into the model separately. Compared with inputting social media comment data as a single input into the model, inputting different comment groups into the model separately can shorten the model input and avoid losing key information when the model is analyzed.

[0091] In social media, each first-level comment and its subordinate reply comments generally have a high degree of consistency in the discussion information. Based on this, the comments under the original post can be divided into multiple groups, where each group is centered around a first-level comment and includes the first-level comment and all its direct or indirect n-level comments. For example, Figure 3 The data relationship tree shown is centered on the first-level comments and is divided into two groups.

[0092] In one embodiment of the present application, the method further comprises:

[0093] Determine a first target comment group in which the number of comment IDs among the plurality of comment groups is less than a first preset number;

[0094] At least two first target review groups are merged.

[0095] In this embodiment, a strategy for controlling the number of comments is proposed, taking into account that some comment groups may have relatively few comments. If a comment group has a relatively small number of comments (i.e., the first target comment group), it will be merged with other comment groups with a relatively small number of comments, so that the number of comments in each comment group is relatively consistent. This improves data processing efficiency on the one hand, and prevents inaccurate model analysis due to the inability of the input model to provide sufficient context on the other hand.

[0096] In one embodiment of the present application, the method further comprises:

[0097] Determine a second target review group in which the number of review IDs in the plurality of review groups is greater than a second preset number, the second preset number being greater than the first preset number;

[0098] dividing the second target comment group into a plurality of sub-comment groups according to a third preset number, where the third preset number is smaller than the second preset number;

[0099] For each sub-comment group, keep the first and last comments of the sub-comment group;

[0100] The first comment and the last comment of each sub-comment group are used as the third target comment group, and the second target comment group is updated using the third target comment group.

[0101] In this embodiment, if the number of words in a comment group exceeds the limit accommodated by the model, or the number of comments is too large, the comment group (i.e., the second target comment group) is divided into multiple sub-comment groups according to a third preset number or a preset number of words. In each sub-comment group after the division, at least the first comment and at least the last comment in the sub-comment group are retained, for example, the first comment and the comment that replies to the comment at the split are retained. The comments retained in the multiple sub-comment groups are arranged in order as the third target comment group, and the third target comment group is used to update the second target comment group, so as to shorten the group while retaining the contextual meaning of the group as much as possible.

[0102] Step 1024 , concatenate the original post content of each comment group to obtain social media comment data in the target data format.

[0103] In social media, in addition to the implicit contextual information, some discussions do not directly mention the topic of the original post. In order to enhance the contextual information of the comment content, the original post content is spliced ​​onto each comment group to obtain social media comment data in the target data format.

[0104] In one embodiment of the present application, the original post content of each comment group is spliced ​​to obtain social media comment data in the target data format, including:

[0105] Mark the target content in the original post content to obtain the marking result;

[0106] The labeling results are spliced ​​at the beginning of each comment group to obtain the social media comment data in the target data format.

[0107] In this example, the target content associated with the original post is tagged. For example, in the case of product market reviews, the target content is the category and brand, and the categories and brands mentioned in the original post are tagged. The tagged results are then concatenated at the beginning of each comment group, serving as a reference for the model's analysis of the commentators within the comment group. After concatenating the tagged results, the multiple comment groups now constitute the social media comment data in the target data format.

[0108] For a comment group, such as Figure 3 The target data format of the comment group after splicing is as follows:

[0109] Original post initiated by: u0:category:brand, indicating the post initiated by commentator u0, and lists the categories and brands involved in the post in a fixed format, which can be empty.

[0110] First-level comment: u2:p6-nan: comment content, indicating the commentator u1’s direct reply to the original post, and the ID of this comment is p1.

[0111] N-level comments:

[0112] u2:p6-u5:p7: Comment content, indicating commenter u5's reply to u2's comment p6, and the ID of this comment is p7;

[0113] u2:p6-u6:p8: Comment content, indicating the commenter u6's reply to u2's comment p6, and the ID of this comment is p8.

[0114] A real data example could be:

[0115] u0:Category 1:Brand 2.

[0116] u2:p6-nan: Take some time to experience it, for fear that I won’t be able to use it after buying it.

[0117] u2:p6-u5:p7:Okay.

[0118] u2:p6-u6:p8:If I am really busy, I will give priority to brand 1, which is more efficient. Although brand 2 is good, its efficiency is slower.

[0119] In this embodiment, by tagging the original post content and then splicing it into each comment group, the contextual information of the comment content can be enhanced, thereby improving the accuracy and stability of the model output. In addition, by tagging the original post content before splicing it, rather than directly splicing the original post content, the present application can reduce the input data length, avoid excessive model input data, and reduce the impact of the model on comment analysis.

[0120] As a specific implementation of the above-mentioned method for processing social media comment data, the present embodiment provides a device for processing social media comment data. Figure 4 As shown, the social media comment data processing device 400 includes: a data acquisition module 401, a relationship tree construction module 402, a format conversion module 403 and a labeling module 404.

[0121] The data acquisition module 401 is used to acquire social media comment data to be annotated;

[0122] A relationship tree construction module 402 is used to construct a data relationship tree between the original post and the comments based on the social media comment data, wherein the data relationship tree represents the contextual relationship between the original post and the comments;

[0123] A format conversion module 403 is used to convert the data format of the social media comment data into a target data format based on the data relationship tree, where the target data format is a format adapted to the data annotation model for data annotation;

[0124] The annotation module 404 is used to input the social media comment data in the target data format into the data annotation model and output the annotation results of the social media comment data.

[0125] Furthermore, the device also includes: a data cleaning module for performing data cleaning on social media comment data;

[0126] Among them, the data cleaning method includes at least one of the following: removing original posts and their corresponding comment content that do not contain specific keywords in the social media comment data, removing comment content in the social media comment data whose number of words or characters is less than a first preset number, and removing comment content in the social media comment data whose number of words or characters is greater than a second preset number, where the second preset number is greater than the first preset number.

[0127] Furthermore, the social media comment data includes the original post ID, comment ID, comment time, and comment relationship; the relationship tree construction module 402 is specifically used to: use the original post ID as the root node, the comment ID as the child node, and combine the comment time and comment relationship corresponding to each comment ID to construct a hierarchical relationship to obtain a data relationship tree.

[0128] Furthermore, the social media comment data also includes the original post content, commentator ID, and comment content; the format conversion module 402 is specifically used to:

[0129] Convert comment ID to comment order, and convert commenter ID to commenter order;

[0130] Based on the order of comments, the order of commentators, and the content of comments, the data relationship tree is converted into comment association data; wherein the comment association data includes the first-level comments and n-level comments of the original post, where n is an integer greater than 1;

[0131] Group the n-level comments of the original post according to the first-level comments to obtain multiple comment groups. One comment group includes the first-level comments and the n-level comments under the first-level comments.

[0132] The original post content of each comment group is spliced ​​to obtain social media comment data in the target data format.

[0133] Furthermore, the format conversion module 402 is specifically configured to:

[0134] The first-level child nodes of the data relationship tree are used as first-level comments, and the n-level child nodes of the data relationship tree are used as n-level comments;

[0135] Based on the order of comments, order of reviewers, and content of comments, the data content of first-level comments and the data content of n-level comments are constructed;

[0136] Based on the hierarchical relationship of the data relationship tree, the association relationship between the first-level comments and the n-level comments, as well as the association relationship between the n-level comments, is constructed.

[0137] Furthermore, the data format of the first-level comments is: j :p i -nan: Comment content, where u j represents the jth reviewer, p i Indicates the comment ID of the i-th comment, "nan" indicates no parent comment, "-" indicates a connector, and i and j are integers;

[0138] The data format of n-level comments is: j’ :p i’ -u j” :p i” : Comment content, where u j’ represents the j'th reviewer, u j” represents the j'th reviewer, p i’ Indicates the comment ID of the i'th comment, p i” Indicates the comment ID of the i'th comment, "-" is a connector, and i', j', i", and j" are integers.

[0139] Furthermore, the format conversion module 402 is further configured to:

[0140] Determine a first target comment group in which the number of comment IDs among the plurality of comment groups is less than a first preset number;

[0141] At least two first target review groups are merged.

[0142] Furthermore, the format conversion module 402 is further configured to:

[0143] Determine a second target review group in which the number of review IDs in the plurality of review groups is greater than a second preset number, the second preset number being greater than the first preset number;

[0144] dividing the second target comment group into a plurality of sub-comment groups according to a third preset number, where the third preset number is smaller than the second preset number;

[0145] For each sub-comment group, keep the first and last comments of the sub-comment group;

[0146] The first comment and the last comment of each sub-comment group are used as the third target comment group, and the second target comment group is updated using the third target comment group.

[0147] Furthermore, the format conversion module 402 is specifically configured to:

[0148] Mark the target content in the original post content to obtain the marking result;

[0149] The labeling results are spliced ​​at the beginning of each comment group to obtain the social media comment data in the target data format.

[0150] The social media comment data processing device 400 in the embodiment of the present application can be a computer device, or a component in a computer device, such as an integrated circuit or a chip. The computer device can be a terminal, or a device other than a terminal. For example, the computer device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted computer device, a mobile Internet device (MID), a robot, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (PDA), etc. It can also be a server, a network attached storage (NAS), a personal computer (PC), etc., and the embodiment of the present application does not specifically limit it.

[0151] The social media comment data processing device 400 provided in the embodiment of the present application can achieve Figure 1 To avoid repetition, the various processes implemented in the embodiment of the method for processing social media comment data are not described here.

[0152] The present application also provides a computer device, such as Figure 5 As shown, the computer device 500 includes a processor 501 and a memory 502. The memory 502 stores programs or instructions that can be run on the processor 501. When the program or instructions are executed by the processor 501, the various steps of the embodiment of the method for processing social media comment data described above are implemented and can achieve the same technical effects. To avoid repetition, they are not described here.

[0153] The memory 502 can be used to store software programs and various data. The memory 502 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store an operating system, applications or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory 502 may include volatile memory or non-volatile memory, or the memory 502 may include both volatile and non-volatile memory. The non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DRRAM). The memory 502 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.

[0154] Processor 501 may include one or more processing units. Optionally, processor 501 integrates an application processor and a modem processor. The application processor primarily handles operations related to the operating system, user interface, and application programs, while the modem processor primarily processes wireless communication signals, such as a baseband processor. It is understood that the modem processor may not be integrated into processor 501.

[0155] The embodiment of the present application further provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the embodiment of the method for processing social media comment data described above is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0156] It should be noted that, in this article, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element. In addition, it should be noted that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in the opposite order according to the functions involved. For example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0157] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of this application, ordinary technicians in this field can also make many forms without departing from the purpose of this application and the scope of protection of the claims, all of which are within the protection of this application.

Claims

1. A method for processing social media comment data, characterized in that: include: Obtain social media comment data to be annotated; Building a data relationship tree between the original post and the comments based on the social media comment data, wherein the data relationship tree represents the contextual relationship between the original post and the comments; Converting the data format of the social media comment data into a target data format based on the data relationship tree, wherein the target data format is a format adapted to the data annotation model for data annotation; The social media comment data in the target data format is input into the data annotation model, and an annotation result of the social media comment data is output.

2. The method according to claim 1, characterized in that Before constructing a data relationship tree between original posts and comments based on the social media comment data, the method further includes: performing data cleaning on the social media comment data; In particular, the data cleaning method includes at least one of the following: removing original posts and their corresponding comment content that do not contain specific keywords in the social media comment data, removing comment content in the social media comment data whose number of words or characters is less than a first preset number, and removing comment content in the social media comment data whose number of words or characters is greater than a second preset number, where the second preset number is greater than the first preset number.

3. The method according to claim 1, characterized in that The social media comment data includes the original post ID, comment ID, comment time, and comment relationship; The step of constructing a data relationship tree between the original post and the comments based on the social media comment data includes: The original post ID is used as the root node, the comment ID is used as the child node, and a hierarchical relationship is constructed in combination with the comment time and comment relationship corresponding to each comment ID to obtain the data relationship tree.

4. The method according to claim 3, characterized in that The social media comment data also includes the original post content, commenter ID, and comment content; The converting the data format of the social media comment data into a target data format based on the data relationship tree includes: Convert the comment ID into comment order, and convert the commenter ID into commenter order; Based on the order of comments, the order of commentators, and the content of comments, the data relationship tree is converted into comment association data; wherein the comment association data includes the first-level comments and n-level comments of the original post, where n is an integer greater than 1; Grouping the n-level comments of the original post according to the first-level comments to obtain multiple comment groups, wherein one comment group includes the first-level comment and each n-level comment under the first-level comment; The original post content of each comment group is spliced ​​to obtain the social media comment data in the target data format.

5. The method according to claim 4, characterized in that The step of converting the data relationship tree into comment association data based on the comment order, the commentator order, and the comment content includes: Using the first-level child node of the data relationship tree as the first-level comment, and using the n-level child node of the data relationship tree as the n-level comment; Constructing the data content of the first-level comments and the data content of the n-level comments based on the comment order, the commentator order, and the comment content; Based on the hierarchical relationship of the data relationship tree, an association relationship between the first-level comments and the n-level comments, and an association relationship between the n-level comments are constructed.

6. The method according to claim 5, characterized in that The data format of the first-level comment is: j :p i -nan: Comment content, where u j represents the jth reviewer, p i Indicates the comment ID of the i-th comment, "nan" indicates no parent comment, "-" indicates a connector, and i and j are integers; The data format of the n-level comment is: j’ :p i '-u j” :p i” : Comment content, where u j’ represents the j'th reviewer, u j” represents the j'th reviewer, p i 'Indicates the comment ID of the i-th comment, p i” Indicates the comment ID of the i'th comment. "-" is a connector. i', j', i", and j" are integers.

7. The method according to claim 4, characterized in that The method further comprises: Determine a first target comment group in which the number of comment IDs among the plurality of comment groups is less than a first preset number; At least two of the first target review groups are merged.

8. The method according to claim 4, characterized in that The method further comprises: Determine a second target review group in which the number of review IDs in the plurality of review groups is greater than a second preset number, where the second preset number is greater than the first preset number; dividing the second target comment group into a plurality of sub-comment groups according to a third preset number, where the third preset number is smaller than the second preset number; For each sub-comment group, retain the first comment and the last comment of the sub-comment group; The first comment and the last comment of each sub-comment group are used as a third target comment group, and the second target comment group is updated using the third target comment group.

9. The method according to claim 4, characterized in that The step of splicing the original post contents of each comment group to obtain the social media comment data in the target data format includes: Marking the target content in the original post content to obtain a marking result; The marking results are spliced ​​at the beginning of each comment group to obtain the social media comment data in the target data format.

10. A device for processing social media comment data, characterized in that: include: A data acquisition module is used to obtain social media comment data to be annotated; A relationship tree construction module is used to construct a data relationship tree between the original post and the comments based on the social media comment data, wherein the data relationship tree represents the contextual relationship between the original post and the comments; a format conversion module, configured to convert the data format of the social media comment data into a target data format based on the data relationship tree, wherein the target data format is a format adapted to a data annotation model for data annotation; The annotation module is used to input the social media comment data in the target data format into the data annotation model and output the annotation results of the social media comment data.

11. A computer device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction running on the processor, and when the program or instruction is executed by the processor, the steps of the method for processing social media comment data according to any one of claims 1 to 9 are implemented.

12. A readable storage medium having a program or instruction stored thereon, characterized in that: When the program or instruction is executed by a processor, the steps of the method for processing social media comment data according to any one of claims 1 to 9 are implemented.