Method, device, equipment, medium and program product for improving comment quality
By calculating the weighted sum of similarity between comment and song information across multiple dimensions, an output similarity is generated. With authorization, a large language model is used to modify the comments, solving the problem of inaccurate comment quality identification in existing technologies and improving comment quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2026-03-20
AI Technical Summary
In existing technologies, sorting comments by the number of keywords they contain cannot accurately identify high-quality comments, leading to low-quality comments being mistakenly identified as high-quality comments.
By calculating the weighted sum of the similarities between comments and song information across different dimensions (such as lyric similarity, theme similarity, sentiment similarity, and audio feature similarity), an output similarity is generated. When the output similarity is less than a quality threshold, the comments are modified into high-quality comments using a large language model.
This improves the accuracy and comprehensiveness of comments, ensuring that low-quality comments are modified into high-quality comments after authorization, thus meeting users' professional needs.
Smart Images

Figure CN119670703B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the field of data processing, and in particular, to a method and device for improving the quality of comments, a medium and a program product. BACKGROUND
[0002] With the development of terminals, more and more users listen to songs through music applications on terminals. When listening to songs, users also check comments on the songs from other users.
[0003] In related technologies, keywords related to songs are extracted from comments, and comments are sorted according to the number of keywords contained in the comments, so that comments containing more keywords are displayed in the comment area in the front as high-quality comments.
[0004] However, such selected comments are only higher in quality compared with other comments in the comment area, and may still be low-quality comments, which cannot accurately comment on songs. SUMMARY
[0005] The present application provides a method and device for improving the quality of comments, a medium and a program product, which includes at least one of the following aspects.
[0006] According to an aspect of an embodiment of the present application, a method for improving the quality of comments is provided, which includes:
[0007] obtaining a comment and song information related to the comment, the song information including at least one of lyrics and audio;
[0008] calculating the similarity of the comment and the song information in different dimensions based on the comment and the song information;
[0009] calculating the weighted sum of the similarity in different dimensions to obtain an output similarity of the comment;
[0010] in the case where the output similarity is less than a quality threshold, modifying the comment to a high-quality comment based on a large language model, the output similarity of the high-quality comment being greater than or equal to the quality threshold.
[0011] According to another aspect of an embodiment of the present application, a device for improving the quality of comments is provided, which includes:
[0012] an obtaining module configured to obtain a comment and song information related to the comment, the song information including at least one of lyrics and audio;
[0013] a calculating module configured to calculate the similarity of the comment and the song information in different dimensions based on the comment and the song information;
[0014] The calculation module is used to calculate the weighted sum of similarities across different dimensions to obtain the output similarity of the comments;
[0015] The processing module is used to modify comments into high-quality comments based on a large language model when the output similarity is less than the quality threshold. High-quality comments have an output similarity greater than or equal to the quality threshold.
[0016] According to another aspect of the embodiments of this application, a computer device is provided, comprising: a processor and a memory, wherein at least one program is stored in the memory; the processor is configured to execute the at least one program in the memory to implement the above-described method for improving the quality of comments.
[0017] According to another aspect of the embodiments of this application, a computer-readable storage medium is provided, which stores at least one program that is loaded and executed by a processor to implement the above-described method for improving comment quality.
[0018] According to another aspect of the embodiments of this application, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium, a processor retrieving the computer instructions from the computer-readable storage medium, and the processor executing the computer instructions to implement the above-described method for improving review quality.
[0019] The technical solutions provided in this application embodiment may include the following beneficial effects:
[0020] This method calculates the weighted sum of the similarities between comments and song information across different dimensions to obtain the output similarity of the comments. If the output similarity is less than a quality threshold, the comment is modified into a higher-quality comment. This method calculates comment quality from multiple dimensions, which is more comprehensive and reasonable compared to single-dimensional calculations, and it improves the overall comment quality by modifying lower-quality comments into higher-quality ones. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 A schematic diagram of a computer system provided in an exemplary embodiment of this application is shown;
[0023] Figure 2 A schematic diagram of a method for improving comment quality provided in an exemplary embodiment of this application is shown;
[0024] Figure 3 A flow chart of a method for improving comment quality is shown according to an example embodiment of the present application;
[0025] Figure 4 A flow chart of a method for improving comment quality is shown according to an example embodiment of the present application;
[0026] Figure 5 A flow chart of a method for improving comment quality is shown according to an example embodiment of the present application;
[0027] Figure 6 A flow chart of a method for improving comment quality is shown according to an example embodiment of the present application;
[0028] Figure 7 A block diagram of an apparatus for improving comment quality is shown according to an example embodiment of the present application;
[0029] Figure 8 A structural block diagram of a computer device is shown according to an example embodiment of the present application. DETAILED DESCRIPTION
[0030] For the purpose of making the objects, technical solutions and advantages of the present application clearer, the following further describes the embodiments of the present application with reference to the accompanying drawings.
[0031] The example embodiments will be described in detail herein with reference to the accompanying drawings. The following description is with reference to the drawings, in which like numerals represent like elements, unless otherwise described in connection with the following description. The following example embodiments described in the example embodiments are not representative of all embodiments consistent with the present application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the present application as detailed in the appended claims.
[0032] The terminology used in the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the present application. As used in the present application and the appended claims, the singular forms "a," "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0033] It should be noted that the object information (including but not limited to object device information, object personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the object or fully authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0034] It should be understood that although the terms first, second, etc. can be used in this application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of the present application, the first parameter can also be referred to as the second parameter, and similarly, the second parameter can also be referred to as the first parameter. Depending on the context, the word "if" as used herein can be interpreted as "when" or "upon" or "in response to determining".
[0035] First, some of the terms involved in the present application are explained:
[0036] Pre-training model (Pre-Training Model, PTM): also known as cornerstone model, large model, refers to a deep neural network (Deep Neural Network, DNN) with large parameters, which is trained on a large amount of unlabeled data. PTM uses the function approximation capability of large parameter DNN to extract common features on data, and uses techniques such as fine-tuning and high-efficiency parameter fine-tuning to adapt to downstream tasks. Therefore, the pre-training model can achieve ideal results in small sample or zero sample scenarios. PTM can be divided into language model, visual model, speech model, multi-modal model according to the data modality processed, among which the multi-modal model refers to a model that establishes the representation of two or more data modalities. Pre-training model is an important tool for outputting artificial intelligence generated content, and can also be used as a general interface connecting multiple specific task models.
[0037] Natural language processing (Nature Language Processing, NLP): is an important direction in the field of computer science and artificial intelligence. It studies various theories and methods that can realize effective communication between people and computers using natural language. Natural language processing involves natural language, i.e. the language used in daily life, and is closely related to linguistic research, as well as computer science and mathematics. The important technology of artificial intelligence model training is the pre-training model, which is developed from the large language model (Large Language Model, LLM) in the field of NLP. After fine-tuning, the large language model can be widely used in downstream tasks. Natural language processing technology usually includes text processing, semantic understanding, machine translation, robot question and answer, knowledge graph, etc.
[0038] Figure 1 A schematic diagram of a computer system 10 provided by an example embodiment of the present application is shown. The computer system 10 can include a terminal 100 and a server 200.
[0039] The terminal 100 can be an electronic device such as a mobile phone, a tablet computer, a vehicle-mounted terminal (car machine), a wearable device, a personal computer (PC), and the like. The terminal 100 can be installed with a client running a target application, which can be an application supporting the method for improving comment quality, and the present application does not limit the target application. In addition, the present application does not limit the form of the target application, including but not limited to an application (App) installed in the terminal 100, a mini program, a client, and the like, and can also be in the form of a web page.
[0040] The server 200 can be a standalone physical server, a server cluster or a distributed system composed of multiple physical servers, a cloud server providing cloud computing services, a cloud database, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and basic cloud computing services such as big data and artificial intelligence image recognition platforms. The server 200 can be a background server of the above-mentioned target application, and is configured to provide background services for the client of the target application.
[0041] The cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and network to realize data calculation, storage, processing, and sharing in a wide area network or a local area network. The cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, and the like based on the cloud computing business model, and can form a resource pool for on-demand use and flexible convenience. Cloud computing technology will become an important support. The background service of a technical network system requires a large amount of computing and storage resources, such as video websites, picture websites, and more portals. With the high development and application of the Internet industry, in the future, every item may have its own identification mark and needs to be transmitted to the background system for logical processing. Different levels of data will be processed separately, and various industry data needs strong system support, which can only be realized through cloud computing.
[0042] In some embodiments, the server described above can also be implemented as a node in a blockchain system. Blockchain is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and cryptographic algorithms. Essentially, a blockchain is a decentralized database, a chain of data blocks linked together using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and to generate the next block.
[0043] Terminal 100 and server 200 can communicate via a network, such as a wired network or a wireless network.
[0044] The method for improving comment quality provided in this application embodiment can be executed by a computer device, which refers to an electronic device with data computing, processing, and storage capabilities. Figure 1 Taking the computer system 10 shown as an example, the method for improving comment quality can be executed by the terminal 100, the server 200, or by the terminal 100 and the server 200 in interactive cooperation. This application does not limit this.
[0045] With the development of mobile devices, more and more users are listening to songs through music applications on these devices. While listening, users also view other users' comments on the songs. One related technology extracts song-related keywords from the comments and sorts them based on the number of keywords contained, thus displaying comments with more keywords as higher-quality comments at the top of the comment section. However, this selection only indicates that the comments are of higher quality compared to other comments in the section; they may still be low-quality comments and cannot accurately reflect the song's content.
[0046] To address the aforementioned issues, this application proposes a method for improving the quality of comments. Figure 2 This illustration shows a schematic diagram of a method for improving comment quality provided by an exemplary embodiment of this application. The example given is comment 210 in the comment section of song A, where comment 210 includes at least one comment. In this embodiment, terms such as object, user, and account used to represent the subject posting the comment have the same meaning, and this application does not limit their usage.
[0047] In some embodiments, comment 210 and song information 211 related to comment 210 are obtained, the song information 211 including at least one of lyrics and audio.
[0048] like Figure 2 As shown, 210 comments (comment A) posted by the author's account were retrieved, including: "The sound is so strange, it's a bit like being in a bucket, I don't really feel anything, overall it's not very good." Figure 2For example, the author account of the comment 210 is the account corresponding to the comment 210.
[0049] Optionally, the song information 211 further includes singer, composer, lyricist, song using musical instruments, song company, etc. The embodiments of the present application do not limit the same.
[0050] In some embodiments, the comment 210 is preprocessed.
[0051] Optionally, the preprocessing includes at least one of the following: filtering comments with text length shorter than a length threshold; detecting whether the comment includes a violation word; and detecting whether the comment includes a keyword.
[0052] The filtering of the comment with the text length shorter than the length threshold is because the comment with the text length too short may not have substantive content. For example, the length threshold is 5 Chinese characters (or 15 bytes), and for the comment "haha", the text length is shorter than the length threshold, so the comment is filtered.
[0053] The detection of whether the comment includes the violation word is to avoid the comment violating the relevant legal provisions. For example, the comment involving violent and terrorist content and other violation words needs to be filtered.
[0054] The detection of whether the comment includes the keyword in the keyword is a word in the pre-set database. Some comments containing the keyword will be filtered on a specified date and will not be filtered at other times. For example, the comment containing "911" will not be filtered at ordinary times, but will be filtered on September 11.
[0055] In some embodiments, based on the preprocessed comment and the song information, different similarities of the comment and the song information are calculated from different dimensions.
[0056] Optionally, the step includes at least two of the following:
[0057] (1) calculating a lyric similarity 221 of the comment based on the text of the comment and the lyrics;
[0058] (2) calculating a theme similarity 222 of the comment based on the theme of the comment and the lyrics;
[0059] (3) calculating an emotion similarity 223 of the comment based on the emotion of the comment and the lyrics;
[0060] (4) calculating an audio feature similarity 224 of the comment based on the comment and the audio.
[0061] For (1), the purpose is to associate the text content of the comment and the lyrics.
[0062] In some embodiments, the first model is called to extract a first text feature vector of the comment and a second text feature vector of the lyrics, and the first model is used to extract the text feature vector;
[0063] A cosine similarity between the first text feature vector and the second text feature vector is calculated to obtain a lyrics similarity 221 of the comment.
[0064] Optionally, the first model includes a bag-of-words model, which is used to extract the first text feature vector and the second text feature vector, and then a cosine similarity between the two text feature vectors is calculated as the lyrics similarity 221 of the comment, and the lyrics similarity 221 can reflect the relevance between the text content of the comment and the lyrics.
[0065] For (2), the purpose is to associate the themes of the comment and the lyrics.
[0066] In some embodiments, the second model is called to obtain a probability distribution vector corresponding to the comment and the lyrics respectively, the second model is used to identify the themes in the comment and the lyrics, and the comment is represented as a first probability distribution vector of the themes, and the lyrics are represented as a second probability distribution vector of the themes, each element in the first probability distribution vector is used to represent the probability that the comment belongs to the theme, and each element in the second probability distribution vector is used to represent the probability that the lyrics belongs to the theme, and the theme is used to describe the scene involved in the comment and the lyrics.
[0067] A cosine similarity between the first probability distribution vector and the second probability distribution vector is calculated to obtain a theme similarity 222 of the comment.
[0068] By way of example but not limitation, the theme includes a scenery scene, a character scene, a natural scene, and the like for describing things.
[0069] After the first probability distribution vector and the second probability distribution vector are obtained by calling the second model, a cosine similarity between the two probability distribution vectors is calculated as the theme similarity 222 of the comment, and the theme similarity 222 can reflect the relevance between the themes of the comment and the lyrics.
[0070] For (3), the purpose is to associate the emotions of the comment and the lyrics.
[0071] In some embodiments, a third model is called based on the comment, the lyrics, and a second prompt word to obtain a first emotion feature vector of the comment and a second emotion feature vector of the lyrics, and the third model is a pre-trained large language model used to extract emotion feature vectors of the comment and the lyrics, and the second prompt word is used to instruct the third model to extract the emotion feature vector.
[0072] A cosine similarity between the first emotion feature vector and the second emotion feature vector is calculated to obtain an emotion similarity 223 of the comment.
[0073] As an example but not limitation, the third model includes a sentiment analysis LLM capable of identifying and extracting sentiment tendencies in the text, such as positive sentiment, negative sentiment, neutral sentiment, etc.
[0074] For example, the comment A and the lyrics A are obtained, and the second prompt word includes: "extract the sentiment feature vectors corresponding to the comment A and the lyrics A respectively according to the comment A and the lyrics A". After obtaining the first sentiment feature vector and the second sentiment feature vector, the cosine similarity between the two sentiment feature vectors is calculated as the sentiment similarity 223 of the comment, which can reflect the relevance between the sentiment of the comment and the lyrics.
[0075] For (4), the purpose is to associate the comment with the audio feature.
[0076] In some embodiments, a fourth model is invoked based on the comment and the third prompt word to obtain a keyword feature vector corresponding to a keyword of the comment, the keyword being related to the audio feature of the audio, the fourth model being used to extract the keyword feature vector, and the third prompt word being used to instruct the fourth model to extract the keyword feature vector.
[0077] The audio is analyzed by using an audio database to obtain an audio feature vector corresponding to the audio feature;
[0078] The cosine similarity between the keyword feature vector and the audio feature vector is calculated to obtain an audio feature similarity 224 of the comment.
[0079] As an example but not limitation, the audio feature includes at least one of the following: frequency, loudness, chroma feature, mel-frequency cepstral coefficient.
[0080] For example, the comment A is obtained, the keyword includes the audio features such as frequency and loudness, and the third prompt word includes: "extract the keyword feature vector according to the comment A and the keyword"; the audio A is obtained, and the audio feature vector is generated by using an audio database such as Librosa, and then the cosine similarity between the keyword feature vector and the audio feature vector is calculated as the audio feature similarity 224, which can reflect the relevance between the comment and the audio feature.
[0081] In some embodiments, the weighted sum of the similarities of different dimensions is calculated to obtain an output similarity 230 of the comment.
[0082] Optionally, the weight of the weighted sum is a preset value that allows adjustment.
[0083] Exemplarily, the different dimensions of the similarity include a lyric similarity 221, a theme similarity 222, an emotion similarity 223, and an audio feature similarity 224, where the lyric similarity 221 corresponds to a weight of 0.4, the theme similarity 222 corresponds to a weight of 0.3, the emotion similarity 223 corresponds to a weight of 0.2, and the audio feature similarity 224 corresponds to a weight of 0.1, so the output similarity 230 = 0.4 * lyric similarity 221 + 0.3 * theme similarity 222 + 0.2 * emotion similarity 223 + 0.1 * audio feature similarity 224.
[0084] In some embodiments, it is determined whether the output similarity 230 is less than a quality threshold.
[0085] Optionally, in a case where the output similarity 230 is greater than or equal to the quality threshold, the comment 210 is not modified.
[0086] If the output similarity 230 is greater than or equal to the quality threshold, it indicates that the quality of the comment 210 has reached the level of a high-quality comment, and no modification is needed.
[0087] In some embodiments, in a case where the output similarity is less than the quality threshold, it is determined whether an author account is authorized, the author account being a corresponding account of the comment.
[0088] If the output similarity 230 is less than the quality threshold, it indicates that the quality of the comment 210 is poor, and the quality of the comment 210 can be improved by modifying the comment 210, but the modification of the comment 210 must be authorized by the author account, and the comment 210 will not be modified without authorization of the author account.
[0089] It should be noted that the account information (including but not limited to account device information, account personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the account or fully authorized by all parties, and the collection, use, and processing of the related data need to comply with relevant laws, regulations, and standards of relevant countries and regions.
[0090] In some embodiments, the comment 210 is not modified without satisfying the condition of authorization of the author account.
[0091] For example, a comment A is “the sound is strange, a bit like in a bucket, not much feeling, the whole thing is not good”, the output similarity of the comment A is less than the quality threshold, but the comment A will not be modified without authorization of the author account, and the original comment is retained.
[0092] In some embodiments, if the output similarity 230 is less than the quality threshold, and under the condition of author account authorization, the large language model is called based on comment 210 and the first prompt word to modify comment 210 into a high-quality comment 240, and the output similarity of the high-quality comment 240 is greater than or equal to the quality threshold.
[0093] Among them, the large language model is used to improve the output similarity of comment 210, and the first prompt word is used to instruct the large language model to modify comment 210 into a high-quality comment 240.
[0094] Optionally, if the output similarity is less than the quality threshold, and provided that the author account has checked the "Allow modification" checkbox, the large language model is invoked based on comment 210 and the first prompt word to modify the comment into a high-quality comment.
[0095] like Figure 2 As shown, comment 210 (comment A) is "The sound is strange, a bit like being in a bucket, not very impressive, overall not very good." The output similarity of comment A is less than the quality threshold, and the author account checked the "Allow modification" checkbox 250 when posting the comment, indicating that the author account allows modification of comment A. Therefore, based on comment A and the first prompt word, the large language model is called. The first prompt word includes: "Increase the output similarity of comment A and modify comment A into a high-quality comment," resulting in high-quality comment 240 (high-quality comment B): "The sound performance is poor, the overall feeling is dull and lacks depth." Figure 2 (Only a portion of high-quality comment B is used as an example; the rest is omitted.) High-quality comment B is more professional and more accurate in its description compared to comment A.
[0096] In summary, the method provided in this embodiment calculates the weighted sum of the similarities between comment and song information across different dimensions to obtain the output similarity of the comment. If the output similarity is less than a quality threshold, the comment is modified into a higher-quality comment. This method calculates comment quality from different dimensions, which is more comprehensive and reasonable compared to single-dimensional calculation, and it improves the overall comment quality by modifying lower-quality comments into higher-quality ones.
[0097] The method provided in this embodiment further modifies comments into high-quality comments by invoking a large language model based on the comment and the first prompt word, provided that the output similarity is less than a quality threshold and the author's account authorization is satisfied. This ensures that the comment modification is authorized by the author's account, and the high-quality comments obtained by invoking the large language model are more natural, thus solving the problem that author accounts want to publish high-quality comments but lack sufficient capabilities.
[0098] Figure 3 A flowchart of a method for improving comment quality provided in an exemplary embodiment of this application is shown, the method comprising at least one of the following steps.
[0099] Step 310: Obtain the comment and the comment-related song information.
[0100] The song information includes at least one of lyrics and audio.
[0101] For example, the comment A "the sound is strange, a little like in a barrel, not much feeling, the whole thing is not good" and the lyrics A and the audio A are obtained.
[0102] Optionally, the song information further includes singer, composer, lyricist, song using musical instruments, song belonging company, etc., which are not limited in the embodiments of the present application.
[0103] Step 320: Calculate the similarity of the comment and the song information in different dimensions based on the comment and the song information.
[0104] In some embodiments, the similarity in different dimensions includes at least two of the following: lyrics similarity; theme similarity; emotion similarity; audio feature similarity.
[0105] The lyrics similarity is the similarity between the text of the comment and the lyrics; the theme similarity is the similarity between the theme of the comment and the lyrics; the emotion similarity is the similarity between the emotion of the comment and the lyrics; and the audio feature similarity is the similarity between the audio feature of the comment and the audio.
[0106] Optionally, the similarity in different dimensions can further include other dimensions, which are only taken as an example in the embodiments of the present application and are not limited.
[0107] By calculating the similarity in different dimensions, the correlation between the comment and the song information can be quantified, thereby facilitating the subsequent improvement of the quality of the comment.
[0108] Step 330: Calculate the weighted sum of the similarity in different dimensions to obtain the output similarity of the comment.
[0109] Optionally, the weight of the weighted sum is a preset value that is allowed to be adjusted. In the case of obtaining the output similarity of the comment, the weight corresponding to the similarity in different dimensions is manually adjusted to make the output similarity more reasonable.
[0110] For example, the similarity in different dimensions includes lyrics similarity, theme similarity, emotion similarity and audio feature similarity, wherein the weight corresponding to the lyrics similarity is set to 0.4, the weight corresponding to the theme similarity is set to 0.3, the weight corresponding to the emotion similarity is set to 0.2, and the weight corresponding to the audio feature similarity is set to 0.1, so the output similarity = 0.4*lyrics similarity + 0.3*theme similarity + 0.2*emotion similarity + 0.1*audio feature similarity.
[0111] The comprehensive similarity is obtained by weighted sum of the similarities in different dimensions, and is more reasonable as the output similarity of the review.
[0112] Step 340: In the case that the output similarity is less than the quality threshold, modifying the review to a high-quality review based on the large language model.
[0113] The output similarity of the high-quality review is greater than or equal to the quality threshold.
[0114] If the output similarity is less than the quality threshold, it means that the quality of the review is poor, and the quality of the review can be improved by modifying the review.
[0115] In some embodiments, in the case that the output similarity is greater than or equal to the quality threshold, the review is not modified. If the output similarity is greater than or equal to the quality threshold, it means that the quality of the review has reached the level of a high-quality review, and the review does not need to be modified.
[0116] In summary, the method provided by the embodiment calculates the weighted sum of the similarities in different dimensions between the review and the song information to obtain the output similarity of the review, and modifies the review to a high-quality review with higher quality in the case that the output similarity is less than the quality threshold. The method calculates the quality of the review from different dimensions, which is more comprehensive and reasonable than single-dimensional calculation, and modifies the review with low quality to a high-quality review, thereby improving the quality of the review.
[0117] Figure 4 A flowchart of a method for improving the quality of a review is shown, and the method includes at least one of the following steps.
[0118] Step 310: Obtain a review and song information related to the review.
[0119] In some embodiments, the review is preprocessed.
[0120] Optionally, the preprocessing includes at least one of the following: filtering a review with a text length less than a length threshold; detecting whether the review includes a violation word; and detecting whether the review includes a keyword.
[0121] The review with a text length less than a length threshold is filtered because a review with a too short text length may not have substantive content. For example, the length threshold is 5 Chinese characters (or 15 bytes), and for the review "haha", the text length is less than the length threshold, so the review is filtered.
[0122] The review is detected whether it includes a violation word in order to avoid the review violating relevant legal provisions. For example, if the review involves violent and terrorist content or other violation words, the review needs to be filtered.
[0123] Detecting whether the comment includes a keyword in the keywords is a word in the pre-set database. Some comments containing keywords will be filtered on a specified date and will not be filtered at other times. For example, comments containing "911" will not be filtered on ordinary days, but will be filtered on September 11.
[0124] Step 320: Based on the comment and the song information, the similarity of the comment and the song information in different dimensions is calculated.
[0125] Step 330: The weighted sum of the similarity in different dimensions is calculated to obtain the output similarity of the comment.
[0126] Step 342: In the case where the output similarity is less than the quality threshold, a large language model is called based on the comment and the first prompt word to modify the comment into a high-quality comment.
[0127] Among them, the large language model is used to improve the output similarity of the comment, and the first prompt word is used to instruct the large language model to modify the comment into a high-quality comment.
[0128] If the output similarity is less than the quality threshold, it means that the quality of the comment is poor, and at this time the large language model can be called based on the comment and the first prompt word to modify the comment, so as to improve the quality of the comment. For example, the first prompt word includes: "improve the output similarity of the comment, and modify the comment into a high-quality comment".
[0129] In some embodiments, the method comprises: in the case where the output similarity is less than the quality threshold, under the condition that the author account authorization is met, calling a large language model based on the comment and the first prompt word to modify the comment into a high-quality comment, and the author account is the account corresponding to the comment.
[0130] Modifying the comment requires authorization of the author account, and the comment will not be modified without authorization of the author account. It should be noted that the account information (including but not limited to account device information, account personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the account or fully authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0131] As an example but not limited, in the case where the output similarity is less than the quality threshold, under the condition that the author account checks the allow modification checkbox, a large language model is called based on the comment and the first prompt word to modify the comment into a high-quality comment.
[0132] For example, the comment A is "the sound is strange, a bit like in a barrel, no feeling yet, the whole thing is not good", the output similarity of the comment A is less than the quality threshold, and the author account checks the allow modification checkbox when publishing the comment, indicating that the author account allows modification of the comment A, so the large language model is called based on the comment A and the first prompt word, the first prompt word includes: "improve the output similarity of the comment A, modify the comment A to a high-quality comment", and a high-quality comment B "the sound performance is poor, the overall feeling is dull and lacks layers" is obtained. Compared with the comment A, the high-quality comment B is more professional and the description is more accurate.
[0133] By way of example and not limitation, a prompt information is displayed when the author account publishes the comment, and the prompt information is used to ask whether the author account agrees to modify the comment;
[0134] In the case where the output similarity is less than the quality threshold, under the condition that the author account agrees to modify the comment, the large language model is called based on the comment and the first prompt word to modify the comment to a high-quality comment.
[0135] For example, when the author account publishes the comment, after clicking the "send" control, the system interface displays a prompt pop-up window, the prompt pop-up window includes a prompt information "do you agree to allow us to modify your comment later, so as to improve the possibility of your comment becoming a high-quality comment?", a "agree" control and a "reject" control, and after the author account clicks the "agree" control, it indicates that the author account agrees to modify the comment.
[0136] In some embodiments, in the case where the output similarity is less than the quality threshold, under the condition that the author account does not authorize, the comment is not modified.
[0137] For example, the comment A is "the sound is strange, a bit like in a barrel, no feeling yet, the whole thing is not good", the output similarity of the comment A is less than the quality threshold, but in the case where the author account does not authorize, the comment A is not modified, but the original comment is retained.
[0138] In some embodiments, the first prompt word includes a reference to the style of the historical comments of the author account, and the comment is modified to a high-quality comment, and the author account is the account corresponding to the comment.
[0139] For the author account with historical comments, the modified comment referring to the style of the historical comments is more natural and conforms to the language habits of the author account.
[0140] In some embodiments, the method further includes: obtaining historical comments of the author account;
[0141] The feature extraction model is used to extract text features, and the feature extraction prompt word is used to instruct the feature extraction model to extract historical text features of the historical review.
[0142] The analysis model is used to analyze text features to obtain the style of the text, including but not limited to commonly used words in historical reviews, common emotions in historical reviews, etc., wherein the commonly used words are words with a frequency greater than a word frequency threshold in historical reviews, and the word frequency threshold is a pre-set value, for example, 50%.
[0143] For example, in 10 historical reviews of the author account, 7 start with "I think", with a frequency of 70%, which is higher than the word frequency threshold, so starting with "I think" is a style of historical reviews. The modified high-quality review can also start with "I think", which is more likely to be accepted by the author account.
[0144] In some embodiments, the large language model is trained based on a training set, the training set includes a sample text pair, the sample text pair includes a sample poor-quality review and a corresponding sample high-quality review, the corresponding output similarity of the sample poor-quality review is less than a quality threshold, and the corresponding output similarity of the sample high-quality review is greater than or equal to the quality threshold.
[0145] Optionally, the sample poor-quality review and the sample high-quality review carry corresponding classification information, for example, the sample poor-quality review is "the sound is strange and not good to listen to", which carries negative emotion type emotion classification information, and the corresponding sample high-quality review is "the sound performance is not good and makes people uncomfortable", which also carries negative emotion type emotion classification information.
[0146] In some embodiments, the method further comprises: calling a classification model based on the review and the song information to obtain the classification of the review and the song information, and the classification model is used to distinguish the classification to which the review and the song information belong.
[0147] Optionally, the first prompt word includes the classification of the reference review and the song information, the review is modified into a high-quality review according to the sample high-quality review, and the sample high-quality review is associated with the classification. The sample high-quality review is a review with an output similarity greater than a quality threshold selected by a person, and carries the classification corresponding to the review, for example, carries the classification of "positive emotion" and "school theme".
[0148] In some embodiments, the song information includes lyrics and audio, and the classification model includes a text classification network and an audio classification network, and the method further comprises:
[0149] The sample text is input into the text classification network, and the sample text carries a corresponding text sample classification;
[0150] The text classification network outputs a text prediction classification of the sample text;
[0151] The similarity between the text sample classification and the text prediction classification is compared, and the text classification network is trained with the similarity greater than a first classification threshold as a target;
[0152] The sample audio is input into an audio classification network, and the sample audio carries a corresponding audio sample classification;
[0153] The audio classification network outputs an audio prediction classification of the sample audio;
[0154] The similarity between the audio sample classification and the audio prediction classification is compared, and the audio classification network is trained with the similarity greater than a second classification threshold as a target, and the first classification threshold and the second classification threshold are the same or different.
[0155] For example, training the text classification network or training the audio classification network includes adjusting hyperparameters, such as adjusting the learning rate, the number of training rounds, etc. of the text classification network or the audio classification network.
[0156] By way of example but not limitation, the classification model includes a topic classification model, a sentiment classification model, an audio feature classification model, etc. The embodiments of the present application are not limited thereto, and the sentiment classification model is taken as an example for illustration.
[0157] For example, the sentiment classification model is invoked based on the comment A and the song information A, and the classification of the comment A and the song information A is obtained. The classification of the comment A and the song information A is a negative sentiment type. The sample high-quality comment in the training set carrying the negative sentiment type includes a sample high-quality comment C. The first prompt word includes: “Reference negative sentiment type, modify comment A to high-quality comment according to sample high-quality comment C”.
[0158] In some embodiments, the method further includes: invoking a classification model based on the comment and the song information to obtain a classification of the comment and the song information, the classification model being used to distinguish the classification to which the comment and the song information belong;
[0159] Based on the classification of the comment and the song information, other songs containing the same classification are searched in the audio database;
[0160] In the case of outputting a similarity less than a quality threshold, a large language model is invoked based on the comment and the first prompt word to modify the comment to a high-quality comment;
[0161] The first prompt word includes a reference to the classification of the comment and the song information, and the comment is modified to a high-quality comment according to a popular comment associated with the other songs containing the same classification. The popular comment includes a comment whose statistical indicator exceeds a statistical threshold. The statistical indicator includes at least one of the number of likes and the number of replies.
[0162] For example, for a song A, the classification of a comment A includes: a positive sentiment type, the classification of the song information of the song A includes: a campus life type, a positive sentiment type and a piano type, a song B is searched in the audio database based on the above classifications, and the classification of the song information of the song B includes: a campus life type, a positive sentiment type, a piano type and a violin type.
[0163] The popular comments associated with the song B include a comment B1, a comment B2 and a comment B3, wherein the comment B1 is the comment with the largest number of likes and replies. The method can modify the comment by referring to the comment B1, the comment B2 and the comment B3, or can modify the comment by referring to only the comment B1.
[0164] For example, the first prompt word includes: “modify the comment to a high-quality comment by referring to the classification of the comment and the song information, and according to the comment with the largest number of likes in the popular comments associated with other songs containing the same classification”.
[0165] In some embodiments, the method further comprises: calling a key word model based on the comment to obtain key words included in the comment, the key words including words used to represent the semantics of the comment;
[0166] In the case that the output similarity is less than the quality threshold, calling a large language model based on the comment and the first prompt word to modify the comment to a high-quality comment;
[0167] The first prompt word includes a sentence pattern in a sentence pattern database, and the high-quality comment is modified from the comment by referring to the key words included in the comment, and the sentence pattern database includes at least one of a commonly used sentence pattern, a popular sentence pattern and a classic sentence pattern.
[0168] The commonly used sentence pattern is a sentence pattern that conforms to the language use standard or conforms to the language use habit; the popular sentence pattern is a sentence pattern with a heat index greater than a first heat threshold in a first specified time period (for example, in the last week), and the heat index includes at least one of the number of search times and the number of related entries; the classic sentence pattern is a sentence pattern with a heat index greater than a second heat threshold in a second specified time period (for example, from 2000 to 2010), and a heat index greater than a third heat threshold in a third specified time period (for example, in the last year), and the first heat threshold, the second heat threshold and the third heat threshold are the same or different.
[0169] In some embodiments, the method further comprises: inputting a sample text into the key word model, the sample text carrying a sample key word artificially labeled;
[0170] The key word model outputs a predicted key word of the sample text;
[0171] The similarity between the predicted key word and the sample key word is compared, and the key word model is trained with the similarity greater than a key word threshold as the target.
[0172] For example, training the key word model includes adjusting hyperparameters, such as adjusting the learning rate of the key word model, the number of training rounds, and the like.
[0173] In some embodiments, the sentence database is a pre-set database that collects various sentences on the network and has a function of updating in time.
[0174] For example, the sentence database is updated once a day, and the classification of the existing sentences in the sentence database is adjusted or new sentences are added according to the heat index. For example, sentence A was a popular sentence last week, but the heat index this week is less than the first heat threshold, so sentence A is deleted from the popular sentence; or, sentence B has a heat index greater than the second heat threshold in 2020, and the heat index in the last week is greater than the third heat threshold, so sentence B is classified as a classic sentence.
[0175] The sentence database can also include other types of sentences, and the embodiments of the present application are only described by way of example with the above three types of sentences, without being limited thereto.
[0176] For example, the comment C is: “Someone said that the style of this song is old-fashioned, but I like it very much”, wherein the key words include “old-fashioned style” and “I like it very much”, and the sentence database includes the sentence C: “Who said that this XX is Y? This XX is Z!” Based on the comment and the first prompt word, the large language model is called to modify the comment C to the high-quality comment C: “Who said that this song is old? This song is great!”.
[0177] In some embodiments, the song information includes the singer, the lyricist, and the composer, and the method further includes: searching for related information of the singer, the lyricist, and the composer;
[0178] In the case where the output similarity is less than the quality threshold, the large language model is called based on the comment and the first prompt word to modify the comment to a high-quality comment, including: in the case where the output similarity is less than the quality threshold, the large language model is called based on the comment and the first prompt word to modify the comment to a high-quality comment;
[0179] The first prompt word includes reference information of the singer, the lyricist, and the composer, and the comment is modified to a high-quality comment.
[0180] By way of example but not limitation, the related information of the singer, the lyricist, and the composer includes at least one of the following: biographical information; related stories when singing or creating the song; singing style; lyric writing style; and composition style.
[0181] For example, the singer of song A is singer X, the lyricist is singer X's father Y, and the composer is singer X's mother Z. Before singer X sang song A for the first time, father Y and mother Z passed away, so song A also contains singer X's longing for father Y and mother Z. Based on such information, relevant content is added in the comments.
[0182] The above-mentioned information of the singer, lyricist and composer is used as reference information for the large language model to generate high-quality comments, thereby improving the professionalism and relevance of the high-quality comments to the song.
[0183] In summary, the method provided in the embodiment reduces the amount of comments that need to be processed subsequently by preprocessing the comments, thereby reducing the data processing pressure.
[0184] The method provided in the embodiment also modifies the comments to high-quality comments based on the comments and the first prompt word by calling the large language model under the condition that the output similarity is less than the quality threshold and the author account authorization condition is met, thereby ensuring that the modified comments are authorized by the author account, solving the problem that the author account wants to post high-quality comments but does not have enough ability, and subsequent modification operations will not disturb the author account.
[0185] The method provided in the embodiment also modifies the comments to high-quality comments by referring to the style of the historical comments of the author account, so that the modified comments are more natural and consistent with the language habits of the author account, and are more likely to be accepted by the author account.
[0186] The method provided in the embodiment also modifies the comments to high-quality comments by referring to the classification of the comments and the song information, and according to the sample high-quality comments, so that the comments can be modified more specifically, and the quality of the high-quality comments can be guaranteed with the sample high-quality comments as a reference.
[0187] The method provided in the embodiment also modifies the comments to high-quality comments by referring to the classification of the comments and the song information, and according to the popular comments associated with other songs containing the same classification, since the comments for the current song and other songs containing the same classification usually have similarities, and the popular comments associated with other songs are more popular comments, the high-quality comments obtained by modifying according to the popular comments associated with other songs containing the same classification are more likely to meet the user's preferences.
[0188] The method provided in the embodiment also modifies the comments to high-quality comments by referring to the sentence patterns in the sentence pattern database and according to the key words included in the comments, thereby improving the interestingness and popularity of the comments based on the expression of the semantic comments and in combination with the sentence patterns in the sentence pattern database (such as popular sentence patterns).
[0189] The method provided by the embodiment further modifies the comment into a high-quality comment by referring to the related information of the singer, lyricist and composer, and improves the professionalism and relevance of the high-quality comment to the song.
[0190] Figure 5 A flowchart of a method for improving comment quality is shown, and the method comprises at least one of the following steps.
[0191] Step 310: Obtain the comment and the song information related to the comment.
[0192] Step 321: Calculate the lyric similarity of the comment based on the text of the comment and the lyrics.
[0193] Optionally, step 320 comprises at least two of steps 321 to 324, and the embodiment of the present application is generally described by taking an example in which step 320 comprises steps 321 to 324, without being limited thereto.
[0194] In some embodiments, the first text feature vector of the comment and the second text feature vector of the lyrics are extracted by calling a first model, and the first model is used to extract the text feature vector.
[0195] The cosine similarity between the first text feature vector and the second text feature vector is calculated to obtain the lyric similarity of the comment.
[0196] Optionally, the first model comprises a bag-of-words model, which is used to extract the first text feature vector and the second text feature vector, and then the cosine similarity between the two text feature vectors is calculated as the lyric similarity of the comment, and the lyric similarity can reflect the relevance between the text content of the comment and the lyrics.
[0197] Step 322: Calculate the theme similarity of the comment based on the theme of the comment and the lyrics.
[0198] In some embodiments, the probability distribution vectors corresponding to the comment and the lyrics are obtained by calling a second model, the second model is used to identify the theme in the comment and the lyrics, and the comment is represented as a first probability distribution vector of the theme, and the lyrics are represented as a second probability distribution vector of the theme, each element in the first probability distribution vector is used to represent the probability that the comment belongs to the theme, each element in the second probability distribution vector is used to represent the probability that the lyrics belong to the theme, and the theme is used to describe the scene involved in the comment and the lyrics.
[0199] The cosine similarity between the first probability distribution vector and the second probability distribution vector is calculated to obtain the theme similarity of the comment.
[0200] By way of example but not limitation, the theme comprises a scene for describing things, such as a scenery scene, a character scene, a natural scene, etc.
[0201] After obtaining the first probability distribution vector and the second probability distribution vector by calling the second model, a cosine similarity between the two probability distribution vectors is calculated as a theme similarity of the comment, and the theme similarity can reflect a relevance between the theme of the comment and the theme of the lyrics.
[0202] Step 323: Based on the sentiment of the comment and the lyrics, a sentiment similarity of the comment is calculated.
[0203] In some embodiments, a third model is called based on the comment, the lyrics and a second prompt word, to obtain a first sentiment feature vector of the comment and a second sentiment feature vector of the lyrics, the third model being a pre-trained large language model for extracting sentiment feature vectors of the comment and the lyrics, and the second prompt word being used to instruct the third model to extract the sentiment feature vectors.
[0204] A cosine similarity between the first sentiment feature vector and the second sentiment feature vector is calculated to obtain the sentiment similarity of the comment.
[0205] By way of example but not limitation, the third model includes a sentiment analysis LLM capable of identifying and extracting sentiment tendencies in text, such as positive sentiment, negative sentiment, neutral sentiment, etc.
[0206] Illustratively, the comment A and the lyrics A are obtained, and the second prompt word includes: “extract the sentiment feature vectors corresponding to the comment A and the lyrics A respectively according to the comment A and the lyrics A”. After obtaining the first sentiment feature vector and the second sentiment feature vector, a cosine similarity between the two sentiment feature vectors is calculated as a sentiment similarity of the comment, and the sentiment similarity can reflect a relevance between the sentiment of the comment and the sentiment of the lyrics.
[0207] Step 324: Based on the comment and the audio, an audio feature similarity of the comment is calculated.
[0208] In some embodiments, a fourth model is called based on the comment and a third prompt word to obtain a keyword feature vector corresponding to a keyword of the comment, the keyword being related to an audio feature of the audio, and the fourth model being used to extract the keyword feature vector, and the third prompt word being used to instruct the fourth model to extract the keyword feature vector.
[0209] The audio is analyzed by using an audio database to obtain an audio feature vector corresponding to the audio feature;
[0210] A cosine similarity between the keyword feature vector and the audio feature vector is calculated to obtain the audio feature similarity of the comment.
[0211] By way of example and not limitation, the audio features include at least one of the following: frequency, loudness, chroma features, Mel-Frequency Cepstral Coefficients (MFCC).
[0212] wherein the frequency refers to the number of vibrations of a sound wave per unit time, which determines the pitch of the sound; the loudness is a subjective feeling of the human ear to the strength of the sound; the chroma features are features used to describe the pitch information; the MFCC is obtained by converting the frequency spectrum of the audio signal into a mel-scale frequency spectrum through a mel filter bank, and calculating the discrete cosine transform of the mel-scale frequency spectrum.
[0213] For example, the comment A is obtained, the keywords include the audio features such as frequency and loudness, and the third prompt word includes: “extract the keyword feature vector according to the comment A and the keywords”; the audio A is obtained, the audio feature vector is generated by using an audio database such as Librosa, and then the cosine similarity between the keyword feature vector and the audio feature vector is calculated as the audio feature similarity, which can reflect the relevance between the comment and the audio features.
[0214] The audio features can also include other types, and the embodiments of the present application are only described by way of example of the above audio features, without limitation.
[0215] Step 330: Calculate the weighted sum of the similarities in different dimensions to obtain the output similarity of the comment.
[0216] Step 340: In the case where the output similarity is less than the quality threshold, modify the comment to a high-quality comment based on the large language model.
[0217] In summary, the method provided by the embodiment calculates the quality of the comment from different dimensions, which is more comprehensive and reasonable compared with single-dimensional calculation, and helps to improve the relevance of the subsequent modified high-quality comment and at least one of the text of the lyrics, the theme of the lyrics, the emotion of the lyrics, and the audio features of the audio.
[0218] Figure 6 A flowchart of a method for improving the quality of a comment provided by an example embodiment of the present application is shown, and the method and Figure 3 Compared with the embodiment, the method further includes the following steps.
[0219] Step 350: Calculate the output similarity of the high-quality comment based on the modified high-quality comment and the song information.
[0220] The output similarity of the high-quality comment is obtained by calculating the similarity of the modified high-quality comment and the song information in different dimensions based on the modified high-quality comment and the song information, and then calculating the weighted sum of the similarity in different dimensions. For specific implementation details, refer to Figure 5 Embodiments are not described here again.
[0221] Step 360: Based on the output similarity of the high-quality comment and the output similarity of the other comment other than the high-quality comment, the high-quality comment and the other comment are sorted in descending order.
[0222] For example, the output similarity of the high-quality comment A is 0.9, the output similarity of the other comment D is 0.88, and the output similarity of the other comment E is 0.85. Then the order of the sorting order is high-quality comment A, other comment D, and other comment E.
[0223] Further, the server sends the order and the related comments to the client, and the client displays the comments in the order of high-quality comment A, other comment D, and other comment E.
[0224] In summary, the method provided in the embodiment sorts the high-quality comment and the other comment in descending order based on the output similarity of the high-quality comment and the output similarity of the other comment other than the high-quality comment, and ranks the comment with higher output similarity in the front position, so that the account can see the comment with higher quality when viewing the comment area.
[0225] In the above embodiments, steps with the same serial numbers can be considered as the same step. Among them, Figure 3 Corresponding embodiments, Figure 4 Corresponding embodiments, Figure 5 Corresponding embodiments and Figure 6 Corresponding embodiments can be implemented independently or in combination, and the present application does not limit this.
[0226] For example, the method for improving the quality of comments is applied to the server scene related to the music application program. The server obtains comment A and song information A related to comment A. The song information A includes lyrics A and audio A.
[0227] The author account sends comment A to the server through the client. The author account is the account corresponding to comment A. Moreover, when the author account publishes comment A through the client, the author account checks the allow modification checkbox, indicating that the author account allows to modify comment A.
[0228] The server calculates the similarity of the comment A and the song information A in different dimensions based on the comment A and the song information A, including: calculating the lyric similarity of the comment A based on the text of the comment A and the lyrics A; calculating the theme similarity of the comment A based on the theme of the comment A and the lyrics A; calculating the emotion similarity of the comment A based on the emotion of the comment A and the lyrics A; and calculating the audio feature similarity of the comment A based on the comment A and the audio A. For specific implementation details, please refer to Figure 5 In an embodiment, the above description is not repeated here.
[0229] For example, the lyric similarity of the comment A is 0.66, the theme similarity of the comment A is 0.76, the emotion similarity of the comment A is 0.21, and the audio feature similarity of the comment A is 0.1.
[0230] The weighted sum of the similarity of the four dimensions is calculated to obtain the output similarity of the comment A. For example, the weight corresponding to the lyric similarity is set to 0.4, the weight corresponding to the theme similarity is set to 0.3, the weight corresponding to the emotion similarity is set to 0.2, and the weight corresponding to the audio feature similarity is set to 0.1. Therefore, the output similarity = 0.4*lyric similarity + 0.3*theme similarity + 0.2*emotion similarity + 0.1*audio feature similarity = 0.4*0.66 + 0.3*0.76 + 0.2*0.21 + 0.1*0.1 = 0.264 + 0.228 + 0.042 + 0.01 = 0.544.
[0231] Since the quality threshold is 0.7, in the case where the output similarity (0.544) is less than the quality threshold, the author account authorization condition is met, and the large language model is called based on the comment A and the first prompt word to modify the comment A to a high-quality comment.
[0232] Since the author account checks the permission to modify the checkbox, the author account authorization condition is met. For example, the first prompt word includes: "improve the output similarity of the comment A, and modify the comment A to a high-quality comment", the comment A is "the sound is strange, a little like in a bucket, no feeling yet, the overall is not good", and the modified high-quality comment B is "the sound performance is poor, the overall feeling is dull and lacks depth". The high-quality comment B is more professional and more accurate than the comment A.
[0233] The server sends the high-quality comment B to the client after modifying the comment A to the high-quality comment B, and the client displays the high-quality comment B.
[0234] Figure 7 A block diagram of a comment quality improvement device provided by an exemplary embodiment of the present application is shown. The device can be realized as a computer device or a part of a computer device through software or hardware or a combination of both. The device includes:
[0235] The acquisition module 710 is configured to acquire a comment and comment-related song information, the song information including at least one of lyrics and audio;
[0236] The calculation module 720 is configured to calculate a similarity of the comment and the song information in different dimensions based on the comment and the song information.
[0237] The calculation module 720 is configured to calculate a weighted sum of the similarities in different dimensions to obtain an output similarity of the comment.
[0238] The processing module 730 is configured to, in a case where the output similarity is less than a quality threshold, modify the comment into a high-quality comment based on a large language model, the output similarity of the high-quality comment being greater than or equal to the quality threshold.
[0239] In a possible design of the embodiment, the processing module 730 is configured to, in a case where the output similarity is less than the quality threshold, invoke the large language model based on the comment and a first prompt word to modify the comment into the high-quality comment.
[0240] The large language model is configured to improve the output similarity of the comment, and the first prompt word is configured to instruct the large language model to modify the comment into the high-quality comment.
[0241] In a possible design of the embodiment, the processing module 730 is configured to, in a case where the output similarity is less than the quality threshold, invoke the large language model based on the comment and the first prompt word to modify the comment into the high-quality comment, under a condition that an author account is authorized, the author account being an account corresponding to the comment.
[0242] In a possible design of the embodiment, the processing module 730 is configured to, in a case where the output similarity is less than the quality threshold, invoke the large language model based on the comment and the first prompt word to modify the comment into the high-quality comment.
[0243] The first prompt word includes a style of a historical comment of a reference author account, the author account being the account corresponding to the comment.
[0244] In a possible design of the embodiment, the processing module 730 is further configured to invoke a classification model based on the comment and the song information to obtain a classification of the comment and the song information, the classification model being configured to distinguish a classification to which the comment and the song information belong.
[0245] The processing module 730 is configured to, in a case where the output similarity is less than the quality threshold, invoke the large language model based on the comment and a first prompt word to modify the comment into a high-quality comment.
[0246] The first prompt word includes a classification of the comment and the song information, and the comment is modified into the high-quality comment according to a sample high-quality comment, the sample high-quality comment being associated with the classification.
[0247] In a possible design of the present embodiment, the large language model is trained based on a training set, and the training set includes sample text pairs, each of which includes a sample poor-quality comment and a corresponding sample high-quality comment, the sample poor-quality comment corresponds to an output similarity less than a quality threshold, and the sample high-quality comment corresponds to an output similarity greater than or equal to the quality threshold.
[0248] In a possible design of the present embodiment, the computing module 720 is configured to perform at least two of the following:
[0249] calculating a lyric similarity of the comment based on the text of the comment and the text of the lyrics;
[0250] calculating a theme similarity of the comment based on the theme of the comment and the theme of the lyrics;
[0251] calculating an emotion similarity of the comment based on the emotion of the comment and the emotion of the lyrics;
[0252] calculating an audio feature similarity of the comment based on the comment and the audio.
[0253] In a possible design of the present embodiment, the computing module 720 is configured to extract a first text feature vector of the comment and a second text feature vector of the lyrics by invoking a first model, and the first model is configured to extract a text feature vector.
[0254] calculating a cosine similarity between the first text feature vector and the second text feature vector to obtain the lyric similarity of the comment.
[0255] In a possible design of the present embodiment, the computing module 720 is configured to obtain a probability distribution vector corresponding to the comment and a probability distribution vector corresponding to the lyrics by invoking a second model, and the second model is configured to identify a theme in the comment and the lyrics, and represent the comment as a first probability distribution vector of the theme and represent the lyrics as a second probability distribution vector of the theme, each element in the first probability distribution vector is used to represent a probability that the comment belongs to the theme, each element in the second probability distribution vector is used to represent a probability that the lyrics belong to the theme, and the theme is used to describe a scene involved in the comment and the lyrics.
[0256] calculating a cosine similarity between the first probability distribution vector and the second probability distribution vector to obtain the theme similarity of the comment.
[0257] In a possible design of the present embodiment, the computing module 720 is configured to invoke a third model based on the comment, the lyrics, and a second prompt word to obtain a first emotion feature vector of the comment and a second emotion feature vector of the lyrics, and the third model is a pre-trained large language model configured to extract an emotion feature vector of the comment and the lyrics, and the second prompt word is used to instruct the third model to extract the emotion feature vector.
[0258] The sentiment similarity of the comments is obtained by calculating the cosine similarity between the first sentiment feature vector and the second sentiment feature vector.
[0259] In one possible design of this embodiment, the calculation module 720 is used to call the fourth model based on the comment and the third prompt word to obtain the keyword feature vector corresponding to the keyword of the comment. The keyword is related to the audio features of the audio. The fourth model is used to extract the keyword feature vector, and the third prompt word is used to instruct the fourth model to extract the keyword feature vector.
[0260] By analyzing audio using an audio database, audio feature vectors corresponding to audio features are obtained;
[0261] Calculate the cosine similarity between the keyword feature vector and the audio feature vector to obtain the audio feature similarity of the comment.
[0262] In one possible design of this embodiment, the audio features include at least one of the following: frequency, loudness, chromaticity features, and Mel frequency cepstral coefficients.
[0263] In one possible design of this embodiment, the calculation module 720 is used to calculate the output similarity of high-quality comments based on the modified high-quality comment and song information;
[0264] The sorting module 740 is used to sort high-quality comments and other comments in descending order based on the output similarity of high-quality comments and the output similarity of other comments besides high-quality comments.
[0265] This embodiment uses an acquisition module 710, a calculation module 720, a processing module 730, and a sorting module 740 as an example for illustration. The number of acquisition modules 710, calculation modules 720, processing modules 730, and sorting modules 740 is not limited.
[0266] For a functional introduction to module 710, please refer to [link / reference]. Figure 3 The content of step 310 in the embodiment.
[0267] For a functional description of the 720 computing module, please refer to [link / reference]. Figure 3 The contents of steps 320 and 330 in the embodiment are as follows: Figure 5 The contents of steps 321, 322, 323, and 324 in the embodiment are as follows: Figure 6 The content of step 350 in the embodiment.
[0268] For a functional description of the processing module 730, please refer to [link / reference]. Figure 3 The content of step 340 in the embodiment, Figure 4 The content of step 342 in the embodiment.
[0269] The functions of the sorting module 740 are described in detail in the following. Figure 6 The content of step 360 in the embodiment.
[0270] Figure 8 A structural block diagram of a computer device 800 is shown according to an example embodiment of the present application. The computer device can be used to implement the method for improving the quality of comments provided in the above embodiments. The computer device 800 includes a central processing unit (CPU) 801, a system memory 804 including a random access memory (RAM) 802 and a read-only memory (ROM) 803, and a system bus 805 connecting the system memory 804 and the central processing unit 801. The computer device 800 also includes an input / output (I / O) system 806 to help transfer information between various devices in the computer device, and a mass storage device 807 for storing an operating system 813, application programs 814, and other program modules 815.
[0271] The input / output system 806 includes a display 808 for displaying information and an input device 809 such as a mouse, keyboard, or the like for inputting information by a user. The display 808 and the input device 809 are both connected to the central processing unit 801 through an input / output controller 810 connected to the system bus 805. The input / output system 806 can also include an input / output controller 810 for receiving and processing input from a keyboard, mouse, or electronic stylus, or other devices. Similarly, the input / output controller 810 also provides output to a display screen, printer, or other types of output devices.
[0272] The mass storage device 807 is connected to the central processing unit 801 through a mass storage controller (not shown) connected to the system bus 805. The mass storage device 807 and its associated computer readable storage media provide non-volatile storage for the computer device 800. That is, the mass storage device 807 can include a computer readable storage medium (not shown) such as a hard disk or a compact disc read-only memory (CD-ROM) drive.
[0273] Without loss of generality, the computer-readable storage medium can include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable storage instructions, data structures, program modules or other data. Computer storage media include RAM, ROM, erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other solid-state storage technologies, CD-ROM, digital versatile discs (DVD), or other optical storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices. Of course, a person skilled in the art can know that the computer storage medium is not limited to the above several. The system memory 804 and the mass storage device 807 described above can be collectively referred to as a memory.
[0274] The memory stores one or more programs configured to be executed by the one or more central processing units 801, and the one or more programs contain instructions for implementing the above method embodiments, and the central processing unit 801 executes the one or more programs to implement the comment quality improvement method provided by each of the above method embodiments.
[0275] According to various embodiments of the present application, the computer device 800 can also be connected to a remote terminal device running on a network through a network such as the Internet. That is, the computer device 800 can be connected to a network 812 through a network interface unit 811 connected to the system bus 805, or in other words, the network interface unit 811 can also be used to connect to other types of networks.
[0276] The memory also includes one or more programs stored in the memory, and the one or more programs contain steps performed by the computer device in the method provided by the embodiments of the present application.
[0277] The embodiments of the present application also provide a computer device, which includes a processor and a memory, and the memory stores at least one program; the processor is used to execute the at least one program in the memory to implement the comment quality improvement method provided by each of the above method embodiments.
[0278] The embodiment of the present application further provides a computer readable storage medium, and at least one program is stored in the computer readable storage medium, the at least one program is loaded by a processor and executed to realize the method for improving the comment quality provided by each method embodiment.
[0279] The embodiment of the present application further provides a computer program product, the computer program product comprises computer instructions, the computer instructions are stored in a computer readable storage medium, a processor acquires the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to realize the method for improving the comment quality provided by each method embodiment.
[0280] It should be understood that "multiple" mentioned herein refers to two or more than two. "And / or" describes the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B can represent the following three cases: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents that the associated objects before and after it are in an "or" relationship.
[0281] Those skilled in the art should realize that in one or more examples described above, the functions described in the embodiments of the present application can be realized by hardware, software, firmware or any combination thereof. When realized by software, these functions can be stored in a computer readable storage medium or transmitted as one or more instructions or codes on a computer readable storage medium. The computer readable storage medium includes a computer storage medium and a communication medium, wherein the communication medium includes any medium facilitating the transmission of a computer program from one place to another. The storage medium can be any available medium accessible by a general-purpose or special-purpose computer.
[0282] The above is only an optional embodiment of the present application, and is not used to limit the present application, and any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for improving the quality of comments, characterized in that, The method includes: Obtain the comment and related song information, wherein the song information includes at least one of lyrics and audio; Based on the comments and the song information, calculate the similarity between the comments and the song information in different dimensions; Calculate the weighted sum of the similarities across the different dimensions to obtain the output similarity of the comment; If the output similarity is less than the quality threshold, a large language model is invoked based on the comment and the first prompt word to modify the comment into a high-quality comment, wherein the output similarity of the high-quality comment is greater than or equal to the quality threshold. The first prompt word includes a classification that references the comments and the song information, and modifies the comments to the high-quality comments based on sample high-quality comments, wherein the sample high-quality comments and the classification are associated.
2. The method according to claim 1, characterized in that, in, The large language model is used to improve the output similarity of the comment, and the first prompt word is used to instruct the large language model to modify the comment into a high-quality comment.
3. The method according to claim 2, characterized in that, When the output similarity is less than the quality threshold, the step of calling a large language model based on the comment and the first prompt word to modify the comment into a high-quality comment includes: If the output similarity is less than the quality threshold, and the author account authorization is satisfied, the large language model is invoked based on the comment and the first prompt word to modify the comment into the high-quality comment, where the author account is the account corresponding to the comment.
4. The method according to claim 3, characterized in that, in, The first prompt includes referencing the style of the author's account's historical comments, modifying the comment to the high-quality comment, where the author's account is the account corresponding to the comment.
5. The method according to claim 3, characterized in that, The method further includes: Based on the comments and song information, a classification model is invoked to obtain the classification of the comments and song information. The classification model is used to distinguish the classification to which the comments and song information belong.
6. The method according to claim 5, characterized in that, The large language model is trained on a training set, which includes sample text pairs. Each sample text pair includes a poor-quality sample comment and a corresponding good-quality sample comment. The output similarity corresponding to the poor-quality sample comment is less than the quality threshold, and the output similarity corresponding to the good-quality sample comment is greater than or equal to the quality threshold.
7. The method according to claim 1, characterized in that, The step of calculating the similarity between the comment and the song information across different dimensions includes at least two of the following: Calculate the lyric similarity of the comment based on the text of the comment and the lyrics; Calculate the topic similarity of the comments based on the topics of the comments and the lyrics; Calculate the emotional similarity of the comments based on the emotions of the lyrics; Based on the comment and the audio, calculate the audio feature similarity of the comment.
8. The method according to claim 7, characterized in that, The calculation of the lyric similarity of the comment based on the text of the comment and the lyrics includes: The first model is used to extract the first text feature vector of the comment and the second text feature vector of the lyrics by calling the first model; The cosine similarity between the first text feature vector and the second text feature vector is calculated to obtain the lyric similarity of the comment.
9. The method according to claim 7, characterized in that, The calculation of topic similarity of the comments based on the topics of the comments and the lyrics includes: The second model is used to obtain the probability distribution vectors corresponding to the comments and lyrics respectively. The second model is used to identify the themes in the comments and lyrics, and represents the comments as a first probability distribution vector of the theme, and the lyrics as a second probability distribution vector of the theme. Each element in the first probability distribution vector is used to represent the probability that the comments belong to the theme, and each element in the second probability distribution vector is used to represent the probability that the lyrics belong to the theme. The theme is used to describe the scenario involved in the comments and lyrics. The cosine similarity between the first probability distribution vector and the second probability distribution vector is calculated to obtain the topic similarity of the comment.
10. The method according to claim 7, characterized in that, The calculation of the emotional similarity of the comment based on the sentiment of the comment and the lyrics includes: Based on the comment, the lyrics, and the second prompt word, a third model is invoked to obtain the first sentiment feature vector of the comment and the second sentiment feature vector of the lyrics. The third model is a pre-trained large language model used to extract the sentiment feature vectors of the comment and the lyrics. The second prompt word is used to instruct the third model to extract the sentiment feature vectors. The cosine similarity between the first sentiment feature vector and the second sentiment feature vector is calculated to obtain the sentiment similarity of the comment.
11. The method according to claim 7, characterized in that, The step of calculating the audio feature similarity of the comment based on the comment and the audio includes: Based on the comment and the third prompt word, the fourth model is invoked to obtain the keyword feature vector corresponding to the keyword of the comment. The keyword is related to the audio features of the audio. The fourth model is used to extract the keyword feature vector, and the third prompt word is used to instruct the fourth model to extract the keyword feature vector. By analyzing the audio using an audio database, the audio feature vector corresponding to the audio features is obtained; The cosine similarity between the keyword feature vector and the audio feature vector is calculated to obtain the audio feature similarity of the comment.
12. The method according to claim 10, characterized in that, The audio features include at least one of the following: frequency, loudness, chromaticity features, and Mel frequency cepstral coefficients.
13. The method according to any one of claims 1 to 12, characterized in that, The method further includes: Based on the modified high-quality comments and the song information, the output similarity of the high-quality comments is calculated; Based on the output similarity of the high-quality comments and the output similarity of other comments besides the high-quality comments, the high-quality comments and the other comments are sorted in descending order.
14. A device for improving the quality of reviews, characterized in that, The device includes: The acquisition module is used to acquire the comment and song information related to the comment, wherein the song information includes at least one of lyrics and audio. The calculation module is used to calculate the similarity between the comment and the song information in different dimensions based on the comment and the song information. The calculation module is used to calculate the weighted sum of the similarities in different dimensions to obtain the output similarity of the comment; The processing module is used to call a large language model based on the comment and the first prompt word when the output similarity is less than the quality threshold, and modify the comment into a high-quality comment, wherein the output similarity of the high-quality comment is greater than or equal to the quality threshold. The first prompt word includes a classification that references the comments and the song information, and modifies the comments to the high-quality comments based on sample high-quality comments, wherein the sample high-quality comments and the classification are associated.
15. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing at least one program; the processor is configured to execute the at least one program in the memory to implement the method for improving comment quality as described in any one of claims 1 to 13.
16. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one program, which is loaded and executed by a processor to implement the method for improving comment quality as described in any one of claims 1 to 13.
17. A computer program product, characterized in that, The computer program product includes computer instructions stored in a computer-readable storage medium, a processor retrieving the computer instructions from the computer-readable storage medium, and the processor executing the computer instructions to implement the method for improving comment quality as described in any one of claims 1 to 13.
Citation Information
Patent Citations
Reference bullet screen display method, system and device and electronic equipment
CN116996747A
Comment quality determination method and device, electronic equipment and storage medium
CN118378629A