Information base construction method and device, text information generation method and device, equipment and medium
By obtaining task requirements and text examples, determining keywords and generating original texts, and establishing an information database index relationship, the problem of poor performance of language processing models in text generation is solved, and the accuracy and user satisfaction of generated text are improved.
Patent Information
- Application Number
- CN202310763721.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-26
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2043-06-26
AI Technical Summary
When generating text, the existing language processing model cannot fully meet all user requirements due to the limitations of the ability to understand and process natural language, resulting in poor generation results.
By obtaining the requirements information for tasks to be constructed and the text example to be constructed, the keywords are determined, and original text information is generated based on the keywords and text examples, and target original text information is determined in response to user feedback. If the similarity requirements are met, Store in the information library to establish an index relationship between keywords and text examples so that subsequent text generation can provide information that meets task requirements quickly and accurately.
It improves the accuracy and user satisfaction of the language processing model when generating text information, ensures that the generated text is more in line with task requirements, and enhances the use effect of the model.
Smart Images

Figure CN119202230A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of building an information database, and in particular to an information database building method, a text information generating method, a device, a equipment and a medium. Background Art
[0002] Language processing models can perform various natural language processing tasks excellently, such as language translation, text summarization, dialogue generation, etc., but they still cannot fully meet all the requirements of user input.
[0003] When existing language processing models generate corresponding original text based on user-given task requirements, the core idea is to first pre-train the model with a large amount of data, and then fine-tune it for specific tasks, so that original content can be generated based on user input prompts and the basic rules of natural language that have been learned.
[0004] However, due to the limitations of the language processing model's ability to understand and process natural language, existing methods have the problem of poor performance when using language processing models for text generation. Summary of the invention
[0005] The present application provides an information library construction method, a text information generation method, an apparatus, a device and a medium, which are used to solve the problem that the existing method has poor use effect when using a language processing model to generate text.
[0006] In a first aspect, the present application provides a method for constructing an information database, the method comprising:
[0007] Obtaining requirement information of the task to be constructed and a text example to be constructed, where the text example to be constructed is a text example corresponding to the requirement information of the task to be constructed;
[0008] Determine the keywords of the information required for the task to be constructed;
[0009] Generate and display original text information to users based on keywords and text examples to be constructed;
[0010] In response to the user's feedback operation on the original text information, determining target original text information and non-target original text information in the original text information, wherein the target original text information is information selected by the user from the original text information and meets the task requirements, and the non-target original text information is other original text information in the original text information except the target original text information;
[0011] If the target original text information and the non-target original text information meet the preset similarity requirements, the keywords and the text examples to be constructed are stored in the information library, and an index relationship between the keywords and the text examples to be constructed is constructed in the information library so that the language processing model can use it when generating the target text information after receiving the task requirement information.
[0012] In the embodiment of the present application, after determining the target original text information and the non-target original text information in the original text information in response to the user's feedback operation on the original text information, the method further includes:
[0013] If all the original text information is target original text information selected by the user and meets the task requirements, the keywords and the text examples to be constructed are stored in the information library, and an index relationship between the keywords and the text examples to be constructed is constructed in the information library.
[0014] In the embodiment of the present application, if the target original text information and the non-target original text information meet the preset similarity requirement, the keywords and the text examples to be constructed are stored in the information library, and an index relationship between the keywords and the text examples to be constructed is constructed in the information library, including:
[0015] Determining a target text information segment in the non-target original text information, the target text information segment being a text information segment that meets a preset similarity requirement with the target original text information;
[0016] If the number of target text information segments and the total number of text information segments in the non-target original text information meet the preset ratio threshold requirement, then the original text information is determined to be standard original text information that meets the information requirements of the task to be constructed;
[0017] Based on the standard original text information, the keywords and the text examples to be constructed are stored in the information base, and an index relationship between the keywords and the text examples to be constructed is constructed in the information base.
[0018] In the embodiment of the present application, if the target original text information and the non-target original text information meet the preset similarity requirement, the keyword and the text example to be constructed are stored in the information library, and an index relationship between the keyword and the text example to be constructed is constructed in the information library. The method further includes:
[0019] If the target original text information and the non-target original text information do not meet the similarity requirement, then obtain the next text example, which is an example that is re-acquired according to the task requirement information and is different from the text example;
[0020] Taking the next text example as the text example, re-execute the step of generating original text information based on the keywords and text examples until the target original text information and the non-target original text information in the original text information meet the similarity requirements, store the keywords and the next text example in the information library, and build an index relationship between the keywords and the next text example in the information library.
[0021] In a second aspect, the present application provides a method for generating text information, the method comprising:
[0022] Responding to a task input operation by a user, obtaining task requirement information;
[0023] Based on the task requirement information, target keyword information is determined, where the target keyword information is a keyword that matches the task keyword in the information base, and the information base is an information base in any one of the information base construction methods;
[0024] According to the task keywords, a target text example having an index relationship with the task keywords is obtained from the information database;
[0025] Based on the target text examples, generate target text information that meets the task requirements;
[0026] Display target text information.
[0027] In the embodiment of the present application, based on the target text example, target text information that meets the task requirement information is generated, including:
[0028] Based on the target text examples and task requirements, construct sample examples, which include text key points examples, text example sentences, and task requirements information;
[0029] Input the example sample into the preset generation model to obtain the target text information that meets the task requirements.
[0030] In the embodiment of the present application, based on the target text example and the task requirement information, an example sample is constructed, and the example sample includes a text key point example, a text sentence example, and the task requirement information, including:
[0031] Based on the type of the target text, the target text examples are divided to obtain text key point examples and text example sentence examples;
[0032] Based on the text key point examples and the text example sentence examples, determine the connecting words of the text key point examples and the connecting words of the text example sentence examples;
[0033] Example samples are constructed based on the connectives of the text key point examples, the connectives of the text sentence examples, and the task requirement information.
[0034] In the embodiment of the present application, after displaying the target text information, the method further includes:
[0035] In response to a user's feedback operation according to the target text information, obtaining first user feedback information;
[0036] If the first user feedback information is information indicating that the target text information does not match the task requirement information, obtaining a target text example input by the user;
[0037] Based on the target text example input by the user, generate optimized text information that meets the task requirements;
[0038] Display optimized text information.
[0039] In the embodiment of the present application, after displaying the optimized text information, the method further includes:
[0040] In response to a user's feedback operation according to the optimized text information, obtaining second user feedback information;
[0041] If the second user feedback information is information indicating that the optimized text information matches the task requirement information, the target text example input by the user is stored in a preset information library, and an index relationship between the target text example and the target keyword information is established;
[0042] If the second user feedback information characterizes that the optimized text information is information that does not match the task requirement information, then other target text examples input by the user are re-acquired, and the other target text examples are used as target text examples, and the step of generating optimized text information that meets the task requirement information is executed based on the target text examples input by the user.
[0043] In a third aspect, the present application provides an information library construction device, the device comprising:
[0044] An information acquisition module, used to acquire the requirement information of the task to be constructed and the text example to be constructed, where the text example to be constructed is a text example corresponding to the requirement information of the task to be constructed;
[0045] A keyword determination module, used to determine keywords of the information required for the task to be constructed;
[0046] An information generation module, used to generate and display original text information to users based on keywords and text examples to be constructed;
[0047] an information determination module, in response to a user's feedback operation on the original text information, determining target original text information and non-target original text information in the original text information, wherein the target original text information is information selected by the user from the original text information and meets the task requirements, and the non-target original text information is other original text information in the original text information except the target original text information;
[0048] The storage and construction module is used to store the keywords and the text examples to be constructed in the information library if the target original text information and the non-target original text information meet the preset similarity requirements, and to construct an index relationship between the keywords and the text examples to be constructed in the information library.
[0049] In a fourth aspect, the present application provides a text information generating device, the device comprising:
[0050] An information acquisition module, used to acquire task requirement information in response to a task input operation by a user;
[0051] An information determination module, used to determine target keyword information based on task requirement information, the target keyword information being a keyword matching a task keyword in an information database, the information database being an information database of any one of claims 1 to 4;
[0052] An example acquisition module is used to acquire target text examples having an index relationship with the task keywords from the information database according to the task keywords;
[0053] An information generation module, used to generate target text information that meets the task requirements based on the target text example;
[0054] The information display module is used to display the target text information.
[0055] In a fifth aspect, the present application provides a device, comprising: a processor, and a memory communicatively connected to the processor;
[0056] Memory stores computer-executable instructions;
[0057] The processor executes the computer-executable instructions stored in the memory to implement the method of the present application.
[0058] In a sixth aspect, the present application provides a computer-readable storage medium, in which program code is stored, and when the program code is executed by a processor, it is used to implement the method of the present application.
[0059] The information library construction method, text information generation method, device, equipment and medium provided by the present application obtain the task requirement information to be constructed and the text example to be constructed, wherein the text example to be constructed is a text example corresponding to the task requirement information to be constructed; determine the keywords of the task requirement information to be constructed; based on the keywords and the text example to be constructed, generate and display original text information to the user; in response to the user's feedback operation on the original text information, determine the target original text information and non-target original text information in the original text information, wherein the target original text information is the information selected by the user from the original text information and meets the task requirements, and the non-target original text information is the other original text information in the original text information except the target original text information; if the target original text information and the non-target original text information meet the preset similarity requirements, the keywords and the text example to be constructed are stored in the information library, and an index relationship between the keywords and the text example to be constructed is constructed in the information library.
[0060] In this way, the original text information can be obtained by obtaining the task requirement information to be constructed and the text example to be constructed corresponding to the task requirement information to be constructed, and by judging whether the target original text information and the non-target original text information in the original text information meet the preset similarity requirements, it can be judged whether the original text information is the text information that meets the task requirements, so that after determining that the original text information is the text information that meets the task requirements, the keywords required by the task and the given typical examples are stored in the information library, and the index relationship between the keywords and the typical examples is established, so as to construct the information library used by the language processing model. When the language processing model is used to generate text information, the target keyword information and the target text example corresponding to the target keyword information can be determined from the information library through keyword comparison, and through the target text example, the language processing model can quickly and accurately provide the user with the target text information that meets the task requirement information, thereby enabling the user to accurately provide the appropriate text information even if too many samples are provided when using the language processing model, thereby improving the use effect of the language processing model. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] 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.
[0062] Figure 1 A scenario diagram of a method for constructing an information database provided in an embodiment of the present application.
[0063] Figure 2 A flowchart of a method for constructing an information database provided in an embodiment of the present application.
[0064] Figure 3A flowchart of a method for generating text information provided in an embodiment of the present application.
[0065] Figure 4 A flowchart of another information database construction method provided in an embodiment of the present application.
[0066] Figure 5 A schematic diagram of the structure of an information library construction device provided in an embodiment of the present application.
[0067] Figure 6 A structural schematic diagram of a text information generating device provided in an embodiment of the present application.
[0068] Figure 7 This is a structural block diagram of a device for executing the information database construction method according to an embodiment of the present application.
[0069] The above-mentioned drawings have shown clear embodiments of the present application, which will be described in more detail below; these drawings and textual descriptions are not intended to limit the scope of the concept 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
[0070] 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.
[0071] In the prior art, language processing models use various machine learning methods to learn the content-text component of an object from training data, and then generate new and completely original text content. Since the data used to train the model is always limited and cannot cover all user requirements, when the user inputs some new task requirements that are significantly different from the training data, the quality of the text content generated by the language processing model will be greatly reduced and will be very different from the user's task requirements.
[0072] In order to solve the above problems, an embodiment of the present application provides a method for constructing an information library, which can train a language processing model through task requirements and given typical examples, and when it is determined that the original text generated by the language processing model based on the task requirements and the typical examples meets the task requirements, the keywords extracted from the task requirements and the given typical examples are stored in the information library, and an index relationship between the keywords and the typical examples is established, thereby realizing the construction of the information library; at the same time, a method for generating text information is also proposed. When the language processing model faces task requirements, it can match the typical examples stored in the information library and corresponding to the task information based on the extracted keywords and the keyword library in the information library, thereby generating original text that meets the task requirements, thereby improving the accuracy of the language processing model in generating original text that meets the user's task requirements, and effectively enhancing the effect of the language processing model in generating original text content.
[0073] 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.
[0074] Figure 1 This is a diagram of a practical application scenario of an information library construction method provided in an embodiment of the present application. Figure 1 As shown, the scene graph may include an information acquisition unit 11, a text generation unit 12, and an information storage unit 13.
[0075] Among them, the information acquisition unit 11 can be an information acquisition unit for acquiring task requirements and given typical examples input by the user through the screen of the terminal device, or it can be acquired through other methods. As long as it is an information acquisition unit for acquiring task requirements and typical examples input by the user, this embodiment does not impose any restrictions on this.
[0076] The text generation unit 12 can be a language processing model, that is, a deep learning model for natural language processing, which is trained to understand and generate natural language, and learns the content-text component of the object from the training data through various machine learning methods, and then generates new and completely original text; the language processing model can be a natural language processing model (Nature Language Processing, NLP), for example, Chat GPT, or a recurrent neural network (Recurrent Neural Network, RNN), for example, seq2seq, or a language representation model (Bidirectional Encoder Representation from Transformers, BERT) and other language processing models.
[0077] The information storage unit 13 may be an information library having an information storage function, and may be used to store keyword information required by the task and given typical examples, and to establish an index relationship between the keywords and the typical examples.
[0078] The signal interaction between the information acquisition unit 11, the text generation unit 12 and the information storage unit 13 can be carried out by wireless transmission.
[0079] In some embodiments, the text generation unit 12 generates an original text that better meets the task requirements based on the keyword information and the matched typical examples in the information storage unit 13. The process of constructing the information storage unit 13 is as follows: the information acquisition unit 11 acquires the given task requirements and typical examples, and sends them to the text generation unit 12. The text generation unit 12 generates original text information based on this. If the original text information meets the given task requirements, the extracted keyword information of the task requirements and the given typical examples are stored in the information storage unit 13 together, and an index relationship between the keyword information and the typical examples is established; in this way, the information storage unit 13 storing the keyword information and the typical examples with the corresponding index relationship is constructed, so that the subsequent text generation unit 12 extracts the keyword information from the task requirements based on the given task requirements, and matches the corresponding typical examples from the information storage unit 13 based on the keyword information, thereby generating original text information that meets the task requirements based on the task requirements and the matched determined typical examples, thereby improving the accuracy of the generated original text information to the task requirements and better meeting the needs of users.
[0080] Among them, the keyword information is the key information extracted from the task requirements that best reflects the user's needs, and is used to match the corresponding typical examples from the information storage unit 13; the method of extracting the keyword information can be template matching, full sentence search, deep neural network model and other methods, or other methods that can accurately find the task keywords in the text, and this embodiment does not limit this.
[0081] Figure 2 The flowchart of a method for building an information library provided in an embodiment of the present application is shown in FIG. 1 , wherein the execution subject of the method may be an information library in a language processing model. Figure 2 As shown, the information database construction method may include the following steps:
[0082] S210: Obtaining requirement information of the task to be constructed and a text example to be constructed, where the text example to be constructed is a text example corresponding to the requirement information of the task to be constructed.
[0083] Among them, the task requirement information to be constructed and the text example to be constructed represent the task requirement information and text examples given to the language processing model in the process of building the information database; the text example to be constructed is a given text example, and the content corresponds to the task requirement information to be constructed, so that the original text information generated by the language processing model based on the text example to be constructed can better meet the task requirement information to be constructed; it can be a text example entered by the user himself, or it can be an example obtained by crawling, and the user selects the example that best corresponds to the task requirement information to be constructed as the text example to be constructed.
[0084] Based on this, the requirement information of the task to be constructed and the text examples to be constructed are obtained, so as to subsequently generate the corresponding original text information and build an information library.
[0085] S220: Determine keywords of the task requirement information to be constructed.
[0086] Among them, keywords are key information extracted from task requirements that best reflect user needs.
[0087] Based on this, keywords are extracted from the requirement information of the task to be constructed, so that original text information can be subsequently generated based on the keywords and the text examples to be constructed, and an index relationship between the keywords and the text examples to be constructed can be established.
[0088] S230: Generate and display original text information to the user based on the keywords and the text examples to be constructed.
[0089] Based on this, the language processing model generates original text information and displays it to the user through the keywords in the task requirement information and the text examples to be constructed.
[0090] S240. In response to the user's feedback operation on the original text information, determine the target original text information and non-target original text information in the original text information, wherein the target original text information is the information selected by the user from the original text information and meets the task requirements, and the non-target original text information is the other original text information in the original text information except the target original text information.
[0091] Among them, the feedback operation is an operation that represents the user's determination of whether the original text information meets the task requirements. It can be an operation in which the user selects a section or all of the original text information as information that meets the task requirements, or it can be an operation in which the user determines that the generated original text information does not meet the task requirements.
[0092] Based on this, after displaying the original text information to the user and receiving the user's feedback operation, in response to the user's feedback operation, the text information that the user believes meets the task requirements is determined from the original text information as the target original text information, and the remaining text information that the user has not operated on is the non-target original text information. There may also be text information that meets the task requirements in the non-target original text information, but because the generated text information is large, the user is unable to determine it.
[0093] In some implementations, after determining the target original text information and the non-target original text information in the original text information in response to the user's feedback operation on the original text information, the method further includes:
[0094] If all the original text information is target original text information selected by the user and meets the task requirements, the keywords and the text examples to be constructed are stored in the information library, and an index relationship between the keywords and the text examples to be constructed is constructed in the information library.
[0095] Among them, the target original text information that all original text information is selected by users and meets the task requirements can be a representation that the generated original text information is small, and the user can determine whether the original text information all meets the task requirements, that is, whether the original text information is all target original text information.
[0096] Based on this, if the generated original text information is small, the user can determine by himself whether all the task requirements of the task requirement information to be constructed are met, that is, determine whether all of them are target original text information; and after determining that all the original text information is the target original text information, store the keywords and text examples to be constructed in the information library, and build an index relationship between the keywords and the text examples to be constructed in the information library, thereby realizing the construction of the information library, so that the subsequent language processing model can generate original text information that meets the task requirements based on the keywords and text examples with index relationships constructed in the information library.
[0097] S250. If the target original text information and the non-target original text information meet the preset similarity requirements, the keywords and the text examples to be constructed are stored in the information library, and an index relationship between the keywords and the text examples to be constructed is constructed in the information library so that the language processing model can use it when generating the target text information after receiving the task requirement information.
[0098] Among them, the preset similarity requirement is a pre-set similarity requirement, which is used to compare the similarity between the target original text information and the non-target original text information; if the target original text information and the non-target original text information meet the preset similarity requirement, since the target original text information is determined by the user to meet the task requirements, the non-target original text information also meets the task requirements, that is, the original text information meets the task requirements; thus, it can be determined whether the original text information meets the task requirements through the preset similarity requirement.
[0099] The similarity comparison may be performed by calculating the similarity between the target original text information and the non-target original text information through an algorithm, or by performing a similarity comparison through a vector angle, or by comparing sentence structures, word repetition rates, etc. This embodiment does not impose any restrictions on this.
[0100] In some implementations, if the target original text information and the non-target original text information meet the preset similarity requirement, the keyword and the text example to be constructed are stored in the information library, and an index relationship between the keyword and the text example to be constructed is constructed in the information library, including:
[0101] Determining a target text information segment in the non-target original text information, the target text information segment being a text information segment that meets a preset similarity requirement with the target original text information;
[0102] If the number of target text information segments and the total number of text information segments in the non-target original text information meet the preset ratio threshold requirement, then the original text information is determined to be standard original text information that meets the information requirements of the task to be constructed;
[0103] Based on the standard original text information, the keywords and the text examples to be constructed are stored in the information base, and an index relationship between the keywords and the text examples to be constructed is constructed in the information base.
[0104] Among them, the text information segment is a segment of information in the non-target original text information. The text in the original text information can be divided into paragraphs, and one segment of text is determined as a text information segment, or several segments of text are determined as one text information segment. This embodiment does not limit this.
[0105] The preset ratio threshold is a pre-set ratio threshold used to determine the ratio of the target text information segment in the non-target original text information; if the preset ratio threshold is met, that is, the ratio of the text information segments that meet the task requirements in the non-target original text information is relatively large, then the non-target original text information is determined to be the text information that meets the task requirements, and the generated original text information is thereby determined to be the text information that meets the task requirements.
[0106] Based on this, after the user determines the target original text information that meets the task requirements, each text information segment of the non-target original text information is compared with the target original text information for similarity to obtain the target text information segment that meets the preset similarity requirements. If the ratio of the number of target text information segments to the non-target original text information meets the preset ratio threshold, it is determined that the non-target original text information also meets the task requirements. Therefore, the keywords and the text examples to be constructed are stored in the information library and an index relationship is established to realize the construction of the information library.
[0107] In other embodiments, if the target original text information and the non-target original text information meet the preset similarity requirement, the keyword and the text example to be constructed are stored in the information library, and an index relationship between the keyword and the text example to be constructed is constructed in the information library, and the method further includes:
[0108] If the target original text information and the non-target original text information do not meet the similarity requirement, then obtain the next text example, which is an example that is re-acquired according to the task requirement information and is different from the text example;
[0109] Taking the next text example as the text example, re-execute the step of generating original text information based on the keywords and text examples until the target original text information and the non-target original text information in the original text information meet the similarity requirements, store the keywords and the next text example in the information library, and build an index relationship between the keywords and the next text example in the information library.
[0110] Based on this, if the target original text information and the non-target original text information do not meet the similarity requirements, that is, the characterization of the original text information does not meet the task requirements, a new text example is determined so that the language processing model generates new original text information based on the task requirement information to be constructed and the new text example, and continues to execute based on the preset similarity requirements, determines that the original text information meets the task requirements, and stores the keywords and the new text examples in the information library, and constructs an index relationship between the keywords and the new text examples in the information library.
[0111] In this embodiment, original text information is generated by obtaining the task requirement information to be constructed and the text example to be constructed. The user can determine by himself that the original text information meets the task requirements; or a part of the text information that meets the task requirements can be determined as the target original text information, and the text information segments that meet the task requirements in the non-target original text information can be determined as the target text information segments through the preset similarity requirements. If the ratio of the number of target text information segments and non-target original text information meets the preset ratio threshold, it is characterized that the original text information meets the task requirements, and the keywords and the next text example are stored in the information library, and an index relationship between the keywords and the next text example is constructed in the information library.
[0112] In this way, by presetting similarity requirements and preset ratio thresholds, it is determined that the original text information meets the task requirements, and based on the keywords of the task requirement information to be constructed and the text examples to be constructed, the construction of the information database is realized, so that when the subsequent language processing model generates original text information, it can determine the text examples in the information database that match the task requirements, so that the generated original text information is more in line with the user's task requirements, thereby improving accuracy and user satisfaction.
[0113] Figure 3 The flowchart of a text information generation method provided in the embodiment of the present application is shown in FIG. 1 , and the execution subject of the method may be a language processing model. Figure 3 As shown, the text information generating method may include the following steps:
[0114] S310 . In response to a task input operation by a user, obtain task requirement information.
[0115] Among them, the task input operation represents that the user needs the language processing model to generate original text information that meets the task requirements. It can be the user manually inputting the task requirement information or voice input.
[0116] Based on this, the language processing model responds to the user's task input operation and determines the task requirement information of the original text information that needs to be generated.
[0117] S320. Determine target keyword information based on the task requirement information. The target keyword information is a keyword that matches the task keyword in the information library. The information library is any information library in the information library construction method.
[0118] Among them, the target keyword information is the key information required by the task, which is used to determine the corresponding text examples from the information library based on the index relationship in the future, so that the language processing model can generate original text information.
[0119] S330. According to the task keyword, a target text example having an index relationship with the task keyword is obtained from the information database.
[0120] Based on this, an index relationship between keywords and corresponding text examples has been established when the information database is constructed, and thus the target text examples stored in the information database are determined through the index relationship according to the task keywords.
[0121] S340: Generate target text information that meets task requirements based on the target text example.
[0122] Based on this, through task keywords and target text examples in the information library, the language processing model generates target text information that meets the task requirements, thereby improving the accuracy of the text content.
[0123] In some implementations, generating target text information that meets task requirements based on the target text example includes:
[0124] Based on the target text examples and task requirements, construct sample examples, which include text key points examples, text example sentences, and task requirements information;
[0125] Input the example sample into the preset generation model to obtain the target text information that meets the task requirements.
[0126] Among them, text key point examples are examples that represent the key points of the target text examples, such as "like to use double words and reduplications to describe things", "often use phrases and short sentences to have conversations". Such examples that represent the characteristics of text key points are text key point examples; text example sentence examples are original text sentences corresponding to the task requirements.
[0127] The preset generation model is a pre-set text information generation model, which may be a language processing model.
[0128] Based on this, according to the different text types, the target text examples can be divided into two categories: text key points examples and text example sentence examples. The text key points examples, text example sentence examples and task requirement information are used as example samples, so that the generation model can generate original text information that meets the task requirements based on the example samples.
[0129] In this implementation, based on the target text example and the task requirement information, an example sample is constructed, and the example sample includes a text key point example, a text sentence example, and the task requirement information, including:
[0130] Based on the type of the target text, the target text examples are divided to obtain text key point examples and text example sentence examples;
[0131] Based on the text key point examples and the text example sentence examples, determine the connecting words of the text key point examples and the connecting words of the text example sentence examples;
[0132] Example samples are constructed based on the connectives of the text key point examples, the connectives of the text sentence examples, and the task requirement information.
[0133] Among them, the conjunctions are used to connect target text examples of the same type so that the language processing model can better generate original text information based on the text examples; the conjunctions for the text key point examples can be "the main points are as follows", and the conjunctions for the text example sentence examples can be "the following are several example sentences".
[0134] Based on this, the text key point examples and text example sentence examples are connected into coherent text information through corresponding connectives, and example samples are constructed based on the text key point examples with connectives, the text example sentence examples with connectives, and the task requirement information.
[0135] S350: Display target text information.
[0136] Based on this, the generated target text information may be displayed to the user in text form or in voice form, which is not limited in this embodiment.
[0137] In some implementations, after displaying the target text information, the method further includes:
[0138] In response to a user's feedback operation according to the target text information, obtaining first user feedback information;
[0139] If the first user feedback information is information indicating that the target text information does not match the task requirement information, obtaining a target text example input by the user;
[0140] Based on the target text example input by the user, generate optimized text information that meets the task requirements;
[0141] Display optimized text information.
[0142] Among them, the first user feedback information is feedback information obtained based on the user's feedback operation, which is whether the target text information matches the task requirement information. For example, the language processing model can provide the user with an option of whether the target text information matches the task requirement information. If the user selects the negative option, the first user feedback information obtained is information that indicates that the user believes that the target text information does not match the task requirement information.
[0143] Based on this, if the language processing model obtains the first user feedback information characterizing that the target text information does not match the task requirement information, the language processing model can prompt the user to input a new text example as the target text example, and generate optimized text information based on the target text example, so that the optimized text information can meet the task requirements and realize the user's needs.
[0144] In this embodiment, after displaying the optimized text information, the method further includes:
[0145] In response to a user's feedback operation according to the optimized text information, obtaining second user feedback information;
[0146] If the second user feedback information is information indicating that the optimized text information matches the task requirement information, the target text example input by the user is stored in a preset information library, and an index relationship between the target text example and the target keyword information is established;
[0147] If the second user feedback information characterizes that the optimized text information is information that does not match the task requirement information, then other target text examples input by the user are re-acquired, and the other target text examples are used as target text examples, and the step of generating optimized text information that meets the task requirement information is executed based on the target text examples input by the user.
[0148] The second user feedback information is feedback information obtained based on the user's feedback operation, which is used to determine whether the optimized text information matches the task requirement information, and is used to determine whether the optimized text information meets the task requirement.
[0149] Based on this, after displaying the optimized text information to the user, based on the second user feedback information obtained, determine whether the optimized text information meets the task requirements. If it does, it indicates that the target text example input by the user is beneficial to the language processing model, and it is correspondingly stored in the preset information library, and an index relationship between the target text example and the target keyword information is established, so that when the subsequent language processing model faces task requirements with the same keywords, it can generate text information that meets the task requirements based on the target text example; if it does not meet the requirements, it indicates that the target text example given by the user this time is not suitable for the language processing model, so the user is prompted to continue to input new target text examples until the language processing model generates text information that meets the task requirements.
[0150] In this embodiment, the language processing model obtains task requirement information, extracts keywords from it, and uses the constructed information library to match target examples corresponding to the keywords from the information library according to the index relationship, and classifies them according to the type of examples and determines the corresponding connecting words, so as to obtain coherent target examples, so that the language processing model generates text information that meets the task requirements based on the task keywords and target examples, and determines new target examples based on the obtained user feedback information to ensure that the text information finally generated meets the task requirements, and continuously improves the information library based on keywords and new target examples.
[0151] In this way, through the target examples stored in the information database and corresponding to the task requirements, the language processing model can improve the accuracy of the generated text information relative to the task requirements, thereby prompting the user's satisfaction; if the user believes that the generated text information does not meet the task requirements, it can also obtain new target examples input by the user to ensure that original text information that meets the task requirements is generated to meet the user's needs; and the target text examples input by the user are stored in the information database to achieve continuous improvement of the information database.
[0152] Figure 4 A flowchart of another information database construction method provided in an embodiment of the present application. Figure 4 As shown, the information database construction method may include the following steps:
[0153] S410. For a certain task requirement, provide corresponding typical examples and input them into the generative artificial intelligence model as a whole to obtain the corresponding results.
[0154] Based on this, in the process of building the information database, task requirements and corresponding examples are provided to the artificial intelligence model so that the model can generate corresponding original text content.
[0155] S420: Determine whether the output result meets the task requirements. If so, add the input typical example to the task example library, and store the keywords of the input task text as the index of the example in the task example library.
[0156] Among them, judging whether the output result meets the task requirements can be done by the user confirming whether the output result meets the requirements, or by an algorithm or vector angle, or by calculating similarity.
[0157] The keywords of the task text can be determined through template matching, full sentence search, deep neural network model, etc., which can accurately find the task keywords in the text.
[0158] S430: If the output result does not meet the task requirements, replace the typical example or add a typical example, and repeat the above steps again until a suitable example is screened out and added to the task example library.
[0159] The typical examples may be replaced by users inputting the typical examples themselves, or by crawling a large number of relevant examples and allowing the user to determine the typical examples that best correspond to the task requirements as the input model.
[0160] Based on this, after storing the corresponding typical examples and keyword indexes of enough new tasks in the task example library, the construction of the task example library is completed.
[0161] S440: Ask the user whether the output result solves the proposed task. If the user feedback is that it is not solved, prompt the user to provide some task examples.
[0162] Among them, voice or text prompt information may be output to the user to confirm to the user whether the output result meets the task requirement.
[0163] S450. Combine the task examples and task requirements provided by the user to obtain corresponding output results, and determine whether the task requirements are met. If so, add the typical examples input by the user and the extracted keywords as indexes of the examples to the task example library.
[0164] Based on this, the model generates new text information according to the task examples input by the user. If the task requirements are met, the typical examples input by the user and the keywords required by the task are stored in the task example library, and a corresponding index relationship between the keywords and examples is established in the task example library.
[0165] Furthermore, if the output result does not meet the task requirements, the user is prompted to replace the typical example or add a typical example, and the above steps are repeated again until a suitable example is screened out and added to the task example library.
[0166] In some embodiments, after the user inputs the task requirements, the task keyword extraction model will be called to determine whether the input matches the index in the existing task example library, that is, whether the user input contains keywords; when it is determined that the input task has a matching task example, the corresponding example in the task example library is retrieved, and the corresponding example is merged with the user's original input, and an updated prompt word is generated by adding a prompt word generator of the example. The prompt word generator here adopts a manually designed prompt template method, and merges the example with the input through a fixed sentence pattern. The updated prompt word is input into the generative artificial intelligence model to obtain an optimized output result, which will be more in line with the user's requirements and of higher quality than the result obtained directly using the original input; on the other hand, when it is determined that there is no matching task example in the input task, the original input is directly given to the generative artificial intelligence model to obtain the result.
[0167] In this embodiment, the task example library is continuously improved during use so that the language processing model can better generate text information that meets the task requirements based on the task example library.
[0168] Figure 5 A schematic diagram of the structure of an information library construction device 500 provided in an embodiment of the present application is shown in FIG. Figure 5 As shown, the information database construction device 500 includes: an information acquisition module 510, a keyword determination module 520, an information generation module 530, an information determination module 540 and a storage and construction module 550.
[0169] An information acquisition module 510 is used to acquire the requirement information of the task to be constructed and the text example to be constructed, where the text example to be constructed is a text example corresponding to the requirement information of the task to be constructed;
[0170] A keyword determination module 520, used to determine keywords of the task requirement information to be constructed;
[0171] An information generation module 530 is used to generate and display original text information to users based on keywords and text examples to be constructed;
[0172] The information determination module 540 is used to determine the target original text information and the non-target original text information in the original text information in response to the user's feedback operation on the original text information, wherein the target original text information is the information selected by the user from the original text information and meets the task requirements, and the non-target original text information is the other original text information in the original text information except the target original text information;
[0173] The storage and construction module 550 is used to store the keywords and the text examples to be constructed in the information library if the target original text information and the non-target original text information meet the preset similarity requirements, and to construct an index relationship between the keywords and the text examples to be constructed in the information library, so that the language processing model can use it when generating the target text information after receiving the task requirement information.
[0174] In the embodiment of the present application, the information database construction device 500 may also be specifically used for:
[0175] If all the original text information is target original text information selected by the user and meets the task requirements, the keywords and the text examples to be constructed are stored in the information library, and an index relationship between the keywords and the text examples to be constructed is constructed in the information library.
[0176] In the embodiment of the present application, the storage and construction module 550 may also be specifically used for:
[0177] Determining a target text information segment in the non-target original text information, the target text information segment being a text information segment that meets a preset similarity requirement with the target original text information;
[0178] If the number of target text information segments and the total number of text information segments in the non-target original text information meet the preset ratio threshold requirement, then the original text information is determined to be standard original text information that meets the information requirements of the task to be constructed;
[0179] Based on the standard original text information, the keywords and the text examples to be constructed are stored in the information base, and an index relationship between the keywords and the text examples to be constructed is constructed in the information base.
[0180] In the embodiment of the present application, the information database construction device 500 may also be specifically used for:
[0181] If the target original text information and the non-target original text information do not meet the similarity requirement, then obtain the next text example, which is an example that is re-acquired according to the task requirement information and is different from the text example;
[0182] Taking the next text example as the text example, re-execute the step of generating original text information based on the keywords and text examples until the target original text information and the non-target original text information in the original text information meet the similarity requirements, store the keywords and the next text example in the information library, and build an index relationship between the keywords and the next text example in the information library.
[0183] Figure 6 A structural diagram of a text information generating device provided in an embodiment of the present application is shown in FIG. Figure 6 As shown, the text information generating device 600 includes: an information acquiring module 610 , an information determining module 620 , an example acquiring module 630 , an information generating module 640 and an information displaying module 650 .
[0184] The information acquisition module 610 is used to acquire task requirement information in response to the task input operation of the user;
[0185] An information determination module 620 is used to determine target keyword information based on the task requirement information, where the target keyword information is a keyword that matches the task keyword in the information library, and the information library is an information library in any information library construction method;
[0186] An example acquisition module 630 is used to acquire target text examples having an index relationship with the task keyword from the information database according to the task keyword;
[0187] An information generation module 640 is used to generate target text information that meets task requirements based on the target text example;
[0188] The information display module 650 is used to display target text information.
[0189] In the embodiment of the present application, the information generation module 640 may also be specifically used for:
[0190] Based on the target text examples and task requirements, construct sample examples, which include text key points examples, text example sentences, and task requirements information;
[0191] Input the example sample into the preset generation model to obtain the target text information that meets the task requirements.
[0192] In the embodiment of the present application, the information generation module 640 may also be specifically used for:
[0193] Based on the type of the target text, the target text examples are divided to obtain text key point examples and text example sentence examples;
[0194] Based on the text key point examples and the text example sentence examples, determine the connecting words of the text key point examples and the connecting words of the text example sentence examples;
[0195] Example samples are constructed based on the connectives of the text key point examples, the connectives of the text sentence examples, and the task requirement information.
[0196] In the embodiment of the present application, the text information generating device 600 may also be specifically used for:
[0197] In response to a user's feedback operation according to the target text information, obtaining first user feedback information;
[0198] If the first user feedback information is information indicating that the target text information does not match the task requirement information, obtaining a target text example input by the user;
[0199] Based on the target text example input by the user, generate optimized text information that meets the task requirements;
[0200] Display optimized text information.
[0201] In the embodiment of the present application, the text information generating device 600 may also be specifically used for:
[0202] In response to a user's feedback operation according to the optimized text information, obtaining second user feedback information;
[0203] If the second user feedback information is information indicating that the optimized text information matches the task requirement information, the target text example input by the user is stored in a preset information library, and an index relationship between the target text example and the target keyword information is established;
[0204] If the second user feedback information characterizes that the optimized text information is information that does not match the task requirement information, then other target text examples input by the user are re-acquired, and the other target text examples are used as target text examples, and the step of generating optimized text information that meets the task requirement information is executed based on the target text examples input by the user.
[0205] Figure 7 This is a schematic diagram of the structure of the device provided in the embodiment of the present application. Figure 7 As shown, the device 700 includes:
[0206] The device 700 may include a processor 701 with one or more processing cores, a memory 702 with one or more computer-readable storage media, a communication component 703 and other components. The processor 701 , the memory 702 and the communication component 703 are connected via a bus 704 .
[0207] In a specific implementation process, at least one processor 701 executes the computer execution instructions stored in the memory 702, so that at least one processor 701 executes the above message processing method.
[0208] The specific implementation process of the processor 701 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.
[0209] In the above Figure 7 In the illustrated embodiment, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the present application may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0210] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-volatile Memory, NVM), such as at least one disk memory.
[0211] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.
[0212] In some embodiments, a computer program product is also proposed, including a computer program or instructions, which, when executed by a processor, implements the steps in any of the above-mentioned information base construction methods and text information generation methods.
[0213] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0214] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0215] To this end, an embodiment of the present application provides a computer-readable storage medium, in which multiple program codes are stored. The program codes can be loaded by a processor to execute the steps in any information library construction method or text information generation method provided in the embodiment of the present application.
[0216] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0217] According to one aspect of the present application, a computer program product or a computer program is provided. The computer program product or the computer program comprises computer instructions stored in a computer-readable storage medium.
[0218] Since the instructions stored in the storage medium can execute the steps in any information database construction method and text information generation method provided in the embodiments of the present application, the beneficial effects that can be achieved by any information database construction method and text information generation method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0219] 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.
[0220] 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 method for constructing an information database, characterized in that: An information base applied to a language processing model, the method comprising: Acquire requirement information of the task to be constructed and a text example to be constructed, wherein the text example to be constructed is a text example corresponding to the requirement information of the task to be constructed; Determine keywords of the information required for the task to be constructed; Based on the keywords and the text examples to be constructed, generate and display original text information to the user; In response to the user's feedback operation on the original text information, determining target original text information and non-target original text information in the original text information, wherein the target original text information is information selected by the user from the original text information and meets the task requirement, and the non-target original text information is other original text information in the original text information except the target original text information; If the target original text information and the non-target original text information meet the preset similarity requirement, the keywords and the text examples to be constructed are stored in the information library, and an index relationship between the keywords and the text examples to be constructed is constructed in the information library, so that the language processing model can use it when generating the target text information after receiving the task requirement information.
2. The method according to claim 1, characterized in that After determining the target original text information and the non-target original text information in the original text information in response to the user's feedback operation on the original text information, the method further includes: If all the original text information is target original text information selected by the user and meets the task requirements, the keywords and the text examples to be constructed are stored in the information library, and an index relationship between the keywords and the text examples to be constructed is constructed in the information library.
3. The method according to claim 1, characterized in that: If the target original text information and the non-target original text information meet the preset similarity requirement, the keyword and the text example to be constructed are stored in the information library, and an index relationship between the keyword and the text example to be constructed is constructed in the information library, so that the language processing model can be used in generating the target text information after receiving the task requirement information, including: Determining a target text information segment in the non-target original text information, the target text information segment being a text information segment that meets a preset similarity requirement with the target original text information; If the number of the target text information segments and the total number of text information segments in the non-target original text information meet a preset ratio threshold requirement, then determining that the original text information is standard original text information that meets the required information of the task to be constructed; Based on the standard original text information, the keywords and the text examples to be constructed are stored in the information library, and an index relationship between the keywords and the text examples to be constructed is constructed in the information library.
4. The method according to claim 1, characterized in that After the keyword and the text example to be constructed are stored in the information base if the target original text information and the non-target original text information meet the preset similarity requirement, and an index relationship between the keyword and the text example to be constructed is constructed in the information base so that the language processing model can use the target text information when receiving the task requirement information, the method further includes: If the target original text information and the non-target original text information do not meet the similarity requirement, obtaining a next text example, wherein the next text example is an example that is re-obtained according to the task requirement information and is different from the text example; The next text example is used as the text example, and the step of generating original text information based on the keyword and the text example is re-executed until the target original text information and the non-target original text information in the original text information meet the similarity requirement, the keyword and the next text example are stored in the information library, and an index relationship between the keyword and the next text example is constructed in the information library.
5. A method for generating text information, characterized in that: Applied to a language processing model, the method comprises: Responding to a task input operation by a user, obtaining task requirement information; Based on the task requirement information, determine target keyword information, wherein the target keyword information is a keyword that matches a task keyword in an information database, and the information database is the information database according to any one of claims 1 to 4; According to the task keyword, obtaining a target text example having an index relationship with the task keyword from the information database; Based on the target text example, generating target text information that meets the task requirement information; The target text information is displayed.
6. The method according to claim 5, characterized in that The step of generating target text information that meets the task requirement information based on the target text example includes: Based on the target text example and the task requirement information, construct an example sample, wherein the example sample includes a text key point example, a text sentence example, and task requirement information; The example sample is input into a preset generation model to obtain target text information that meets the task requirements.
7. The method according to claim 6, characterized in that The example sample is constructed based on the target text example and the task requirement information, wherein the example sample includes a text key point example, a text sentence example, and the task requirement information, including: Based on the type of the target text, the target text examples are divided to obtain text key point examples and text example sentence examples; Based on the text key point example and the text example sentence example, determining the connecting words of the text key point example and the connecting words of the text example sentence example; The example sample is constructed based on the connecting words of the text main point example, the connecting words of the text example sentence example, and the task requirement information.
8. The method according to claim 5, characterized in that After displaying the target text information, the method further includes: In response to a user's feedback operation according to the target text information, obtaining first user feedback information; If the first user feedback information is information indicating that the target text information does not match the task requirement information, obtaining a target text example input by the user; Based on the target text example input by the user, generating optimized text information that meets the task requirement information; The optimized text information is displayed.
9. The method according to claim 8, characterized in that After displaying the optimized text information, the method further includes: In response to a user's feedback operation according to the optimized text information, obtaining second user feedback information; If the second user feedback information is information indicating that the optimized text information matches the task requirement information, storing the target text example input by the user into a preset information library, and establishing an index relationship between the target text example and the target keyword information; If the second user feedback information indicates that the optimized text information is information that does not match the task requirement information, then other target text examples input by the user are reacquired, and the other target text examples are used as the target text examples, and the step of generating optimized text information that meets the task requirement information based on the target text examples input by the user is performed.
10. An information base construction device, characterized in that: An information base applied to a language processing model, the device comprising: An information acquisition module, used to acquire the requirement information of the task to be constructed and the text example to be constructed, wherein the text example to be constructed is a text example corresponding to the requirement information of the task to be constructed; A keyword determination module, used to determine keywords of the task requirement information to be constructed; An information generation module, used to generate and display original text information to a user based on the keywords and the text examples to be constructed; an information determination module, in response to the user's feedback operation on the original text information, determining target original text information and non-target original text information in the original text information, wherein the target original text information is information selected by the user from the original text information and meets the task requirement, and the non-target original text information is other original text information in the original text information except the target original text information; A storage and construction module is used to store the keywords and the text examples to be constructed in the information library if the target original text information and the non-target original text information meet the preset similarity requirement, and to construct an index relationship between the keywords and the text examples to be constructed in the information library, so that the language processing model can use it when generating the target text information after receiving the task requirement information.
11. A text information generating device, characterized in that: Applied to a language processing model, the device comprises: An information acquisition module, used to acquire task requirement information in response to a task input operation by a user; An information determination module, used to determine target keyword information based on the task requirement information, wherein the target keyword information is a keyword that matches a task keyword in an information database, and the information database is the information database according to any one of claims 1 to 4; An example acquisition module, used to acquire, according to the task keyword, a target text example having an index relationship with the task keyword from the information database; An information generation module, used to generate target text information that meets the task requirements based on the target text example; The information display module is used to display the target text information.
12. A device, characterized in that: include: one or more processors; Memory; One or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs being configured to execute the method according to any one of claims 1 to 9.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program code, which can be called by a processor to execute the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Individualized document processing system based on keywords
CN101004737A
Question and answer corpus generation method and device based on text generation model
CN112328762A
Information generation method and device, electronic equipment and storage medium
CN113051380A
Advertisement text generation method and device, equipment, medium and product
CN115293817A
Cited By
Text generation method, electronic equipment and computer readable storage medium
CN119862277A
