Context learning method and device, equipment and storage medium

The context learning method addresses prediction errors in single-sample reliance by using a large language model and vector-based voting to automatically determine question categories, enhancing efficiency and reliability in question categorization.

CN119128087AActive Publication Date: 2024-12-13PING AN TECH (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411178574.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-26
Publication Date
2024-12-13
Estimated Expiration
2044-08-26

Smart Images

  • Figure CN119128087A_ABST
    Figure CN119128087A_ABST
Patent Text Reader

Abstract

The invention relates to the field of artificial intelligence and financial science and technology, and discloses a context learning method, device and equipment and a storage medium, and the method comprises the steps: obtaining an example problem, and obtaining prediction probability distribution outputted by a large language model based on the example problem; obtaining an information entropy value corresponding to the example problem according to the prediction probability distribution, and obtaining a reference problem according to the information entropy value; forming a set through a plurality of reference problems; obtaining a vector of each reference question in the set, obtaining a customer service dialogue, obtaining context content of a current query question in the customer service dialogue, and obtaining a vector of the context content; according to the vector of each reference question and the vector of the context content, generating each reference vector, obtaining each category predicted by the large language model based on each reference vector, obtaining the votes of each category, and selecting the category with the most votes as the question category of the current query question. The method is beneficial for improving the acquisition efficiency of the text theme.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of artificial intelligence and financial technology, and in particular to context learning methods, devices, equipment and storage media. Background Art

[0002] Problem classification plays a vital role in the field of information processing. By clarifying the problem category, the nature of the problem and the field to which it belongs can be clearly identified, so that more targeted solution strategies and methods can be adopted. This classification process not only improves work efficiency but also improves user satisfaction.

[0003] However, the current process of obtaining the question category of the query question is cumbersome, which is not conducive to improving the efficiency of obtaining the question category. The reason is that the existing context learning method relies on a single sample when predicting and is easily affected by a single sample, thus causing prediction errors. Prediction errors sometimes cause customer service personnel to manually enter the question category, and the manual input of the question category consumes a lot of time resources, which increases the time to obtain the question category, and is therefore not conducive to improving the efficiency of obtaining the question category. Summary of the invention

[0004] The present invention provides a context learning method, apparatus, computer equipment and storage medium to solve the technical problem that the process of obtaining the question category of the current query question is cumbersome and is not conducive to improving the efficiency of obtaining the question category.

[0005] In a first aspect, a context learning method is provided, comprising:

[0006] Obtain a preset query question, and obtain a context template corresponding to the preset query question;

[0007] Based on the preset query question and the context template, obtain an example question, and obtain a predicted probability distribution output by a large language model based on the example question;

[0008] According to the predicted probability distribution, an information entropy value corresponding to the example question is obtained, and according to the information entropy value and a predefined acquisition method, a reference question is obtained;

[0009] A set is formed by using a plurality of the reference questions;

[0010] Obtaining a vector of each reference question in the set, obtaining a customer service conversation, obtaining context content of a current query question in the customer service conversation, and obtaining a vector of the context content;

[0011] According to the vectors of each of the reference questions, the vector of the context content and a predefined generation method, each reference vector is generated, each category predicted by the large language model based on each of the reference vectors is obtained, the number of votes for each of the categories is obtained, and the category with the most votes is selected as the question category of the current query question.

[0012] Further, the obtaining of an example question based on the preset query question and the context template, and obtaining a predicted probability distribution output by a large language model based on the example question, includes:

[0013] Replace the placeholder in the context template with the preset query question, and use the replaced context template as an example question;

[0014] The example question is input into a preset large language model, and a predicted probability distribution output by the large language model based on the example question is obtained.

[0015] Further, obtaining the information entropy value corresponding to the example question according to the predicted probability distribution, and obtaining the reference question according to the information entropy value and a predefined acquisition method, includes:

[0016] According to the predicted probability distribution, obtaining the information entropy value corresponding to the example question, and determining whether the information entropy value is higher than a preset value;

[0017] When the information entropy value is higher than the preset value, the example question is marked as a reference question.

[0018] Furthermore, the plurality of reference questions are used to form a set, including:

[0019] Obtaining a preset number corresponding to the preset query question;

[0020] A set is formed by a preset number of the reference questions.

[0021] Further, the obtaining of the vectors of the reference questions in the set, obtaining the customer service dialogue, obtaining the context content of the current query question in the customer service dialogue, and obtaining the vector of the context content includes:

[0022] Extract features from the semantic units of each of the reference questions to obtain vectors of each of the reference questions, connect to the target system, and obtain the customer service dialogue sent by the target system;

[0023] The context content of the current query question in the customer service dialogue is obtained, and features of semantic units of the context content are extracted to obtain a vector of the context content.

[0024] Further, generating each reference vector according to the vector of each reference question, the vector of the context content and a predefined generation method, obtaining each category predicted by the large language model based on each reference vector, obtaining the number of votes for each category, and selecting the category with the largest number of votes as the question category of the current query question includes:

[0025] Concatenate the vectors of each reference question and the vectors of the context content to generate each reference vector, input each reference vector into the large language model, and obtain each category predicted by the large language model based on each reference vector;

[0026] Voting is performed on each of the categories to obtain the number of votes for each category, and the category with the largest number of votes is selected as the question category of the current query question.

[0027] Further, after generating each reference vector according to the vector of each reference question, the vector of the context content and a predefined generation method, obtaining each category predicted by the large language model based on each reference vector, obtaining the number of votes for each category, and selecting the category with the most votes as the question category of the current query question, the context learning method includes:

[0028] A solution corresponding to the problem category is obtained, and the solution is displayed in the customer service dialogue.

[0029] In a second aspect, a context learning device is provided, comprising:

[0030] A first acquisition module, used to acquire a preset query question and acquire a context template corresponding to the preset query question;

[0031] A second acquisition module is used to acquire an example question based on the preset query question and the context template, and acquire a predicted probability distribution output by the large language model based on the example question;

[0032] A third acquisition module is used to obtain the information entropy value corresponding to the example question according to the predicted probability distribution, and obtain the reference question according to the information entropy value and a predefined acquisition method;

[0033] A composition module, used to form a set through a plurality of the reference questions;

[0034] A fourth acquisition module is used to acquire the vector of each reference question in the set, acquire the customer service dialogue, acquire the context content of the current query question in the customer service dialogue, and acquire the vector of the context content;

[0035] A generation module is used to generate each reference vector according to the vector of each reference question, the vector of the context content and a predefined generation method, obtain each category predicted by the large language model based on each reference vector, obtain the number of votes for each category, and select the category with the most votes as the question category of the current query question.

[0036] In a third aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned context learning method when executing the computer program.

[0037] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned context learning method are implemented.

[0038] The present application provides a context learning method, apparatus, computer equipment and storage medium, which obtain a preset query question and a context template corresponding to the preset query question; based on the preset query question and the context template, obtain an example question and obtain a predicted probability distribution output by a large language model based on the example question; according to the predicted probability distribution, obtain an information entropy value corresponding to the example question, and obtain a reference question according to the information entropy value and a predefined acquisition method; form a set through a plurality of the reference questions; obtain a vector of each of the reference questions in the set, obtain a customer service conversation, obtain the context content of the current query question in the customer service conversation, and obtain a vector of the context content; generate each reference vector according to the vector of each reference question, the vector of the context content and a predefined generation method, and obtain the large language model; The language model predicts each category based on each reference vector, obtains the number of votes for each category, and selects the category with the largest number of votes as the question category of the current query question. The beneficial effects are in two aspects. On the one hand, according to the vectors of each reference question, the vector of the context content and the predefined generation method, each reference vector is generated, and each category predicted by the large language model based on each reference vector is obtained, the number of votes for each category is obtained, and the category with the largest number of votes is selected as the question category of the current query question. Since manual acquisition is not required, the acquisition time of the text topic of the text to be processed is reduced, which is conducive to improving the acquisition efficiency of the text topic of the text to be processed; on the other hand, since the topic generation model will not be affected by manual intervention, it is conducive to improving the reliability of the acquired text topic of the text to be processed. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0040] Figure 1 is a schematic diagram of an application environment of a context learning method in one embodiment of the present invention;

[0041] Figure 2 A flowchart of a context learning method provided by an embodiment of the present invention;

[0042] Figure 3 yes Figure 1 A schematic flow chart of a specific implementation of step S23;

[0043] Figure 4 yes Figure 1 A schematic flow chart of a specific implementation of step S25;

[0044] Figure 5 yes Figure 1 A schematic flow chart of a specific implementation of step S26;

[0045] Figure 6 is a structural diagram of a context learning device in one embodiment of the present invention;

[0046] Figure 7 is a schematic diagram of a structure of a computer device in one embodiment of the present invention;

[0047] Figure 8 It is another structural schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION

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

[0049] See also Figure 1 , Figure 1 is a schematic diagram of an application environment of a context learning method in an embodiment of the present invention. The context learning method provided by the embodiment of the present invention can be applied in Figure 1 In an application environment, a client communicates with a server through a network.

[0050] The server obtains a preset query question through the client, and obtains a context template corresponding to the preset query question;

[0051] Based on the preset query question and the context template, obtain an example question, and obtain a predicted probability distribution output by a large language model based on the example question;

[0052] According to the predicted probability distribution, an information entropy value corresponding to the example question is obtained, and according to the information entropy value and a predefined acquisition method, a reference question is obtained;

[0053] A set is formed by using a plurality of the reference questions;

[0054] Obtaining a vector of each reference question in the set, obtaining a customer service conversation, obtaining context content of a current query question in the customer service conversation, and obtaining a vector of the context content;

[0055] According to the vectors of each of the reference questions, the vector of the context content and a predefined generation method, each reference vector is generated, each category predicted by the large language model based on each of the reference vectors is obtained, the number of votes for each of the categories is obtained, and the category with the most votes is selected as the question category of the current query question.

[0056] In the scheme implemented by the above-mentioned context learning method, device, equipment and medium, the beneficial effects are in two aspects. On the one hand, according to the vector of each reference question, the vector of the context content and the predefined generation method, each reference vector is generated, and each category predicted by the large language model based on each reference vector is obtained, and the votes of each category are obtained. The category with the most votes is selected as the question category of the current query question. Since manual acquisition is not required, the acquisition time of the text topic of the text to be processed is reduced, which is conducive to improving the acquisition efficiency of the text topic of the text to be processed. On the other hand, since the topic generation model will not be affected by manual intervention, it is conducive to improving the reliability of the acquired text topic of the text to be processed.

[0057] The client may include but is not limited to various personal computers, laptops, smart phones, tablet computers, and portable wearable devices.

[0058] The server can be implemented with an independent task database or a task database cluster composed of multiple task databases. The present invention is described in detail below through specific embodiments.

[0059] See also Figure 2 , Figure 2 A flowchart of a context learning method provided by an embodiment of the present invention includes the following steps:

[0060] S21, obtaining a preset query question, and obtaining a context template corresponding to the preset query question;

[0061] Exemplarily, obtaining a preset query question and obtaining a context template corresponding to the preset query question includes:

[0062] A question set of a target business is obtained, any question in the question set of the target business is selected as a preset query question, and a context template corresponding to the preset query question is obtained.

[0063] Among them, the target business includes one or a combination of financial business, technology business, and insurance business.

[0064] For the sake of illustration, an example is given below:

[0065] Obtain a question set of financial services, select any question in the question set of financial services as a preset query question, and obtain a context template corresponding to the preset query question;

[0066] Obtain a set of questions about science and technology business, select any question in the set of questions about science and technology business as a preset query question, and obtain a context template corresponding to the preset query question;

[0067] A question set of insurance business is obtained, any question in the question set of insurance business is selected as a preset query question, and a context template corresponding to the preset query question is obtained.

[0068] S22, based on the preset query question and the context template, obtaining an example question, and obtaining a predicted probability distribution output by the large language model based on the example question;

[0069] Wherein, obtaining an example question based on the preset query question and the context template, and obtaining a predicted probability distribution output by a large language model based on the example question, includes:

[0070] Replace the placeholder in the context template with the preset query question, and use the replaced context template as an example question;

[0071] The example question is input into a preset large language model, and a predicted probability distribution output by the large language model based on the example question is obtained.

[0072] S23, obtaining an information entropy value corresponding to the example question according to the predicted probability distribution, and obtaining a reference question according to the information entropy value and a predefined acquisition method;

[0073] Exemplarily, obtaining the information entropy value corresponding to the example question according to the predicted probability distribution includes:

[0074] According to the predicted probability distribution and the calculation formula of the information entropy value, the information entropy value corresponding to the example question is obtained.

[0075] The calculation formula of information entropy value is as follows:

[0076] L(x)=-∑Xi×log 2 p(Xi);

[0077] Wherein, L(X) is the information entropy value of the Xth example question, Xi represents the i-th category in the predicted probability distribution output of the Xth example question, and p(Xi) is the probability of the i-th category in the predicted probability distribution output by the large language model based on the Xth example question.

[0078] For the sake of illustration, an example is given below:

[0079] For example, there are two sample questions, sample question A and sample question B;

[0080] The predicted probability distribution of the large language model based on the example question A output is as follows:

[0081] Category A: 0.9;

[0082] Category B: 0.1;

[0083] The predicted probability distribution of the large language model based on the example question B is as follows:

[0084] Category A: 0.2;

[0085] Category B: 0.8;

[0086] The information entropy value of example problem A is as follows:

[0087] L1=-(0.9×log 2 0.9+0.1×log 2 0.1)≈0.469;

[0088] The information entropy value of example problem B is as follows:

[0089] L2=-(0.2log20.2+0.8log20.8)≈0.722;

[0090] In this example, the information entropy value of example question B is higher, indicating that the large language model is more uncertain about the prediction of this example, and example question B contains more useful information or requires more attention.

[0091] When the preset value is 0.5, the information entropy value of example question B is higher than the preset value, and example question B is marked as a reference question.

[0092] S24, forming a set through a plurality of the reference questions;

[0093] The plurality of reference questions are combined into a set, including:

[0094] Obtaining a preset number corresponding to the preset query question;

[0095] A set is formed by a preset number of the reference questions.

[0096] The preset quantity is set by the user or by the system default and is not limited here.

[0097] For the sake of illustration, an example is given below:

[0098] For example, 1,000 different reference questions are stored together to form a set;

[0099] For example, 2,000 different reference questions are stored together to form a set;

[0100] For example, 10,000 different reference questions are stored together to form a collection.

[0101] S25, obtaining a vector of each of the reference questions in the set, obtaining a customer service conversation, obtaining a context content of the current query question in the customer service conversation, and obtaining a vector of the context content;

[0102] For the sake of illustration, an example is given below:

[0103] For example, the context of the current query question is: Is my car insurance policy, policy number: 123456789, currently valid? When does it expire?

[0104] The current query question is: Is it currently valid? When does it expire?

[0105] For the sake of illustration, an example is given below:

[0106] For example, the context of the current query question is: I submitted a medical insurance claim application last week, application number: A123456. What is the current claim progress? When can I expect to receive the compensation?

[0107] The current query question is: What is the current progress of the claim? When can I expect to receive the compensation?

[0108] S26, generating each reference vector according to the vector of each reference question, the vector of the context content and a predefined generation method, obtaining each category predicted by the large language model based on each reference vector, obtaining the number of votes for each category, and selecting the category with the most votes as the question category of the current query question.

[0109] For the sake of illustration, an example is given below:

[0110] For example, the context of the current query question is: Is my car insurance policy, policy number: 123456789, currently valid? When does it expire?

[0111] The current query question is: Is it currently valid? When does it expire?

[0112] The reference questions are reference question 1, reference question 2, and reference question 3;

[0113] The vector of reference question 1 and the vector of the context content are concatenated to generate reference vector 1, and reference vector 1 is input into the large language model to obtain the policy status query category predicted by the large language model based on reference vector 1;

[0114] splicing the vector of reference question 2 and the vector of the context content to generate reference vector 2, inputting reference vector 2 into the large language model, and obtaining the claim progress query category predicted by the large language model based on reference vector 2;

[0115] The vector of reference question 3 and the vector of the context content are concatenated to generate reference vector 3, and reference vector 3 is input into the large language model to obtain the policy status query category predicted by the large language model based on reference vector 3;

[0116] Therefore, the various categories are as follows: Policy status inquiry category, Claim progress inquiry category;

[0117] Count the votes for each category:

[0118] Policy status inquiry category: 2 tickets; Claim progress inquiry category: 1 ticket;

[0119] The category with the most votes is the policy status inquiry category, so the policy status inquiry category is selected as the question category for whether it is currently valid and when it expires.

[0120] Wherein, after generating each reference vector according to the vector of each reference question, the vector of the context content and a predefined generation method, obtaining each category predicted by the large language model based on each reference vector, obtaining the number of votes for each category, and selecting the category with the most votes as the question category of the current query question, the context learning method includes:

[0121] A solution corresponding to the problem category is obtained, and the solution is displayed in the customer service dialogue.

[0122] In the embodiment of the present invention, the beneficial effects lie in two aspects. On the one hand, according to the vectors of each of the reference questions, the vectors of the context content and the predefined generation method, each reference vector is generated, and each category predicted by the large language model based on each of the reference vectors is obtained, and the votes for each of the categories are obtained, and the category with the largest number of votes is selected as the question category of the current query question. Since manual acquisition is not required, the acquisition time of the text topic of the text to be processed is reduced, which is conducive to improving the acquisition efficiency of the text topic of the text to be processed. On the other hand, since the topic generation model will not be affected by manual intervention, it is conducive to improving the reliability of the acquired text topic of the text to be processed.

[0123] See also Figure 3 , Figure 3 yes Figure 1 A specific implementation flow diagram of step S23 is described in detail as follows:

[0124] S31, obtaining an information entropy value corresponding to the example question according to the predicted probability distribution, and determining whether the information entropy value is higher than a preset value;

[0125] Exemplarily, obtaining the information entropy value corresponding to the example question according to the predicted probability distribution includes:

[0126] According to the predicted probability distribution and the calculation formula of the information entropy value, the information entropy value corresponding to the example question is obtained.

[0127] The calculation formula of information entropy value is as follows:

[0128] L(x)=-∑Xi×log 2 p(Xi);

[0129] Wherein, L(X) is the information entropy value of the Xth example question, Xi represents the i-th category in the predicted probability distribution output of the Xth example question, and p(Xi) is the probability of the i-th category in the predicted probability distribution output by the large language model based on the Xth example question.

[0130] S32: When the information entropy value is higher than the preset value, the example question is marked as a reference question.

[0131] The information entropy value is used to describe the amount of information in the example problem. The larger the information entropy is, the more information the example problem contains, and the smaller the information entropy is, the less information the example problem contains.

[0132] In an embodiment of the present invention, when the information entropy value is higher than the preset value, the example question is marked as a reference question, so that a reference question with a higher amount of information than expected can be obtained.

[0133] See also Figure 4 , Figure 4 yes Figure 1 A specific implementation flow diagram of step S25 is described in detail as follows:

[0134] S41, extracting features from the semantic units of each of the reference questions to obtain vectors of each of the reference questions, connecting to a target system, and obtaining a customer service dialogue sent by the target system;

[0135] The target system includes one or a combination of financial system, technology system and insurance system.

[0136] For the sake of illustration, an example is given below:

[0137] Feature extraction is performed on the semantic unit of each of the reference questions to obtain a vector of each of the reference questions, and the financial system is connected to obtain the customer service dialogue sent by the financial system.

[0138] Feature extraction is performed on the semantic units of each of the reference questions to obtain the vectors of each of the reference questions, and the technology system is connected to obtain the customer service dialogue sent by the technology system.

[0139] Feature extraction is performed on the semantic unit of each of the reference questions to obtain a vector of each of the reference questions, and the insurance system is connected to obtain the customer service dialogue sent by the insurance system.

[0140] S42, obtaining the context content of the current query question in the customer service dialogue, performing feature extraction on the semantic units of the context content, and obtaining a vector of the context content.

[0141] Among them, the context vector can be used as a feature representation of the context content to distinguish different types of context content.

[0142] In an embodiment of the present invention, the first embedding vector is reconstructed according to the attention score to generate a second embedding vector corresponding to the semantic unit, which can focus more on important semantic units and improve the accuracy and efficiency of semantic unit screening.

[0143] See also Figure 5 , Figure 5 yes Figure 1 A specific implementation flow diagram of step S26 is described in detail as follows:

[0144] S51, concatenating the vectors of each of the reference questions and the vectors of the context content to generate each reference vector, inputting each reference vector into the large language model, and obtaining each category predicted by the large language model based on each of the reference vectors;

[0145] S52, voting on each of the categories, obtaining the number of votes for each category, and selecting the category with the largest number of votes as the question category of the current query question.

[0146] In an embodiment of the present invention, the category with the most votes is selected as the question category of the current query question. This can avoid relying on certain specific and possibly biased features, thereby reducing the prediction error that may be caused by a single reference vector. The application of this strategy allows us to not rely too much on a certain reference vector, but to comprehensively consider the opinions of multiple reference vectors, thereby improving the robustness and accuracy of contextual learning.

[0147] See also Figure 6 , Figure 6 is a schematic diagram of a context learning device in one embodiment of the present invention. Figure 6 As shown, the context learning device includes a first acquisition module 101, a second acquisition module 102, a third acquisition module 103, a composition module 104, a fourth acquisition module 105, and a generation module 106. The functional modules are described in detail as follows:

[0148] The first acquisition module 101 is used to acquire a preset query question and acquire a context template corresponding to the preset query question;

[0149] A second acquisition module 102 is used to acquire an example question based on the preset query question and the context template, and acquire a predicted probability distribution output by the large language model based on the example question;

[0150] A third acquisition module 103 is used to acquire the information entropy value corresponding to the example question according to the predicted probability distribution, and acquire the reference question according to the information entropy value and a predefined acquisition method;

[0151] A composition module 104 is used to form a set through a plurality of the reference questions;

[0152] A fourth acquisition module 105 is used to acquire a vector of each reference question in the set, acquire a customer service conversation, acquire a context content of a current query question in the customer service conversation, and acquire a vector of the context content;

[0153] The generation module 106 is used to generate each reference vector according to the vector of each reference question, the vector of the context content and a predefined generation method, obtain each category predicted by the large language model based on each reference vector, obtain the number of votes for each category, and select the category with the most votes as the question category of the current query question.

[0154] In one embodiment, the first acquisition module 102 includes:

[0155] A replacement subunit, used to replace the placeholder in the context template with the preset query question, and use the replaced context template as an example question;

[0156] The first acquisition subunit is used to input the example question into a preset large language model, and obtain the predicted probability distribution output by the large language model based on the example question.

[0157] In one embodiment, the third acquisition module 103 includes:

[0158] A judgment subunit, configured to obtain an information entropy value corresponding to the example question according to the predicted probability distribution, and to judge whether the information entropy value is higher than a preset value;

[0159] A marking subunit is used to mark the example question as a reference question when the information entropy value is higher than the preset value.

[0160] In one embodiment, the component module 104 includes:

[0161] A second acquisition subunit is used to acquire a preset number corresponding to the preset query question;

[0162] The composition subunit is used to form a set through a preset number of the reference questions.

[0163] In one embodiment, the fourth acquisition module 105 includes:

[0164] A first extraction subunit is used to extract features from the semantic units of each of the reference questions, obtain vectors of each of the reference questions, connect to the target system, and obtain the customer service dialogue sent by the target system;

[0165] The second extraction subunit is used to obtain the context content of the current query question in the customer service dialogue, perform feature extraction on the semantic unit of the context content, and obtain a vector of the context content.

[0166] In one embodiment, the generating module 106 includes:

[0167] An input subunit, used to concatenate the vectors of each of the reference questions and the vectors of the context content to generate each reference vector, input each reference vector into the large language model, and obtain each category predicted by the large language model based on each of the reference vectors;

[0168] The voting subunit is used to vote for each of the categories, obtain the number of votes for each category, and select the category with the largest number of votes as the question category of the current query question.

[0169] In one embodiment, the context learning device further includes:

[0170] A display module is used to obtain a solution corresponding to the problem category and display the solution in the customer service dialogue.

[0171] In the embodiment of the present invention, the beneficial effects lie in two aspects. On the one hand, according to the vectors of each of the reference questions, the vectors of the context content and the predefined generation method, each reference vector is generated, and each category predicted by the large language model based on each of the reference vectors is obtained, and the votes for each of the categories are obtained, and the category with the largest number of votes is selected as the question category of the current query question. Since manual acquisition is not required, the acquisition time of the text topic of the text to be processed is reduced, which is conducive to improving the acquisition efficiency of the text topic of the text to be processed. On the other hand, since the topic generation model will not be affected by manual intervention, it is conducive to improving the reliability of the acquired text topic of the text to be processed.

[0172] For the specific definition of the context learning device, please refer to the definition of the context learning method above, which will not be repeated here.

[0173] Each module in the above context learning device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.

[0174] See also Figure 7 , Figure 7is a schematic diagram of a computer device in one embodiment of the present invention. In one embodiment, a computer device is provided. The computer device may be a server. The internal structure diagram thereof may be as shown in FIG. Figure 7 The computer device includes a processor, a memory, a network interface and a database connected through a system bus.

[0175] The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile and / or volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external client through a network connection. When the computer program is executed by the processor, a function or step of a context learning method on the server side is implemented.

[0176] See also Figure 8 , Figure 8 is another structural diagram of a computer device in one embodiment of the present invention. In one embodiment, a computer device is provided. The computer device may be a client, and its internal structure diagram may be as shown in FIG. Figure 8 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external task database through a network connection. When the computer program is executed by the processor, it implements the functions or steps of a context learning method.

[0177] In one embodiment, a computer device is provided, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor.

[0178] It should be noted that the above functions or steps that can be implemented by the computer-readable storage medium or computer device can refer to the relevant descriptions on the server side and the client side in the aforementioned method embodiment. To avoid repetition, they will not be described one by one here.

[0179] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a graphics processing unit (GPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.

[0180] The above description and accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent possible changes only. Unless explicitly required, separate components and functions are optional, and the order of operation may vary. Parts and subsamples of some embodiments may be included in or replace parts and subsamples of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and claims, unless the context clearly indicates, the singular forms of "a", "an" and "the" are intended to include plural forms as well. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of listings containing one or more associated ones. In addition, when used in the present application, the term "comprise" and its variants "comprises" and / or comprising refer to the presence of a stated sub-sample, whole, step, operation, element, and / or component, but do not exclude the presence or addition of one or more other sub-samples, wholes, steps, operations, elements, components and / or groups of these. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the presence of other identical elements in the process, method or device comprising the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the various embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.

[0181] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. Technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present disclosure. Technicians can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0182] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units can be only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some sub-samples can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiment of the present disclosure may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.

[0183] The flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to the embodiment of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the 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. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and the block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.

Claims

1. A context learning method, characterized in that: include: Obtain a preset query question, and obtain a context template corresponding to the preset query question; Based on the preset query question and the context template, obtain an example question, and obtain a predicted probability distribution output by a large language model based on the example question; According to the predicted probability distribution, an information entropy value corresponding to the example question is obtained, and according to the information entropy value and a predefined acquisition method, a reference question is obtained; A set is formed by using a plurality of the reference questions; Obtaining a vector of each reference question in the set, obtaining a customer service conversation, obtaining context content of a current query question in the customer service conversation, and obtaining a vector of the context content; According to the vectors of each of the reference questions, the vector of the context content and a predefined generation method, each reference vector is generated, each category predicted by the large language model based on each of the reference vectors is obtained, the number of votes for each of the categories is obtained, and the category with the most votes is selected as the question category of the current query question.

2. The context learning method according to claim 1, characterized in that: The obtaining of an example question based on the preset query question and the context template, and obtaining a predicted probability distribution output by a large language model based on the example question, includes: Replace the placeholder in the context template with the preset query question, and use the replaced context template as an example question; The example question is input into a preset large language model, and a predicted probability distribution output by the large language model based on the example question is obtained.

3. The context learning method according to claim 1, characterized in that: The step of obtaining, according to the predicted probability distribution, an information entropy value corresponding to the example question, and obtaining a reference question according to the information entropy value and a predefined acquisition method, includes: According to the predicted probability distribution, obtaining the information entropy value corresponding to the example question, and determining whether the information entropy value is higher than a preset value; When the information entropy value is higher than the preset value, the example question is marked as a reference question.

4. The context learning method according to claim 1, characterized in that: The plurality of reference questions are used to form a set, including: Obtaining a preset number corresponding to the preset query question; A set is formed by a preset number of the reference questions.

5. The context learning method according to claim 1, characterized in that: The step of obtaining a vector of each reference question in the set, obtaining a customer service dialogue, obtaining context content of the current query question in the customer service dialogue, and obtaining a vector of the context content includes: Extract features from the semantic units of each of the reference questions to obtain vectors of each of the reference questions, connect to the target system, and obtain the customer service dialogue sent by the target system; The context content of the current query question in the customer service dialogue is obtained, and features of semantic units of the context content are extracted to obtain a vector of the context content.

6. The context learning method according to claim 1, characterized in that: The generating of each reference vector according to the vector of each reference question, the vector of the context content and a predefined generating method, obtaining each category predicted by the large language model based on each reference vector, obtaining the number of votes for each category, and selecting the category with the largest number of votes as the question category of the current query question includes: Concatenate the vectors of each reference question and the vectors of the context content to generate each reference vector, input each reference vector into the large language model, and obtain each category predicted by the large language model based on each reference vector; Voting is performed on each of the categories to obtain the number of votes for each category, and the category with the largest number of votes is selected as the question category of the current query question.

7. The context learning method according to claim 1, characterized in that: After generating each reference vector according to the vector of each reference question, the vector of the context content and a predefined generation method, obtaining each category predicted by the large language model based on each reference vector, obtaining the number of votes for each category, and selecting the category with the most votes as the question category of the current query question, the context learning method includes: A solution corresponding to the problem category is obtained, and the solution is displayed in the customer service dialogue.

8. A context learning device, characterized in that: include: A first acquisition module, used to acquire a preset query question and acquire a context template corresponding to the preset query question; A second acquisition module is used to acquire an example question based on the preset query question and the context template, and acquire a predicted probability distribution output by the large language model based on the example question; A third acquisition module is used to obtain the information entropy value corresponding to the example question according to the predicted probability distribution, and obtain the reference question according to the information entropy value and a predefined acquisition method; A composition module, used to form a set through a plurality of the reference questions; A fourth acquisition module is used to acquire the vector of each reference question in the set, acquire the customer service dialogue, acquire the context content of the current query question in the customer service dialogue, and acquire the vector of the context content; A generation module is used to generate each reference vector according to the vector of each reference question, the vector of the context content and a predefined generation method, obtain each category predicted by the large language model based on each reference vector, obtain the number of votes for each category, and select the category with the most votes as the question category of the current query question.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the context learning method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the context learning method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Intelligent customer service chat robot implementation method and system based on deep learning

    CN112527972A

  • Information processing method and device, storage medium and electronic equipment

    CN118535692A