Method for generating comments based on large model, model training method and device and medium

By obtaining the information of the object to be commented and determining its comment style label, and combining reference examples in the example library to generate style matching comment content, the problem of insufficient accuracy of comment content in the prior art is solved and the user experience is improved.

CN119441407APending Publication Date: 2025-02-14BAIDU (CHINA) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411549518.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

It is difficult for the prior art to generate comment content that matches the object to be commented and has high accuracy, especially in the user's consumption behavior of comment content in the recommendation system, users tend to explore other users' opinions and feedback.

Method used

By obtaining the information of the object to be commented, determining the matching comment style tag, and obtaining the corresponding reference examples in the sample library, inputting them into the comment generation model to generate the target comment that matches the style.

Benefits of technology

It realizes the generation style matching the comment content of the object to be commented, which improves the accuracy of the comments and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119441407A_ABST
    Figure CN119441407A_ABST
Patent Text Reader

Abstract

The invention provides a comment generation method based on a large model, a comment generation model training method and device and a medium, and relates to the technical field of artificial intelligence, in particular to the technical field of natural language processing and large language models. According to the implementation scheme, first information of a to-be-commented object is obtained; based on the first information, determining a comment style label matched with the to-be-commented object; obtaining a reference example corresponding to the comment style label in an example library; and inputting a first prompt text corresponding to the comment style label, the first information and the reference example into a comment generation model to generate a target comment corresponding to the comment style label for commenting the to-be-commented object according to the first prompt text, the reference example and the first information through the comment generation model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, in particular to the field of natural language processing and large language model technology, and specifically to a method for generating comments based on a large model, a training method, device, electronic device, computer-readable storage medium and computer program product for a comment generation model. Background Art

[0002] Artificial intelligence is a discipline that studies how to use computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.). It includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, as well as machine learning / deep learning, big data processing technology, knowledge graph technology, and other major directions.

[0003] In building an efficient and highly engaged recommendation system, users' consumption behavior of recommended content is not limited to browsing and absorbing the content itself, but is also deeply reflected in their interaction with the comment area attached to the content. Users tend to actively explore other users' opinions, feedback or additional information while consuming recommended content. This behavior pattern reveals the importance of social interaction in improving user stickiness and content attractiveness.

[0004] The methods described in this section are not necessarily methods that have been previously conceived or employed. Unless otherwise indicated, it should not be assumed that any method described in this section is considered to be prior art simply because it is included in this section. Similarly, unless otherwise indicated, the issues mentioned in this section should not be considered to have been recognized in any prior art. Summary of the invention

[0005] The present disclosure provides a method for generating comments based on a large model, a training method, an apparatus, an electronic device, a computer-readable storage medium, and a computer program product for a comment generation model.

[0006] According to one aspect of the present disclosure, a method for generating comments based on a large model is provided, including: obtaining first information of an object to be commented on, the first information including at least one of a title and a content summary; based on the first information, determining a comment style label that matches the object to be commented on; obtaining a reference example corresponding to the comment style label in an example library, the reference example including example object description information and example comments; and inputting first prompt text, first information and reference example corresponding to the comment style label into a comment generation model, so as to generate a target comment corresponding to the comment style label for commenting on the object to be commented on according to the first prompt text, the reference example and the first information through the comment generation model.

[0007] According to another aspect of the present disclosure, a training method for a comment generation model is provided, comprising: obtaining first sample data, the first sample data comprising first information of a first sample object, a first comment style label, and a sample comment corresponding to the first comment style label, the first information comprising at least one of a title and a content summary; obtaining a first reference example corresponding to the first comment style label in an example library, the first reference example comprising example object description information and an example comment; inputting a first prompt text, the first information, and the first reference example corresponding to the first comment style label into a first initial model, so as to generate, through the first initial model, a first comment corresponding to the first comment style label for commenting on the first sample object according to the first prompt text, the first reference example, and the first information; and adjusting parameters of the first initial model based on the first comment and the sample comment.

[0008] According to another aspect of the present disclosure, a comment generation device is provided, including: a first acquisition unit, configured to acquire first information of an object to be commented on, the first information including at least one of a title and a content summary; a first determination unit, configured to determine a comment style label matching the object to be commented on based on the first information; a second acquisition unit, configured to acquire a reference example corresponding to the comment style label in an example library, the reference example including example object description information and example comments; and a generation unit, configured to input a first prompt text, the first information and a reference example corresponding to the comment style label into a comment generation model, so as to generate a target comment corresponding to the comment style label for commenting on the object to be commented on according to the first prompt text, the reference example and the first information through the comment generation model.

[0009] According to another aspect of the present disclosure, a training device for a comment generation model is provided, comprising: a first acquisition unit, configured to acquire first sample data, the first sample data comprising first information of a first sample object, a first comment style label, and a sample comment corresponding to the first comment style label, the first information comprising at least one of a title and a content summary; a second acquisition unit, configured to acquire a first reference example corresponding to the first comment style label in an example library, the first reference example comprising example object description information and an example comment; a generation unit, configured to input a first prompt text, the first information and a first reference example corresponding to the first comment style label into a first initial model, so as to generate, through the first initial model, a first comment corresponding to the first comment style label for commenting on the first sample object according to the first prompt text, the first reference example and the first information; and an adjustment unit, configured to adjust parameters of the first initial model based on the first comment and the sample comment.

[0010] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned method for generating comments based on a large model or the training method for a comment generation model.

[0011] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the above-mentioned method for generating comments based on a large model or the method for training a comment generation model.

[0012] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein the computer program implements the above-mentioned method for generating comments based on a large model or the method for training a comment generation model when executed by a processor.

[0013] According to one or more embodiments of the present disclosure, it is possible to generate review content with a style matching the object to be reviewed and with higher accuracy.

[0014] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The accompanying drawings exemplarily illustrate the embodiments and constitute a part of the specification, and together with the text description of the specification, are used to explain the exemplary implementation of the embodiments. The embodiments shown are for illustrative purposes only and do not limit the scope of the claims. In all drawings, the same reference numerals refer to similar but not necessarily identical elements.

[0016] Figure 1 A schematic diagram showing an exemplary system in which the various methods described herein may be implemented according to an embodiment of the present disclosure;

[0017] Figure 2 A flowchart of a method for generating comments based on a large model according to an embodiment of the present disclosure is shown;

[0018] Figure 3 A flowchart of a method for training a review generation model according to an embodiment of the present disclosure is shown;

[0019] Figure 4 A flowchart of a method for training a review generation model according to an embodiment of the present disclosure is shown;

[0020] Figure 5A structural block diagram of a comment generating device according to an embodiment of the present disclosure is shown;

[0021] Figure 6 A structural block diagram of a training device for a review generation model according to an embodiment of the present disclosure is shown;

[0022] Figure 7 A structural block diagram of an exemplary electronic device that can be used to implement the embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0023] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0024] In the present disclosure, unless otherwise specified, the use of the terms "first", "second", etc. to describe various elements is not intended to limit the positional relationship, temporal relationship, or importance relationship of these elements, and such terms are only used to distinguish one element from another element. In some examples, the first element and the second element may refer to the same instance of the element, and in some cases, based on the description of the context, they may also refer to different instances.

[0025] The terms used in the description of various examples in this disclosure are only for the purpose of describing specific examples and are not intended to be limiting. Unless the context clearly indicates otherwise, if the number of elements is not specifically limited, the element can be one or more. In addition, the term "and / or" used in this disclosure covers any one of the listed items and all possible combinations.

[0026] In the related art, methods for generating comments usually include the following: 1) Comment generation based on rules and templates: According to the keywords or topics in the content, select a suitable template from the predefined comment template library, fill in the corresponding words or short sentences, and generate comments related to the content. The comments generated by this scheme are relatively simple and lack flexibility; 2) Comment generation based on content summary: Extract key information or summaries from the original text and integrate them into concise and clear comments. The comment content generated by this scheme is only a summary of the content of the comment object, lacking analysis of viewpoints; 3) Comment generation based on style transfer: Use style transfer technology to convert comments of one style into another style (such as from formal to humorous). The comment content generated by this scheme has poor semantic coherence.

[0027] The embodiment of the present disclosure discloses a method for generating comments based on a large model, which determines a comment style label according to the first information of the object to be commented on, and obtains at least one reference example corresponding to the comment style label in the example library; the first prompt text corresponding to the comment style label, the first information and the at least one reference example are input into the comment generation model together, so that the comment generation model analyzes and understands the first information under the guidance of the first prompt text, and refers to the example object description information and the example comments of the corresponding style in at least one reference example to generate a target comment of the corresponding style for the object to be commented on. Through the above method, it is possible to generate comment content with a style suitable for the object to be commented on and with higher accuracy.

[0028] The embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.

[0029] Figure 1 FIG. 1 is a schematic diagram of an exemplary system 100 in which various methods and apparatuses described herein may be implemented according to an embodiment of the present disclosure. Figure 1 , the system 100 includes one or more client devices 101, 102, 103, 104, 105, and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. The client devices 101, 102, 103, 104, 105, and 106 may be configured to execute one or more applications.

[0030] In an embodiment of the present disclosure, the server 120 may run one or more services or software applications that enable the execution of the above-mentioned method for generating comments based on a large model or the method for training a comment generation model.

[0031] In some embodiments, server 120 may also provide other services or software applications, which may include non-virtualized environments and virtualized environments. In some embodiments, these services may be provided as web-based services or cloud services, such as provided to users of client devices 101, 102, 103, 104, 105, and / or 106 under a software as a service (SaaS) model.

[0032] exist Figure 1 In the configuration shown, the server 120 may include one or more components that implement the functions performed by the server 120. These components may include software components, hardware components, or a combination thereof that can be executed by one or more processors. Users operating client devices 101, 102, 103, 104, 105, and / or 106 may in turn utilize one or more client applications to interact with the server 120 to utilize the services provided by these components. It should be understood that a variety of different system configurations are possible, which may differ from the system 100. Therefore, Figure 1 is one example of a system for implementing the various methods described herein and is not intended to be limiting.

[0033] The user can use client devices 101, 102, 103, 104, 105 and / or 106 to read the generated review content. The client device can provide an interface that enables the user of the client device to interact with the client device. The client device can also output information to the user via the interface. Figure 1 Only six client devices are depicted, but one skilled in the art will appreciate that the present disclosure may support any number of client devices.

[0034] Client devices 101, 102, 103, 104, 105 and / or 106 may include various types of computer devices, such as portable handheld devices, general-purpose computers (such as personal computers and laptop computers), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, game systems, thin clients, various messaging devices, sensors or other sensing devices, etc. These computer devices may run various types and versions of software applications and operating systems, such as MICROSOFT Windows, APPLE iOS, UNIX-like operating systems, Linux or Linux-like operating systems (such as GOOGLE Chrome OS); or include various mobile operating systems, such as MICROSOFT Windows Mobile OS, iOS, Windows Phone, Android. Portable handheld devices may include cellular phones, smart phones, tablet computers, personal digital assistants (PDAs), etc. Wearable devices may include head-mounted displays (such as smart glasses) and other devices. Game systems may include various handheld game devices, Internet-enabled game devices, etc. Client devices are capable of executing various different applications, such as various Internet-related applications, communication applications (such as email applications), short message service (SMS) applications, and may use various communication protocols.

[0035] The network 110 may be any type of network known to those skilled in the art that may support data communications using any of a variety of available protocols, including but not limited to TCP / IP, SNA, IPX, etc. By way of example only, the one or more networks 110 may be a local area network (LAN), an Ethernet-based network, a token ring, a wide area network (WAN), the Internet, a virtual network, a virtual private network (VPN), an intranet, an extranet, a blockchain network, a public switched telephone network (PSTN), an infrared network, a wireless network (e.g., Bluetooth, WIFI), and / or any combination of these and / or other networks.

[0036] Server 120 may include one or more general purpose computers, dedicated server computers (e.g., PC (personal computer) servers, UNIX servers, mid-range servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and / or combination. Server 120 may include one or more virtual machines running virtual operating systems, or other computing architectures involving virtualization (e.g., one or more flexible pools of logical storage devices that may be virtualized to maintain a server's virtual storage device). In various embodiments, server 120 may run one or more services or software applications that provide the functionality described below.

[0037] The computing units in the server 120 may run one or more operating systems including any of the above operating systems and any commercially available server operating systems. The server 120 may also run any of a variety of additional server applications and / or middle-tier applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, etc.

[0038] In some implementations, server 120 may include one or more applications to analyze and consolidate data feeds and / or event updates received from users of client devices 101, 102, 103, 104, 105, and / or 106. Server 120 may also include one or more applications to display data feeds and / or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105, and / or 106.

[0039] In some embodiments, the server 120 may be a server of a distributed system, or a server combined with a blockchain. The server 120 may also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. A cloud server is a host product in a cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and virtual private servers (VPS) services.

[0040] The system 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data and other information. For example, one or more of the databases 130 may be used to store information such as audio files and video files. The databases 130 may reside in various locations. For example, the database used by the server 120 may be local to the server 120, or may be remote from the server 120 and may communicate with the server 120 via a network-based or dedicated connection. The databases 130 may be of different types. In some embodiments, the databases used by the server 120 may be, for example, relational databases. One or more of these databases may store, update, and retrieve data to and from the databases in response to commands.

[0041] In some embodiments, one or more of the databases 130 may also be used by applications to store application data. The databases used by the applications may be different types of databases, such as a key-value store, an object store, or a conventional store backed by a file system.

[0042] Figure 1 The system 100 may be configured and operated in various ways to enable the application of various methods and apparatuses described in the present disclosure.

[0043] According to some embodiments, Figure 2 As shown, a method for generating comments based on a large model is provided, including: step S201, obtaining first information of an object to be commented on, the first information including at least one of a title and a content summary; step S202, determining a comment style label matching the object to be commented on based on the first information; step S203, obtaining a reference example corresponding to the comment style label in an example library, the reference example including example object description information and example comments; and step S204, inputting a first prompt text, first information and reference example corresponding to the comment style label into a comment generation model, so as to generate a target comment corresponding to the comment style label for commenting on the object to be commented on through the comment generation model according to the first prompt text, the reference example and the first information.

[0044] Thus, by determining the review style label according to the first information of the object to be reviewed, and obtaining the reference example corresponding to the review style label in the example library; the first prompt text, the first information and the reference example corresponding to the review style label are input into the review generation model together, so that the review generation model analyzes and understands the first information under the guidance of the first prompt text, and refers to the sample object description information and the sample review of the corresponding style in the reference example to generate the target review of the corresponding style for the object to be reviewed. Through the above method, the review content with the style matching the object to be reviewed can be generated, the accuracy of the review can be improved, and the user experience can be further improved.

[0045] In some embodiments, the object to be commented on may be various types of recommendation information from a recommendation system, including but not limited to video objects, picture objects, audio objects, article objects, etc. from the recommendation system.

[0046] In some embodiments, first information of the object to be reviewed is obtained. The first information may include at least one of a title and a content summary. For the object to be reviewed of the type of video, picture or audio, the content summary may be the description information of the corresponding object, or the summary information obtained by extracting and summarizing the text information in the corresponding object.

[0047] In some embodiments, the first information of an article object may also include the full text of the article. In some embodiments, the first information of a video object or a picture object may also include image features (e.g., one or more frames of video images in a video object and the picture object itself). In some embodiments, the first information of an audio object may also include audio features.

[0048] It is understandable that relevant technical personnel can determine the content of the first information by themselves, and no limitation is made here.

[0049] In some embodiments, the first information may also include a classification label corresponding to the object to be commented on. Based on the first information, it is determined that the comment style label that matches the object to be commented on can match its corresponding comment style label according to the classification label. For example, for vertical information such as law, finance, and technology, select in-depth style comments to ensure that the comment content has in-depth analysis; for vertical information such as automobiles and golf, select professional style comments to show the professionalism of the comments. This precise matching of classification labels and emotional styles can not only improve the accuracy of comments, but also better meet user needs for content in different fields and improve user experience.

[0050] In some embodiments, the above-mentioned classification labels may include multi-level classification labels, so that the review styles suitable for the content to be evaluated in various fields can be more accurately divided through the multi-level classification labels.

[0051] After obtaining the review style tag corresponding to the object to be reviewed, reference examples corresponding to the review style tag may be further obtained from the example library. The number of reference examples may be one or more, which is not limited here.

[0052] The example library may be a preset knowledge base, in which reference examples corresponding to a plurality of comment style tags may be pre-stored. For each comment style tag, the example library includes a plurality of reference examples corresponding to the comment style tag, and each reference example includes example object description information and example comments corresponding to the comment style tag.

[0053] In some embodiments, the example object description information may include at least one of a title and a content summary of the example object.

[0054] In some embodiments, the example object description information may be a title of the example object, thereby improving the efficiency of subsequent comment generation by simplifying the content in the reference example.

[0055] In some embodiments, construction of the above-mentioned example library may include: obtaining high-quality comments historically input by users in the recommended content database, and on this basis, classifying and rewriting the high-quality comments by style, and saving the high-quality comments and the description information of their corresponding example objects in the example library.

[0056] In some embodiments, obtaining at least one reference example corresponding to the comment style label in the example library may be randomly extracting at least one reference example from a plurality of reference examples corresponding to the determined comment style label.

[0057] After obtaining the reference example, the first prompt text corresponding to the determined comment style label, the above-mentioned first information, and the above-mentioned reference example can be input into the comment generation model together to obtain the target comment output by the comment generation model for the object to be commented on and corresponding to the determined comment style label.

[0058] In some embodiments, the comment generation model described above may be a general large language model.

[0059] In some embodiments, the comment generation model described above may also be a model obtained by further training based on a general large language model. The specific training method will be described in detail below.

[0060] In some embodiments, a corresponding first prompt text may be preset for each comment style label, and the first prompt text is used to guide the comment generation model to analyze and understand the first information, and refer to the example object description information and the example comments of the corresponding style in at least one reference example to generate a target comment of the corresponding style for the object to be commented on. For example, "Based on <the first information of the object to be commented on>, refer to <reference example 1> and <reference example 2>, generate a humorous and funny style comment".

[0061] In some embodiments, the first prompt text may also include prompt text for the number of target comments to be generated, for example, "generate a comment on...", "generate 2 comments on...".

[0062] In some embodiments, the first prompt text may also include prompt text for guiding the comment generation model to refer to network information related to the comment style. For example, "...generate humorous and funny comments, which can quote network buzzwords, hot topics, or use appropriate exaggerated language", or "...generate highly professional comments, which can refer to relevant professional knowledge on the Internet".

[0063] In some embodiments, the first prompt text may also include prompt text for guiding the comment generation model to avoid citing other additional network information in the comment content, such as "... only generate comments without any additional information".

[0064] In some embodiments, the first prompt text may include the above prompt text and a slot for integrating the above first information and reference examples. Before inputting the comment generation model, the first prompt text, the first information and the reference examples may be integrated and input into the model together. For example, the first prompt text for guiding the comment generation model to generate funny comments may be:

[0065] “Based on the title and summary, **generate** two **funny comments**. The comments can quote Internet buzzwords, hot topics, or use appropriate exaggerated language. Generate only the comments without any additional information.

[0066] Example:

[0067] Title: 《%s》

[0068] Funny comment: %s

[0069] Title: 《%s》

[0070] Funny comment: %s

[0071] Title: 《%s》

[0072] Summary: %s

[0073] Funny comment 1:

[0074] Funny comment 2:”

[0075] In some exemplary embodiments, corresponding first prompt texts may be preset for comment style labels such as "positive encouragement", "funny", "professional", and "depth". For the positive encouragement style, the positive and energetic elements may be emphasized; for the funny style, the sense of humor and the ability to create humor using online hot spots may be emphasized; for the professional style, the use of professional insights and industry professional terms may be emphasized; and for the in-depth style, the profound content and extensible viewpoints may be emphasized.

[0076] In some embodiments, the first prompt text corresponding to the comment style label, the first information and at least one reference example are input into the comment generation model together. The comment generation model can analyze and understand the first information under the guidance of the first prompt text, and refer to the example object description information and the example comments of the corresponding style in at least one reference example to generate a target comment of the corresponding style for the object to be commented on. In this way, the generated comment content can generate comment content with more prominent style, more coherent semantics and higher accuracy based on the comments of the corresponding style reference examples on the basis of smooth semantics, thereby improving the user experience.

[0077] In some embodiments, obtaining reference examples corresponding to comment style tags in an example library may include: based on first information, obtaining reference examples from candidate examples corresponding to comment style tags in the example library, wherein the correlation between example object description information of each reference example and the first information is higher than a predetermined correlation.

[0078] In some embodiments, obtaining a reference example corresponding to a comment style label in the example library may also be performed by first determining one or more candidate examples of the corresponding style in the example library based on the determined comment style label; then, respectively calculating the correlation between the example object description information of each candidate example and the first information, and taking the candidate examples whose correlation meets preset conditions as reference examples.

[0079] In some embodiments, the relevance between the example object description information of the candidate example and the first information may be the text similarity or semantic similarity between the two information.

[0080] In some embodiments, the relevance between the example object description information of the candidate examples and the first information may also be the text similarity or semantic similarity between their respective corresponding classification labels.

[0081] In some embodiments, the predetermined relevance can be set by relevant technical personnel according to actual needs, and is not limited here.

[0082] Therefore, through the above-mentioned method of obtaining reference examples, it is possible to obtain reference examples that are closer to the object to be reviewed, and applying such reference examples to generate reviews can further improve the accuracy of the generated review content.

[0083] In some embodiments, based on the first information, among the candidate examples corresponding to the comment style label in the example library, obtaining a reference example may include: inputting the comment style label, the first information, and the second prompt text into a first language model, so as to obtain a reference example through the first language model according to the second prompt text, the comment style label, the first information, and the example object description information of each candidate example in the example library.

[0084] In some embodiments, based on the first information, obtaining the reference example from the candidate examples corresponding to the comment style tag in the example library may also be achieved through the first language model.

[0085] In some embodiments, the first language model may be a general large language model.

[0086] In some embodiments, the second prompt text is used to guide the first language model to analyze the example object description information of each candidate example in the example library according to the first information and the comment style label, and select the reference example that is most suitable for the current object to be commented on and the comment style based on the analysis results.

[0087] In some embodiments, the second prompt text may further include a plurality of preset comment style tags, and be used to guide the first language model to select a comment style tag of the object to be commented on from the plurality of comment style tags.

[0088] The aforementioned multiple preset comment style tags may correspond to the comment style tags included in the example library.

[0089] In some exemplary embodiments, the above-mentioned preset multiple comment style tags may include, for example, "positive encouragement", "funny", "controversial", "ordinary", "professional", "depth", etc. It is understandable that relevant technicians can set the comment style tags according to actual needs, and there is no limitation here.

[0090] Therefore, by applying the first language model, it is possible to obtain reference examples that are more suitable for the current object to be reviewed and the review style. Applying such reference examples to generate reviews can further improve the accuracy of the generated review content, thereby improving the user experience.

[0091] In some embodiments, based on the first information, determining the comment style label that matches the object to be commented on may include: at least inputting the first information into a comment style acquisition model to obtain an output comment style label, wherein the comment style acquisition model is trained based on at least two sample comments with labeled style labels.

[0092] In some embodiments, the first information can be analyzed by a trained review style acquisition model, and based on the first information, a review style that is most suitable for evaluating the review object can be predicted from a plurality of preset review style labels. The review style acquisition model can be trained based on a plurality of sample data, wherein each sample data includes the first information of the sample object and the review style label corresponding to the sample object.

[0093] Therefore, by applying the comment style acquisition model to analyze the first information and predict the comment style label, the accuracy of determining the comment style label can be further improved.

[0094] In some embodiments, at least the first information is input into the comment style acquisition model, and obtaining the output comment style label may include: inputting the first information and the third prompt text into the comment style acquisition model, so as to determine the comment style label from at least two preset style labels according to the third prompt text and the first information through the comment style acquisition model.

[0095] In some embodiments, the comment style acquisition model may also be a large language model trained based on the above sample data.

[0096] In some embodiments, the third prompt text can be used to guide the comment style acquisition model to analyze the first information and select the most suitable comment style label from a plurality of preset comment style labels based on the first information.

[0097] In some embodiments, the first information and the third prompt text can be input into the above-mentioned comment style acquisition model together, so that the comment style acquisition model analyzes the first information under the guidance of the third prompt text, and selects the most suitable comment style label for the object to be commented on from multiple preset comment style labels based on the first information.

[0098] Therefore, by applying a large language model to analyze the first information and predict the comment style label, the accuracy of determining the comment style label can be further improved.

[0099] In some embodiments, Figure 3 As shown, a training method for a comment generation model is provided, including: step S301, obtaining first sample data, the first sample data including first information of a first sample object, a first comment style label, and a sample comment corresponding to the first comment style label, the first information including at least one of a title and a content summary; step S302, obtaining a first reference example corresponding to the first comment style label in an example library, the first reference example including example object description information and an example comment; step S303, inputting a first prompt text, the first information and the first reference example corresponding to the first comment style label into a first initial model, so as to generate a first comment corresponding to the first comment style label for commenting on the first sample object according to the first prompt text, the first reference example and the first information through the first initial model; and step S304, adjusting the parameters of the first initial model based on the first comment and the sample comment.

[0100] The review generation model training method can be used to train a review generation model for the method of generating reviews based on a large model. The review generation model is used to generate reviews, which can generate review content with a style suitable for the review object and higher accuracy, thereby improving user experience.

[0101] In some embodiments, the first initial model may be a general large language model.

[0102] In some embodiments, the first sample data may be obtained by screening historical review content in a recommended content database.

[0103] In some embodiments, the historical comment content may be filtered using preset a posteriori indicators, where the a posteriori indicators may include, for example, at least one of the number of likes, the number of replies, and the number of distributions.

[0104] In some exemplary embodiments, high-quality comments in the recommended content database with a like amount greater than a first threshold (eg, 800) and a distribution amount greater than a second threshold (eg, 5) may be used as sample comments.

[0105] In some exemplary embodiments, high-quality comments in the recommended content database with a like amount greater than a first threshold, a distribution amount greater than a second threshold, and a ratio of a reply amount to a like amount less than a third threshold (e.g., 0.7) can be used as sample comments.

[0106] After obtaining the sample comments, the comment style of each sample comment can be further annotated. In some embodiments, the comment style of each sample comment can be annotated based on a trained classification model to obtain a first comment style label of each sample comment. The classification model can be trained by sample comments with annotated comment styles.

[0107] In some embodiments, the prompt text and the sample comment can be input into the large language model together, so that the large language model can perform style annotation on the sample comment based on its text understanding ability. The prompt text can be used to guide the large language model to select a comment style label that best matches the style of the current sample comment from among multiple preset comment style labels.

[0108] In some exemplary embodiments, the above-mentioned multiple comment style tags may include, for example, styles such as "positive encouragement", "funny", "controversial", "ordinary", "professional", "in-depth", etc. It is understandable that relevant technicians can set the number and category of comment style tags according to actual needs, and there is no limitation here.

[0109] After the first comment style label of each sample comment is obtained, the sample comment, the first comment style label of the sample comment and the first information of the corresponding first sample object may be used as the first sample data.

[0110] Acquiring the first reference example corresponding to the first comment style tag in the example library may be randomly selecting the first reference example from multiple reference examples corresponding to the first comment style tag in the example library. The number of the first reference examples may be one or more, which is not limited here. The method for constructing the example library can be referred to above and will not be described in detail here.

[0111] In some embodiments, a corresponding first prompt text may be preset for each comment style label. The first prompt text used in the model training phase may be the same as the first prompt text used in the above-mentioned method for generating comments based on a large model, which will not be described in detail here. By constructing first prompt texts of different styles in the model training phase and training the model, the model can better distinguish comments with different emotional styles, and then the model can generate comment content with a style matching the object to be commented on, thereby improving the accuracy of the comments and further improving the user experience.

[0112] In some embodiments, a loss function may be constructed based on the difference between the first comment and the sample comment, and then the first initial model may be trained until the model converges.

[0113] In some embodiments, a model obtained after training with at least one first sample data can be used as a target comment generation model to execute the above-mentioned method of generating comments based on a large model.

[0114] In some embodiments, obtaining a first reference example corresponding to a first comment style tag in an example library may include: based on the first information, obtaining a first reference example from candidate examples corresponding to the first comment style tag in the example library, wherein the correlation between the example object description information of each first reference example and the first information is higher than a predetermined correlation.

[0115] In this way, reference examples that are closer to the object to be reviewed can be obtained. Applying such reference examples to generate reviews can generate review content with more prominent style, more coherent semantics and higher accuracy, thereby improving user experience.

[0116] In some embodiments, based on the first information, among the candidate examples corresponding to the first comment style label in the example library, obtaining the first reference example may include: inputting the first comment style label, the first information, and the second prompt text into the first language model, so as to obtain the first reference example through the first language model according to the second prompt text, the first comment style label, the first information, and the example object description information of each candidate example in the example library.

[0117] Therefore, by applying the first language model, it is possible to obtain reference examples that are more suitable for the current object to be reviewed and the review style. Applying such reference examples to generate reviews can further improve the accuracy of the generated review content.

[0118] In some embodiments, the first initial model is a general large language model that has completed pre-training, and the training method of the above-mentioned comment generation model may also include: determining the target parameters according to the importance of each parameter in the first initial model; and wherein, adjusting the parameters of the first initial model based on the first comment and the sample comment includes: adjusting the target parameters in the first initial model based on the first comment and the sample comment.

[0119] In some embodiments, the target parameters in the first initial model may be determined based on the importance of each parameter in the first initial model, wherein the number of the target parameters may be one or more, which is not limited here.

[0120] In some embodiments, the importance of each parameter can be determined based on a preset importance index, wherein the importance index can include at least one of the size of the parameter, the absolute value of the gradient, and the impact on the model output. For example, a parameter whose absolute value of the gradient is greater than a preset threshold can be used as a target parameter.

[0121] In some embodiments, after determining the target parameters, other parameters in the first initial model that are not the target parameters can be frozen, and only the target parameters can be adjusted to adapt the first initial model to the review generation task. In this way, while reducing the consumption of computing resources and improving the efficiency of fine-tuning, by focusing only on the key parameters in the model (i.e., the target parameters), the basic generalization ability of the pre-trained deep model can be retained, making it more flexible to adapt to new data.

[0122] In some embodiments, Figure 4As shown, the training method of the above-mentioned comment generation model may also include: step S401, obtaining second sample data, the second sample data including second information of the second sample object, a second comment style label, a second reference example, positive sample comments and negative sample comments corresponding to the second comment style label, and the second information including at least one of a title and a content summary; step S402, inputting the third prompt text and the second sample data into the second initial model, so as to obtain, through the second initial model, a first probability corresponding to the positive sample comment and a second probability of the negative sample comment according to the third prompt text, the second information, the second comment style label and the second reference example, wherein the second initial model is the adjusted first initial model; and step S403, adjusting the parameters of the second initial model based on the first probability and the second probability.

[0123] In some embodiments, after completing the previous stage of training, the model (the second initial model, ie, the adjusted first initial model) may be further trained and optimized based on the second sample data.

[0124] The positive sample comments and negative sample comments in the second sample data may be comments that have received positive feedback from users and comments that have received negative feedback from users, respectively, and they may be obtained by screening historical comment content in the recommended content database.

[0125] In some embodiments, the method for screening positive sample comments can refer to the method for screening sample comments described above, which will not be described in detail here.

[0126] In some embodiments, after a positive sample comment is obtained through screening, negative sample comments can be further screened from other comments of the corresponding sample object. The negative sample comments can also be obtained through screening based on a posteriori indicators such as the number of likes, the number of replies, and the number of distributions.

[0127] In some embodiments, comments with a like amount less than a certain threshold (eg, 60) or comments with a ratio of a reply amount to a like amount not less than a certain threshold (eg, 0.7) may be determined as negative sample comments.

[0128] In some embodiments, style annotation may be performed on each sample comment using the method described above, which will not be described in detail here.

[0129] In some embodiments, the positive sample comments and negative sample comments of the same comment style label corresponding to the second sample, the corresponding comment style label (i.e., the second comment style label) and the second reference example can be taken as a second sample data. The number of the second reference examples can be one or more, which is not limited here. The second reference example can be obtained based on any of the methods described above, which will not be described in detail here.

[0130] In some embodiments, the third prompt text can be used to guide the model to output the first probability of the positive sample comment and the second probability of the negative sample comment respectively according to the input second information, the second comment style label and the second reference example, wherein the first probability and the second probability can represent the inclination of the model for the corresponding sample comment. For example, if the first probability is 0.9 and the second probability is 0.1, the model is more inclined to select the positive sample comment.

[0131] In some embodiments, adjusting the parameters of the second initial model based on the first probability and the second probability may be calculating a loss function based on the difference between the first probability and the second probability, and then adjusting the second initial model based on the loss function.

[0132] In some embodiments, the difference between the first probability and the second probability may be a difference in log-likelihood probabilities.

[0133] In some embodiments, the model can be trained by maximizing the above-mentioned difference, thereby obtaining a target comment generation model for the above-mentioned method of generating comments based on a large model.

[0134] Through the above training process, the decision-making process of the model generating comments can be further optimized. By simultaneously strengthening the decision-making behavior of generating positive samples and weakening the decision-making behavior of generating negative samples under the guidance of the implicit reward signal constructed based on the first probability and the second probability, the model can significantly increase the probability of high-quality comments while reducing the probability of low-quality comments, so that the comments generated by the model can be more in line with user preferences.

[0135] In some embodiments, the training method of the above-mentioned comment generation model may also include: inputting the third prompt text and the second sample data into the first initial model, so as to obtain, through the first initial model, a third probability corresponding to the positive sample comment and a fourth probability of the negative sample comment according to the third prompt text, the second information, the second comment style label and the second reference example; and wherein, adjusting the parameters of the second initial model based on the first probability and the second probability includes: adjusting the parameters of the second initial model based on the first probability, the second probability, the third probability and the fourth probability.

[0136] In some embodiments, the second sample data and the third prompt text can be input into the model being optimized at the same time as the second sample data and the third prompt text are input into the first initial model to obtain the third probability and the fourth probability output by the first initial model.

[0137] In some embodiments, based on the first probability, the second probability, the third probability and the fourth probability, adjusting the parameters of the second initial model can be based on the difference between the probability ratio between the first probability and the third probability and the probability ratio between the second probability and the fourth probability, determining the loss function, and then adjusting the second initial model based on the loss function.

[0138] In some embodiments, the above probability ratio may be a log probability ratio.

[0139] In some embodiments, the above loss function can be expressed as the following formula:

[0140]

[0141] Among them, π θ ,π ref are the second initial model and the first initial model in the optimization, respectively; x is the second information in the second sample data, the second comment style label, and the second reference example y w ,y l They represent the positive sample comments and negative sample comments in the second sample data respectively, β is a hyperparameter, and σ is the sigmoid function.

[0142] In some embodiments, the second initial model can be optimized in the above manner based on at least one second sample data until the second initial model converges to obtain a target comment generation model for executing the above method of generating comments based on a large model. By applying the target comment generation model, the probability of high-quality comments appearing can be further increased, while the probability of low-quality comments appearing can be reduced, so that the comments generated by the model can be more in line with the user's preferences.

[0143] In some embodiments, Figure 5 As shown, a device 500 for generating comments based on a large model is provided, including: a first acquisition unit 510, configured to acquire first information of an object to be commented on, the first information including at least one of a title and a content summary; a first determination unit 520, configured to determine a comment style label matching the object to be commented on based on the first information; a second acquisition unit 530, configured to acquire a reference example corresponding to the comment style label in an example library, the reference example including example object description information and example comments; and a generation unit 540, configured to input a first prompt text, the first information and a reference example corresponding to the comment style label into a comment generation model, so as to generate a target comment corresponding to the comment style label for commenting on the object to be commented on according to the first prompt text, the reference example and the first information through the comment generation model.

[0144] in, Figure 5 The various units of the device 500 shown in FIG. 5 can be used in conjunction with the reference Figure 2The steps in the method for generating comments based on a large model correspond to each other. Therefore, the operations, features and advantages described above for the method for generating comments based on a large model are also applicable to the device 500 and the various units included therein. For the sake of brevity, some operations, features and advantages are not repeated here.

[0145] In some embodiments, the second acquisition unit can be further configured to: based on the first information, acquire reference examples from candidate examples corresponding to the comment style label in the example library, wherein the correlation between the example object description information of each reference example and the first information is higher than a predetermined correlation.

[0146] In some embodiments, the second acquisition unit can be further configured to: input the comment style label, the first information and the second prompt text into the first language model, so as to obtain a reference example through the first language model based on the second prompt text, the comment style label, the first information and the example object description information of each candidate example in the example library.

[0147] In some embodiments, the first determination unit may be further configured to: input at least the first information into a comment style acquisition model to obtain an output comment style label, wherein the comment style acquisition model is trained based on at least two sample comments with annotated style labels.

[0148] In some embodiments, the first determination unit may be further configured to input the first information and the third prompt text into a comment style acquisition model, so as to determine a comment style tag from at least two preset style tags according to the third prompt text and the first information through the comment style acquisition model.

[0149] In some embodiments, Figure 6 As shown, a training device 600 for a comment generation model is provided, and the device 600 includes: a first acquisition unit 610, configured to acquire first sample data, the first sample data including first information of a first sample object, a first comment style label, and a sample comment corresponding to the first comment style label, the first information including at least one of a title and a content summary; a second acquisition unit 620, configured to acquire a first reference example corresponding to the first comment style label in an example library, the first reference example including example object description information and an example comment; a generation unit 630, configured to input a first prompt text, the first information and a first reference example corresponding to the first comment style label into a first initial model, so as to generate a first comment corresponding to the first comment style label for commenting on the first sample object according to the first prompt text, the first reference example and the first information through the first initial model; and an adjustment unit 640, configured to adjust the parameters of the first initial model based on the first comment and the sample comment.

[0150] in, Figure 6 The various units of the device 600 shown in FIG. 6 can be compared with those of the reference Figure 3 The steps in the training method of the review generation model described above correspond to each other. Therefore, the operations, features and advantages described above for the training method of the review generation model are also applicable to the device 600 and the various units included therein. For the sake of brevity, some operations, features and advantages are not repeated here.

[0151] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0152] According to an embodiment of the present disclosure, an electronic device, a readable storage medium and a computer program product are also provided.

[0153] refer to Figure 7 , a block diagram of an electronic device 700 that can be used as a server or client of the present disclosure will now be described, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0154] like Figure 7 As shown, the electronic device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the electronic device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0155] Multiple components in the electronic device 700 are connected to the I / O interface 705, including: an input unit 706, an output unit 707, a storage unit 708, and a communication unit 709. The input unit 706 can be any type of device that can input information to the electronic device 700. The input unit 706 can receive input digital or character information and generate key signal input related to user settings and / or function control of the electronic device, and can include but is not limited to a mouse, a keyboard, a touch screen, a track pad, a track ball, a joystick, a microphone, and / or a remote controller. The output unit 707 can be any type of device that can present information, and can include but is not limited to a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 708 can include but is not limited to a disk, an optical disk. The communication unit 709 allows the electronic device 700 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, and can include but is not limited to a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or a chipset, such as a Bluetooth device, an 802.11 device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.

[0156] The computing unit 701 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 701 performs the various methods and processes described above, such as the above-mentioned method for generating comments based on a large model or the above-mentioned training method for the comment generation model. For example, in some embodiments, the above-mentioned method for generating comments based on a large model or the above-mentioned training method for the comment generation model may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 700 via the ROM 702 and / or the communication unit 709. When the computer program is loaded into the RAM 703 and executed by the computing unit 701, one or more steps of the above-mentioned method for generating comments based on a large model or the above-mentioned training method for the comment generation model may be executed. Alternatively, in other embodiments, the computing unit 701 may be configured in any other appropriate manner (for example, by means of firmware) to execute the above-mentioned method for generating comments based on a large model or the above-mentioned method for training a comment generation model.

[0157] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0158] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0159] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0160] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0161] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0162] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0163] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0164] Although the embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it should be understood that the above-mentioned methods, systems and devices are merely exemplary embodiments or examples, and the scope of the present invention is not limited by these embodiments or examples, but only by the claims after authorization and their equivalent scope. Various elements in the embodiments or examples can be omitted or replaced by their equivalent elements. In addition, each step can be performed in an order different from that described in the present disclosure. Further, the various elements in the embodiments or examples can be combined in various ways. It is important that with the evolution of technology, many elements described herein can be replaced by equivalent elements that appear after the present disclosure.

Claims

1. A method for generating comments based on a large model, comprising: Acquire first information of the object to be reviewed, wherein the first information includes at least one of a title and a content summary; Based on the first information, determining a review style tag matching the object to be reviewed; Acquire a reference example corresponding to the comment style tag in an example library, wherein the reference example includes example object description information and example comments; as well as The first prompt text corresponding to the comment style label, the first information and the reference example are input into the comment generation model, so that the comment generation model can generate a target comment corresponding to the comment style label for commenting on the object to be commented on based on the first prompt text, the reference example and the first information.

2. The method according to claim 1, wherein: The obtaining of a reference example corresponding to the comment style tag in the example library includes: Based on the first information, the reference examples are obtained from candidate examples corresponding to the comment style tag in the example library, wherein the correlation between the example object description information of each reference example and the first information is higher than a predetermined correlation.

3. The method according to claim 2, wherein: The acquiring the reference example from the candidate examples corresponding to the comment style tag in the example library based on the first information includes: The comment style label, the first information and the second prompt text are input into a first language model to obtain the reference example through the first language model according to the second prompt text, the comment style label, the first information and the example object description information of each candidate example in the example library.

4. The method according to any one of claims 1 to 3, wherein: The step of determining, based on the first information, a comment style tag matching the object to be commented on comprises: At least the first information is input into a comment style acquisition model to obtain the comment style label as output, wherein the comment style acquisition model is trained based on at least two sample comments that have been annotated with style labels.

5. The method according to claim 4, wherein: The step of at least inputting the first information into a comment style acquisition model to obtain the comment style label as output includes: The first information and the third prompt text are input into the comment style acquisition model, so as to determine the comment style tag from at least two preset style tags according to the third prompt text and the first information through the comment style acquisition model.

6. A method for training a review generation model, the method comprising: Acquire first sample data, the first sample data including first information of a first sample object, a first comment style label, and a sample comment corresponding to the first comment style label, the first information including at least one of a title and a content summary; Acquire a first reference example corresponding to the first comment style tag in an example library, wherein the first reference example includes example object description information and example comments; Inputting a first prompt text corresponding to the first comment style label, the first information, and the first reference example into a first initial model, so as to generate, through the first initial model, a first comment corresponding to the first comment style label for commenting on the first sample object according to the first prompt text, the first reference example, and the first information; as well as Based on the first review and the sample review, parameters of the first initial model are adjusted.

7. The method according to claim 6, wherein: The acquiring a first reference example corresponding to the first comment style tag in the example library includes: Based on the first information, the first reference examples are obtained from candidate examples corresponding to the first comment style tag in the example library, wherein the correlation between the example object description information of each of the first reference examples and the first information is higher than a predetermined correlation.

8. The method according to claim 7, wherein: The acquiring the first reference example from the candidate examples corresponding to the first comment style tag in the example library based on the first information includes: The first comment style label, the first information, and the second prompt text are input into a first language model to obtain the first reference example through the first language model according to the second prompt text, the first comment style label, the first information, and the example object description information of each candidate example in the example library.

9. The method according to any one of claims 6 to 8, wherein: The first initial model is a general large language model that has completed pre-training, and the method further includes: According to the importance of each parameter in the first initial model, the target parameter is determined; and wherein, The adjusting the parameters of the first initial model based on the first comment and the sample comment includes: Based on the first review and the sample review, the target parameter in the first initial model is adjusted.

10. The method according to any one of claims 6 to 9, further comprising: Acquire second sample data, the second sample data including second information of a second sample object, a second comment style label, a second reference example, a positive sample comment and a negative sample comment corresponding to the second comment style label, the second information including at least one of a title and a content summary; Inputting the third prompt text and the second sample data into a second initial model, so as to obtain, through the second initial model, a first probability corresponding to the positive sample comment and a second probability of the negative sample comment according to the third prompt text, the second information, the second comment style label and the second reference example, wherein the second initial model is the adjusted first initial model; and Based on the first probability and the second probability, parameters of the second initial model are adjusted.

11. The method according to claim 10, further comprising: The third prompt text and the second sample data are input into the first initial model, so as to obtain, through the first initial model, a third probability corresponding to the positive sample comment and a fourth probability of the negative sample comment according to the third prompt text, the second information, the second comment style label and the second reference example; and wherein, The adjusting the parameters of the second initial model based on the first probability and the second probability includes: Based on the first probability, the second probability, the third probability and the fourth probability, parameters of the second initial model are adjusted.

12. A device for generating comments based on a large model, comprising: A first acquisition unit is configured to acquire first information of the object to be reviewed, wherein the first information includes at least one of a title and a content summary; A first determining unit is configured to determine a review style tag matching the object to be reviewed based on the first information; A second acquisition unit is configured to acquire a reference example corresponding to the comment style tag in an example library, wherein the reference example includes example object description information and example comments; as well as The generation unit is configured to input the first prompt text corresponding to the comment style label, the first information and the reference example into the comment generation model, so as to generate a target comment corresponding to the comment style label for commenting on the object to be commented on according to the first prompt text, the reference example and the first information through the comment generation model.

13. The device according to claim 12, wherein: The second acquiring unit is further configured to: Based on the first information, the reference examples are obtained from candidate examples corresponding to the comment style tag in the example library, wherein the correlation between the example object description information of each reference example and the first information is higher than a predetermined correlation.

14. The device according to claim 13, wherein: The second acquiring unit is further configured to: The comment style label, the first information and the second prompt text are input into a first language model to obtain the reference example through the first language model according to the second prompt text, the comment style label, the first information and the example object description information of each candidate example in the example library.

15. The device according to any one of claims 12 to 14, wherein: The first determining unit is further configured to: At least the first information is input into a comment style acquisition model to obtain the comment style label as output, wherein the comment style acquisition model is trained based on at least two sample comments that have been annotated with style labels.

16. The device according to claim 15, wherein: The first determining unit is further configured to: The first information and the third prompt text are input into the comment style acquisition model, so as to determine the comment style tag from at least two preset style tags according to the third prompt text and the first information through the comment style acquisition model.

17. A training device for a review generation model, the device comprising: A first acquisition unit is configured to acquire first sample data, wherein the first sample data includes first information of a first sample object, a first comment style label, and a sample comment corresponding to the first comment style label, wherein the first information includes at least one of a title and a content summary; A second acquisition unit is configured to acquire a first reference example corresponding to the first comment style tag in an example library, wherein the first reference example includes example object description information and example comments; a generating unit configured to input a first prompt text corresponding to the first comment style label, the first information, and the first reference example into a first initial model, so as to generate a first comment corresponding to the first comment style label for commenting on the first sample object according to the first prompt text, the first reference example, and the first information through the first initial model; as well as An adjustment unit is configured to adjust parameters of the first initial model based on the first comment and the sample comment.

18. An electronic device, comprising: at least one processor; as well as a memory communicatively coupled to the at least one processor; in The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 11.

19. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to make a computer execute the method according to any one of claims 1-11.

20. A computer program product comprising a computer program, wherein: When the computer program is executed by a processor, the method according to any one of claims 1 to 11 is implemented.