Content generation method and device, electronic equipment, storage medium and product

By using natural language processing tools and classification models in the content generation method to determine whether the target document is needed and selecting an appropriate error correction mechanism, the content inaccuracy caused by broad or vague input information is solved, and the accuracy and user experience of content generation are improved.

CN119807354APending Publication Date: 2025-04-11DAWNING INT INFORMATION IND CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411834761.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

In the prior art, if the input information is broad or vague, or the content generation model is incomplete, the content output from the content generation model will be inaccurate and affect the user's user experience.

Method used

By receiving content generation requests, natural language processing tools and classification models are used to determine whether target documents related to target input information need to be obtained. If not, the first error correction mechanism and the content generation model are used to determine the target content; if necessary, the second error correction mechanism, including the document correlation error correction mechanism, is used to assist the content generation model in determining the target content.

Benefits of technology

By selecting the error correction mechanism targetedly, we can accurately achieve error correction, optimize the generated content, and improve the accuracy of the generated target content, thereby improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119807354A_ABST
    Figure CN119807354A_ABST
Patent Text Reader

Abstract

The invention provides a content generation method and device, electronic equipment, a storage medium and a product. The method comprises the following steps: receiving a content generation request, wherein the content generation request comprises target input information; determining whether a target document related to the target input information needs to be acquired or not through a natural language processing tool and a classification model according to the content generation request; if not, target content corresponding to the target input information is determined through a first error correction mechanism and a content generation model, and the first error correction mechanism does not comprise a document correlation error correction mechanism; if yes, target content corresponding to the target input information is determined through a second error correction mechanism and a content generation model, and the second error correction mechanism comprises a document correlation error correction mechanism. According to the scheme, the corresponding error correction mechanism is determined according to whether the target document is needed to perform error correction on the generated content, and error correction can be accurately realized, so that the generated content is optimized, and the accuracy of the generated target content is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a content generation method, device, electronic device, storage medium and product. Background Art

[0002] In the field of artificial intelligence technology, intelligent generation of matching content based on user input information can achieve functions such as question answering, dialogue generation, or information query.

[0003] In the related art, input information from a user is received, the input information is input into a content generation model, the content generation model outputs content matching the input information, and the content is pushed to the user.

[0004] However, if the input information is too broad, too vague, or the content generation model is imperfect, the content generation model may output inaccurate content, affecting the user experience. Summary of the invention

[0005] The present application provides a content generation method, device, electronic device, storage medium and product to improve the accuracy of content generation.

[0006] In a first aspect, the present application provides a content generation method, comprising: receiving a content generation request, the content generation request comprising target input information; determining, based on the content generation request, through a natural language processing tool and a classification model, whether it is necessary to obtain a target document related to the target input information; if not, determining, through a first error correction mechanism and a content generation model, a target content corresponding to the target input information, the first error correction mechanism not including a document relevance error correction mechanism; if yes, determining, through a second error correction mechanism and the content generation model, a target content corresponding to the target input information, the second error correction mechanism including a document relevance error correction mechanism.

[0007] Optionally, the method as described above determines whether it is necessary to obtain a target document related to the target input information through a natural language processing tool and a classification model, including: extracting target keywords in the target input information through the natural language processing tool; inputting the target keywords into the classification model to obtain a classification result, the classification result including an index type or a real-time event type, and the classification model is trained using a pre-labeled training set; if the classification result is an index type or a real-time event type, it is determined that the target document needs to be obtained; if the classification result is not an index type and is not a real-time event type, it is determined that the target document does not need to be obtained.

[0008] Optionally, in the method as described above, the first error correction mechanism includes a content relevance error correction mechanism and a content validity error correction mechanism; determining the target content corresponding to the target input information through the first error correction mechanism and the content generation model, including: inputting the target input information into the content generation model to obtain initial content; determining the target content through the content relevance error correction mechanism, the content validity error correction mechanism, and the initial content.

[0009] Optionally, in the method described above, the second error correction mechanism also includes a content relevance error correction mechanism and a content validity error correction mechanism; the target content corresponding to the target input information is determined through the second error correction mechanism and the content generation model, including: performing target retrieval processing on the target input information to obtain an initial document; determining a first semantic similarity between the initial document and the target input information through the document relevance error correction mechanism, and determining whether the initial document has passed verification based on the first semantic similarity; if so, determining the initial document as the target document, inputting the target document and the target input information into the content generation model, and obtaining initial content, and determine the target content through the content relevance error correction mechanism, the content validity error correction mechanism, and the initial content; if not, perform multiple retrieval processes on the target input information through network retrieval to obtain multiple candidate documents, respectively perform verification processes on the multiple candidate documents through the document relevance error correction mechanism until the verification is passed, then determine the corresponding candidate document as the target document, input the target document and the target input information into the content generation model to obtain the initial content, and determine the target content through the content relevance error correction mechanism, the content validity error correction mechanism, and the initial content.

[0010] Optionally, the method as described above performs target retrieval processing on the target input information to obtain an initial document, including: if the classification result is an index type, determining the target vector of the target input information, and performing retrieval processing on the target vector through a knowledge base to obtain the initial document; if the classification result is a real-time event type, performing retrieval processing on the target input information through network retrieval to obtain the initial document.

[0011] Optionally, the method as described above determines the target content through the content relevance correction mechanism, the content validity correction mechanism, and the initial content, including: determining the keyword intersection ratio between the initial content and the target input information through the content relevance correction mechanism, and determining whether the relevance of the initial content is verified based on the keyword intersection ratio; if not, repeatedly generating the initial content through the content generation model until the relevance of the initial content is verified; if yes, determining the second semantic similarity between the initial content and the target input information through the content validity correction mechanism, and determining whether the validity of the initial content is verified based on the second semantic similarity; if yes, determining the initial content as the target content.

[0012] In a second aspect, the present application provides a content generation device, comprising: a receiving module, used to receive a content generation request, the content generation request including target input information; a determination module, used to determine whether it is necessary to obtain a target document related to the target input information based on the content generation request through a natural language processing tool and a classification model; a first error correction module, used to determine the target content corresponding to the target input information through a first error correction mechanism and a content generation model if not, the first error correction mechanism does not include a document relevance error correction mechanism; a second error correction module, used to determine the target content corresponding to the target input information through a second error correction mechanism and the content generation model if yes, the second error correction mechanism includes a document relevance error correction mechanism.

[0013] Optionally, in the device as described above, the determination module is specifically used to extract target keywords in the target input information through the natural language processing tool; the determination module is also specifically used to input the target keywords into the classification model to obtain a classification result, the classification result includes an index type or a real-time event type, and the classification model is obtained by training with a pre-labeled training set; the determination module is also specifically used to determine that the target document needs to be acquired if the classification result is an index type or a real-time event type; the determination module is also specifically used to determine that the target document does not need to be acquired if the classification result is not an index type and is not a real-time event type.

[0014] Optionally, in the device as described above, the first error correction mechanism includes a content relevance error correction mechanism and a content validity error correction mechanism; the device also includes: a first execution module, used to input the target input information into the content generation model to obtain initial content; the first execution module is also used to determine the target content through the content relevance error correction mechanism, the content validity error correction mechanism, and the initial content.

[0015] Optionally, in the device as described above, the second error correction mechanism also includes a content relevance error correction mechanism and a content validity error correction mechanism; the device also includes: a second execution module, used to perform target retrieval processing on the target input information to obtain an initial document; the second execution module is also used to determine the first semantic similarity between the initial document and the target input information through the document relevance error correction mechanism, and determine whether the initial document has passed the verification based on the first semantic similarity; the second execution module is also used to determine the initial document as the target document if so, input the target document and the target input information into the content generation model to obtain the initial content , and determine the target content through the content relevance error correction mechanism, the content validity error correction mechanism, and the initial content; the second execution module is also used to, if not, perform multiple retrieval processes on the target input information through network retrieval to obtain multiple candidate documents, and verify the multiple candidate documents respectively through the document relevance error correction mechanism until the verification passes, then determine the corresponding candidate document as the target document, input the target document and the target input information into the content generation model to obtain the initial content, and determine the target content through the content relevance error correction mechanism, the content validity error correction mechanism, and the initial content.

[0016] Optionally, in the device as described above, the second execution module is specifically used to determine the target vector of the target input information if the classification result is an index type, and retrieve the target vector through a knowledge base to obtain the initial document; the second execution module is also specifically used to retrieve the target input information through network retrieval to obtain the initial document if the classification result is a real-time event type.

[0017] Optionally, the device as described above further includes: a verification module, used to determine the keyword intersection ratio between the initial content and the target input information through the content relevance correction mechanism, and determine whether the relevance of the initial content has been verified based on the keyword intersection ratio; the verification module is also used to, if not, repeatedly generate the initial content through the content generation model until the relevance of the initial content has been verified; the verification module is also used to, if so, determine the second semantic similarity between the initial content and the target input information through the content validity correction mechanism, and determine whether the validity of the initial content has been verified based on the second semantic similarity; the verification module is also used to, if so, determine the initial content as the target content.

[0018] In a third aspect, the present application provides an electronic device comprising: a processor, and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement any method described in the first aspect.

[0019] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are executed by a processor as described in any one of the methods in the first aspect.

[0020] In a fifth aspect, the present application provides a computer program product, comprising a computer program, wherein the computer program is executed by a processor as in any one of the methods in the first aspect.

[0021] The content generation method, device, electronic device, storage medium and product provided by the present application include: receiving a content generation request, the content generation request includes target input information; according to the content generation request, determining whether it is necessary to obtain a target document related to the target input information through a natural language processing tool and a classification model; if not, determining the target content corresponding to the target input information through a first error correction mechanism and a content generation model, the first error correction mechanism does not include a document relevance error correction mechanism; if yes, determining the target content corresponding to the target input information through a second error correction mechanism and the content generation model, the second error correction mechanism includes a document relevance error correction mechanism. The above scheme can accurately implement error correction based on whether the target document is required to determine the corresponding error correction mechanism to correct the generated content, thereby optimizing the generated content and improving the accuracy of the generated target content. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0023] Figure 1 A schematic diagram of an application scenario of a content generation method provided in an embodiment of the present application;

[0024] Figure 2 A flowchart of a content generation method provided in an embodiment of the present application;

[0025] Figure 3 A flowchart of a content generation method provided in an embodiment of the present application;

[0026] Figure 4 A schematic diagram of determining whether to obtain a target document provided in an embodiment of the present application;

[0027] Figure 5A schematic diagram of determining a target document provided in an embodiment of the present application;

[0028] Figure 6 A schematic diagram of determining target content provided in an embodiment of the present application;

[0029] Figure 7 A schematic diagram of the structure of a content generation device provided in an embodiment of the present application;

[0030] Figure 8 A schematic diagram of the structure of a content generation device provided in an embodiment of the present application;

[0031] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0032] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0033] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0034] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, processing, transmission, provision, disclosure and application of the relevant data comply with the relevant laws, regulations and standards of the relevant countries and regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0035] It should be noted that the content generation method, device, electronic device, storage medium and product of the present application can be used in the field of artificial intelligence technology, and can also be used in any field other than artificial intelligence. The application field of the content generation method, device, electronic device, storage medium and product of the present application is not limited.

[0036] Figure 1A schematic diagram of an application scenario of a content generation method provided in an embodiment of the present application is given as an example in combination with the illustrated scenario: a user inputs input information through terminal device 1, inputs the input information into a content generation model, and the content generation model outputs corresponding target content.

[0037] In practical applications, problems such as broad input information, vague input information, or imperfect content generation models may lead to inaccurate target content.

[0038] In the related art, in the scenario where the target content is inaccurate, the user needs to modify the input information and re-enter it until the target content meets the user's requirements. This process will affect the user's experience.

[0039] The content generation method provided in this application is intended to solve the above technical problems in the prior art.

[0040] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0041] Figure 2 A flow chart of a content generation method provided in an embodiment of the present application, the method comprising the following steps:

[0042] S201: Receive a content generation request.

[0043] The content generation request includes target input information.

[0044] Exemplarily, the input type of the target input information includes but is not limited to at least one of the following: a definition type, a reason type, a method type, or a fact type, etc.

[0045] Combined with the scenario examples, definition questions refer to questions where users want to get a clear definition or explanation of a term, concept, object or phenomenon. Cause questions refer to questions where users want to understand the cause or logic behind an event, phenomenon or result. Method questions refer to questions where users want to get specific steps or methods to complete a task or solve a problem. Fact questions refer to questions where users want to get support from specific facts or data to verify a point of view or obtain relevant information. Multiple input types can be applied to different business scenarios to enhance the user experience.

[0046] S202: According to the content generation request, determine whether it is necessary to obtain a target document related to the target input information through a natural language processing tool and a classification model.

[0047] The target document is a document or information source that is highly relevant to the user input information. The target document can provide necessary background information and context for the target input information. By citing the information in the target document, the accuracy of the generated target content is improved. Combined with the information in the target document, the generated target content can be made more comprehensive and detailed.

[0048] Exemplarily, keywords and / or key phrases in the target input information are extracted by a natural language processing tool to improve the classification accuracy of the classification model. The classification model classifies the target input information into an index type, a real-time event type, or other types according to the keywords and key phrases.

[0049] Combined with the scenario example, the target input information of the index type needs to obtain the target document from the local knowledge base. The target input information of the real-time event type needs to obtain the target document from the Internet or other real-time data sources. Other types of target input information do not need to obtain the target document, and the target content is directly generated by the content generation model.

[0050] S203: If not, determine the target content corresponding to the target input information through the first error correction mechanism and the content generation model, and the first error correction mechanism does not include a document relevance error correction mechanism.

[0051] In combination with the scenario example, if there is no need to obtain the target document, there is no need to correct the target document, and the corresponding first error correction mechanism does not include a document relevance error correction mechanism, but only includes error correction of the target content.

[0052] It can be understood that by correcting the target content, the accuracy of the generated target content can be improved, avoiding the user from repeatedly entering the target input information when the target content is inaccurate, thereby improving the user experience.

[0053] S204: If yes, determine the target content corresponding to the target input information through a second error correction mechanism and a content generation model, wherein the second error correction mechanism includes a document relevance error correction mechanism.

[0054] Exemplarily, the target content is used as a reference, and the auxiliary content generation model generates the target content corresponding to the target input information.

[0055] Combined with the scenario example, the target document may have a low correlation with the target input information. In this scenario, the target content generated with the assistance of the target document will have a low accuracy problem. Correcting the target document through the document correlation error correction mechanism can improve the accuracy of the target document, thereby improving the accuracy of the generated target content.

[0056] It can be understood that by determining the corresponding error correction mechanism based on whether the target document is needed, error correction can be implemented in a targeted manner, thereby improving the accuracy of error correction.

[0057] The content generation method provided in the embodiment of the present application receives a content generation request, and the content generation request includes target input information; according to the content generation request, determines whether it is necessary to obtain a target document related to the target input information through a natural language processing tool and a classification model; if not, determines the target content corresponding to the target input information through a first error correction mechanism and a content generation model, and the first error correction mechanism does not include a document relevance error correction mechanism; if so, determines the target content corresponding to the target input information through a second error correction mechanism and a content generation model, and the second error correction mechanism includes a document relevance error correction mechanism. The above scheme corrects the generated content according to whether the target document is needed to determine the corresponding error correction mechanism, which can accurately implement error correction, thereby optimizing the generated content and improving the accuracy of the generated target content.

[0058] Based on any of the above embodiments, Figure 3 , the detailed process of content generation is explained.

[0059] Figure 3 A flow chart of a content generation method provided in an embodiment of the present application. Figure 3 As shown, the method includes:

[0060] S301: Receive a content generation request.

[0061] It should be noted that the execution process of S301 refers to S201 and will not be repeated here.

[0062] S302: Determine the metadata structure of the target file system corresponding to the target object identifier according to the file recovery request.

[0063] A feasible implementation method can determine whether it is necessary to obtain the target document by the following method: extract the target keywords in the target input information through a natural language processing tool; input the target keywords into a classification model to obtain a classification result, the classification result includes an index type or a real-time event type, and the classification model is trained by a pre-labeled training set; if the classification result is an index type or a real-time event type, it is determined that the target document needs to be obtained; if the classification result is not an index type and is not a real-time event type, it is determined that the target document does not need to be obtained.

[0064] Among them, the target keyword is the keyword that best reflects the characteristics of the target input information.

[0065] Optionally, the training set includes multiple historical keywords with pre-labeled classification results. The classification model obtained by training the training set can learn the deep regular features between the historical keywords and the labeled classification results, thereby achieving accurate classification.

[0066] Combined with the scenario example, the target input information of the index type is fixed and already exists. For example, the target input information of the index type can be "What is quantum computing", "What is the concept of blockchain technology", etc. The corresponding target document can be found through the existing local knowledge base. The target input information of the real-time event type is the latest and constantly updated information. For example, "What is the weather like today", "What is the recent market situation", the corresponding target document does not exist in the local knowledge base, and the target document needs to be obtained through the network.

[0067] Next, combine Figure 4 Determining whether to acquire a target document is described.

[0068] Figure 4 A schematic diagram of determining whether to obtain a target document provided in an embodiment of the present application. Figure 4 As shown, the target keyword corresponding to the target input information is determined by a natural language processing tool. The target keyword is classified by a classification model to determine the classification result corresponding to the target input information. It is determined whether the target document needs to be obtained according to the specific classification result.

[0069] In this feasible implementation, the classification results are accurately determined through natural language processing tools and classification models, and whether the target document needs to be obtained is determined based on the classification results, thereby meeting the business scenario and improving the accuracy of content generation.

[0070] Next, we will provide examples for scenarios where no target document is required.

[0071] S303: Input the target input information into the content generation model to obtain initial content.

[0072] Combined with the scenario example, for business scenarios that do not require a target document, the initial content can be obtained by directly inputting the target input information into the content generation model.

[0073] In the related art, the initial content is pushed to the user after it is obtained. If the initial content does not meet the user's requirements, the user is required to re-enter the target input information and re-execute the content generation.

[0074] In this application, after the initial content is obtained, it is not pushed to the user yet, but is first verified through an error correction mechanism. If the verification passes, it is pushed to the user, thereby improving the accuracy of the version pushed to the user.

[0075] Next, examples are given for scenarios where a target document is required.

[0076] S304: Perform target retrieval processing on the target input information to obtain an initial document.

[0077] Combined with the scenario example, for the scenario that requires a target document, the initial document is obtained before the content generation model performs the generation work.

[0078] A feasible implementation method is to obtain the initial document through the following method: if the classification result is an index type, determine the target vector of the target input information, and retrieve and process the target vector through the knowledge base to obtain the initial document; if the classification result is a real-time event type, retrieve and process the target input information through network retrieval to obtain the initial document.

[0079] Exemplarily, the documents in the knowledge base are all in the form of vectors. For the index type, the target input information is converted into a target vector, a search formula is created based on the target vector, the vector with the highest similarity is determined in the knowledge base based on the search formula, and the initial document is determined based on the vector with the highest similarity.

[0080] Optionally, the target input information is converted into a target vector through a pre-trained word embedding model.

[0081] It can be understood that the vector representation can capture the semantic similarity between words, not just the literal similarity, thereby improving the accuracy of retrieval.

[0082] Exemplarily, the network retrieval is achieved by inputting the target input information into a network search engine to obtain an initial document.

[0083] Optionally, before inputting the target input information into the network search engine, verify whether the database version of the network search engine is the latest version, and perform the search when the database version is the latest version.

[0084] It can be understood that by verifying the database version, the accuracy of the search can be effectively improved.

[0085] In this feasible implementation, for different classification results, a matching retrieval processing method is selected to perform retrieval, thereby improving the accuracy of the retrieval.

[0086] S305 . Determine a first semantic similarity between the initial document and the target input information through a document correlation error correction mechanism, and determine whether the initial document has passed verification based on the first semantic similarity.

[0087] Optionally, a similarity threshold is determined, and if the first semantic similarity is greater than or equal to the similarity threshold, it is determined that the initial document verification has passed.

[0088] A feasible implementation method is that if yes, the initial document is determined as the target document, the target document and the target input information are input into the content generation model to obtain the initial content, and the target content is determined through the content relevance error correction mechanism, the content validity error correction mechanism, and the initial content; if not, the target input information is searched and processed multiple times through network retrieval to obtain multiple candidate documents, and the multiple candidate documents are verified and processed respectively through the document relevance error correction mechanism until the verification passes, then the corresponding candidate document is determined as the target document, the target document and the target input information are input into the content generation model to obtain the initial content, and the target content is determined through the content relevance error correction mechanism, the content validity error correction mechanism, and the initial content.

[0089] Combined with the scenario example, if the initial document verification passes, it means that the initial document is related to the target input information. The initial document and the target input information are input into the content generation model so that the content generation model generates initial content related to the target input information with reference to the initial document.

[0090] Combined with the scenario example, if the initial document fails to pass the verification, it means that the initial document has a low degree of relevance to the target input information. On this basis, if the content generation model refers to the initial document, the generated content will have a low accuracy. The document relevance error correction mechanism can be used to correct the initial document with a low degree of relevance.

[0091] Specifically, if the initial document fails to pass the verification, the search process is repeated through network search, and a candidate document is obtained each time. After each candidate document is obtained, the candidate document is verified through the document relevance error correction mechanism. If the verification passes, it means that the current candidate document has a high degree of relevance to the target input information, and the current candidate document is determined as the target document. If the verification fails, the search process and verification process are continued until the verification passes.

[0092] Next, combine Figure 5 Describe the target document.

[0093] Figure 5 A schematic diagram of determining a target document provided in an embodiment of the present application. Figure 5 As shown, the initial document is verified through the document correlation error correction mechanism. If the verification passes, the initial document is determined as the target document. If the verification fails, the re-retrieval and verification are performed cyclically until the verification passes, and the current candidate document is determined as the target document.

[0094] In this feasible implementation, through the document relevance error correction mechanism, effective error correction can be performed on documents with a low degree of relevance to the target input information, thereby improving the accuracy of the target content generated from the document.

[0095] S306: Determine the keyword intersection ratio between the initial document and the target input information through the content relevance error correction mechanism, and determine whether the relevance of the initial content has been verified based on the keyword intersection ratio.

[0096] Combined with the scenario example, the keyword intersection ratio is used to determine whether the initial content has hallucinations, that is, whether the initial content is irrelevant to the target input information. If hallucinations exist, the initial content cannot meet the user's requirements, and the initial content with hallucinations is corrected through the content relevance error correction mechanism.

[0097] Among them, keywords are representative and important words or phrases in the text of the initial content and target input information, which can reflect the theme, content and core information of the text.

[0098] Optionally, keywords are extracted from the text of the initial content and the target input information respectively through a pre-trained deep learning model.

[0099] Exemplarily, the number of intersection keywords between the keywords of the initial content and the keywords of the target input information is determined, the ratio of the number of intersection keywords to the number of keywords of the target input information is determined as the keyword intersection ratio, and whether the relevance of the initial content is verified is determined based on the relationship between the keyword intersection ratio and the ratio threshold.

[0100] If not, execute S307.

[0101] If yes, execute S308.

[0102] S307 , repeatedly generating initial content through the content generation model until the relevance verification of the initial content passes.

[0103] Exemplarily, the initial content is repeatedly generated, and a relevance verification process is performed on each generated initial content until the relevance verification passes, the relevance verification process is stopped, and the current initial content is determined as the target content.

[0104] Combined with the scenario example, if the relevance of the initial content is not verified, it means that the initial content has a low relevance to the target input information. By repeatedly generating the initial content, the initial content with a high relevance to the target input information can be screened out, thereby improving the accuracy of the generated target content.

[0105] S308. Determine the second semantic similarity between the initial content and the target input information through a content validity correction mechanism, and determine whether the validity of the initial content has been verified based on the second semantic similarity.

[0106] Among them, content validity is used to verify whether the initial content matches the target input information.

[0107] Combined with the scenario example, for the target input information of definition type, the generated answer should contain a clear definition or explanation to ensure that the user can understand the meaning of the question. For the target input information of cause type, the generated answer should provide a reasonable explanation or reason to ensure that the user can understand why something happened. For the target input information of method type, the generated answer should provide specific steps or methods to ensure that the user can follow the guidance provided. For the target input information of fact type, the generated answer should provide specific facts or data to ensure that the user can obtain accurate information.

[0108] Further, exemplarily, if the second semantic similarity reaches a preset value, it indicates whether the validity of the initial content has been verified.

[0109] S309: Determine the initial content as the target content.

[0110] Optionally, if the validity of the initial content is not verified, the target document is re-determined through network retrieval, and the target content is re-determined through the target document until the re-determined target content is verified.

[0111] Next, combine Figure 6 Describe the content of the target.

[0112] Figure 6 A schematic diagram of determining target content provided in an embodiment of the present application. Figure 6 As shown, the classification result is determined according to the target input information. For other types of classification results, the target content is generated according to the target input information. If the target content does not pass the content relevance verification and content validity verification, the target content is repeatedly generated. For the classification results of the index type, the target document is determined through the knowledge base. For the classification results of the real-time event type, the target document is determined through a network search. If the document relevance of the target document is not verified, the target document is obtained through repeated network search. If the document relevance of the target document is verified, the target content is generated through the target input information and the target document. If the target content passes the content relevance verification and content validity verification, the target content is pushed to the user. If the target content does not pass the content relevance verification, that is, the target content has hallucinations, the target content is repeatedly generated until the target content passes the content relevance verification. If the target content does not pass the content validity verification, that is, the target content does not match the target input information, the target document is repeatedly determined through a network search, and the target content is repeatedly generated. Until the target content passes the content relevance verification and content validity verification.

[0113] In combination with the scenario example, after the initial content is verified, it can be determined that the initial content is related to the target input information and the initial content matches the target input information, and the initial content can be determined as the target content.

[0114] Based on the above implementation manner, through the first error correction mechanism and the second error correction mechanism, effective error correction can be performed before the target content is pushed to the user, thereby improving the accuracy of the generated target content.

[0115] Figure 7 This is a schematic diagram of the structure of a content generation device provided in an embodiment of the present application. Figure 7 As shown, the content generation device 70 may include: a receiving module 71, a determining module 72, a first error correction module 73, and a second error correction module 74, wherein:

[0116] The receiving module 71 is used to receive a content generation request, where the content generation request includes target input information.

[0117] The determination module 72 is used to generate a request according to the content and determine whether it is necessary to obtain a target document related to the target input information through a natural language processing tool and a classification model.

[0118] The first error correction module 73 is used to determine the target content corresponding to the target input information through the first error correction mechanism and the content generation model if no, and the first error correction mechanism does not include a document relevance error correction mechanism.

[0119] The second error correction module 74 is used to determine the target content corresponding to the target input information through a second error correction mechanism and a content generation model. The second error correction mechanism includes a document relevance error correction mechanism.

[0120] Optionally, the receiving module 71 may execute Figure 2 S201 in the embodiment.

[0121] Optionally, the determination module 72 may execute Figure 2 S202 in the embodiment.

[0122] Optionally, the first error correction module 71 may execute Figure 2 S203 in the embodiment.

[0123] Optionally, the second error correction module 72 may execute Figure 2 S204 in the embodiment.

[0124] It should be noted that the content generating device shown in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0125] In a possible implementation, the determination module 72 is specifically configured to:

[0126] Extract target keywords from target input information through natural language processing tools;

[0127] Input the target keyword into the classification model to obtain the classification result, which includes the index type or the real-time event type. The classification model is trained by using a pre-labeled training set.

[0128] If the classification result is an index type or a real-time event type, it is determined that the target document needs to be obtained;

[0129] If the classification result is not of the index type and is not of the real-time event type, it is determined that there is no need to obtain the target document.

[0130] Figure 8 A schematic diagram of the structure of a content generation device provided in an embodiment of the present application. Figure 7 Based on the embodiment shown, Figure 8 As shown, the content generating device 80 further includes: a first execution module 75, a second execution module 76, and a verification module 77, wherein:

[0131] The first error correction mechanism includes a content relevance error correction mechanism and a content validity error correction mechanism; the first execution module 75 is used to:

[0132] Input the target input information into the content generation model to obtain the initial content;

[0133] The target content is determined through the content relevance correction mechanism, the content validity correction mechanism, and the initial content.

[0134] The second error correction mechanism also includes a content relevance error correction mechanism and a content validity error correction mechanism; the second execution module 76 is used to:

[0135] Perform target retrieval processing on the target input information to obtain the initial document;

[0136] Determine the first semantic similarity between the initial document and the target input information through the document correlation error correction mechanism, and determine whether the initial document has passed the verification according to the first semantic similarity;

[0137] If yes, the initial document is determined as the target document, the target document and the target input information are input into the content generation model to obtain the initial content, and the target content is determined through the content relevance error correction mechanism, the content validity error correction mechanism, and the initial content;

[0138] If not, the target input information is searched multiple times through network retrieval to obtain multiple candidate documents, and the multiple candidate documents are verified separately through the document relevance error correction mechanism until the verification is passed. Then the corresponding candidate document is determined as the target document, and the target document and the target input information are input into the content generation model to obtain the initial content, and the target content is determined through the content relevance error correction mechanism, the content validity error correction mechanism, and the initial content.

[0139] In a possible implementation manner, the second execution module 76 is specifically configured to:

[0140] If the classification result is an index type, the target vector of the target input information is determined, and the target vector is retrieved through the knowledge base to obtain the initial document;

[0141] If the classification result is a real-time event type, the target input information is retrieved and processed through network retrieval to obtain the initial document.

[0142] The verification module 77 is used to:

[0143] Through the content relevance error correction mechanism, determine the keyword intersection ratio between the initial content and the target input information, and determine whether the relevance of the initial content has been verified based on the keyword intersection ratio;

[0144] If not, the initial content is repeatedly generated through the content generation model until the relevance verification of the initial content passes;

[0145] If yes, determine the second semantic similarity between the initial content and the target input information through the content validity correction mechanism, and determine whether the validity of the initial content is verified based on the second semantic similarity;

[0146] If so, the initial content is determined as the target content.

[0147] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Fig. 9 As shown, the electronic device includes:

[0148] The electronic device includes a processor 291 and a memory 292; it may also include a communication interface 293 and a bus 294. The processor 291, the memory 292, and the communication interface 293 may communicate with each other through the bus 294. The communication interface 293 may be used for information transmission. The processor 291 may call the logic instructions in the memory 292 to execute the method of the above embodiment.

[0149] In addition, the logic instructions in the above-mentioned memory 292 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product.

[0150] The memory 292 is a computer-readable storage medium that can be used to store software programs and computer executable programs, such as program instructions / modules corresponding to the methods in the embodiments of the present application. The processor 291 executes functional applications and data processing by running the software programs, instructions, and modules stored in the memory 292, that is, implementing the methods in the above method embodiments.

[0151] The memory 292 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 292 may include a high-speed random access memory and may also include a non-volatile memory.

[0152] An embodiment of the present application provides a non-temporary computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the method as described in the above embodiment.

[0153] An embodiment of the present application provides a computer program product, including a computer program, which implements the method of the above embodiment when the computer program is executed by a processor.

[0154] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.

[0155] It should be further noted that, although the various steps in the flowchart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0156] It should be understood that the above-mentioned device embodiments are only illustrative, and the device of the present application can also be implemented in other ways. For example, the division of units / modules in the above-mentioned embodiments is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units, modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed.

[0157] In addition, unless otherwise specified, each functional unit / module in each embodiment of the present application may be integrated into one unit / module, each unit / module may exist physically separately, or two or more units / modules may be integrated together. The above-mentioned integrated unit / module may be implemented in the form of hardware or in the form of a software program module.

[0158] If the integrated unit / module is implemented in the form of hardware, the hardware may be a digital circuit, an analog circuit, etc. The physical implementation of the hardware structure includes but is not limited to transistors, memristors, etc. The processor may be any appropriate hardware processor, such as a CPU, a GPU, an FPGA, a DSP, and an ASIC, etc. The storage unit may be any appropriate magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory RRAM (Resistive Random Access Memory), a dynamic random access memory DRAM (Dynamic Random Access Memory), a static random access memory SRAM (Static Random-Access Memory), an enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), a high-bandwidth memory HBM (High-Bandwidth Memory), a hybrid memory cube HMC (Hybrid Memory Cube), etc.

[0159] If the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.

[0160] In the above embodiments, the description of each embodiment has its own emphasis. For the part not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0161] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0162] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A content generation method, characterized in that: include: receiving a content generation request, wherein the content generation request includes target input information; According to the content generation request, determining whether it is necessary to obtain a target document related to the target input information through a natural language processing tool and a classification model; If not, determining the target content corresponding to the target input information through a first error correction mechanism and a content generation model, wherein the first error correction mechanism does not include a document relevance error correction mechanism; If so, the target content corresponding to the target input information is determined through a second error correction mechanism and the content generation model, wherein the second error correction mechanism includes a document relevance error correction mechanism.

2. The method according to claim 1, characterized in that Determining whether it is necessary to obtain a target document related to the target input information by using a natural language processing tool and a classification model includes: Extracting target keywords from the target input information by using the natural language processing tool; Inputting the target keyword into the classification model to obtain a classification result, wherein the classification result includes an index type or a real-time event type, and the classification model is obtained by training with a pre-labeled training set; If the classification result is an index type or a real-time event type, determining that the target document needs to be acquired; If the classification result is not of the index type and is not of the real-time event type, it is determined that there is no need to obtain the target document.

3. The method according to claim 2, characterized in that The first error correction mechanism includes a content relevance error correction mechanism and a content validity error correction mechanism; determining the target content corresponding to the target input information through the first error correction mechanism and the content generation model includes: Inputting the target input information into the content generation model to obtain initial content; The target content is determined by the content relevance error correction mechanism, the content validity error correction mechanism, and the initial content.

4. The method according to claim 2, characterized in that: The second error correction mechanism also includes a content relevance error correction mechanism and a content validity error correction mechanism; Determining target content corresponding to the target input information by using a second error correction mechanism and a content generation model includes: Performing target retrieval processing on the target input information to obtain an initial document; Determining a first semantic similarity between the initial document and the target input information through the document correlation error correction mechanism, and determining whether the initial document has passed verification according to the first semantic similarity; If yes, the initial document is determined as the target document, the target document and the target input information are input into the content generation model to obtain initial content, and the target content is determined through the content relevance error correction mechanism, the content validity error correction mechanism, and the initial content; If not, the target input information is searched multiple times through network retrieval to obtain multiple candidate documents, and the multiple candidate documents are verified respectively through the document relevance error correction mechanism until the verification is passed. Then the corresponding candidate document is determined as the target document, and the target document and the target input information are input into the content generation model to obtain initial content, and the target content is determined through the content relevance error correction mechanism, the content validity error correction mechanism, and the initial content.

5. The method according to claim 4, characterized in that Performing target retrieval processing on the target input information to obtain an initial document, including: If the classification result is an index type, determining a target vector of the target input information, and performing a search process on the target vector through a knowledge base to obtain the initial document; If the classification result is a real-time event type, the target input information is searched and processed by means of network search to obtain the initial document.

6. The method according to claim 3 or 4, characterized in that: Determining the target content by using the content relevance error correction mechanism, the content validity error correction mechanism, and the initial content includes: Determine the keyword intersection ratio between the initial content and the target input information through the content relevance error correction mechanism, and determine whether the relevance of the initial content has been verified based on the keyword intersection ratio; If not, the initial content is repeatedly generated by the content generation model until the relevance verification of the initial content passes; If yes, determining the second semantic similarity between the initial content and the target input information through the content validity correction mechanism, and determining whether the validity of the initial content is verified based on the second semantic similarity; If so, the initial content is determined as the target content.

7. A content generating device, characterized in that: include: A receiving module, configured to receive a content generation request, wherein the content generation request includes target input information; A determination module, configured to generate a request according to the content, and determine whether it is necessary to obtain a target document related to the target input information through a natural language processing tool and a classification model; A first error correction module, configured to, if not, determine the target content corresponding to the target input information through a first error correction mechanism and a content generation model, wherein the first error correction mechanism does not include a document relevance error correction mechanism; The second error correction module is used to determine the target content corresponding to the target input information through a second error correction mechanism and the content generation model, and the second error correction mechanism includes a document relevance error correction mechanism.

8. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 6 when executed by a processor.

10. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 6 when being executed by a processor.