Generative matching large model construction method, medium and equipment for customer service scenarios

Through the generative matching large model construction method for customer service scenarios, the functions of the large model are optimized in stages, using cross-domain corpora and customer service scenario data for pre-training and weak supervision training, and combining automatic annotation and manual annotation of data to solve the problems in the existing technology. It solves the problem of building large models, achieving rapid expansion and accurate migration, reducing costs and meeting a variety of business needs.

CN117709969BActive Publication Date: 2024-08-27SOUTH CHINA UNIV OF TECH +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311760197.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-20
Publication Date
2024-08-27
Estimated Expiration
2043-12-20

AI Technical Summary

Technical Problem

The construction of existing large-scale smart customer service models is difficult to adapt to engineering needs. The pseudo-label generation solution based on deep learning has limitations. The noise of pseudo-label data affects the training effect, and the single function cannot meet the rich business needs.

Method used

Adopting a generative matching large model construction method for customer service scenarios, the large model functions are gradually optimized in stages, including model setting, pre-training, domain migration and downstream fine-tuning. Cross-domain corpora and customer service scenario data are used for pre-training and weak supervision training. , combine automatic annotation and manual annotation data for data enhancement, and achieve rapid migration of business requirements through matching algorithms.

Benefits of technology

It achieves in-depth mining of large-scale customer service text data knowledge, has rapid expansion and accurate migration capabilities, reduces development and annotation costs, avoids the model learning erroneous knowledge from noisy data, and meets a variety of business needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117709969B
    Figure CN117709969B
Patent Text Reader

Abstract

This invention provides a method, medium, and device for constructing a generative matching large-scale model for customer service scenarios. The method includes a model setting stage, a pre-training stage, a domain transfer stage, and a downstream fine-tuning stage, executed sequentially. The pre-training stage involves using text from a cross-domain Chinese corpus as samples to pre-train the large-scale model base of the intelligent customer service model. The domain transfer stage involves using customer service scenario data as samples to perform weakly supervised training on the large-scale model base of the intelligent customer service model. The downstream fine-tuning stage involves using manually labeled data from customer service scenarios as samples to train the intelligent customer service model to learn relevant knowledge for new businesses. This method progressively implements and optimizes the functionality of the large-scale model in stages, enabling it to deeply mine knowledge from large-scale customer service text data, while also possessing the ability to accurately transfer and rapidly expand upon new business requirements and changing business content.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer model construction, and more specifically, to a method, medium and device for constructing a generative matching large model for customer service scenarios. Background Art

[0002] The smart customer service big model is an application for the customer service industry developed on the basis of large-scale knowledge processing. In the existing customer service scenarios, the core function of smart customer service is human-computer dialogue, which is currently mainly achieved through natural language generation big models. After completing the pre-training of the big model through corpora in different fields, the system converts the received human language into sequence data and inputs it into the big model. After a series of working mechanisms to capture the information in the dialogue, a series of judgment logic is also required based on human experience and business rules to filter out invalid information. The final output is converted into natural language to achieve human-computer dialogue.

[0003] However, there are the following technical problems when building the existing intelligent customer service model:

[0004] (I) Conventional large-scale modeling solutions are difficult to adapt to engineering needs:

[0005] Conventional large-model modeling solutions have extremely high requirements for the scale and quality of labeled data; at the same time, in the process of adapting to different downstream tasks, the original model architecture needs to be expanded and the original parameters need to be fine-tuned. Secondary development often brings non-negligible additional workload. Specifically in the smart customer service scenario, more complex actual situations still need to be solved. For example, in user calls and customer service conversations, the problems reflected by customers usually involve a wide variety of businesses, and there are also situations where business content is constantly iterated and updated. Conventional large-model pre-training plus fine-tuning solutions are difficult to adapt to the update frequency of specific businesses.

[0006] (II) The pseudo-label generation solution based on deep learning has limitations in customer service scenarios:

[0007] Customer service conversation scenarios involve a variety of complex business issues. Customer service personnel with certain professional knowledge and work experience are required to complete the annotation of conversation texts well. Pre-training of large models often requires large-scale annotated data to achieve satisfactory results. Existing pseudo-label generation solutions based on deep learning require the construction of a deep learning model separately, and only after training with a certain amount of annotated data can a good generation effect be achieved, which will undoubtedly bring additional development and annotation costs. For large models that rely on a large amount of training data to ensure high accuracy, how to make full use of manually annotated information, reduce the workload of annotation, and fully combine human experience with learning rules has become a key issue that needs to be solved urgently.

[0008] (III) The large amount of noise contained in pseudo-label data will affect the training effect of the smart customer service model:

[0009] Although the automatic annotation method of generating pseudo-labeled data through deep learning models has become a mainstream data enhancement method at this stage, compared with manual annotation, the former is difficult to guarantee the quality of the labeled data and often contains a certain amount of noise. Therefore, the data set in the real scene can be divided into a small amount of manually annotated precision data and a large amount of pseudo-labeled data with noise. At this time, using the entire data set for large model training actually takes noisy data as the main learning object, and the method of minimizing the overall loss function may not achieve the expected effect. How to prevent the model from learning wrong knowledge from a large amount of noisy data is still an issue that needs to be focused on.

[0010] (IV) The existing smart customer service model has a single function and cannot meet the diverse business needs:

[0011] The core functions of the existing intelligent customer service model solutions are limited to human-computer dialogue, and do not involve attribution analysis and other functions that can truly assist customer service staff in handling incoming calls. The technical architecture of the model usually uses a generative model combined with various rules to respond to user questions, and the final output is still in the form of dialogue text. There is a gap between the output results and actual business needs. Summary of the invention

[0012] In order to overcome the shortcomings and deficiencies in the prior art, the purpose of the present invention is to provide a generative matching large model construction method, medium and equipment for customer service scenarios; this method gradually realizes and optimizes the functions of the large model in stages, so that it has the ability to deeply mine large-scale customer service text data knowledge, and at the same time has the ability to accurately migrate and quickly expand new business needs and changing business content; it can not only adapt to different computing resources and data scales, strengthen managers' control over the algorithm development process, but also provide targeted solutions for constantly updated business needs.

[0013] In order to achieve the above object, the present invention is implemented by the following technical solutions: a generative matching large model construction method for customer service scenarios, including a model setting stage, a pre-training stage, a domain migration stage and a downstream fine-tuning stage executed in sequence;

[0014] The model setting stage refers to: setting a smart customer service big model based on the Transformer architecture; the smart customer service big model includes a big model base and a mapping module connected to the output end of the big model base;

[0015] The pre-training stage refers to: using the text of the cross-domain Chinese corpus as samples to pre-train the big model base of the smart customer service big model, so that the smart customer service big model has strong generalization ability;

[0016] The domain migration phase refers to: using customer service scenario data as samples; using the precise labeled data in the customer service scenario data and the pseudo-label data obtained through automatic annotation to perform weak supervision training on the big model base of the smart customer service big model, so that the smart customer service big model has strong domain knowledge;

[0017] The downstream fine-tuning stage refers to: using manually labeled data of customer service scenarios as samples; splicing the samples with corresponding business requirement prompt templates according to business needs to obtain task data; and using the task data to train the smart customer service big model to learn relevant knowledge of the new business.

[0018] Preferably, the domain migration stage includes the following steps:

[0019] X1. Collect customer service scenario data; classify the customer service scenario data into user information 1, product information, and customer service dialogue; the customer service dialogue includes a voice transcribed dialogue text 1;

[0020] The dialogue text 1 includes the dialogue text 1 with labels and the dialogue text 1 without labels; the number of the dialogue text 1 with labels is greater than the number of the dialogue text 1 without labels;

[0021] X2. When the dialogue text 1 is a labeled dialogue text 1, the refined labeled data is formed in the form of "dialogue text-label";

[0022] When the dialogue text 1 is an unlabeled dialogue text 1, user information 1 corresponding to the dialogue text 1 is obtained; according to the context template, the user information 1 is converted into a text description, and is spliced ​​with the dialogue text 1 to obtain a dialogue spliced ​​text; the dialogue spliced ​​text is automatically annotated to obtain a summary corresponding to the dialogue text 1; the dialogue text 1 and the summary are combined to form pseudo-label data in the form of "dialogue text-summary" to achieve data enhancement;

[0023] X3. Input the label data and pseudo-label data into the big model base of the smart customer service big model respectively; in a forward propagation process, calculate the loss gradient of the label data and pseudo-label data, and compare the similarity of the loss gradient:

[0024] If the loss gradient direction is consistent, the training is considered effective, and then backpropagation is performed to complete weakly supervised training;

[0025] Otherwise, the loss gradient of the pseudo-label data is set to zero, and then backpropagation is performed to complete weakly supervised training.

[0026] Preferably, the step X2, automatically annotating the concatenated dialogue text to obtain a summary corresponding to the dialogue text, means that it includes the following sub-steps:

[0027] X21, initialize summary set;

[0028] X22, split the dialogue concatenation text into n sentences;

[0029] X23, concatenate each sentence with all the sentences in the summary set to obtain a concatenated summary sentence;

[0030] X24, respectively calculate the maximum common subsequence length L of each summary concatenation sentence and the remaining sentences of the dialogue concatenation text; remove the sentence corresponding to the maximum L from the dialogue concatenation text and store it in the summary set;

[0031] X25. Determine whether the number of sentences s in the summary set reaches the set number of sentences: if so, set the current summary set as the summary of the dialogue text 1; otherwise, jump to sub-step X22 and continue to increase the number of sentences s in the summary set.

[0032] Preferably, the context template includes the content of user information one and the content of dialogue text one; the content of user information one includes call balance, package name, package fee, and package traffic.

[0033] Preferably, the downstream fine-tuning stage comprises the following sub-steps:

[0034] Y1. Collecting manually annotated data of customer service scenarios; the manually annotated data includes a labeled dialogue text 2; obtaining user information 2 corresponding to the dialogue text 2; setting a business requirement prompt template according to business requirements; converting the user information 2 into a text description according to the context template, and splicing it with the dialogue text 2, and then splicing it with the business requirement prompt template to obtain task data;

[0035] Y2. Set the candidate tags of the candidate tag list;

[0036] Y3. Input the task data and candidate labels into the big model base of the smart customer service big model respectively to obtain the generated information sentence vector and the candidate label sentence vector; calculate the similarity between the generated information sentence vector and each candidate label sentence vector respectively through the matching algorithm; take the candidate label corresponding to the candidate label sentence vector with the highest similarity as the predicted label;

[0037] Y4. Calculate the loss function based on the predicted label and actual label of the second dialogue text; when the value of the loss function converges or the number of iterations reaches the set number, the downstream fine-tuning phase ends, otherwise adjust the parameters of the smart customer service model and return to step Y3 to continue training.

[0038] Preferably, the execution frequency of the pre-training stage is less than the execution frequency of the domain transfer stage and less than the execution frequency of the downstream fine-tuning stage.

[0039] Preferably, in the smart customer service big model, the big model base includes an encoder and a decoder; the mapping module includes a number of fully connected layers connected in sequence.

[0040] A readable storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the method for constructing a generative matching large model for customer service scenarios.

[0041] A computer device includes a processor and a memory for storing a program executable by the processor. When the processor executes the program stored in the memory, the method for constructing a generative matching large model for customer service scenarios is implemented.

[0042] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0043] (I) According to the actual customer service work content and customer service data characteristics, the modeling process of the smart customer service big model is broken down into four stages: model setting, pre-training, domain migration, and downstream fine-tuning. The functions of the big model are gradually realized and optimized in stages, so that it has the ability to deeply mine large-scale customer service text data knowledge, and at the same time has the ability to accurately migrate and quickly expand new business needs and changing business content; in the multi-stage modeling method, the pre-training stage effectively solves the cold start problem of customer service dialogues by learning open domain public corpus; the domain migration stage mines a large amount of effective information of unlabeled dialogue texts through a small amount of labeled data; the downstream fine-tuning stage uses matching algorithms to quickly and accurately migrate the capabilities of the big model to specific businesses, avoiding resource consumption for secondary development. The staged modeling method accurately matches the entire process of customer service work, which can not only adapt to different computing resources and data scales, strengthen managers' control over the algorithm development process, but also provide targeted solutions for constantly updated business needs.

[0044] (2) Adopting an automatic annotation algorithm for dialogue text, extracting summary information from each dialogue, constructing a corpus in the form of "original text-summary", and using massive amounts of original dialogue data to generate pseudo-labeled data required for large-scale model domain transfer training; compared with the solution of independently building a deep learning model to generate pseudo-labeled data, the automatic annotation algorithm pays more attention to the characteristics of the data itself, and mines the language patterns in specific scenarios through statistical analysis of the distribution characteristics of real data. No additional annotated data is required, which greatly reduces the development workload and computing power consumption. It can make full use of the existing massive original dialogue data to generate a large amount of pseudo-labeled data for dialogue texts in a short period of time, greatly reducing the time and labor costs of annotation work.

[0045] (III) A weakly supervised pre-learning method based on data enhancement is adopted. On the basis of a large amount of pseudo-labeled data generated by the automatic labeling algorithm, a small amount of manually labeled data is combined to achieve data enhancement in the customer service scenario through weak supervision. The manually labeled dialogue text contains language patterns unique to the customer service scenario and can be regarded as strong supervision data. The automatic labeling algorithm can obtain large-scale pseudo-labeled data at a low cost, but the quality is lower than that of manually labeled data, which can be regarded as weakly supervised data containing noise. The weakly supervised training method proposed in the present invention uses a larger amount of noisy data as the main learning object of the model when the quality of the training data set is uneven. It can mine effective information from a large amount of noisy data based on a small amount of strongly supervised data to improve the model effect.

[0046] (IV) Adopting a matching algorithm based on a generative big model, using the annotated data of a specific business scenario to fine-tune the smart customer service big model, on this basis, input the business data and conversation text into the big model for encoding at the same time, and finally realize the functions required by the specific business scenario through feature matching. The matching algorithm, by setting different prompt templates to train and guide the big model's generation capabilities in different application scenarios, and using feature matching to connect the big model's generation capabilities and business needs, has good adaptability to the constantly iterating business content and newly added business scenarios, avoiding the cost of secondary development. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 It is a flow chart of the method for constructing a generative matching large model for customer service scenarios of the present invention;

[0048] Figure 2 It is a schematic diagram of the pre-training phase of the generative matching large model construction method for customer service scenarios of the present invention;

[0049] Figure 3 It is a flow chart of the automatic annotation algorithm of the method for building a generative matching large model for customer service scenarios of the present invention;

[0050] Figure 4 It is a weakly supervised training flow chart of the generative matching large model construction method for customer service scenarios of the present invention;

[0051] Figure 5 It is a schematic diagram of an encoder and a decoder in the downstream fine-tuning stage of the generative matching large model construction method for customer service scenarios of the present invention;

[0052] Figure 6 It is a schematic diagram of sentence vector mapping of the generative matching large model construction method for customer service scenarios of the present invention. DETAILED DESCRIPTION

[0053] The present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0054] Embodiment 1

[0055] This embodiment provides a generative matching large model construction method for customer service scenarios, including a model setting phase, a pre-training phase, a domain migration phase, and a downstream fine-tuning phase, which are performed in sequence. Figure 1 shown.

[0056] The application paradigm of existing large models is to perform fine-tuning based on pre-training. However, in real-life application scenarios, human conversations are complex and ambiguous, and simply applying the paradigm cannot produce satisfactory results. Therefore, the present invention analyzes the work content and data characteristics of customer service scenarios and summarizes a set of modeling methods suitable for smart customer service scenarios.

[0057] The model setting stage refers to: setting a smart customer service big model based on the Transformer architecture; the smart customer service big model includes a big model base and a mapping module including several fully connected layers; the big model base includes an encoder and a decoder.

[0058] The pre-training stage refers to: using the text of the cross-domain Chinese corpus as samples to pre-train the big model base of the smart customer service big model, so that the smart customer service big model has strong generalization ability. The pre-training stage is domain-independent and task-independent, and the training of the big model base is completed using the open domain Chinese corpus.

[0059] In the pre-training stage, the encoder converts the input text into sequence data, extracts high-order semantic information such as grammar, part of speech, and entity, and maps it into feature vectors; the decoder remaps the feature vector output by the encoder into a data sequence, and continuously optimizes the model parameters through the supervision signal provided by the data label. Based on the massive Chinese corpus, the data distribution characteristics of the Chinese language are learned through rich pre-training tasks such as masked word restoration, topic classification, and abstract extraction to construct a Chinese semantic space. Therefore, it is necessary to collect and clean data from multiple data sources, build a cross-domain Chinese corpus, and transform data according to different task templates. The large intelligent customer service model output in the pre-training stage has strong Chinese semantic understanding and generalization capabilities. The training method in the pre-training stage can adopt existing technologies.

[0060] The domain migration stage refers to: using customer service scenario data as samples; using the precise labeled data in the customer service scenario data and the pseudo-label data obtained through automatic annotation to perform weakly supervised training on the big model base of the smart customer service big model, so that the smart customer service big model has strong domain knowledge.

[0061] The downstream fine-tuning stage refers to: using manually labeled data of customer service scenarios as samples; splicing the samples with corresponding business requirement prompt templates according to business needs to obtain task data; and using the task data to train the smart customer service big model to learn relevant knowledge of the new business.

[0062] Specifically, in the pre-training stage, the encoder converts the input text into sequence data, extracts high-level semantic information such as grammar, part of speech, and entity from the sequence data, and maps it into feature vectors; the decoder remaps the feature vector output by the encoder into a data sequence, and continuously optimizes the model parameters through the supervision signal provided by the data label, such as Figure 2 shown.

[0063] The core of the domain migration stage is to use data from customer service scenarios to realize knowledge migration of large models in vertical fields.

[0064] The domain migration phase includes the following steps:

[0065] X1. Collect customer service scenario data; classify customer service scenario data into user information, product information, and customer service conversations.

[0066] Among them, the content of user information 1 includes information such as call balance, package name, package rate, package traffic, as well as recent self-service operations, phone consultations, and complaints; product information includes detailed content of various packages and services, such as campus packages and their fees, free call duration, directional traffic and other package contents; customer service conversations include voice-transcribed conversation text 1, as well as regular manual sampling records (one conversation text corresponds to one manual summary sentence).

[0067] User information and product information can provide key information for conversation intent recognition. Customer service conversations reflect the process of analyzing and solving problems based on user information and product information, and are the main learning objects of the smart customer service model.

[0068] The dialogue text 1 includes the dialogue text 1 with labels and the dialogue text 1 without labels; the number of the dialogue text 1 with labels is greater than the number of the dialogue text 1 without labels;

[0069] The labeled dialogue text is used as the precise labeled data; the unlabeled dialogue text is automatically annotated to convert the unlabeled dialogue text into pseudo-labeled data.

[0070] X2. When the dialogue text 1 is a labeled dialogue text 1, the refined labeled data is formed in the form of "dialogue text-label";

[0071] When the conversation text 1 is an unlabeled conversation text 1, in order to enrich the context of the current conversation, each conversation text 1 needs to be matched with user information 1; the present invention obtains user information 1 corresponding to the conversation text 1; according to the context template, the user information 1 is converted into a text description, and is spliced ​​with the conversation text 1 to obtain a conversation splicing text. The context template includes the content of user information 1 and the content of conversation text 1; the content of user information 1 includes call balance, package name, package fee, and package traffic. Assume that the context template is as shown in Table 1,

[0072] Table 1 Context template

[0073] Fields content Phone balance 20 Yuan Package Name Campus Scholar Package Package Rates 29 yuan / month Package traffic Domestic general traffic 30G, directional traffic 50G Conversation content Hello, my data package is not enough. Is there a larger data package? It would be best if...

[0074] The spliced ​​text of the conversation is: The current user's phone balance is (20 yuan), the package used is (campus academic package), the package fee is (29 yuan per month), including traffic (30G domestic general traffic, 50G directional traffic), and the current conversation content is (Hello, my package traffic is not enough, is there a larger traffic package, preferably...).

[0075] The concatenated dialogue text is automatically annotated to obtain the summary corresponding to the dialogue text; the dialogue text and the summary are combined to form pseudo-label data in the form of "dialogue text-summary" to achieve data enhancement. Specifically, Figure 3 As shown, it includes the following steps:

[0076] X21, initialize summary set;

[0077] X22, split the dialogue concatenation text into n sentences;

[0078] X23, concatenate each sentence with all the sentences in the summary set to obtain a concatenated summary sentence;

[0079] X24, respectively calculate the maximum common subsequence length L of each summary concatenation sentence and the remaining sentences of the dialogue concatenation text; remove the sentence corresponding to the maximum L from the dialogue concatenation text and store it in the summary set;

[0080] X25. Determine whether the number of sentences s in the summary set reaches the set number of sentences: if so, set the current summary set as the summary of the dialogue text 1; otherwise, jump to sub-step X22 and continue to increase the number of sentences s in the summary set.

[0081] X3. Input the label data and pseudo-label data into the big model base of the smart customer service big model respectively to perform weak supervision training; weak supervision training means: Figure 4 As shown in Figure 1, during a forward propagation process, the loss gradients of the labeled data and the pseudo-labeled data are calculated, and the similarity of the loss gradients is compared:

[0082] If the loss gradient direction is consistent, it is determined that the optimization direction of the training data is consistent with the optimization direction of the clean data, and the training is effective. Then backpropagation is performed to complete weakly supervised training;

[0083] Otherwise, it is determined that noise affects the clean data training, and the loss gradient of the pseudo-label data is set to zero, followed by backpropagation to complete the weakly supervised training.

[0084] The goal of the downstream fine-tuning stage is to provide solutions for different business needs. The intelligent customer service model learns relevant knowledge of new business from a small amount of manually labeled data to improve the performance of specific tasks.

[0085] The downstream fine-tuning stage includes the following steps:

[0086] Y1. Collecting manually annotated data of customer service scenarios; the manually annotated data includes a labeled dialogue text 2; obtaining user information 2 corresponding to the dialogue text 2; setting a business requirement prompt template according to business requirements; converting the user information 2 into a text description according to the context template, and splicing it with the dialogue text 2, and then splicing it with the business requirement prompt template to obtain task data;

[0087] As an important function in the smart customer service scenario, user conversation attribution analysis can provide key analysis results for enterprises, assist customer service staff in timely discovering and solving problems, and ultimately achieve the goal of improving user satisfaction. This embodiment takes user conversation attribution analysis as an example to illustrate the work content of the downstream fine-tuning stage; attribution analysis refers to the customer service staff classifying the current conversation into specific services or products based on the user's calls and conversation content in combination with existing information. If you need to analyze which products are the most popular from user calls and conversations within a certain time period, you can build a product attribution prompt template; if you need to locate the causes of user complaints and product failures, you can build a complaint attribution prompt template; for other business needs, different types of prompt templates can be built according to the characteristics of business data to provide auxiliary information for the input data of the smart customer service big model.

[0088] When the business demand is product attribution, the content of the business demand prompt template is: "What product does the current conversation belong to?"; when the business demand is complaint attribution, the content of the business demand prompt template is: "What is the complaint content of the current conversation?"

[0089] Taking complaint attribution as an example, the task data is:

[0090] "The current user's phone balance is (20 yuan), the package used is (campus master package), the package fee is (29 yuan per month), including data (30G domestic general data, 50G directional data), the current conversation content is (Hello, my package data is not enough, is there a larger data package, preferably...). What is the complaint content of the current conversation?"

[0091] Y2. Query related products and activities from the business system based on keywords as candidate tags and save them to the candidate tag list;

[0092] Y3. Input the task data into the encoder of the smart customer service model, and the decoder of the smart customer service model outputs the decoder generation information; input the decoder generation information into the mapping module of the smart customer service model, and obtain the generated information sentence vector after mapping by the multi-layer fully connected layer of the mapping module, such as Figure 5 As shown; the candidate tags are input into the intelligent customer service model to obtain the candidate tag sentence vector;

[0093] Based on the attention mechanism, the encoder deeply mines the key information of the input text, such as part of speech, grammar, context, contextual association, and relative position, and encodes it into an implicit feature vector as the input of the decoder. The decoder is responsible for reconstructing the implicit feature vector into the label of the input text. Through the encoding-decoding workflow, the language patterns and contextual common sense in customer service scenarios are mined from large-scale "text-label" sample pairs.

[0094] The purpose of sentence vector mapping is to input the task data and candidate label text into the large model encoding at the same time and perform similarity matching to achieve efficient matching of task data and labels. This part requires building a mapping module containing multiple fully connected layers after the decoder to map the generated sentences of the decoder into sentence vectors of fixed length.

[0095] The matching algorithm is used to calculate the cosine similarity between the generated information sentence vector and each candidate label sentence vector; the candidate label corresponding to the candidate label sentence vector with the highest similarity is used as the predicted label, such as Figure 6 shown.

[0096] Y4. Calculate the loss function based on the predicted label and actual label of the second dialogue text; when the value of the loss function converges or the number of iterations reaches the set number, the downstream fine-tuning phase ends, otherwise adjust the parameters of the smart customer service model and return to step Y3 to continue training.

[0097] Embodiment 2

[0098] This embodiment provides a readable storage medium, wherein the readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the method for constructing a generative matching large model for customer service scenarios described in Embodiment 1.

[0099] Embodiment 3

[0100] The present embodiment provides a computer device, including a processor and a memory for storing a program executable by the processor. When the processor executes the program stored in the memory, the method for constructing a generative matching large model for customer service scenarios described in the first embodiment is implemented.

[0101] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.

Claims

1. A generative matching large model construction method for customer service scenarios, characterized by: It includes the model setting phase, pre-training phase, domain transfer phase and downstream fine-tuning phase which are executed sequentially; The model setting stage refers to: setting a smart customer service big model based on the Transformer architecture; the smart customer service big model includes a big model base and a mapping module connected to the output end of the big model base; The pre-training stage refers to: using the text of the cross-domain Chinese corpus as samples to pre-train the big model base of the smart customer service big model, so that the smart customer service big model has strong generalization ability; The domain migration phase refers to: using customer service scenario data as samples; using the precise labeled data in the customer service scenario data and the pseudo-label data obtained through automatic annotation to perform weak supervision training on the big model base of the smart customer service big model, so that the smart customer service big model has strong domain knowledge; The downstream fine-tuning stage refers to: using manually labeled data from customer service scenarios as samples; Samples are spliced ​​into corresponding business demand prompt templates according to business needs to obtain task data; the task data is used to train the smart customer service model to learn relevant knowledge of new business; The domain migration phase includes the following steps: X1. Collect customer service scenario data; classify the customer service scenario data into user information 1, product information, and customer service dialogue; the customer service dialogue includes a voice transcribed dialogue text 1; The dialogue text 1 includes the dialogue text 1 with labels and the dialogue text 1 without labels; the number of the dialogue text 1 with labels is greater than the number of the dialogue text 1 without labels; X2. When the dialogue text 1 is a dialogue text 1 with a label, the refined label data is formed in the form of "dialogue text-label"; When the dialogue text 1 is an unlabeled dialogue text 1, user information 1 corresponding to the dialogue text 1 is obtained; according to the context template, the user information 1 is converted into a text description, and is spliced ​​with the dialogue text 1 to obtain a dialogue spliced ​​text; the dialogue spliced ​​text is automatically annotated to obtain a summary corresponding to the dialogue text 1; the dialogue text 1 and the summary are combined to form pseudo-label data in the form of "dialogue text-summary" to achieve data enhancement; X3. Input the label data and pseudo-label data into the big model base of the smart customer service big model respectively; in a forward propagation process, calculate the loss gradient of the label data and pseudo-label data, and compare the similarity of the loss gradient: If the loss gradient direction is consistent, the training is considered effective, and then backpropagation is performed to complete weakly supervised training; Otherwise, the loss gradient of the pseudo-label data is set to zero, and then backpropagation is performed to complete weakly supervised training; The downstream fine-tuning stage includes the following steps: Y1. Collect manually labeled data from customer service scenarios; The manually labeled data includes a labeled dialogue text 2; obtaining user information 2 corresponding to the dialogue text 2; setting a business requirement prompt template according to business requirements; converting the user information 2 into a text description according to the context template, and splicing it with the dialogue text 2, and then splicing it with the business requirement prompt template to obtain task data; Y2. Set the candidate tags of the candidate tag list; Y3. Input the task data and candidate labels into the big model base of the smart customer service big model respectively to obtain the generated information sentence vector and the candidate label sentence vector; calculate the similarity between the generated information sentence vector and each candidate label sentence vector respectively through the matching algorithm; take the candidate label corresponding to the candidate label sentence vector with the highest similarity as the predicted label; Y4. Calculate the loss function based on the predicted label and actual label of the second dialogue text; when the value of the loss function converges or the number of iterations reaches the set number, the downstream fine-tuning phase ends, otherwise adjust the parameters of the smart customer service model and return to step Y3 to continue training.

2. The method for constructing a generative matching large model for customer service scenarios according to claim 1 is characterized in that: The step X2, automatically annotating the concatenated dialogue text to obtain a summary corresponding to the dialogue text, means that it includes the following sub-steps: X21, initialize summary set; X22, split the dialogue concatenation text into n sentences; X23, concatenate each sentence with all the sentences in the summary set to obtain a concatenated summary sentence; X24, respectively calculate the maximum common subsequence length L of each summary concatenation sentence and the remaining sentences of the dialogue concatenation text; remove the sentence corresponding to the maximum L from the dialogue concatenation text and store it in the summary set; X25. Determine whether the number of sentences s in the summary set reaches the set number of sentences: if so, set the current summary set as the summary of the dialogue text 1; otherwise, jump to sub-step X22 and continue to increase the number of sentences s in the summary set.

3. The method for constructing a generative matching large model for customer service scenarios according to claim 1 is characterized in that: The context template includes the content of user information one and the content of dialogue text one; the content of user information one includes call balance, package name, package fee, and package traffic.

4. The method for constructing a generative matching large model for customer service scenarios according to claim 1 is characterized in that: The execution frequency of the pre-training stage is less than the execution frequency of the domain transfer stage and less than the execution frequency of the downstream fine-tuning stage.

5. The method for constructing a generative matching large model for customer service scenarios according to claim 1 is characterized in that: In the smart customer service big model, the big model base includes an encoder and a decoder; the mapping module includes a number of fully connected layers connected in sequence.

6. A readable storage medium, characterized in that: The storage medium stores a computer program, which, when executed by a processor, enables the processor to execute the generative matching large model construction method for customer service scenarios according to any one of claims 1 to 5.

7. A computer device comprising a processor and a memory for storing a program executable by the processor, characterized in that: When the processor executes the program stored in the memory, the generative matching large model construction method for customer service scenarios described in any one of claims 1-5 is implemented.