Prompt model-based text information generation method and device, equipment and storage medium
Through the text information generation method based on the Prompt model, combined with user business information and knowledge graph, the problem of low accuracy in text information generation in the prior art is solved, and more efficient and accurate text information generation is achieved, reducing operational costs.
Patent Information
- Application Number
- CN202411517443.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-28
- Publication Date
- 2025-03-07
AI Technical Summary
Existing dialogue tree-based script configuration methods are low in accuracy when generating text information, and operators need to have professional knowledge, which is time-consuming and costly.
The text information generation method based on the Prompt model is adopted to obtain the user's business information of the target user, determine the user's intention, and match the corresponding knowledge graph, generate the text information to be selected, and determine the target text information through optimization degree score.
Improve the accuracy of generating text information, reduce the professional knowledge requirements of operation personnel, and reduce configuration costs and time.
Smart Images

Figure CN119578521A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of speech semantic interaction technology, which is applied to the field of financial technology business, and in particular to a text information generation method, device, equipment and storage medium based on a Prompt model. Background Art
[0002] With the rapid development of information technology, AI (Artificial Intelligence) technology is increasingly being used in the field of customer service. Especially in outbound call services, AI voice outbound call platforms are gradually replacing traditional manual customer service due to their high efficiency and cost-effectiveness. In this context, the script configuration and dialogue management technology of AI outbound call platforms have become the key to the development of the industry.
[0003] At present, the industry generally adopts the dialogue tree method to implement script configuration and dialogue node jump. This method guides the outbound call system to interact with customers through a preset dialogue path. In different business scenarios, operators need to configure corresponding response scripts for each node of the dialogue tree. For complex business scenarios, the dialogue tree can configure multiple intents at different nodes to achieve jumps between multiple nodes.
[0004] However, this configuration method based on the dialogue tree has some obvious shortcomings. First, it has high requirements for script configuration operators, who must have certain professional knowledge in order to configure appropriate words for each node in different scenarios in advance. This process is not only time-consuming, but also costly. Secondly, since different customers may have different understandings of the same speech node, the questions they ask are also different, which makes it difficult for operators to exhaust all possible questions and answers. The problems reflected by these shortcomings are reflected in the low accuracy of generated dialogue text information. Therefore, how to improve the accuracy of generated text information through AI technology has become a technical problem that needs to be solved urgently. Summary of the invention
[0005] The present application provides a text information generation method, device, equipment and storage medium based on a Prompt model to improve the accuracy of generated text information through AI technology.
[0006] In a first aspect, the present application provides a method for generating text information based on a Prompt model, the method comprising:
[0007] Acquire user service information of the target user, and determine the target user intention of the target user through a preset Prompt model and the user service information;
[0008] Determine at least one target knowledge graph matching the target user intention according to the target user intention;
[0009] Generate at least one set of text information to be selected by using a preset text generation model, the target user intention and each of the target knowledge graphs;
[0010] The optimization degree score of each of the candidate text information is calculated, and the candidate text information with the highest optimization degree score is determined as the target text information.
[0011] In a second aspect, the present application further provides a text information generation device based on a Prompt model, the device comprising:
[0012] A target user intention determination module is used to obtain user service information of a target user and determine the target user intention of the target user through a preset prompt model and the user service information;
[0013] A target knowledge graph determination module, used to determine at least one target knowledge graph matching the target user intention according to the target user intention;
[0014] A module for generating text information to be selected, used to generate at least one set of text information to be selected by using a preset text generation model, the target user intention and each of the target knowledge graphs;
[0015] The target text information determination module is used to calculate the optimization degree score of each of the candidate text information, and determine the candidate text information with the highest optimization degree score as the target text information.
[0016] In a third aspect, the present application also provides a computer device, comprising a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and implement the above-mentioned text information generation method based on the Prompt model when executing the computer program.
[0017] In a fourth aspect, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the above-mentioned method for generating text information based on the Prompt model.
[0018] The present application discloses a method, device, equipment and storage medium for generating text information based on a Prompt model. The method for generating text information based on a Prompt model includes obtaining user business information of a target user, and determining the target user intention of the target user by presetting a Prompt model and the user business information; determining at least one target knowledge graph matching the target user intention according to the target user intention; generating at least one set of selected text information by presetting a text generation model, the target user intention and each of the target knowledge graphs; calculating the optimization degree score of each of the selected text information, and determining the selected text information with the highest optimization degree score as the target text information. In the above manner, the present application directly interacts with the business information of the target user by using a preset Prompt model, accurately determines the user intention and dynamically matches the corresponding knowledge graph to adapt to the needs and preferences of different users, and improves the accuracy of generating text information by calculating the optimization degree score of the selected text information and selecting the selected text information with the highest score as the target text information. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0020] Figure 1 is a schematic flow chart of a text information generation method based on a Prompt model provided in the first embodiment of the present application;
[0021] Figure 2 is a schematic flow chart of a method for generating text information based on a Prompt model provided in the second embodiment of the present application;
[0022] Figure 3 is a schematic flow chart of a method for generating text information based on a Prompt model provided in the third embodiment of the present application;
[0023] Figure 4 is a schematic flow chart of a method for generating text information based on a Prompt model provided in the fourth embodiment of the present application;
[0024] Figure 5 A schematic block diagram of a text information generating device based on a Prompt model provided in an embodiment of the present application;
[0025] Figure 6 A schematic block diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0027] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.
[0028] It should be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0029] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0030] The embodiments of the present application provide a method, device, equipment and storage medium for generating text information based on a Prompt model. The method for generating text information based on a Prompt model can be applied to a server, and directly interacts with the business information of a target user by using a preset Prompt model, accurately determines the user's intention and dynamically matches the corresponding knowledge graph to adapt to the needs and preferences of different users, and improves the accuracy of generating text information by calculating the optimization degree score of the selected text information and selecting the selected text information with the highest score as the target text information. The server can be an independent server or a server cluster.
[0031] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0032] See also Figure 1 , Figure 1This is a schematic flow chart of a text information generation method based on a Prompt model provided in the first embodiment of the present application. The text information generation method based on the Prompt model can be applied to a server, and is used to directly interact with the business information of the target user by using a preset Prompt model, accurately determine the user's intention and dynamically match the corresponding knowledge graph to adapt to the needs and preferences of different users, and improve the accuracy of the generated text information by calculating the optimization degree score of the selected text information and selecting the selected text information with the highest score as the target text information.
[0033] like Figure 1 As shown, the text information generation method based on the Prompt model specifically includes steps S10 to S40.
[0034] Step S10: acquiring user service information of a target user, and determining a target user intention of the target user through a preset Prompt model and the user service information;
[0035] Specifically, when configuring scripts in the industry, it is generally necessary to configure the customer's possible responses or intentions in advance. Generally, several high-frequency intentions and long-tail intentions are preset in advance according to the context. Figure 1 Generally, default intent is used as a fallback. This may result in some customers’ responses not being answered correctly, resulting in a poor experience. The Prompt (prediction) model can predict the customer’s potential intent based on the context and list the customer’s potential intent as much as possible.
[0036] According to the original outbound call script, the Prompt model is called to enumerate the customer's intentions and predict the intentions corresponding to the dialogue script. Specifically, the calling process of the Prompt model is as follows:
[0037] ① Input the prompt template: For example, an insurance user has several insurance policies under his name. He receives a call from an insurance company today. The insurance company's business personnel ask certain questions and may reply to the other party with certain contents. Record these contents.
[0038] ② Output intention list: Based on the other party’s script, the purpose and words that the customer may respond to are shown in Table 1 (for example only).
[0039] Table 1
[0040] Purpose Talk Affirmative answer Yes, that's right, that's right, okay... Negative answer No, wrong number... … …
[0041] Step S20: determining at least one target knowledge graph matching the target user intention according to the target user intention;
[0042] Specifically, natural language processing technology is used to analyze and understand the user's input text, thereby identifying the user's intention, classifying the identified intention, and assigning it to predefined intent categories. These categories may include asking for product information, seeking technical support, understanding service processes, etc. Access multiple business-related knowledge graphs, each of which contains structured data in a specific field, such as product information, service processes, technical parameters, etc. This embodiment labels and classifies each knowledge graph to ensure that they can match specific user intentions.
[0043] In this embodiment, a set of matching rules needs to be pre-defined to associate user intent with the corresponding knowledge graph. These rules can be based on intent categories, keywords, entity recognition results, or semantic similarity.
[0044] Step S30, generating at least one set of text information to be selected through a preset text generation model, the target user intention and each of the target knowledge graphs;
[0045] Specifically, according to historical data analysis results, customers of different ages, genders, and occupations will have significantly different final business handling success rates through different sales pitches. Therefore, here, by entering the user portrait and the corresponding standard sales pitch in the Prompt template, the text generation model is used to generate personalized sales pitches to improve the final conversion rate.
[0046] Therefore, this step relies on the preset Prompt template. The operator generates the Prompt instruction by selecting the Prompt template to configure the answering words of each node. According to the purpose of the outbound call business scenario, it can be classified in advance as shown in Table 2 (for example only).
[0047] Table 2
[0048]
[0049] Step S40: Calculate the optimization degree score of each of the candidate text information, and determine the candidate text information with the highest optimization degree score as the target text information.
[0050] After completing the preliminary configuration of the outbound call script, the API of the Prompt model will be called in real time to generate the outbound call script when executing the outbound call task. After the outbound call task is completed, SMS messages will be randomly sent to a certain proportion of customers to collect evaluations of whether the outbound call script generated based on the Prompt template is complete, fluent, understandable, and guides customers to reply with a score of 1-10 (10 is the full score, the specific score is an example and is not limited):
[0051] ①7-10 points: high-quality speech and excellent presentation;
[0052] ②4-6 points: medium level of speech skills. Please remind the operator to listen to the recording again and modify the prompt template.
[0053] ③1-3 points: Poor salesmanship. Instruct the operator to listen to the recording again and transfer the call to the manual customer service to contact the customer again.
[0054] In a specific embodiment, the present embodiment needs to determine the scoring criteria for evaluating the optimization degree of the selected text information. These criteria may include the relevance, accuracy, completeness, readability, user feedback, contextual consistency, etc. of the text, and each group of generated selected text information is preprocessed, including word segmentation, removal of stop words, part-of-speech tagging, entity recognition, etc., for subsequent scoring processing. A text matching algorithm (such as cosine similarity) is used to evaluate the relevance of the selected text information and the target user's intention. For example, natural language processing technology is used, such as BERT (Bidirectional Encoder Representations from Transformers, pre-trained language model) to understand the semantic relevance of the text. In addition, the selected text information is fact-checked to ensure the accuracy of the information, and to check whether the text covers all the key points of the user's intention and evaluate its integrity.
[0055] The present embodiment discloses a method, device, equipment and storage medium for generating text information based on a Prompt model. The method for generating text information based on a Prompt model includes obtaining user business information of a target user, and determining the target user intention of the target user by presetting a Prompt model and the user business information; determining at least one target knowledge graph matching the target user intention according to the target user intention; generating at least one set of selected text information by presetting a text generation model, the target user intention and each of the target knowledge graphs; calculating the optimization degree score of each of the selected text information, and determining the selected text information with the highest optimization degree score as the target text information. In the above manner, the present application directly interacts with the business information of the target user by using a preset Prompt model, accurately determines the user intention and dynamically matches the corresponding knowledge graph to adapt to the needs and preferences of different users, and improves the accuracy of generating text information by calculating the optimization degree score of the selected text information and selecting the selected text information with the highest score as the target text information.
[0056] See also Figure 2 , Figure 2This is a schematic flow chart of a text information generation method based on a Prompt model provided in the second embodiment of the present application. The text information generation method based on the Prompt model can be applied to a server, and is used to use a preset Prompt model to quickly match relevant knowledge graphs according to user intentions, calculate the optimization degree score of the selected text information, and select the text with the highest score as the target text, thereby improving the speed and accuracy of information retrieval.
[0057] based on Figure 1 The embodiment shown, this embodiment Figure 2 As shown, step S10 includes steps S101 to S104.
[0058] Step S101, traversing the business-related resources of the user business information, and determining the relevant resource keywords of each business-related resource;
[0059] Step S102: Decomposing the user service information into user basic information, historical interaction information and / or user preference information, and determining at least one user service keyword according to the user basic information, the historical interaction information and / or the user preference information;
[0060] Step S103: Matching each of the related resource keywords with each of the user service keywords through the preset Prompt model;
[0061] Step S104: Determine the business-related resources corresponding to each of the user business keywords that matches the relevant resource keywords as the target user intention.
[0062] In one embodiment, all resources related to user business information are traversed, including product documents, service manuals, historical cases, etc. Text processing is performed on each business-related resource to extract key information, and the keywords of each resource are determined through word frequency statistics, TF-IDF (Term Frequency-Inverse Document Frequency, a weighted technology used for information retrieval and text mining), text mining algorithms, and other methods.
[0063] The user business information is subdivided into different categories such as user basic information, historical interaction information and user preference information, and text analysis is performed on the user basic information, historical interaction information and user preference information.
[0064] A preset prompt model is designed in advance, which can process and compare keyword matching, and the extracted business-related resource keywords are matched with the user business keywords using the preset prompt model. The matching method can use string matching, semantic matching or machine learning methods to determine the correlation between keywords.
[0065] For each match, the relevance and accuracy of the match are evaluated. A threshold can be set, and only matches that exceed the threshold are considered valid. Business-related resources that match the user's business keywords are identified as resources that match the target user's intent. If multiple resources match the user's intent, they can be sorted or comprehensively considered based on the matching degree, and the matching resources can be integrated to form a structured knowledge graph.
[0066] The present embodiment discloses a text information generation method, device, equipment and storage medium based on a Prompt model. The text information generation method based on the Prompt model includes obtaining user business information of a target user, and determining the target user intention of the target user through a preset Prompt model and the user business information; determining at least one target knowledge graph matching the target user intention according to the target user intention; generating at least one group of text information to be selected through a preset text generation model, the target user intention and each of the target knowledge graphs; calculating the optimization degree score of each of the text information to be selected, and determining the text information to be selected with the highest optimization degree score as the target text information; determining at least one target knowledge graph matching the target user intention according to the target user intention; generating at least one group of text information to be selected through a preset text generation model, the target user intention and each of the target knowledge graphs; calculating the optimization degree score of each of the text information to be selected, and determining the text information to be selected with the highest optimization degree score as the target text information. Through the above method, this application uses the preset Prompt model to quickly match relevant knowledge graphs according to user intentions, calculates the optimization degree score of the candidate text information, and selects the text with the highest score as the target text, thereby improving the speed and accuracy of information retrieval.
[0067] See also Figure 3 , Figure 3 This is a schematic flow chart of a text information generation method based on a Prompt model provided in the third embodiment of the present application. The text information generation method based on the Prompt model can be applied to a server, and is used to more accurately identify and match the user's true intention by comparing with a preset query template. The fast comparison and matching process reduces the waiting time, so that the system can quickly respond to the user's query needs, efficiently retrieve and provide information, and improve the accuracy of generated text information.
[0068] based on Figure 1 The embodiment shown, this embodiment Figure 3 As shown, step S20 includes steps S201 to S203.
[0069] Step S201: compare the target user intention with each preset query template in the preset knowledge graph database to generate a comparison result;
[0070] Step S202: determining a target query template that matches the target user's intention according to the comparison result;
[0071] Step S203: determine the target knowledge graph through the target query template and the target user intention.
[0072] In one embodiment, a knowledge graph database containing multiple preset query templates is constructed or obtained, and the target user intent is extracted from the user business information through a preset prompt model or other natural language processing technology. The target user intent is preprocessed, including word segmentation, stop word removal, part-of-speech tagging, etc., to improve the accuracy of the comparison. Feature extraction is performed on each preset query template in the knowledge graph database, and these features may include keywords, phrases, entities, etc.
[0073] Use the text matching algorithm to compare the preprocessed target user intent with each preset query template and record the similarity score of each comparison to generate a list of all comparison results. According to the comparison results and the matching threshold, filter out the query template with the highest similarity to the target user intent, select the most matching one or several from the filtered query templates as the target query template, and retrieve the knowledge graph associated with it from the knowledge graph database according to the determined target query template.
[0074] The present embodiment discloses a text information generation method, device, equipment and storage medium based on the Prompt model, the text information generation method based on the Prompt model includes obtaining the user business information of the target user, and determining the target user intention of the target user by presetting the Prompt model and the user business information; comparing the target user intention with each preset query template in the preset knowledge graph database to generate a comparison result; determining the target query template matching the target user intention according to the comparison result; determining the target knowledge graph by the target query template and the target user intention; generating at least one group of selected text information by presetting the text generation model, the target user intention and each target knowledge graph; calculating the optimization degree score of each selected text information, and determining the selected text information with the highest optimization degree score as the target text information. Through the above-mentioned method, the present application can more accurately identify and match the user's true intention by comparing with the preset query template, and the fast comparison and matching process reduces the waiting time, so that the system can quickly respond to the user's query needs, efficiently retrieve and provide information, and improve the accuracy of generated text information.
[0075] In a more preferred embodiment, step S203 includes:
[0076] Performing semantic analysis on the target user's intention by using a preset natural language processing technology to extract key concepts and entities in the target user's intention;
[0077] Matching the key concepts and entities with each query node in the target query template;
[0078] The preset knowledge graph corresponding to the query node matching the key concept and entity is determined as the target knowledge graph.
[0079] In one embodiment, natural language processing techniques, such as dependency parsing or semantic role labeling, are used to deeply analyze the target user's intent and extract key concepts and entities, which may include names, places, organizations, times, events, etc.
[0080] Build a library containing multiple query templates, each of which is designed with specific query nodes to match specific concepts or entities, and match the extracted key concepts and entities with the query nodes in the target query template. For each matching query node, determine its corresponding preset knowledge graph. If there are multiple matching query nodes, sort or select them according to the matching degree or relevance.
[0081] based on Figure 1 In the embodiment shown, in this embodiment, step S30 includes:
[0082] Generate at least one intent keyword according to the target user intent;
[0083] Determining at least one set of associated knowledge information associated with each of the intended keywords from each of the target knowledge graphs;
[0084] Through the semantic association algorithm built into the preset text generation model, each of the intention-associated words and each of the associated knowledge information are integrated to generate each of the text information to be selected.
[0085] In one embodiment, natural language processing technology, such as text mining or machine learning algorithms, is used to analyze the target user's intent, and key words or phrases are extracted from the user's intent, which can represent the user's query intent. According to the extracted intent keywords, each target knowledge graph is searched to find the knowledge information associated with the keywords, and the knowledge information directly or indirectly associated with the intent keywords is extracted from the knowledge graph. The semantic association algorithm built into the preset text generation model is used to integrate the intent keywords with the associated knowledge information to generate the selected text information.
[0086] See also Figure 4 , Figure 4 This is a schematic flow chart of a text information generation method based on a Prompt model provided in the third embodiment of the present application. The text information generation method based on the Prompt model can be applied to a server, and is used to directly interact with the business information of the target user by using a preset Prompt model, accurately determine the user's intention and dynamically match the corresponding knowledge graph to adapt to the needs and preferences of different users, and improve the accuracy of the generated text information by calculating the optimization degree score of the selected text information and selecting the selected text information with the highest score as the target text information.
[0087] based on Figure 1 The embodiment shown, this embodiment Figure 4 As shown, step S40 includes steps S401 to S403.
[0088] Step S401, predetermining the scoring dimensions of the optimization degree scoring, wherein the scoring dimensions include semantic relevance, grammatical accuracy and sentence readability;
[0089] Step S402: Calculate the single dimension score of each of the to-be-selected text information based on the scoring dimensions;
[0090] Step S403: Calculate each optimization degree score based on the preset weight and each single dimension score, and determine the target text information according to each optimization degree score.
[0091] In one embodiment, three main dimensions of optimization degree scoring are determined: semantic relevance, grammatical accuracy, and sentence readability, and specific scoring criteria and indicators are defined for each dimension.
[0092] Use natural language processing technology, such as semantic similarity algorithms, to evaluate the relevance of the candidate text information to the target user's intention; use grammar checking tools or natural language processing models to evaluate the grammatical correctness of the text, such as checking grammatical elements such as subject-verb agreement, tense, and syntactic structure; evaluate the readability of the text, including sentence length, complexity, and the frequency of complex vocabulary. According to the above scoring criteria, calculate a single dimension score for each dimension of each candidate text information.
[0093] Assign preset weights to each scoring dimension. These weights reflect the importance of different dimensions in the final scoring. The weights can be determined based on business needs, user feedback, or historical data analysis. The preset weights and single dimension scores are used to calculate the comprehensive optimization score for each candidate text information.
[0094] Compare the optimization scores of all candidate text information, and select the one with the highest score as the target text information. If there is a tie for the highest score, further analysis can be performed or the most appropriate target text information can be manually selected.
[0095] The present embodiment discloses a text information generation method, apparatus, device and storage medium based on a Prompt model. The text information generation method based on the Prompt model includes obtaining user business information of a target user, and determining the target user intention of the target user through a preset Prompt model and the user business information; determining at least one target knowledge graph matching the target user intention according to the target user intention; generating at least one group of text information to be selected through a preset text generation model, the target user intention and each of the target knowledge graphs; predetermining the scoring dimensions of the optimization degree score, wherein the scoring dimensions include semantic relevance, grammatical accuracy and sentence readability; calculating the single dimension score of each of the text information to be selected based on each of the scoring dimensions; calculating each of the optimization degree scores based on preset weights and each of the single dimension scores, and determining the target text information according to each of the optimization degree scores. Through the above method, the present application directly interacts with the business information of the target user by using a preset Prompt model, accurately determines the user's intention and dynamically matches the corresponding knowledge graph to adapt to the needs and preferences of different users, calculates the optimization degree score of the candidate text information, and selects the candidate text information with the highest score as the target text information, thereby improving the accuracy of the generated text information.
[0096] Based on any of the above embodiments, in this embodiment, before step S10, the following steps are included:
[0097] Acquire historical data as a training set, and generate a pre-training task based on the training set;
[0098] Determine an initial Prompt model, pre-train the initial Prompt model through the pre-training task, and generate a training set prediction result;
[0099] Obtain the verification result corresponding to the training set, adjust the parameters of the initial Prompt model according to the verification result and the prediction result of the training set, and generate the preset Prompt model.
[0100] See also Figure 5 , Figure 5 The embodiment of the present application provides a schematic block diagram of a text information generation device based on a Prompt model, wherein the text information generation device based on a Prompt model is used to execute the aforementioned text information generation method based on a Prompt model. The text information generation device based on a Prompt model can be configured on a server.
[0101] like Figure 5 As shown, the text information generating device 400 based on the Prompt model includes:
[0102] The target user intention determination module 410 is used to obtain user service information of the target user and determine the target user intention of the target user through a preset Prompt model and the user service information;
[0103] A target knowledge graph determination module 420 is used to determine at least one target knowledge graph matching the target user intention according to the target user intention;
[0104] A candidate text information generation module 430 is used to generate at least one set of candidate text information through a preset text generation model, the target user intention and each target knowledge graph;
[0105] The target text information determination module 440 is used to calculate the optimization degree score of each of the candidate text information, and determine the candidate text information with the highest optimization degree score as the target text information.
[0106] Furthermore, the target user intention determination module 410 includes:
[0107] A related resource keyword determination unit, used to traverse the business-related resources of the user business information and determine the related resource keyword of each business-related resource;
[0108] a user service keyword determination unit, configured to decompose the user service information into user basic information, historical interaction information and / or user preference information, and determine at least one user service keyword according to the user basic information, the historical interaction information and / or the user preference information;
[0109] A service keyword matching unit, used for matching each of the related resource keywords with each of the user service keywords through the preset prompt model;
[0110] The target user intention determining unit is used to determine the business-related resources corresponding to each of the user business keywords matching the relevant resource keywords as the target user intention.
[0111] Furthermore, the target knowledge graph determination module 420 includes:
[0112] A comparison result generating unit, used to compare the target user intention with each preset query template in the preset knowledge graph database to generate a comparison result;
[0113] A target query template determining unit, configured to determine a target query template matching the target user intention according to the comparison result;
[0114] The target knowledge graph determination unit is used to determine the target knowledge graph through the target query template and the target user intention.
[0115] Furthermore, the target knowledge graph determination unit includes:
[0116] A key concept and entity extraction subunit, used to perform semantic analysis on the target user's intention by using a preset natural language processing technology, and extract key concepts and entities in the target user's intention;
[0117] A query node matching subunit, used to match the key concept with the entity and each query node in the target query template;
[0118] The target knowledge graph determination subunit is used to determine the preset knowledge graph corresponding to the query node that matches the key concept and entity as the target knowledge graph.
[0119] Furthermore, the module 430 for generating text information to be selected includes:
[0120] An intention keyword generating unit, configured to generate at least one intention keyword according to the target user intention;
[0121] An associated knowledge information determination unit, used to determine at least one set of associated knowledge information associated with each of the intended keywords from each of the target knowledge graphs;
[0122] The unit for generating text information to be selected is used to integrate each of the intention-related words and each of the related knowledge information through the semantic association algorithm built into the preset text generation model to generate each of the text information to be selected.
[0123] Furthermore, the target text information determination module 440 includes:
[0124] A scoring dimension determination unit, used to predetermine the scoring dimensions of the optimization degree score, wherein the scoring dimensions include semantic relevance, grammatical accuracy and sentence readability;
[0125] A single dimension score calculation unit, used for calculating the single dimension score of each of the selected text information based on each of the score dimensions;
[0126] The target text information determination unit is used to calculate each optimization degree score based on a preset weight and each single dimension score, and determine the target text information according to each optimization degree score.
[0127] Furthermore, the text information generating device 400 based on the Prompt model includes:
[0128] A pre-training task generation module, used to obtain historical data as a training set and generate a pre-training task based on the training set;
[0129] A training set prediction result generation module, used to determine an initial Prompt model, pre-train the initial Prompt model through the pre-training task, and generate a training set prediction result;
[0130] The preset Prompt model generation module is used to obtain the verification result corresponding to the training set, adjust the parameters of the initial Prompt model through the verification result and the training set prediction result, and generate the preset Prompt model.
[0131] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described device and each module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0132] The above-mentioned device can be implemented in the form of a computer program. Figure 6 Runs on the computer device shown.
[0133] See also Figure 6 , Figure 6 1 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device may be a server.
[0134] See also Figure 6 The computer device includes a processor, a memory and a network interface connected through a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.
[0135] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any text information generation method based on the Prompt model.
[0136] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.
[0137] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any text information generation method based on the Prompt model.
[0138] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art will understand that Figure 6The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0139] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0140] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:
[0141] Acquire user service information of the target user, and determine the target user intention of the target user through a preset Prompt model and the user service information;
[0142] Determine at least one target knowledge graph matching the target user intention according to the target user intention;
[0143] Generate at least one set of text information to be selected by using a preset text generation model, the target user intention and each of the target knowledge graphs;
[0144] The optimization degree score of each of the candidate text information is calculated, and the candidate text information with the highest optimization degree score is determined as the target text information.
[0145] In one embodiment, user service information of a target user is obtained, and a target user intention of the target user is determined by using a preset Prompt model and the user service information, so as to achieve:
[0146] Traversing the business-related resources related to the user business information, and determining the relevant resource keywords of each of the business-related resources;
[0147] Decomposing the user service information into user basic information, historical interaction information and / or user preference information, and determining at least one user service keyword according to the user basic information, the historical interaction information and / or the user preference information;
[0148] Matching each of the related resource keywords with each of the user service keywords through the preset Prompt model;
[0149] The business-related resources corresponding to each of the user business keywords matching the related resource keywords are determined as the target user intention.
[0150] In one embodiment, at least one target knowledge graph matching the target user intent is determined according to the target user intent, to achieve:
[0151] Compare the target user's intention with each preset query template in the preset knowledge graph database to generate a comparison result;
[0152] Determining a target query template that matches the target user's intention according to the comparison result;
[0153] The target knowledge graph is determined through the target query template and the target user intention.
[0154] In one embodiment, the knowledge graph is determined by the target query template and the target user intention to achieve:
[0155] Performing semantic analysis on the target user's intention by using a preset natural language processing technology to extract key concepts and entities in the target user's intention;
[0156] Matching the key concepts and entities with each query node in the target query template;
[0157] The preset knowledge graph corresponding to the query node matching the key concept and entity is determined as the target knowledge graph.
[0158] In one embodiment, at least one set of text information to be selected is generated by using a preset text generation model, the target user intention and each of the target knowledge graphs, so as to achieve:
[0159] Generate at least one intent keyword according to the target user intent;
[0160] Determining at least one set of associated knowledge information associated with each of the intended keywords from each of the target knowledge graphs;
[0161] Through the semantic association algorithm built into the preset text generation model, each of the intention-associated words and each of the associated knowledge information are integrated to generate each of the text information to be selected.
[0162] In one embodiment, the optimization degree score of each of the selected text information is calculated, and the selected text information with the highest optimization degree score is determined as the target text information, so as to achieve:
[0163] Predetermining the scoring dimensions of the optimization degree score, wherein the scoring dimensions include semantic relevance, grammatical accuracy, and sentence readability;
[0164] Based on the scoring dimensions, calculating the single dimension score of each of the selected text information;
[0165] Based on the preset weights and the scores of each single dimension, each optimization degree score is calculated, and the target text information is determined according to each optimization degree score.
[0166] In one embodiment, before obtaining the user service information of the target user and determining the target user intention of the target user by using a preset Prompt model and the user service information, it is used to achieve:
[0167] Acquire historical data as a training set, and generate a pre-training task based on the training set;
[0168] Determine an initial Prompt model, pre-train the initial Prompt model through the pre-training task, and generate a training set prediction result;
[0169] Obtain the verification result corresponding to the training set, adjust the parameters of the initial Prompt model according to the verification result and the prediction result of the training set, and generate the preset Prompt model.
[0170] A computer-readable storage medium is also provided in an embodiment of the present application, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and the processor executes the program instructions to implement any one of the text information generation methods based on the Prompt model provided in the embodiments of the present application.
[0171] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc., equipped on the computer device.
[0172] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A text information generation method based on the Prompt model, characterized in that: include: Acquire user service information of the target user, and determine the target user intention of the target user through a preset Prompt model and the user service information; Determine at least one target knowledge graph matching the target user intention according to the target user intention; Generate at least one set of text information to be selected by using a preset text generation model, the target user intention and each of the target knowledge graphs; The optimization degree score of each of the candidate text information is calculated, and the candidate text information with the highest optimization degree score is determined as the target text information.
2. The method for generating text information based on the Prompt model according to claim 1, characterized in that: The acquiring the user service information of the target user and determining the target user intention of the target user by using a preset Prompt model and the user service information includes: Traversing the business-related resources related to the user business information, and determining the relevant resource keywords of each of the business-related resources; Decomposing the user service information into user basic information, historical interaction information and / or user preference information, and determining at least one user service keyword according to the user basic information, the historical interaction information and / or the user preference information; Matching each of the related resource keywords with each of the user service keywords through the preset Prompt model; The business-related resources corresponding to each of the user business keywords matching the related resource keywords are determined as the target user intention.
3. The text information generation method based on the Prompt model according to claim 1 is characterized in that: The determining, according to the target user intention, at least one target knowledge graph matching the target user intention includes: Compare the target user's intention with each preset query template in the preset knowledge graph database to generate a comparison result; Determining a target query template that matches the target user's intention according to the comparison result; The target knowledge graph is determined through the target query template and the target user intention.
4. The method for generating text information based on the Prompt model according to claim 3, characterized in that: The determining the knowledge graph by using the target query template and the target user intention includes: Performing semantic analysis on the target user's intention by using a preset natural language processing technology to extract key concepts and entities in the target user's intention; Matching the key concepts and entities with each query node in the target query template; The preset knowledge graph corresponding to the query node matching the key concept and entity is determined as the target knowledge graph.
5. The method for generating text information based on the Prompt model according to claim 1, characterized in that: The method of generating at least one set of text information to be selected by using a preset text generation model, the target user intention and each of the target knowledge graphs includes: Generate at least one intent keyword according to the target user intent; Determining at least one set of associated knowledge information associated with each of the intended keywords from each of the target knowledge graphs; Through the semantic association algorithm built into the preset text generation model, each of the intention-associated words and each of the associated knowledge information are integrated to generate each of the text information to be selected.
6. The method for generating text information based on the Prompt model according to claim 1, characterized in that: The step of calculating the optimization degree score of each of the candidate text information and determining the candidate text information with the highest optimization degree score as the target text information includes: Predetermining the scoring dimensions of the optimization degree score, wherein the scoring dimensions include semantic relevance, grammatical accuracy, and sentence readability; Based on the scoring dimensions, calculating the single dimension score of each of the selected text information; Based on the preset weights and the scores of each single dimension, each optimization degree score is calculated, and the target text information is determined according to each optimization degree score.
7. The method for generating text information based on the Prompt model according to any one of claims 1 to 6, characterized in that: Before obtaining the user service information of the target user and determining the target user intention of the target user by using the preset Prompt model and the user service information, the method includes: Acquire historical data as a training set, and generate a pre-training task based on the training set; Determine an initial Prompt model, pre-train the initial Prompt model through the pre-training task, and generate a training set prediction result; Obtain the verification result corresponding to the training set, adjust the parameters of the initial Prompt model according to the verification result and the prediction result of the training set, and generate the preset Prompt model.
8. A text information generation device based on the Prompt model, characterized in that: include: A target user intention determination module is used to obtain user service information of a target user and determine the target user intention of the target user through a preset prompt model and the user service information; A target knowledge graph determination module, used to determine at least one target knowledge graph matching the target user intention according to the target user intention; A module for generating text information to be selected, used to generate at least one set of text information to be selected by using a preset text generation model, the target user intention and each of the target knowledge graphs; The target text information determination module is used to calculate the optimization degree score of each of the candidate text information, and determine the candidate text information with the highest optimization degree score as the target text information.
9. A computer device, characterized in that: The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is used to execute the computer program and implement the text information generation method based on the Prompt model as described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the text information generation method based on the Prompt model as described in any one of claims 1 to 7.
Citation Information
Cited By
Large model cue word construction method and device, equipment, medium and program product
CN121809442A