Prompt word generation processing method and device, equipment and medium

By building a multi-classification model of decision tree, learning word slot characteristics and contextual relationships, and generating accurate prompt words, the problem of low accuracy in prompt word generation in the big model is solved, and the model's recognition ability and question-and-answer efficiency are improved.

CN119129605APending Publication Date: 2024-12-13CHINA UNIONPAY
View PDF 0 Cites 6 Cited by

Patent Information

Application Number
CN202411151569.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-20
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

In the prior art, the accuracy of the generation of big model prompt words is low and cannot provide an accurate basis for identification for the big model, resulting in ambiguity and ambiguity problems when the model understands and executes user intentions.

Method used

By collecting a large number of question sentences, splitting them according to the word slots and converting them into word slot feature vectors, building a multi-classification model of the decision tree, learning the disambiguation words and contextual relationships in the word slots, and generating accurate prompt words.

Benefits of technology

It improves the accuracy of prompt word generation, provides an accurate identification basis for the big model, reduces the ambiguity problem of the model in intention recognition, and improves the performance of the model and the efficiency of the Q&A scenario.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119129605A_ABST
    Figure CN119129605A_ABST
Patent Text Reader

Abstract

The invention provides a cue word generation processing method and device, equipment and a medium. The method comprises the steps of obtaining a first preset number of question sentences; splitting each question statement according to a word slot to obtain at least one segmented word corresponding to the question statement; according to a connection relationship of word slots corresponding to the segmented words, performing feature value conversion on the at least one segmented word to obtain a word slot feature vector corresponding to each question statement; labeling the intention of each question statement to obtain an intention label of each question statement; taking the word slot feature vectors of the first preset number of question sentences and the intention labels as training sample data; generating a decision tree multi-classification model based on the training sample data, wherein each node in the decision tree multi-classification model corresponds to each word slot feature; and for a question statement to be processed, according to the nodes and the node sequence passed by the decision tree multi-classification model in the process of identifying the question statement to be processed, outputting the corresponding word slot features as cue words.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of large model technology, and in particular to a prompt word generation and processing method, device, equipment and medium. Background Art

[0002] Prompts for large models are text inputs used to guide the models to generate specific types of responses or complete specific tasks when interacting with these models. These prompts are critical for the model to understand and execute user intent. Polysemy and ambiguity are common problems in the preprocessing of prompts for large models, which affects the recognition accuracy of large models. Therefore, it is crucial to disambiguate prompts in large models.

[0003] In related technologies, most of the processing of prompt words is achieved by distinguishing the meanings of similar words. For example, by collecting corpora of different meanings of ambiguous words, a corpus of each ambiguous word is constructed, and the ambiguity of the words is analyzed based on the frequency and number of times each word appears in each meaning, so as to achieve word disambiguation.

[0004] However, the accuracy of prompt word generation in the prior art is low and cannot provide accurate recognition basis for large models. Summary of the invention

[0005] The present application provides a prompt word generation processing method, device, equipment and medium, so as to solve the problem that the prompt word generation accuracy of the prior art is low and cannot provide accurate recognition basis for large models.

[0006] In a first aspect, the present application provides a prompt word generation processing method, comprising:

[0007] Obtaining a first preset number of question statements;

[0008] Splitting each question sentence according to word slots to obtain at least one word segment corresponding to the question sentence;

[0009] According to the connection relationship between the word slots corresponding to the word segmentations, the feature value of the at least one word segmentation is converted to obtain a word slot feature vector corresponding to each question sentence;

[0010] Label the intent of each question sentence to obtain the intent label of each question sentence;

[0011] Using the word slot feature vectors and intention labels of the first preset number of question sentences as training sample data;

[0012] Generate a decision tree multi-classification model based on the training sample data, wherein each node in the decision tree multi-classification model corresponds to each word slot feature;

[0013] For the question sentence to be processed, according to the nodes and node sequence passed by the decision tree multi-classification model in the process of identifying the question sentence to be processed, the corresponding word slot features are output as prompt words.

[0014] The present application provides an accurate and reliable prompt word generation method. First, a large number of question sentences are collected, and each question sentence is split into word segments according to word slots. According to the connection relationship between the word slots corresponding to the word segments, the question sentence is converted into a word slot feature vector for model processing. Based on the word slot feature vector corresponding to each question sentence and its corresponding intent label, a decision tree multi-classification model is constructed. In the process of constructing the decision tree multi-classification model, the present application selects the word slot features that need to be disambiguated in different word slots and the corresponding intent labels to construct the decision tree multi-classification model. The disambiguation words in different word slots and the relationship between the remaining contexts can be learned. Through the nodes and node order of the decision tree multi-classification model, the association path of the intent corresponding to the question sentence can be accurately reflected, and the intent corresponding to the question sentence can be accurately extracted and summarized, thereby providing prompt words that accurately reflect the word slot features, improving the accuracy of prompt word generation, and providing an accurate recognition basis for large models.

[0015] Optionally, generating a decision tree multi-classification model based on the training sample data includes:

[0016] Calculate the feature preference value corresponding to each word slot feature in the word slot feature vector; filter out the word slot features that meet the node requirements according to the feature preference value, and use the word slot features that meet the node requirements as nodes in the decision tree multi-classification model; classify the word slot features in the word slot feature vector based on the nodes in the decision tree multi-classification model; determine the threshold division condition according to the classification result, and determine the connection relationship between each node in the decision tree multi-classification model according to the threshold division condition; generate a decision tree multi-classification model based on the nodes in the decision tree multi-classification model and the connection relationship between each node.

[0017] Among them, in the process of generating a decision tree multi-classification model, the present application selects word slot features that meet the node requirements as nodes of the decision tree. Through the selection of decision tree nodes, word slot features that are ambiguous or have low importance for intent recognition can be effectively eliminated. The word slot features are classified based on the connection relationship between the word slots corresponding to the word segmentation in the word slot feature vector and the intent label. The disambiguation words in different word slots and their classification judgment relationship with other word slot features in the context can be accurately learned. The classification judgment relationship can be reflected in the decision tree as the connection relationship of each node, providing an accurate judgment basis for the generation of prompt words. Through the generation process of the above-mentioned decision tree multi-classification model, a decision tree multi-classification model that accurately identifies prompt words can be generated, thereby improving the accuracy of prompt word generation.

[0018] Optionally, after generating the decision tree multi-classification model based on the nodes in the decision tree multi-classification model and the connection relationship between the nodes, the method further includes:

[0019] Acquire test sample data, wherein the test sample data includes word slot feature vectors and intent labels of a second preset number of question sentences; and optimize the decision tree multi-classification model using the test sample data.

[0020] Here, the present application also optimizes the decision tree multi-classification model based on the test sample data, which can accurately evaluate the performance of the optimization processing of the decision tree multi-classification model, solve the problem of overfitting or low accuracy in the optimization processing of the decision tree multi-classification model, further improve the accuracy of prompt word generation, and further reduce the ambiguity of prompt words.

[0021] Optionally, for the question statement to be processed, according to the nodes and node sequence passed by the decision tree multi-classification model in the process of identifying the question statement to be processed, outputting the corresponding word slot features as prompt words includes:

[0022] Obtain the question sentence to be processed; in the process of the large model identifying the question sentence to be processed, according to the nodes and node sequence passed by the decision tree multi-classification model in the process of identifying the question sentence to be processed, output the corresponding word slot features as prompt words.

[0023] Among them, the decision tree multi-classification model of the present application can provide prompt words for the large model, guiding the large model to point to the recall pool without ambiguity during the reasoning process, meeting the requirements of model disambiguation and improving the performance of the large model.

[0024] Optionally, in the process of identifying the question sentence to be processed by the large model, according to the nodes and node sequence passed by the decision tree multi-classification model in the process of identifying the question sentence to be processed, after outputting the corresponding word slot features as prompt words, the method further includes:

[0025] In the process of the large model identifying the question sentence to be processed, a reply sentence corresponding to the question sentence to be processed is output based on the prompt words and the output order of the prompt words.

[0026] Optionally, the outputting of a reply statement corresponding to the question statement to be processed based on the prompt word and the output order of the prompt word includes:

[0027] Based on the prompt words and the output order of the prompt words, the reply words and the reply order corresponding to the prompt words are determined; and according to the reply words and the reply order, the reply sentences corresponding to the question sentence to be processed are output.

[0028] Here, the big model of the present application can also determine the intention of the question statement based on the accurate prompt words provided by the decision tree multi-classification model, and output the reply statement based on the prompt words, thereby achieving accurate and efficient question and answering, and improving the performance of the big model in the question and answer scenario.

[0029] Optionally, obtaining a first preset number of question statements includes:

[0030] Acquire multiple word segmentation samples corresponding to each word slot, wherein the number of word slots is M; combine the word segmentation samples to obtain a first preset number of question sentences, wherein each question sentence includes N word segmentation samples; wherein M and N are positive integers, and N is less than or equal to M.

[0031] The present application can perform combination processing based on multiple word segmentation samples corresponding to each word slot to obtain multiple question sentences, providing a large number of data processing samples for prompt word generation processing, and based on the clustering of multiple word segmentation samples, providing feature items for the decision tree multi-classification model, which is convenient for accurate word segmentation extraction and analysis, and a sufficient number of data processing samples can improve the accuracy of prompt word disambiguation.

[0032] Optionally, splitting each question sentence according to word slots to obtain at least one word segment corresponding to the question sentence includes:

[0033] Each question statement is matched with a plurality of word segmentation samples corresponding to each word slot to obtain at least one word segmentation corresponding to the question statement.

[0034] The present application achieves word segmentation of question sentences by matching multiple word segmentation samples corresponding to each word slot. The splitting efficiency is high, and the split words can meet the requirements of word slot learning, thereby improving the efficiency of prompt word generation processing.

[0035] Optionally, converting the feature value of the at least one word segmentation includes:

[0036] The feature value of the at least one word segment is converted by using a one-bit effective encoding method.

[0037] Here, the present application adopts a one-hot encoding method to convert the feature values ​​of word segmentations. Through encoding, complex word segmentations can be converted into simple numerical data, thereby simplifying the processing process of the decision tree multi-classification model, maintaining the independence of the word slots corresponding to each word segmentation, and helping the decision tree multi-classification model to learn features more accurately, thereby improving the performance of the decision tree multi-classification model and further improving the accuracy of the prompt word generation process.

[0038] Optionally, before splitting each question sentence according to word slots to obtain at least one word segment corresponding to the question sentence, the method further includes:

[0039] Receiving multiple word slots input by a user; and\or, obtaining multiple word slots in a preset word slot library; and\or, obtaining multiple word slots according to the question category corresponding to the question sentence.

[0040] Among them, the present application provides a variety of word slot acquisition methods, which can flexibly determine word slots according to application scenarios of different problems, thereby achieving accurate analysis and disambiguation of prompt words, and improving the flexibility of prompt word generation processing.

[0041] Optionally, the word slots include multiple ones of a date word slot, a region word slot, an acquiring institution / industry / channel word slot, an indicator name word slot, a classification basis word slot and a sorting order word slot.

[0042] In a second aspect, the present application provides a prompt word generation and processing device, comprising:

[0043] An acquisition module, used for acquiring a first preset number of question statements;

[0044] A splitting module, used for splitting each question sentence according to word slots to obtain at least one word segment corresponding to the question sentence;

[0045] A conversion module, configured to convert the feature value of the at least one segmented word according to the connection relationship between the word slots corresponding to the segmented word, so as to obtain a word slot feature vector corresponding to each question sentence;

[0046] A labeling module is used to label the intent of each question sentence to obtain the intent label of each question sentence;

[0047] A determination module, configured to use the word slot feature vectors and intention labels of the first preset number of question sentences as training sample data;

[0048] A generation module, used to generate a decision tree multi-classification model based on the training sample data, wherein each node in the decision tree multi-classification model corresponds to each word slot feature;

[0049] The output module is used to output the corresponding word slot features as prompt words according to the nodes and node sequences passed by the decision tree multi-classification model in the process of identifying the question sentence to be processed.

[0050] Optionally, the generating module is specifically used for:

[0051] Calculate the feature preference value corresponding to each word slot feature in the word slot feature vector; filter out the word slot features that meet the node requirements according to the feature preference value, and use the word slot features that meet the node requirements as nodes in the decision tree multi-classification model; classify the word slot features in the word slot feature vector based on the nodes in the decision tree multi-classification model; determine the threshold division condition according to the classification result, and determine the connection relationship between each node in the decision tree multi-classification model according to the threshold division condition; generate a decision tree multi-classification model based on the nodes in the decision tree multi-classification model and the connection relationship between each node.

[0052] Optionally, after the generation module is used to generate a decision tree multi-classification model based on the nodes in the decision tree multi-classification model and the connection relationship between the nodes, the apparatus further includes an optimization module, which is used to:

[0053] Acquire test sample data, wherein the test sample data includes word slot feature vectors and intent labels of a second preset number of question sentences; and optimize the decision tree multi-classification model using the test sample data.

[0054] Optionally, the output module is specifically used for:

[0055] Obtain the question sentence to be processed; in the process of the large model identifying the question sentence to be processed, according to the nodes and node sequence passed by the decision tree multi-classification model in the process of identifying the question sentence to be processed, output the corresponding word slot features as prompt words.

[0056] Optionally, in the process of the output module being used to identify the question sentence to be processed in the large model, according to the nodes and node sequence passed by the decision tree multi-classification model in the process of identifying the question sentence to be processed, after outputting the corresponding word slot features as prompt words, the above-mentioned device further includes:

[0057] The reply module is used to output a reply sentence corresponding to the question sentence to be processed based on the prompt words and the output order of the prompt words during the process of the large model identifying the question sentence to be processed.

[0058] Optionally, the reply module is specifically used for:

[0059] Based on the prompt words and the output order of the prompt words, the reply words and the reply order corresponding to the prompt words are determined; and according to the reply words and the reply order, the reply sentences corresponding to the question sentence to be processed are output.

[0060] Optionally, the acquisition module is specifically used for:

[0061] Acquire multiple word segmentation samples corresponding to each word slot, wherein the number of word slots is M; combine the word segmentation samples to obtain a first preset number of question sentences, wherein each question sentence includes N word segmentation samples; wherein M and N are positive integers, and N is less than or equal to M.

[0062] Optionally, the splitting module is specifically used for:

[0063] Each question statement is matched with a plurality of word segmentation samples corresponding to each word slot to obtain at least one word segmentation corresponding to the question statement.

[0064] Optionally, the conversion module is specifically used for:

[0065] The feature value of the at least one word segment is converted by using a one-bit effective encoding method.

[0066] Optionally, before the splitting module is used to split each question sentence according to word slots to obtain at least one word segment corresponding to the question sentence, the apparatus further includes a word slot determination module, which is used to:

[0067] Receiving multiple word slots input by a user; and\or, obtaining multiple word slots in a preset word slot library; and\or, obtaining multiple word slots according to the question category corresponding to the question sentence.

[0068] Optionally, the word slots include multiple ones of a date word slot, a region word slot, an acquiring institution / industry / channel word slot, an indicator name word slot, a classification basis word slot and a sorting order word slot.

[0069] In a third aspect, the present application provides a prompt word generation processing device, including: at least one processor and a memory;

[0070] The memory stores computer-executable instructions;

[0071] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the prompt word generation processing method described in the first aspect and various possible designs of the first aspect.

[0072] In a fourth aspect, the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer execution instructions. When a processor executes the computer execution instructions, the prompt word generation and processing method described in the first aspect and various possible designs of the first aspect are implemented.

[0073] In a fifth aspect, the present invention provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the prompt word generation and processing method as described in the first aspect and various possible designs of the first aspect.

[0074] The present application provides a prompt word generation and processing method, device, equipment and medium, wherein the method first collects a large number of question sentences, splits each question sentence into word segments according to word slots, and converts the question sentence into a word slot feature vector for model processing according to the connection relationship between the word slots corresponding to the word segments. Based on the word slot feature vector corresponding to each question sentence and its corresponding intent label, a decision tree multi-classification model is constructed. In the process of constructing the decision tree multi-classification model, the present application selects the word slot features that need to be disambiguated in different word slots and the corresponding intent labels to construct the decision tree multi-classification model, which can learn the disambiguating words in different word slots and the relationship between the remaining contexts. Through the nodes and node order of the decision tree multi-classification model, the association path of the intent corresponding to the question sentence can be accurately reflected, and the intent corresponding to the question sentence can be accurately extracted and summarized, thereby providing prompt words that accurately reflect the word slot features, improving the accuracy of prompt word generation, and providing accurate recognition basis for large models. BRIEF DESCRIPTION OF THE DRAWINGS

[0075] 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.

[0076] Figure 1 A schematic diagram of the structure of a prompt word generation and processing system provided in an embodiment of the present application;

[0077] Figure 2 A flowchart of a prompt word generation processing method provided in an embodiment of the present application;

[0078] Figure 3 A schematic diagram of word segmentation corresponding to a word slot provided in an embodiment of the present application;

[0079] Figure 4 A schematic diagram of a generation process of a decision tree multi-classification model provided in an embodiment of the present application;

[0080] Figure 5 A schematic diagram of a decision tree corresponding to a specific example of a certain test of a service provided in an embodiment of the present application;

[0081] Figure 6 A schematic diagram of the business logic of a decision tree corresponding to a specific example of a certain test of a business provided in an embodiment of the present application;

[0082] Figure 7 A flowchart of another prompt word generation processing method provided in an embodiment of the present application;

[0083] Figure 8A schematic diagram of a data processing flow in a prompt word generation process provided in an embodiment of the present application;

[0084] Fig. 9 A schematic diagram of a processing process for output disambiguation in a question-answering scenario provided in an embodiment of the present application;

[0085] Fig.10 A schematic diagram of the structure of a prompt word generation and processing device provided in an embodiment of the present application;

[0086] Fig.11 A schematic diagram of the structure of a prompt word generation and processing device provided in an embodiment of the present application.

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

[0088] Here, exemplary embodiments will be described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application.

[0089] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0090] Currently, polysemy and ambiguity are common problems in the preprocessing of large model prompt words: in the natural language processing of prompt words, the same word may have different meanings and usages in different contexts, making it difficult to process using a unified model. Ambiguity in prompt words will cause errors in the recognition of prompt diagrams by the large model, and errors in the subsequent content generation process.

[0091] For example, in the application scenario of indicator query structured query language (SQL) code generation, users have different types of questions for different indicators, and most of the question elements have many similar contents, which easily leads to ambiguity and misunderstanding of the intention. For example, the following statement:

[0092] What is the specific amount of total income of city Q last month? The corresponding sum() sql code logic is generated.

[0093] What was the revenue of Q city QR code transaction channel last month? Corresponding sum()+where sql code logic generation,

[0094] What was the revenue of each transaction channel in city Q last month? Corresponding sum(), group by sql code logic generation.

[0095] Before intention decomposition and disambiguation is performed, it is easy to encounter uncompilable code logic such as select A, sum(B) group by C.

[0096] In the related art, the following methods can be used to achieve the disambiguation of prompt words: by collecting corpora of different ambiguous words and different meanings, a corpus of each ambiguous word is constructed; according to the frequency of each word in each sentence in each meaning, the characteristic word weight of the word in the meaning is constructed; according to the number of occurrences of the meaning vocabulary in each meaning and each sentence, the ambiguity of the sentence is obtained; according to the distance between the word and the ambiguous word in the sentence, the characteristic word weight of the word in the meaning, and the ambiguity of the sentence, the meaning feature vector of the sentence is obtained; according to the meaning feature vector of the sentence and the vector of each word in the sentence, the fusion matrix of the sentence is obtained; according to the fusion matrix of the sentence, a neural network is used to output the semantic classification of ambiguous words. However, the related art is mostly focused on distinguishing the meanings of similar words in natural language texts, lacking the understanding and classification capabilities of text intent and knowledge ambiguity, and the accuracy of prompt word generation is low, which cannot provide accurate recognition basis for large models.

[0097] In order to solve the above problems, the embodiments of the present application provide a prompt word generation and processing method, device, equipment and medium. The method constructs an association path of word segments through context. Specifically, each question sentence is split into word segments according to word slots, and according to the connection relationship between the word slots corresponding to the word slots, the question sentence is converted into a word slot feature vector for model processing. Based on the word slot feature vector corresponding to each question sentence and its corresponding intent label, a decision tree multi-classification model is constructed. Based on the word slot features corresponding to the nodes in the decision tree multi-classification model and the node order, accurate prompt words are output.

[0098] Optional, Figure 1A schematic diagram of the system architecture for generating and processing prompt words provided in an embodiment of the present application. Figure 1 In the above architecture, the above architecture includes at least one of a data acquisition device 101, a processing device 102 and a display device 103.

[0099] It is understandable that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the architecture of the prompt word generation processing system. In other feasible implementations of the present application, the above architecture may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently, which can be determined according to the actual application scenario and is not limited here. Figure 1 The components shown may be implemented in hardware, software, or a combination of software and hardware.

[0100] In a specific implementation process, the data acquisition device 101 may include an input / output interface and may also include a communication interface. The data acquisition device 101 may be connected to the processing device via the input / output interface or the communication interface.

[0101] The processing device 102 can split each question sentence into word segments according to the word slots, and convert the question sentence into a word slot feature vector for model processing based on the connection relationship between the word slots corresponding to the word segments. Based on the word slot feature vector corresponding to each question sentence and its corresponding intention label, a decision tree multi-classification model is constructed, and based on the word slot features corresponding to the nodes in the decision tree multi-classification model and the node order, accurate prompt words are output.

[0102] The display device 103 may also be a touch display screen or a screen of a terminal device, which is used to receive user instructions while displaying the above content to achieve interaction with the user.

[0103] It should be understood that the above-mentioned processing device can be implemented by a processor reading instructions in a memory and executing the instructions, or it can be implemented by a chip circuit.

[0104] In addition, the network architecture and business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Ordinary technicians in this field can know that with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0105] The technical solution of the present application is described in detail below in conjunction with specific embodiments:

[0106] Optionally, Figure 2 A flowchart of a prompt word generation processing method provided in an embodiment of the present application. The execution subject of the embodiment of the present application can be Figure 1The specific execution subject can be determined according to the actual application scenario. Figure 2 As shown, the method comprises the following steps:

[0107] S201: Obtain a first preset number of question statements.

[0108] It is understandable that the first preset number can be determined based on actual conditions, and the embodiment of the present application does not impose any specific limitation on this.

[0109] Optionally, obtaining a first preset number of question statements includes: obtaining a plurality of word segmentation samples corresponding to each word slot; and combining the word segmentation samples to obtain the first preset number of question statements.

[0110] The number of word slots is M, each question sentence includes N word segmentation samples, M and N are positive integers, and N is less than or equal to M.

[0111] In a possible implementation, the embodiment of the present application can collect and form a large number of question sentences by splitting the question semantic word slots and connecting the contexts.

[0112] Specifically, first, semantic splitting of different types of questions is performed.

[0113] Optionally, the word slots include multiple ones of a date word slot, a region word slot, an acquiring institution / industry / channel word slot, an indicator name word slot, a classification basis word slot and a sorting order word slot.

[0114] Taking a transaction scenario as an example, multiple categories of semantic word slots are split:

[0115] For the problem: In October 2023, the total revenue of the branch in region A and the acquiring institution is Bank B. It can be split into 4 slots, namely: date slot (October 2023), region slot (region A), acquiring institution slot (Bank B), indicator name slot (total revenue).

[0116] For the problem: the sum of the total revenue of each transaction channel in October 2023, sorted in descending order. It can be split into 5 word slots, namely: classification based on word slot (each transaction channel), sorting order (descending order).

[0117] By extracting and summarizing multiple word slots such as date, region, acquiring institution / transaction channel / industry type, indicator name, classification basis, sorting order, etc., a word vector library can be formed based on common corpus samples. Among them, each word vector library can correspond to a word slot, and the word vector library includes the word segmentation or word segmentation vector corresponding to the word slot.

[0118] Therefore, for the user's question, combined with word segmentation and context connection, the following word slot vector library context connection samples can be formed, and each word slot vector library context connection sample is a question sentence. Figure 3 As shown, Figure 3 A schematic diagram of word segmentation corresponding to a word slot provided in an embodiment of the present application, such as Figure 3 As shown in the figure, the date word slot corresponds to multiple date corpora, which are the word segments in the word vector library corresponding to the date word slot. For different questions, the above corpora have contextual relationships. Figure 3 By selecting any one or more word segments from any word slot or multiple word slots, a question sentence can be formed through the relationship of the context. For example, for the question: Sum of total revenue of each transaction channel in October 2023, sorted in descending order. The context contains the word slot context connection relationship of "date-classification basis-indicator name-sorting order".

[0119] The embodiment of the present application can perform combination processing based on multiple word segmentation samples corresponding to each word slot to obtain multiple question sentences, providing a large number of data processing samples for prompt word generation processing, and providing feature items for the decision tree multi-classification model based on clustering of multiple word segmentation samples, which is convenient for accurate word segmentation extraction and analysis, and a sufficient number of data processing samples can improve the accuracy of prompt word disambiguation.

[0120] S202: Split each question sentence according to word slots to obtain at least one word segment corresponding to the question sentence.

[0121] Optionally, each question statement is split according to word slots to obtain at least one word segmentation corresponding to the question statement, including: matching each question statement with multiple word segmentation samples corresponding to each word slot to obtain at least one word segmentation corresponding to the question statement.

[0122] Optionally, each question sentence is matched with a plurality of word segmentation samples corresponding to each word slot by a forward maximum matching method, a reverse maximum matching method or a bidirectional maximum matching method.

[0123] The embodiment of the present application achieves word segmentation of question sentences by matching multiple word segmentation samples corresponding to each word slot. The splitting efficiency is high, and the split words can meet the requirements of word slot learning, thereby improving the efficiency of prompt word generation processing.

[0124] Optionally, each question sentence is split into word slots to obtain word segments through techniques such as syntactic analysis and semantic analysis.

[0125] Optionally, before splitting each question statement according to word slots to obtain at least one word segment corresponding to the question statement, it also includes: receiving multiple word slots input by the user; and\or, obtaining multiple word slots in a preset word slot library; and\or, obtaining multiple word slots according to the question category corresponding to the question statement.

[0126] Based on different application scenarios, different word slots can be customized to adapt to a variety of application scenarios, improving the flexibility of prompt word generation and processing.

[0127] Among them, the embodiments of the present application provide a variety of word slot acquisition methods, which can flexibly determine word slots according to application scenarios of different problems, thereby achieving accurate analysis and disambiguation of prompt words, and improving the flexibility of prompt word generation processing.

[0128] S203: According to the connection relationship between the word slots corresponding to the word segmentations, the feature value of at least one word segmentation is converted to obtain a word slot feature vector corresponding to each question sentence.

[0129] Optionally, converting the feature value of at least one word segmentation includes: converting the feature value of at least one word segmentation by using One-hot encoding.

[0130] Here, the embodiment of the present application adopts the One-hot encoding method to convert the feature values ​​of the word segmentation. Through encoding, complex word segmentation can be converted into simple numerical data, thereby simplifying the processing process of the decision tree multi-classification model, maintaining the independence of the word slots corresponding to each word segmentation, and helping the decision tree multi-classification model to learn features more accurately, thereby improving the performance of the decision tree multi-classification model and further improving the accuracy of the prompt word generation process.

[0131] In one possible implementation, encoding is performed based on word slot context connection vectorization, thereby enabling modeling of an intent recognition decision tree multi-classification model.

[0132] Specifically, the onehot encoding contains the vectors of all enumerated word slot classes, namely:

[0133] {Date word vector}+{Region word vector}+{Acquiring institution / industry / channel word vector}+{Indicator name word vector}+{Classification basis word vector}+{Sorting order word vector}.

[0134] For "Date-Classification Basis-Indicator Name-Sorting Order", the words such as region, acquiring institution, indicator name, etc. under the full code are set to zero by default, and those with word values ​​are converted into word vector expressions (which can be set to 128 bits).

[0135] For example Figure 3For multiple word segments in any word slot shown in the figure, if a word slot is an acquirer / industry / channel word vector word slot, the word segment in the word slot can be converted into a 128-bit word vector and filled into {acquirer / industry / channel word vector}, thereby constructing a feature string of different word vector feature blocks:

[0136] That is, X = {X1 = date word vector} + {X2 = region word vector} + {X3 = acquiring institution / industry / channel word vector} + {X4 = indicator name word vector} + {X5 = classification basis word vector} + {X6 = sorting order word vector}.

[0137] Here, X is the word slot feature vector in the embodiment of the present application, which can be used as a training sample for the decision tree multi-classification model.

[0138] In order to build a decision tree multi-classification model, it is necessary to label the intent classes of different questions, for example:

[0139] The specific amount of total income of city Q last month is labeled as Y=1.

[0140] What was the revenue of Q city’s QR code transaction channel last month? Label it as Y=2.

[0141] What was the revenue of each transaction channel in city Q last month? Label it as Y=3.

[0142] A decision tree multi-classification model is constructed with X and Y as above, and classification learning is performed. From this, the threshold conditions of the main tree and subtrees of the decision tree can be obtained to distinguish different types of question intentions, that is, the feature values ​​of each word slot can be distinguished and their order in determining the classification of question intentions.

[0143] In a possible implementation, a context vector feature network is constructed based on word vectors. Specifically, the sample sentences are vectorized after word segmentation and the word categories are marked. The word segmentation contexts under different categories are extracted, and the context word vectors are clustered through the graph embedding algorithm to form different corpus clusters and number them. The corpus clusters are clustered and the cluster clusters are labeled and aggregated as feature items for decision tree classification. At the same time, the cluster clusters are connected according to the context order relationship to form a context feature network.

[0144] S204: Label the intent of each question sentence to obtain an intent label of each question sentence.

[0145] S205: Using the word slot feature vectors and intention labels of a first preset number of question sentences as training sample data.

[0146] S206: Generate a decision tree multi-classification model based on the training sample data.

[0147] Each node in the decision tree multi-classification model corresponds to each word slot feature.

[0148] S207: For the question sentence to be processed, according to the nodes and node sequence that the decision tree multi-classification model passes through in the process of identifying the question sentence to be processed, the corresponding word slot features are output as prompt words.

[0149] The embodiment of the present application provides an accurate and reliable prompt word generation method. First, a large number of question sentences are collected, and each question sentence is split into word segments according to the word slots. According to the connection relationship between the word slots corresponding to the word segments, the question sentences are converted into word slot feature vectors for model processing. Based on the word slot feature vector corresponding to each question sentence and its corresponding intent label, a decision tree multi-classification model is constructed. In the process of constructing the decision tree multi-classification model, the embodiment of the present application selects the word slot features that need to be disambiguated in different word slots and the corresponding intent labels to construct the decision tree multi-classification model. The disambiguation words in different word slots and the relationship between the remaining contexts can be learned. Through the nodes and node order of the decision tree multi-classification model, the association path of the intent corresponding to the question sentence can be accurately reflected, and the intent corresponding to the question sentence can be accurately extracted and summarized, thereby providing prompt words that accurately reflect the word slot features, improving the accuracy of prompt word generation, and providing accurate recognition basis for large models.

[0150] Optionally, Figure 4 A schematic diagram of the generation process of a decision tree multi-classification model provided in an embodiment of the present application is shown in FIG. Figure 4 As shown, step S206 specifically includes the following steps:

[0151] S2061: Calculate the feature preference value corresponding to each word slot feature in the word slot feature vector.

[0152] Optionally, the feature preference value corresponding to each word slot feature is calculated by information gain, gain rate or Gini index.

[0153] This step can select the optimal partition point (the word slot feature corresponding to the node) as the threshold by traversing the feature values ​​and calculating the feature preference values.

[0154] S2062: According to the feature preference value, filter out the word slot features that meet the node requirements, and use the word slot features that meet the node requirements as nodes in the decision tree multi-classification model.

[0155] S2063: Classify the word slot features in the word slot feature vector based on the nodes in the decision tree multi-classification model.

[0156] S2064: Determine a threshold division condition according to the classification result, and determine a connection relationship between nodes in the decision tree multi-classification model according to the threshold division condition.

[0157] S2065: Generate a decision tree multi-classification model based on the nodes in the decision tree multi-classification model and the connection relationship between the nodes.

[0158] Steps S2062 to S2065 divide the data set into two or more subsets according to the selected threshold value, and repeat the above process for each subset until the stopping condition is met, so that a decision tree multi-classification model can be finally generated.

[0159] Optionally, the decision tree uses different cluster labels as features, selects word vectors that need to be disambiguated in different clusters as samples, labels them with different 1 / 0 classes, and classifies the current vector feature network through the decision tree. Through this decision tree classification model, the classification judgment relationship between the disambiguated words in different clusters and other cluster data in the context can be learned.

[0160] Demonstratively, Figure 5 and Figure 6 The following are respectively a schematic diagram of a decision tree corresponding to a specific example of a certain test of a business provided in an embodiment of the present application and a schematic diagram of the business logic of the decision tree. Figure 5 The decision tree maps the feature word slot vector threshold back to the specific data value, which can form the business logic of intent judgment and disambiguation, such as Figure 6 The decision tree can provide a basis for the intention recognition of the large model.

[0161] Through the above decision tree training results, the judgment order based on different conditions in different types of intent recognition can be clearly output. After different judgment orders are distinguished, the recognition of different intents will be more accurate and the ambiguous problems generated will be relatively less.

[0162] Among them, in the process of generating a decision tree multi-classification model, the embodiment of the present application selects word slot features that meet the node requirements as nodes of the decision tree. Through the selection of decision tree nodes, word slot features that are ambiguous or have low importance to intent recognition can be effectively eliminated. The word slot features are classified in combination with the connection relationship between the word slots corresponding to the word segmentation in the word slot feature vector and the intent label. The disambiguation words in different word slots and their classification judgment relationship with other word slot features in the context can be accurately learned. The classification judgment relationship can be reflected in the decision tree as the connection relationship of each node, providing an accurate judgment basis for the generation of prompt words. Through the above-mentioned generation process of the decision tree multi-classification model, a decision tree multi-classification model that accurately identifies prompt words can be generated, thereby improving the accuracy of prompt word generation.

[0163] Optionally, after generating a decision tree multi-classification model based on the nodes in the decision tree multi-classification model and the connection relationship between the nodes, the method further includes:

[0164] Get test sample data. Use the test sample data to optimize the decision tree multi-classification model.

[0165] The test sample data includes word slot feature vectors and intention labels of a second preset number of question sentences.

[0166] It is understandable that the second preset number can be determined according to actual conditions, and the present application embodiment does not impose any specific limitation on this. The method for obtaining the test sample data can refer to the method for obtaining the training sample data described above.

[0167] Here, the embodiment of the present application also optimizes the decision tree multi-classification model based on the test sample data, which can accurately evaluate the performance of the optimization processing of the decision tree multi-classification model, solve the problem of overfitting or low accuracy in the optimization processing of the decision tree multi-classification model, further improve the accuracy of prompt word generation, and further reduce the ambiguity of prompt words.

[0168] Optionally, the embodiment of the present application can provide a basis for intent recognition for the large model. Accordingly, Figure 7 A flowchart of another prompt word generation processing method provided in an embodiment of the present application is shown as follows: Figure 7 As shown, the method includes:

[0169] S701: Obtain a first preset number of question statements.

[0170] S702: Split each question sentence according to word slots to obtain at least one word segment corresponding to the question sentence.

[0171] S703: According to the connection relationship between the word slots corresponding to the word segmentations, transform the feature value of at least one word segmentation to obtain a word slot feature vector corresponding to each question sentence.

[0172] S704: Label the intention of each question sentence to obtain an intention label of each question sentence.

[0173] S705: Use the word slot feature vectors and intention labels of a first preset number of question sentences as training sample data.

[0174] S706: Generate a decision tree multi-classification model based on the training sample data.

[0175] Each node in the decision tree multi-classification model corresponds to each word slot feature.

[0176] Among them, the implementation method of steps S701-S706 is the same as the implementation method of steps S201-S206, and will not be repeated here.

[0177] Optionally, based on decision tree classification, a specific decision classification judgment logic tree is output, and the judgment criteria of each cluster of the logic tree are generated into a thinking chain, and specific prompt words are mapped to each word vector as the prompt word input of the large model, guiding the large model to generate results pointing to a recall pool without ambiguity, thereby meeting the needs of model disambiguation.

[0178] S707: Obtain the question statement to be processed.

[0179] Optionally, the number of question statements to be processed may be multiple, and the large model and the decision tree multi-classification model can process the question statements in batches.

[0180] S708: When the large model identifies the question sentence to be processed, the corresponding word slot features are output as prompt words according to the nodes and node sequence that the decision tree multi-classification model passes through when identifying the question sentence to be processed.

[0181] Among them, the decision tree multi-classification model of the embodiment of the present application can provide prompt words for the large model, guiding the large model to point to the recall pool without ambiguity during the reasoning process, meeting the requirements of model disambiguation and improving the performance of the large model.

[0182] Optionally, in the process of identifying the question sentence to be processed in the large model, according to the nodes and node sequence passed by the decision tree multi-classification model in the process of identifying the question sentence to be processed, after outputting the corresponding word slot features as prompt words, it also includes:

[0183] In the process of the large model identifying the question sentence to be processed, the answer sentence corresponding to the question sentence to be processed is output based on the prompt words and the output order of the prompt words.

[0184] Optionally, based on the prompt words and the output order of the prompt words, outputting a reply sentence corresponding to the question sentence to be processed includes:

[0185] Based on the prompt words and the output order of the prompt words, the reply words and the reply order corresponding to the prompt words are determined; according to the reply words and the reply order, the reply sentences corresponding to the question sentences to be processed are output.

[0186] Here, the big model of the embodiment of the present application can also determine the intention of the question statement based on the accurate prompt words provided by the decision tree multi-classification model, and output the reply statement based on the prompt words, thereby achieving accurate and efficient question and answering, and improving the performance of the big model in the question and answer scenario.

[0187] Through the above decision tree training results, the judgment order based on different conditions in different types of intent recognition can be clearly output. After different judgment orders are distinguished, different intent recognition will be more accurate and the ambiguous problems will be relatively less. Further assembling the decision tree judgment process into a thinking chain for large model application and inputting it into the large model in the form of generating thinking process samples can effectively limit the thinking path of the large model and avoid the model illusion problem caused by diffuse knowledge search.

[0188] By mapping the decision tree into a prompt thinking chain in the form of QA, questions can be broken down into thinking paths at different stages, gradually guiding the large model to think according to standardized ideas and improving model accuracy.

[0189] The following is an example of generating prompt word mapping:

[0190] Question 1: This question does not include the query of the same period last year and the same period last year. Figure 1 : During the SQL generation process, there is no need to introduce more year-on-year and year-on-year calculation formulas for calculation.

[0191] Question 2: This question is arranged in order from largest to smallest. Figure 2 : Arrange in order by desc.

[0192] Optionally, the embodiment of the present application constructs an association path of the vector to be disambiguated through the context, which is used to construct a classification and decision model, and can better summarize and expand the text intent knowledge.

[0193] Optionally, the classification method based on the decision tree in the embodiment of the present application can partially solve the problem of knowledge disambiguation while providing a classification thinking chain for prompt words to output a large model in stages for interpretable application.

[0194] Optionally, based on the above classification method, the embodiment of the present application can batch process a batch of word vectors to be disambiguated, which can be used to improve the parallel processing capability of the prompt word project and save token overhead.

[0195] Figure 8 A schematic diagram of a data processing flow in a prompt word generation process provided in an embodiment of the present application, such as Figure 8 As shown, for the question sentence, after the word vector class division encoding and context feature connection, the obtained data is classified based on the feature of the decision tree, which can realize the decision tree thinking chain mapping and sample prompt generation, providing a basis for intent recognition for the large model.

[0196] Fig. 9 This is a schematic diagram of the output disambiguation processing process of a question-answering scenario provided in an embodiment of the present application. This process can be performed in a decision tree multi-classification model or in a large model. Fig. 9As shown, the embodiment of the present application can achieve the disambiguation of prompt words.

[0197] Fig.10 A schematic diagram of a prompt word generation and processing device provided in an embodiment of the present application is shown in FIG. Fig.10 As shown, the device of the embodiment of the present application includes: an acquisition module 1001, a splitting module 1002, a conversion module 1003, a labeling module 1004, a determination module 1005, a generation module 1006 and an output module 1007. The prompt word generation processing device here can be the above-mentioned processing device itself, or a chip or integrated circuit that realizes the function of the processing device. It should be noted here that the division of the acquisition module 1001, the splitting module 1002, the conversion module 1003, the labeling module 1004, the determination module 1005, the generation module 1006 and the output module 1007 is only a division of logical functions. Physically, the two can be integrated or independent.

[0198] The acquisition module is used to acquire a first preset number of question statements;

[0199] A splitting module, used for splitting each question sentence according to word slots to obtain at least one word segment corresponding to the question sentence;

[0200] A conversion module, used for converting the feature value of at least one segmented word according to the connection relationship between the word slots corresponding to the segmented words, so as to obtain the word slot feature vector corresponding to each question sentence;

[0201] A labeling module is used to label the intent of each question sentence to obtain the intent label of each question sentence;

[0202] A determination module, configured to use the word slot feature vectors and intention labels of a first preset number of question sentences as training sample data;

[0203] A generation module, used to generate a decision tree multi-classification model based on training sample data, wherein each node in the decision tree multi-classification model corresponds to each word slot feature;

[0204] The output module is used to output the corresponding word slot features as prompt words for the question sentence to be processed according to the nodes and node sequences passed by the decision tree multi-classification model in the process of identifying the question sentence to be processed.

[0205] Optionally, the generation module is specifically used for:

[0206] Calculate the feature preference value corresponding to each word slot feature in the word slot feature vector; filter out the word slot features that meet the node requirements based on the feature preference value, and use the word slot features that meet the node requirements as nodes in the decision tree multi-classification model; classify the word slot features in the word slot feature vector based on the nodes in the decision tree multi-classification model; determine the threshold division condition based on the classification result, and determine the connection relationship between each node in the decision tree multi-classification model based on the threshold division condition; generate a decision tree multi-classification model based on the nodes in the decision tree multi-classification model and the connection relationship between each node.

[0207] Optionally, after the generation module is used to generate the decision tree multi-classification model based on the nodes in the decision tree multi-classification model and the connection relationship between the nodes, the above device further includes an optimization module for:

[0208] Acquire test sample data, wherein the test sample data includes word slot feature vectors and intent labels of a second preset number of question sentences; and optimize the decision tree multi-classification model using the test sample data.

[0209] Optionally, the output module is specifically used for:

[0210] Obtain the question sentence to be processed; in the process of the large model identifying the question sentence to be processed, according to the nodes and node sequence passed by the decision tree multi-classification model in the process of identifying the question sentence to be processed, output the corresponding word slot features as prompt words.

[0211] Optionally, in the process of the output module being used to identify the question sentence to be processed in the large model, according to the nodes and node sequence passed by the decision tree multi-classification model in the process of identifying the question sentence to be processed, after outputting the corresponding word slot features as prompt words, the above-mentioned device further includes:

[0212] The reply module is used to output the reply sentence corresponding to the question sentence to be processed based on the prompt words and the output order of the prompt words during the process of the large model identifying the question sentence to be processed.

[0213] Optionally, the reply module is specifically used for:

[0214] Based on the prompt words and the output order of the prompt words, the reply words and the reply order corresponding to the prompt words are determined; according to the reply words and the reply order, the reply sentences corresponding to the question sentences to be processed are output.

[0215] Optionally, the acquisition module is specifically used for:

[0216] Acquire multiple word segmentation samples corresponding to each word slot, where the number of word slots is M; combine the word segmentation samples to obtain a first preset number of question sentences, where each question sentence includes N word segmentation samples; where M and N are positive integers, and N is less than or equal to M.

[0217] Optionally, the splitting module is specifically used for:

[0218] Each question sentence is matched with a plurality of word segmentation samples corresponding to each word slot to obtain at least one word segmentation corresponding to the question sentence.

[0219] Optionally, the conversion module is specifically used for:

[0220] The feature value of at least one word is converted by using a one-bit effective encoding method.

[0221] Optionally, before the splitting module is used to split each question sentence according to the word slot to obtain at least one word segment corresponding to the question sentence, the apparatus further includes a word slot determination module, which is used to:

[0222] Receiving multiple word slots input by a user; and\or, obtaining multiple word slots in a preset word slot library; and\or, obtaining multiple word slots according to the question category corresponding to the question sentence.

[0223] Optionally, the word slots include multiple ones of a date word slot, a region word slot, an acquiring institution / industry / channel word slot, an indicator name word slot, a classification basis word slot and a sorting order word slot.

[0224] refer to Fig.11 , which shows a schematic diagram of the structure of a prompt word generation processing device 1100 suitable for implementing the embodiment of the present disclosure, and the prompt word generation processing device 1100 may be a terminal device or a server. The terminal device may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (Portable Android Devices, PADs), portable multimedia players (PMPs), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig.11 The prompt word generation and processing device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0225] like Fig.11As shown, the prompt word generation processing device 1100 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 1101, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1102 or a program loaded from a storage device 1108 to a random access memory (RAM) 1103. Various programs and data required for the operation of the prompt word generation processing device 1100 are also stored in the RAM 1103. The processing device 1101, the ROM 1102, and the RAM 1103 are connected to each other via a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.

[0226] Typically, the following devices may be connected to the I / O interface 1105: input devices 1106 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 1107 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1108 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1109. The communication device 1109 may allow the prompt word generation processing device 1100 to communicate with other devices wirelessly or by wire to exchange data. Although Fig.11 The prompt word generation processing device 1100 having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0227] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 1109, or installed from the storage device 1108, or installed from the ROM 1102. When the computer program is executed by the processing device 1101, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0228] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0229] The computer-readable medium may be included in the prompt word generation processing device; or may exist independently without being assembled into the prompt word generation processing device.

[0230] The computer-readable medium carries one or more programs. When the one or more programs are executed by the prompt word generation processing device, the prompt word generation processing device executes the method shown in the above embodiment.

[0231] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0232] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0233] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".

[0234] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

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

[0236] The prompt word generation and processing device of the embodiment of the present application can be used to execute the technical solutions in the above-mentioned method embodiments of the present application. Its implementation principles and technical effects are similar and will not be repeated here.

[0237] The embodiment of the present application further provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement any of the above-mentioned prompt word generation processing methods.

[0238] The embodiment of the present application also provides a computer program product, including a computer program, which is used to implement any of the above-mentioned prompt word generation processing methods when the computer program is executed by a processor.

[0239] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0240] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0241] 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.

[0242] 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 prompt word generation and processing method, It is characterized in that include: Obtaining a first preset number of question statements; Splitting each question sentence according to word slots to obtain at least one word segment corresponding to the question sentence; According to the connection relationship between the word slots corresponding to the word segmentations, the feature value of the at least one word segmentation is converted to obtain a word slot feature vector corresponding to each question sentence; Label the intent of each question sentence to obtain the intent label of each question sentence; Using the word slot feature vectors and intention labels of the first preset number of question sentences as training sample data; Generate a decision tree multi-classification model based on the training sample data, wherein each node in the decision tree multi-classification model corresponds to each word slot feature; For the question sentence to be processed, according to the nodes and node sequence passed by the decision tree multi-classification model in the process of identifying the question sentence to be processed, the corresponding word slot features are output as prompt words.

2. The method according to claim 1, It is characterized in that The generating a decision tree multi-classification model based on the training sample data comprises: Calculating a feature preference value corresponding to each word slot feature in the word slot feature vector; According to the feature preference value, a word slot feature that meets the node requirement is screened out, and the word slot feature that meets the node requirement is used as a node in the decision tree multi-classification model; Classifying the slot features in the slot feature vector based on the nodes in the decision tree multi-classification model; Determine a threshold division condition according to the classification result, and determine a connection relationship between each node in the decision tree multi-classification model according to the threshold division condition; A decision tree multi-classification model is generated based on the nodes in the decision tree multi-classification model and the connection relationship between the nodes.

3. The method according to claim 2, It is characterized in that After generating the decision tree multi-classification model based on the nodes in the decision tree multi-classification model and the connection relationship between the nodes, the method further includes: Acquire test sample data, wherein the test sample data includes word slot feature vectors and intention labels of a second preset number of question sentences; The test sample data is used to optimize the decision tree multi-classification model.

4. The method according to claim 1, It is characterized in that The method outputs the corresponding word slot features as prompt words according to the nodes and node sequences passed by the decision tree multi-classification model in the process of identifying the question sentence to be processed, including: Get the question statements to be processed; In the process of the large model identifying the question sentence to be processed, the corresponding word slot features are output as prompt words according to the nodes and node sequences passed by the decision tree multi-classification model in the process of identifying the question sentence to be processed.

5. The method according to claim 4, It is characterized in that In the process of the large model identifying the question sentence to be processed, according to the nodes and node sequence passed by the decision tree multi-classification model in the process of identifying the question sentence to be processed, after outputting the corresponding word slot features as prompt words, the method further includes: In the process of the large model identifying the question sentence to be processed, a reply sentence corresponding to the question sentence to be processed is output based on the prompt words and the output order of the prompt words.

6. The method according to claim 5, It is characterized in that The step of outputting a reply sentence corresponding to the question sentence to be processed based on the prompt word and the output order of the prompt word includes: Determining a reply word and a reply order corresponding to the prompt word based on the prompt word and the output order of the prompt word; According to the reply words and reply order, the reply sentence corresponding to the question sentence to be processed is output.

7. The method according to any one of claims 1 to 6, It is characterized in that The step of obtaining a first preset number of question statements includes: Obtain multiple word segmentation samples corresponding to each word slot, where the number of word slots is M; Combining the word segmentation samples to obtain a first preset number of question sentences, wherein each question sentence includes N word segmentation samples; Wherein, M and N are positive integers, and N is less than or equal to M.

8. The method according to claim 7, It is characterized in that The step of splitting each question sentence according to word slots to obtain at least one word segment corresponding to the question sentence includes: Each question statement is matched with a plurality of word segmentation samples corresponding to each word slot to obtain at least one word segmentation corresponding to the question statement.

9. The method according to any one of claims 1 to 6, It is characterized in that The converting of the feature value of the at least one word segmentation includes: The feature value of the at least one word segment is converted by using a one-bit effective encoding method.

10. The method according to claim 9, It is characterized in that Before splitting each question sentence according to word slots to obtain at least one word segment corresponding to the question sentence, the method further includes: Receive multiple word slots input by the user; and\or, In the preset word slot library, obtain multiple word slots; and\or, According to the question category corresponding to the question sentence, a plurality of word slots are obtained.

11. The method according to any one of claims 1 to 6, It is characterized in that The word slots include multiple ones of a date word slot, a region word slot, an acquiring institution / industry / channel word slot, an indicator name word slot, a classification basis word slot and a sorting order word slot.

12. A prompt word generation and processing device, It is characterized in that include: An acquisition module, used for acquiring a first preset number of question statements; A splitting module, used for splitting each question sentence according to word slots to obtain at least one word segment corresponding to the question sentence; A conversion module, configured to convert the feature value of the at least one segmented word according to the connection relationship between the word slots corresponding to the segmented word, so as to obtain a word slot feature vector corresponding to each question sentence; A labeling module is used to label the intent of each question sentence to obtain the intent label of each question sentence; A determination module, configured to use the word slot feature vectors and intention labels of the first preset number of question sentences as training sample data; A generation module, used to generate a decision tree multi-classification model based on the training sample data, wherein each node in the decision tree multi-classification model corresponds to each word slot feature; The output module is used to output the corresponding word slot features as prompt words according to the nodes and node sequences passed by the decision tree multi-classification model in the process of identifying the question sentence to be processed.

13. A prompt word generation and processing device, It is characterized in that include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 11.

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

Citation Information

Cited By

  • Method and device for identifying intention of statement, electronic equipment and program product

    CN119830892A

  • Prompt word generation method and device for large model, equipment, medium and program product

    CN120632025A

  • Method, device, equipment, medium and program product for prompt word generation of large model

    CN120632025B

  • Large model cue word construction method and device, equipment, medium and program product

    CN121809442A

  • Text generation diagram model testing method and device, equipment, storage medium and program product

    CN122795775A