Content generation method and system and computer readable storage medium

By obtaining fan user content matching with professional knowledge base, building a content generation guidance template and inputting a large language model, the problem of lack of professionalism in the professional field of reply content generation is solved, and high-quality and highly professional content generation is achieved.

CN119558284APending Publication Date: 2025-03-04MICRO DREAM TECHTRONIC NETWORK TECH CHINACO
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411527555.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-03-04

AI Technical Summary

Technical Problem

In the prior art, artificial intelligence lacks professionalism when generating replies to fan users, and it is difficult to meet the professional needs of target bloggers.

Method used

By obtaining the content of fan users targeting the target blogger, text matching is performed to obtain matching results in the professional knowledge base, building content generation guide templates, and entering them into the target large language model to generate professional reply content.

Benefits of technology

The large language model has been implemented to generate high-quality and highly professional reply content in the professional field, which meets the identity characteristics and professional field requirements of the target blogger.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119558284A_ABST
    Figure CN119558284A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a content generation method and system. The method comprises the steps that target content issued by fan users for target blogger users in any professional field is acquired; performing text matching in a professional knowledge base corresponding to the professional field based on the target content to obtain a matching result; according to the matching result, constructing a corresponding content generation guide template; and inputting the content generation guide template into a target large language model to obtain reply content generated by the target large language model based on the target content. Through the target big language model corresponding to the target blogger, the guide template reply content is generated according to the content, so that the reply content generated by the big language model for the target content is professional and accords with the identity characteristic of the target blogger.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of artificial intelligence and natural language processing, and in particular to a content generation method, system and computer-readable storage medium. Background Art

[0002] In the era of social media, content generation and dissemination have become an important means to attract users. As an important role on social media, bloggers’ content generation methods and quality directly affect fans’ interaction and experience. However, most bloggers currently rely mainly on their own experience and intuition to create content, lack effective technical support, and are unable to quickly and accurately generate high-quality content.

[0003] With the development of machine learning technology, people began to use models and algorithms to generate content. For example, by using the conditional features of the target user, the target input information of the target user and noise as training data to train the content generation model, the first loss function is used to perform model convergence on the control content and the target content generated by the content generation model. When the convergence condition is met, the content generation model is trained. The effect of this technology depends on the magnitude of the labeled data. Data labeling requires a lot of manpower and financial resources. Therefore, in general, the amount of labeled data cannot reach a certain scale. If the labeled data is insufficient, the trained model will have problems such as weak generalization ability and low accuracy, which ultimately leads to the generated text content of low quality, which is far from the real content needs of the blogger.

[0004] With the development of artificial intelligence technology, especially the emergence of large language models based on artificial intelligence generated content (AIGC), new possibilities have been provided for the automatic generation of social media content. Large language models usually have hundreds of millions or even more parameters, which enable them to better learn and understand natural language; based on large natural language datasets, they perform well in content generation tasks.

[0005] Although existing content generation techniques based on large language models have achieved certain success, they still have some problems in practical applications:

[0006] Inability to generate professional content: In some professional fields, such as sentiment, existing large language models may not perform well. This is because large language models usually lack professional domain knowledge and data during training, which makes it difficult for them to accurately and comprehensively learn relevant parameters. Summary of the invention

[0007] The embodiments of the present invention provide a content generation method, system and computer-readable storage medium, which can solve the problem of lack of professionalism in the reply content of artificial intelligence to fan users in the prior art.

[0008] To achieve the above objectives, in a first aspect, an embodiment of the present invention provides a method for generating content, comprising:

[0009] Obtain target content posted by fan users for target blogger users in any professional field;

[0010] Based on the target content, text matching is performed in the professional knowledge base corresponding to the professional field to obtain a matching result; the professional knowledge base is constructed based on the professional knowledge content in the professional field;

[0011] According to the matching results, a corresponding content generation guidance template is constructed; the content generation guidance template is used to instruct the corresponding target large language model to simulate a professional blogger to generate content based on fan posts;

[0012] The content generation guidance template is input into a target large language model to obtain reply content generated by the target large language model based on the target content; the target large language model is obtained by fine-tuning an initial large language model based on historical content corresponding to the target blogger user.

[0013] In a second aspect, an embodiment of the present invention provides a content generation system, including:

[0014] A target content acquisition unit, used to acquire target content published by a fan user for a target blogger user in any professional field;

[0015] A matching unit, configured to perform text matching in a professional knowledge base corresponding to the professional field based on the target content to obtain a matching result; the professional knowledge base is constructed based on professional knowledge content in the professional field;

[0016] A guide template generation unit is used to construct a corresponding content generation guide template according to the matching result; the content generation guide template is used to instruct the corresponding target large language model to simulate a professional blogger to generate content based on fan posts;

[0017] The reply content generating unit is used to input the content generation guiding template into the target large language model to obtain the reply content generated by the target large language model based on the target content; the target large language model is obtained by fine-tuning the initial large language model based on the historical content corresponding to the target blogger user.

[0018] In a second aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores one or more programs, and when the one or more programs are executed by a computer device, the computer device executes the aforementioned content generation method.

[0019] The above technical solution has the following beneficial effects: obtaining matching results that match the target content from the professional knowledge base, building a corresponding content generation guidance template based on the matching results, and generating reply content of the target content according to the content generation guidance template through the target large language model corresponding to the target blogger, so that the reply content generated by the large language model for the target content is professional and conforms to the identity characteristics of the target blogger. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0021] Figure 1 is a flowchart of a method for generating content according to an embodiment of the present invention;

[0022] Figure 2 is a structural diagram of a system for generating contents according to an embodiment of the present invention;

[0023] Figure 3 is a flow chart of reply content generation according to an embodiment of the present invention;

[0024] Figure 4 is a flowchart of a process of data vectorization when building a professional knowledge base according to an embodiment of the present invention;

[0025] Figure 5 is a flow chart of a process of building a professional knowledge base of an embodiment of the present invention;

[0026] Figure 6 is a flowchart of a professional knowledge base calling process of an embodiment of the present invention;

[0027] Figure 7 It is a flowchart of constructing a target large language model according to an embodiment of the present invention. DETAILED DESCRIPTION

[0028] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0029] like Figure 1 As shown, in combination with an embodiment of the present invention, a method for generating content is provided, comprising:

[0030] S101: Obtain target content published by a fan user for a target blogger user in any professional field;

[0031] S102: performing text matching in a professional knowledge base corresponding to the professional field based on the target content to obtain a matching result; the professional knowledge base is constructed based on professional knowledge content in the professional field;

[0032] S103: constructing a corresponding content generation guidance template according to the matching result; the content generation guidance template is used to instruct the corresponding target large language model to simulate a professional blogger to generate content based on fan posts;

[0033] S104: Inputting the content generation guidance template into a target large language model to obtain reply content generated by the target large language model based on the target content; the target large language model is obtained by fine-tuning an initial large language model based on historical content corresponding to the target blogger user.

[0034] A matching result matching the target content is obtained from the professional knowledge base, a corresponding content generation guidance template is constructed based on the matching result, and reply content of the target content is generated according to the content generation guidance template through a target large language model corresponding to the target blogger, so that the reply content is professional and conforms to the identity characteristics of the target blogger.

[0035] Preferably, S102: performing text matching in a professional knowledge base corresponding to the professional field based on the target content to obtain a matching result includes:

[0036] S1021: performing vectorization processing on the acquired target content to obtain a target vector corresponding to the target content;

[0037] S1022: The target vector is transferred to the professional knowledge base corresponding to the professional field, and the similarity between the target vector and each vectorized text content in the professional knowledge base is calculated respectively; wherein the professional knowledge base includes vectorized text content corresponding to a plurality of professional knowledge contents;

[0038] S1023: taking the professional knowledge content corresponding to the vectorized text content whose similarity with the target vector satisfies the set matching condition as the matching result;

[0039] S1024: When there is no vectorized text content whose similarity with the target vector satisfies the set matching condition, the matching result is empty.

[0040] The process of generating reply content for target bloggers is as follows Figure 6As shown. First, the public messages of fan users are vectorized using the langchain tool, and then the professional knowledge base is called to pass the vectorized public messages of fan users into the emotional professional knowledge base. The cosine distance algorithm is used to calculate the similarity between the public messages of vectorized fan users and the vectorized text content in the professional knowledge base (the cosine distance algorithm is used, and its calculation formula is the dot product of two vectors divided by the product of their moduli. The result ranges from -1 to 1, and the larger the value, the higher the similarity). The text content (professional knowledge content) with a similarity > 0.7 is obtained. If the professional knowledge content is not obtained, the matching result is empty; if the professional knowledge content is obtained, it is sorted by similarity and the top 3 professional knowledge with the highest similarity are returned. If there are less than three professional knowledge contents with a similarity > 0.7, all of them are returned, that is, 1 or 2.

[0041] Preferably, S103: constructing a corresponding content generation guidance template according to the matching result, wherein the content generation guidance template is used to instruct the corresponding target large language model to simulate a professional blogger to generate content based on fan posts, including:

[0042] S1031: When the matching result contains professional knowledge content matched from the professional knowledge base, construct the target content and the matched professional knowledge content into a form of question and answer; wherein the target content is used as the question and the matched professional knowledge content is used as the answer to the question;

[0043] S1032: Constructing a content generation guidance template containing professional knowledge based on the questions and answers; wherein the content generation guidance template containing professional knowledge carries the questions and answers, and instructs the corresponding target large language model to preferentially extract information from the questions and answers for content generation.

[0044] Specifically, this process mainly involves splicing prompt templates (i.e., splicing content to generate a guide template) for use as input to the target large language model. When professional knowledge content is matched from the professional knowledge base, a prompt template containing professional knowledge is constructed for input to the large language model.

[0045] The prompt template, also called the prompt word, is the content input to the target large language model. Through the prompt template, tell the target large language model what you want the target large language model to do. For example, you can specify the role of the target large language model in the prompt template (for example, define the target large language model as a "blogger who is good at generating emotional content"), you can specify what content to generate in the prompt template (for example, let the fine-tuned large language model generate an emotional content), and you can also add some restrictions (such as limiting the number of words output by the model, not outputting illegal and disciplinary content, etc.).

[0046] The target large language model understands the content of the prompt template input and combines it with a large amount of hidden knowledge to output matching response content.

[0047] When the professional knowledge content is matched in the professional knowledge database based on the fan user's message, the fan user's message and the professional knowledge are processed into the form of question (Q)-answer (A). Q represents the fan user's message, and A represents the professional knowledge content. If the professional knowledge database returns multiple professional knowledge, these professional knowledge are concatenated using the symbol "#" as A. The following example illustrates the QA processing process.

[0048] The fan's message (Q) is: "I've been depressed recently, what should I do?" The three pieces of professional knowledge (A) returned by the professional knowledge database are: "Research shows that depression is related to an imbalance of neurotransmitters in the brain...", "Methods for assessing depressive symptoms include self-report questionnaires, clinical interviews, and observations, etc...", "Methods for treating depression include medication, psychotherapy, and biofeedback, etc...". Then the constructed QA is: "Fan message: I've been depressed recently, what should I do? Then the target large language model generates the following reply for the target blogger: Research shows that depression is related to an imbalance of neurotransmitters in the brain... #Methods for assessing depressive symptoms include self-report questionnaires, clinical interviews, and observations, etc... #Methods for treating depression include medication, psychotherapy, and biofeedback, etc...".

[0049] That is, after obtaining QA, you can generate a prompt template. The prompt template content is defined as follows:

[0050] "You are a blogger who is good at generating emotional content. Your task is to generate an emotional content based on the comments of fans. Please give priority to extracting information from QA for content generation. The comments of fans are: Q", QA is the content data constructed based on the comments and professional knowledge content of fan users.

[0051] Preferably, S103: constructing a corresponding content generation guidance template according to the matching result, wherein the content generation guidance template is used to instruct the corresponding target large language model to simulate a professional blogger to generate content based on fan posts, and further includes:

[0052] S1033: When the matching result is empty, construct the target content into a question;

[0053] S1034: constructing a content generation guidance template without professional knowledge based on the question; wherein the content generation guidance template without professional knowledge carries the question and instructs the corresponding target large language model to generate content according to the question.

[0054] When no professional knowledge is matched in the professional knowledge database, a prompt template without professional knowledge is used as the input of the target large language model. The prompt template cannot contain professional knowledge. The content of the prompt template without professional knowledge is defined as follows:

[0055] "You are a blogger who is good at generating emotional content. Your task is to generate an emotional content based on the fans' comments. The fans' comments are: Q".

[0056] Preferably, S104: inputting the content generation guidance template into the target large language model to obtain the reply content generated by the target large language model based on the target content includes:

[0057] The target large language model corresponding to the target blogger user is called, the content generation guidance template is input into the target large language model, the content generation guidance template is understood by the target large language model, and the reply content is generated in combination with the hidden domain expertise stored in the target large language model.

[0058] Specifically, the model corresponding to the target blogger is called, and the prompt template containing professional knowledge or the prompt template without professional knowledge generated above is input, and the target large language model outputs the reply content, which is the blog content of the target blogger.

[0059] Because the initial large language model itself hides a lot of knowledge, it can understand the intention of the prompt template and give a corresponding answer. Because the target large language model corresponding to the target blogger is obtained through fine-tuning training, the target large language model learns the personality, posting style, language habits, expression methods, etc. of the target blogger, so that the style of the content output by the target large language model tends to be more like the target blogger.

[0060] When the target large language model generates a reply, it first understands what the prompt template wants it to do. For example, the prompt template asks the target large language model to write a reply as a "blogger who is good at generating emotional content" and refer to the professional knowledge matched from the professional knowledge database.

[0061] After the target large language model understands what it wants to do, it can retrieve appropriate content based on its own hidden knowledge, and learn and use the target blogger's style, posting style, language habits, and expression methods. Finally, it organizes and outputs the reply content with smooth semantics and clear structure.

[0062] Preferably, S105: a method for generating a target large language model corresponding to the target blogger user comprises:

[0063] S1051: Collect the historical content corresponding to the target blogger user, the historical content includes multiple historical blog posts published by the target blogger user, historical comment dialogues and their contexts corresponding to each historical blog post, and historical private message dialogues and their contexts corresponding to each historical blog post; collect a large amount of historical content, for example, a total of 50,000, and store the historical content on HDFS. Wherein, a dialogue means that after a fan user initiates a comment in the target blogger's comment area, the target blogger will reply, the fan user will reply to the target blogger's reply, and the target blogger may continue to chat, which forms a dialogue. For a certain historical comment of a fan user, the dialogue before this comment is the previous context, and the dialogue after this comment is the next context. When a fan user sends a private message to the target blogger, the target blogger will reply, the fan user will reply to the target blogger's reply, and the target blogger may continue to chat, which forms a private message. For a certain historical private message of a fan user, the dialogue before this private message is the previous context, and the dialogue after this private message is the next context.

[0064] S1052: performing data cleaning on the collected historical content to obtain cleaned historical content; wherein the collected historical content may be cleaned by removing advertising links, pure expressions, sensitive information, etc.;

[0065] S1053: Processing the cleaned historical content into the form of questions and answers; wherein the historical comments or private messages posted by the fan user in the conversation are used as questions, and the historical reply content of the target blogger user in the conversation is used as answers to the questions;

[0066] S1054: Use the historical content in the form of questions and answers as a training data set to fine-tune the initial large language model, and obtain a target large language model corresponding to the target blogger user after the training is completed. The initial large language model can be a PyTorch deep learning framework, an open source large language base model, and the large language base model is fine-tuned using the lora algorithm. After the training is completed, a large language model with the blogger's posting style and preferences can be obtained.

[0067] The steps to fine-tune the initial large language model include the following:

[0068] Set parameters: Set the corresponding parameters: learning rate 0.0001, batch size 128, training round 10. Select the Lora algorithm, and only adjust a small number of parameters in the initial large language base model to fine-tune the model, while keeping most of the model parameters unchanged.

[0069] Training model: Use the training data set and the set parameters to train the initial large language model. During the training process, observe the loss value of the initial large language model. The loss value is constantly decreasing. When the loss value drops to a certain value (not fixed) and no longer decreases, it means that the initial large language model has fully converged and fine-tuning is completed.

[0070] Model evaluation: 1 / 5 of the training data set is randomly selected as the test set to evaluate the performance of the fine-tuned large language model to verify the performance of the large language model on the target task and obtain the evaluation results.

[0071] Optimization and adjustment: Based on the evaluation results, make necessary optimization adjustments to the large language model, such as adjusting the training parameters, and finally obtain the target large language model corresponding to the target blogger.

[0072] Model deployment: Deploy the target large language model to the server and build a model service API.

[0073] Because the target large language model corresponding to the target blogger is obtained through fine-tuning training, the target large language model learns the personality, blogging style, language habits, and expression methods of the target blogger, so that the style of the content output by the target large language model is biased towards the target blogger. This improves the adaptability and generalization ability of the large language model in generating content for specific target bloggers, enabling it to generate personalized content for bloggers.

[0074] Preferably, S106: the method for constructing a professional knowledge base in a professional field comprises:

[0075] S1061: For any professional field, professional data of the professional field are collected from various network platforms: including two categories: off-site public data and on-site data; the professional data of the professional field include: content published by bloggers in the professional field on other network platforms, publicly available related tests belonging to the professional field and analysis data of related tests, publicly available related books belonging to the professional field, publicly available related articles belonging to the professional field, publicly available related literature on the professional field, historical blog posts published by bloggers in the professional field on this network platform, and interactive content with fan users.

[0076] When the target blogger is an emotion blogger, the off-site data collected include: tweets, posts, public emotion tests and analysis related data, including but not limited to emotional intelligence tests, personality analysis, emotion psychology tests and other professional emotion content; public emotion-related books and articles, including but not limited to the content of books and articles related to emotion psychology, emotion linguistics, emotion sociology, emotion therapy, etc.; public emotion-related literature materials, including but not limited to published emotion-related papers, patents, academic reports, industry standards, etc. The on-site data includes two aspects: one is the blog posts published by emotion bloggers in the past, the comments and conversations generated by the interaction with fans, private message replies, etc.; the other is the blog content with emotion-related tags.

[0077] The collected data is aggregated and stored on the server hard disk. The stored document formats are txt, word, pdf, etc.

[0078] S1062: Clean the non-textual content in the professional data of the professional field to obtain cleaned professional data; the cleaned professional content data includes a plurality of professional knowledge contents; the non-textual content includes: garbled codes, website links, emoticons and other non-textual content.

[0079] S1063: Slicing any piece of professional knowledge content in the cleaned professional data, and vectorizing each text content slice obtained by slicing to obtain vectorized text content corresponding to the professional knowledge content;

[0080] S1064: Construct the vectorized text contents corresponding to the plurality of professional knowledge contents into a professional knowledge base in the patent field.

[0081] All collected professional data can be entered into the professional knowledge database, which not only preserves the integrity of professional knowledge, but also integrates various types of knowledge to enhance the distinction between different knowledge.

[0082] Preferably, in S1063, slicing the professional knowledge content, vectorizing each obtained text content slice, and obtaining vectorized text content corresponding to the professional knowledge content includes:

[0083] S1063-1: Use the document loading module of the data processing tool to load each piece of professional knowledge in the cleaned professional data into the memory one by one; the data processing tool can be a langchain tool, which can provide a vector retrieval interface (API). It provides various components to complete the work of knowledge base construction, vector storage, and vector retrieval. There are also some alternative tools, such as LlamaIndex, Autochain, etc., but langchain is the most used classic tool.

[0084] S1063-2: Call the text slicing module of the data processing tool to slice the professional knowledge content into fixed-length text content slices, which may be 1000. The length of the text content slice cannot be too short, but must be long enough, generally about 1,000 characters, so that each text content slice can basically ensure that it contains a certain amount of information. There may be some slices with missing information, but such slices are generally not retrieved.

[0085] S1063-3: Use the word embedding module of the data processing tool to calculate the text content vector corresponding to each text content slice, and obtain the vectorized text content corresponding to the professional knowledge content. The word embedding module of the Langchain tool integrates a variety of vector generation models, and also supports calling its own trained model for word embedding (vectorization). The embodiment of the present invention uses the default text vectorization model. In addition, the langchain tool provides a wealth of interfaces and tools, so that the word embedding module can be easily integrated with other modules. After the calculation is completed, all vectorized text content is stored in the faiss database for backup. The vectorized text content stored in the faiss database is the professional knowledge base. The process of data vectorization is as follows Figure 4 shown.

[0086] The purpose of slicing each piece of professional knowledge content is to: 1. Adapt to the length limit of the target large language model input. If not sliced, the fan user's message will be matched in the professional knowledge base as a particularly long text, so the length of the generated prompt template text is also too long, which may exceed the length limit of the target large language model input. 2. Improve the accuracy of professional knowledge content retrieval. The particularly long text contains too much information, which will lead to semantic and information confusion. As a result, the fan user's message will match too much professional content knowledge in the professional knowledge base. 3. Optimize processing and analysis efficiency. The text content slices (file blocks) after slicing can be more easily processed in parallel, thereby further improving the processing speed.

[0087] Among them, the sequential process of constructing the professional knowledge base is as follows: Figure 5 The specific process of building a target large language model for the target blogger and generating reply content is as follows: Figure 7 The detailed process of generating the reply content of the present invention is as follows Figure 3 As shown in the figure, the fan user's public message is first vectorized, and then the professional knowledge base is called to match the professional knowledge content related to the fan's public message. Furthermore, if the professional knowledge is matched, a prompt template containing professional knowledge (i.e., a content generation guide template) is generated; if it is not matched, a prompt template without professional knowledge is generated. Finally, the prompt template is input into the target large language model corresponding to the target blogger, and the target large language model outputs the reply content, which is the blog content of the target blogger.

[0088] like Figure 2 As shown, in combination with an embodiment of the present invention, a content generation system is provided, including:

[0089] A target content acquisition unit 21 is used to acquire target content published by a fan user for a target blogger user in any professional field;

[0090] A matching unit 22 is used to perform text matching in a professional knowledge base corresponding to the professional field based on the target content to obtain a matching result; the professional knowledge base is constructed based on the professional knowledge content in the professional field;

[0091] A guide template generation unit 23 is used to construct a corresponding content generation guide template according to the matching result; the content generation guide template is used to instruct the corresponding target large language model to simulate a professional blogger to generate content based on fan posts;

[0092] The reply content generating unit 24 is used to input the content generation guiding template into the target large language model to obtain the reply content generated by the target large language model based on the target content; the target large language model is obtained by fine-tuning the initial large language model based on the historical content corresponding to the target blogger user.

[0093] Preferably, the matching unit 22 includes:

[0094] A vectorization unit, used to perform vectorization processing on the acquired target content to obtain a target vector corresponding to the target content;

[0095] A similarity calculation unit, used to transfer the target vector to the professional knowledge base corresponding to the professional field, and respectively calculate the similarity between the target vector and each vectorized text content in the professional knowledge base; wherein the professional knowledge base includes vectorized text content corresponding to a plurality of professional knowledge contents;

[0096] The matching result determination unit is used to take the professional knowledge content corresponding to the vectorized text content whose similarity with the target vector meets the set matching conditions as the matching result; when there is no vectorized text content whose similarity with the target vector meets the set matching conditions, the matching result is empty.

[0097] Preferably, the guide template generating unit 23 includes:

[0098] A first construction subunit is used for constructing the target content and the matched professional knowledge content into a form of question and answer when the matching result contains professional knowledge content matched from the professional knowledge base; wherein the target content is used as the question and the matched professional knowledge content is used as the answer to the question;

[0099] The first guidance template generation subunit is used to construct a content generation guidance template containing professional knowledge based on the questions and answers; wherein the content generation guidance template containing professional knowledge carries the questions and answers, and instructs the corresponding target large language model to preferentially extract information from the questions and answers for content generation.

[0100] Preferably, the guide template generating unit 23 further includes:

[0101] A second construction subunit, configured to construct the target content into a question when the matching result is empty;

[0102] The second guidance template generation subunit is used to construct a content generation guidance template without professional knowledge based on the question; wherein the content generation guidance template without professional knowledge carries the question and instructs the corresponding target large language model to generate content according to the question.

[0103] Preferably, the reply content generating unit 24 is specifically used for:

[0104] The target large language model corresponding to the target blogger user is called, the content generation guidance template is input into the target large language model, the content generation guidance template is understood by the target large language model, and the reply content is generated in combination with the hidden knowledge stored in the target large language model.

[0105] Preferably, a target large language model construction unit is included, and the target large language model construction unit includes:

[0106] A training data construction subunit is used to collect historical content corresponding to the target blogger user, wherein the historical content includes a plurality of historical blog posts published by the target blogger user, historical comment dialogues corresponding to each historical blog post and their contexts, and historical private message dialogues corresponding to each historical blog post and their contexts;

[0107] Performing data cleaning on the collected historical content to obtain cleaned historical content;

[0108] Process the cleaned historical content into the form of questions and answers; the historical comments or private messages posted by the fan users in the conversation are used as questions, and the historical replies of the target blogger users in the conversation are used as answers to the questions;

[0109] The training subunit is used to use the historical content in the form of questions and answers as a training data set to fine-tune the initial large language model, and obtain a target large language model corresponding to the target blogger user after the training is completed.

[0110] Preferably, the professional knowledge base construction unit comprises:

[0111] The professional data collection subunit is used to collect professional data of any professional field from various network platforms; the professional data of the professional field includes: content published by bloggers in the professional field on other network platforms, relevant tests and analysis data of relevant tests in the professional field, relevant books in the professional field, relevant articles in the professional field, relevant literature in the professional field, historical blog posts published by bloggers in the professional field on this network platform, and interactive content with fan users;

[0112] A cleaning subunit is used to clean the non-text content in the professional data of the professional field to obtain cleaned professional data; the cleaned professional content data includes a plurality of professional knowledge contents;

[0113] A slicing subunit is used to slice the professional knowledge content for any professional knowledge content in the cleaned professional data, and to vectorize each text content slice obtained by slicing to obtain vectorized text content corresponding to the professional knowledge content;

[0114] The professional knowledge base construction subunit is used to construct the vectorized text content corresponding to the multiple professional knowledge contents into a professional knowledge base in the patent field.

[0115] Preferably, the slicing subunit is specifically used for:

[0116] Using the document loading module of the data processing tool, each piece of professional knowledge content in the cleaned professional data is loaded into the memory one by one;

[0117] Calling the text slicing module of the data processing tool to slice the professional knowledge content into text content slices of fixed length;

[0118] The word embedding module of the data processing tool is used to calculate the text content vector corresponding to each text content slice to obtain the vectorized text content corresponding to the professional knowledge content.

[0119] In combination with an embodiment of the present invention, a computer-readable storage medium is also provided, wherein the computer-readable storage medium stores one or more programs, and when the one or more programs are executed by a computer device, the computer device performs any one of the methods for generating content.

[0120] The beneficial technical effects achieved by the embodiments of the present invention are as follows:

[0121] (1) Make full use of the generalization ability of large language models to improve the quality of generated emotional content.

[0122] Traditional machine learning technology usually relies on a small amount of data and low data diversity, so it is difficult to handle complex content generation tasks and cannot guarantee the quality of the generated content. Large language models are generally trained using large-scale, diverse language data, which can learn more comprehensive language laws and features and are more handy when handling complex language tasks. The embodiment of the present invention uses a target large language model that fine-tunes some parameters to ensure the quality of the reply content.

[0123] (2) A complete professional knowledge base has been built to make the generated responses more professional and comprehensive.

[0124] The existing initial large language model does not have the expertise in a specific field. This means that when it comes to highly specialized knowledge, the initial large language model may not be able to give an accurate answer. In the embodiment of the present invention, a complete professional knowledge base is constructed by collecting a large amount of professional knowledge in the field. It aims to provide professional data materials that are as accurate and comprehensive as possible, help the system improve the output capability of professional content, and thus improve the professionalism of the reply content generated by the system.

[0125] (3) Fine-tune the large language model to improve the personalization of generated emotional content

[0126] The existing initial large language model does not know the blogging style and preferences of a target blogger in advance, so it has certain limitations when dealing with the content generation problem of the target blogger. Personalized content generation needs to take into account factors such as the personality, blogging style, language habits, and expression methods of the target blogger, and these factors have not been fully considered in the training process of the initial large language model. Therefore, when dealing with the content generation problem of a specific blogger, the existing initial large language model will have certain limitations. In an embodiment of the present invention, by collecting the content generated by the target blogger historically, some parameters of the initial large language model are fine-tuned based on these contents to obtain a target large language model, thereby improving the system's ability to understand professional knowledge, so that the target large language model has the personalized blogging style and preferences of the target blogger, and has the content production capacity suitable for the target blogger, thereby improving the degree of personalization of imitating the target blogger's blogging when generating content.

[0127] By integrating the professional knowledge content in the professional knowledge base and using the target large language model to generate guidance templates based on content, professional, personalized, high-quality emotional content can be generated quickly.

[0128] It should be understood that the specific order or hierarchy of steps in the disclosed process is an example of an exemplary method. Based on design preferences, it should be understood that the specific order or hierarchy of steps in the process can be rearranged without departing from the scope of protection of the present disclosure. The attached method claims present the elements of the various steps in an exemplary order and are not intended to be limited to the specific order or hierarchy described.

[0129] In the above detailed description, various features are grouped together in a single embodiment to simplify the disclosure. This method of disclosure should not be interpreted as reflecting an intention that the embodiments of the claimed subject matter require more features than are clearly stated in each claim. On the contrary, as reflected in the appended claims, the invention is in a state of having less than all the features of the disclosed individual embodiments. Therefore, the appended claims are hereby expressly incorporated into the detailed description, with each claim standing on its own as a separate preferred embodiment of the invention.

[0130] The disclosed embodiments are described above to enable any person skilled in the art to implement or use the present invention. Various modifications of these embodiments are obvious to those skilled in the art, and the general principles defined herein may also be applied to other embodiments without departing from the spirit and scope of the present disclosure. Therefore, the present disclosure is not limited to the embodiments given herein, but is consistent with the broadest scope of the principles and novel features disclosed in this application.

[0131] The above description includes examples of one or more embodiments. Of course, it is impossible to describe all possible combinations of components or methods for the purpose of describing the above embodiments, but it should be recognized by those skilled in the art that the various embodiments may be further combined and arranged. Therefore, the embodiments described herein are intended to cover all such changes, modifications and variations that fall within the scope of protection of the appended claims. In addition, with respect to the term "comprising" used in the specification or claims, the word is covered in a manner similar to the term "including", just as "including," is explained as a transitional word in the claims. In addition, any term "or" used in the specification of the claims is intended to mean "non-exclusive or".

[0132] Those skilled in the art may also understand that the various illustrative logical blocks, units, and steps listed in the embodiments of the present invention may be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly demonstrate the interchangeability of hardware and software, the various illustrative components, units, and steps described above have generally described their functions. Whether such functions are implemented by hardware or software depends on the specific application and the design requirements of the entire system. Those skilled in the art may use various methods to implement the described functions for each specific application, but such implementation should not be understood as exceeding the scope of protection of the embodiments of the present invention.

[0133] The various illustrative logic blocks or units described in the embodiments of the present invention can be implemented or operated by a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array or other programmable logic device, a discrete gate or transistor logic, a discrete hardware component, or any combination of the above. The general-purpose processor can be a microprocessor, and optionally, the general-purpose processor can also be any conventional processor, controller, microcontroller or state machine. The processor can also be implemented by a combination of computing devices, such as a digital signal processor and a microprocessor, a plurality of microprocessors, one or more microprocessors combined with a digital signal processor core, or any other similar configuration.

[0134] The steps of the method or algorithm described in the embodiments of the present invention can be directly embedded in hardware, a software module executed by a processor, or a combination of the two. The software module can be stored in a RAM memory, a flash memory, a ROM memory, an EPROM memory, an EEPROM memory, a register, a hard disk, a removable disk, a CD-ROM, or other storage media of any form in the art. Exemplarily, the storage medium can be connected to the processor so that the processor can read information from the storage medium and can write information to the storage medium. Optionally, the storage medium can also be integrated into the processor. The processor and the storage medium can be arranged in an ASIC, and the ASIC can be arranged in a user terminal. Optionally, the processor and the storage medium can also be arranged in different components in the user terminal.

[0135] In one or more exemplary designs, the above functions described in the embodiments of the present invention can be implemented in hardware, software, firmware or any combination of the three. If implemented in software, these functions can be stored on a computer-readable medium, or transmitted in the form of one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media that facilitate the transfer of computer programs from one place to another. The storage medium can be any available medium that can be accessed by any general or special computer. For example, such computer-readable media can include but are not limited to RAM, ROM, EEPROM, CD-ROM or other optical disk storage, disk storage or other magnetic storage devices, or any other medium that can be used to carry or store program codes in the form of instructions or data structures and other forms that can be read by general or special computers, or general or special processors. In addition, any connection can be appropriately defined as a computer-readable medium, for example, if the software is transmitted from a website site, server or other remote resource through a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL) or wirelessly, such as infrared, wireless and microwave, it is also included in the defined computer-readable medium. The disk and disc include compact disk, laser disk, optical disk, DVD, floppy disk and blue-ray disk. Disks usually copy data magnetically, while discs usually copy data optically with lasers. The above combination can also be included in computer readable media.

[0136] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for generating content, characterized in that: include: Obtain target content posted by fan users for target blogger users in any professional field; Based on the target content, text matching is performed in the professional knowledge base corresponding to the professional field to obtain a matching result; the professional knowledge base is constructed based on the professional knowledge content in the professional field; According to the matching result, construct a corresponding content generation guide template; The content generation guidance template is used to instruct the corresponding target large language model to simulate a professional blogger to generate content based on fan posts; Inputting the content generation guidance template into a target large language model to obtain reply content generated by the target large language model based on the target content; The target large language model is obtained by fine-tuning the initial large language model based on the historical content corresponding to the target blogger user.

2. The method for generating content according to claim 1, characterized in that: The text matching is performed in the professional knowledge base corresponding to the professional field based on the target content to obtain the matching result, including: Performing vectorization processing on the acquired target content to obtain a target vector corresponding to the target content; The target vector is transferred into the professional knowledge base corresponding to the professional field, and the similarity between the target vector and each vectorized text content in the professional knowledge base is calculated respectively; wherein the professional knowledge base includes vectorized text content corresponding to a plurality of professional knowledge contents; The professional knowledge content corresponding to the vectorized text content whose similarity with the target vector meets the set matching condition is taken as the matching result; When there is no vectorized text content whose similarity with the target vector satisfies the set matching condition, the matching result is empty.

3. The method for generating content according to claim 2, characterized in that: According to the matching result, a corresponding content generation guidance template is constructed, and the content generation guidance template is used to instruct the corresponding target large language model to simulate a professional blogger to generate content based on fan posts, including: When the matching result contains professional knowledge content matched from the professional knowledge base, constructing the target content and the matched professional knowledge content into a form of question and answer; wherein the target content serves as the question and the matched professional knowledge content serves as the answer to the question; A content generation guidance template containing professional knowledge is constructed based on the questions and answers; wherein the content generation guidance template containing professional knowledge carries the questions and answers, and instructs the corresponding target large language model to preferentially extract information from the questions and answers for content generation.

4. The method for generating content according to claim 2, characterized in that: According to the matching result, a corresponding content generation guidance template is constructed, wherein the content generation guidance template is used to instruct the corresponding target large language model to simulate a professional blogger to generate content based on fan posts, and further includes: When the matching result is empty, constructing the target content into a question; A content generation guidance template without professional knowledge is constructed based on the question; wherein the content generation guidance template without professional knowledge carries the question and instructs the corresponding target large language model to generate content according to the question.

5. The method for generating content according to claim 1, characterized in that: The step of inputting the content generation guidance template into a target large language model to obtain reply content generated by the target large language model based on the target content includes: The target large language model corresponding to the target blogger user is called, the content generation guidance template is input into the target large language model, the content generation guidance template is understood by the target large language model, and reply content is generated.

6. The method for generating content according to claim 1, characterized in that: The method for generating a target large language model corresponding to the target blogger user includes: Collecting historical content corresponding to the target blogger user, the historical content including multiple historical blog posts published by the target blogger user, historical comment dialogues corresponding to each historical blog post and their contexts, and historical private message dialogues corresponding to each historical blog post and their contexts; Performing data cleaning on the collected historical content to obtain cleaned historical content; Process the cleaned historical content into the form of questions and answers; the historical comments or private messages posted by the fan users in the conversation are used as questions, and the historical replies of the target blogger users in the conversation are used as answers to the questions; The historical contents in the form of questions and answers are used as training data sets to fine-tune the initial large language model, and after the training is completed, a target large language model corresponding to the target blogger user is obtained.

7. The method for generating content according to claim 1, characterized in that: Methods for building a professional knowledge base in a professional field include: For any professional field, collect professional data in the professional field from various network platforms; Cleaning non-text content in the professional data of the professional field to obtain cleaned professional data; the cleaned professional content data includes a plurality of professional knowledge contents; For any piece of professional knowledge content in the cleaned professional data, the professional knowledge content is sliced, and each text content slice obtained by slicing is vectorized to obtain vectorized text content corresponding to the professional knowledge content; The vectorized text contents corresponding to the multiple pieces of professional knowledge contents are constructed into a professional knowledge base in the patent field.

8. The method for generating content according to claim 7, characterized in that: The step of slicing the professional knowledge content and performing vectorization processing on each obtained text content slice to obtain vectorized text content corresponding to the professional knowledge content includes: Using a document loading module of a data processing tool, each piece of professional knowledge in the cleaned professional data is loaded into the memory one by one; Calling the text slicing module of the data processing tool to slice the professional knowledge content into text content slices of fixed length; The word embedding module of the data processing tool is used to calculate the text content vector corresponding to each text content slice to obtain the vectorized text content corresponding to the professional knowledge content.

9. A content generation system, characterized in that: include: A target content acquisition unit, used to acquire target content published by a fan user for a target blogger user in any professional field; A matching unit, configured to perform text matching in a professional knowledge base corresponding to the professional field based on the target content to obtain a matching result; The professional knowledge base is constructed based on the professional knowledge content in the professional field; A guide template generation unit, used to construct a corresponding content generation guide template according to the matching result; The content generation guidance template is used to instruct the corresponding target large language model to simulate a professional blogger to generate content based on fan posts; The reply content generating unit is used to input the content generation guiding template into the target large language model to obtain the reply content generated by the target large language model based on the target content; the target large language model is obtained by fine-tuning the initial large language model based on the historical content corresponding to the target blogger user.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores one or more programs, and when the one or more programs are executed by a computer device, the computer device executes the content generation method according to any one of claims 1 to 8.