Electric power customer service intelligent question-answering method based on large semantic model and related device
Through the intelligent question-and-answer method of power customer service based on semantic big models, the power customer service semantic big model of Transformer architecture is constructed and pre-trained and fine-tuned. Combined with human feedback reinforcement learning of optimized value functions, a lot of manpower and time are solved in the existing technology. The problem of this has achieved efficient and personalized intelligent Q&A service for power customer service.
Patent Information
- Application Number
- CN202411469649.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-21
- Publication Date
- 2025-02-14
AI Technical Summary
The existing intelligent Q&A technology of power customer service consumes a lot of manpower and time, the model reuse frequency is low, the degree of knowledge correlation is shallow, and the business adaptation is difficult, so it is impossible to achieve large-scale popularization.
Using the intelligent question-and-answer method of power customer service based on semantic big models, the power customer service semantic big model of Transformer architecture is constructed by introducing relative position coding information, large-scale data set pre-training and instruction fine-tuning, combined with human feedback reinforcement learning of optimized value functions, constructed Electric Power Customer Service Intelligent Q&A Big Model.
It improves the accuracy and efficiency of intelligent Q&A of power customer service, reduces labor and time costs, achieves a deep understanding of power customer service knowledge and personalized services, and improves user experience and service quality.
Smart Images

Figure CN119441398A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electric power marketing customer service question and answer, and in particular to an electric power customer service intelligent question and answer method based on a semantic big model and related devices. Background Art
[0002] Semantic big models refer to deep learning models that are mainly based on Transformer structures and trained on a large amount of text data. The number of parameters reaches tens of billions or even hundreds of billions. They can understand and generate natural language texts and handle various types of natural language tasks. This type of big model is characterized by large parameter scale and strong generalization ability. It can greatly reduce the threshold for large-scale application in the industry and has become the main direction of global artificial intelligence technology development. Electric power customer service business is an important part of electric power marketing. It is a strategic link for realizing the interconnection between energy intelligence and user needs, and can lay a solid foundation for the intelligent transformation and upgrading of energy services. As a technology based on natural language understanding and reasoning, intelligent question and answer also shows great application potential in the field of electric power customer service. However, the research on intelligent question and answer of electric power customer service based on semantic big models is still in its infancy. Business-specific models and manual services such as online agents, telephone call services, and conversation summaries still dominate the mainstream. These methods consume a lot of manpower and time, and cannot be popularized on a large scale due to problems such as low frequency of model reuse, shallow knowledge association, and difficulty in business adaptation. Summary of the invention
[0003] The purpose of the embodiments of the present invention is to provide an intelligent question-answering method and related devices for electric power customer service based on a large semantic model, so as to solve the problems existing in the existing intelligent question-answering technology for electric power customer service, such as consuming a lot of manpower and time, low frequency of model reuse, shallow degree of knowledge association, and great difficulty in business adaptation.
[0004] In order to achieve the above purpose, the embodiment of the present invention provides the following technical solutions: According to a first aspect of an embodiment of the present invention, an embodiment of the present invention provides an intelligent question-answering method for electric customer service based on a semantic big model, the method comprising: Get questions from electricity users; Process the questions based on the intelligent question-answering model of power customer service and output responses to the questions asked by power users; The power customer service intelligent question and answer model is constructed through the following steps: By introducing relative position encoding information, a large-scale semantic model of power customer service is constructed based on the transformer model; a large-scale data set is constructed to pre-train the large-scale semantic model of power customer service on a fixed context length to obtain the pre-trained large-scale semantic model of power customer service; The pre-trained electric customer service semantic big model is improved by improving the relative position encoding to obtain the improved electric customer service semantic big model; a command dataset in the field of electric customer service is constructed, and the improved electric customer service semantic big model is fine-tuned to obtain the electric customer service intelligent question and answer big model.
[0005] Furthermore, in the step of constructing a large semantic model of electric customer service based on the transformer model Transformer by introducing relative position encoding information: The large semantic model of electric customer service is based on the Transformer architecture, which is divided into an embedding layer and a multi-layer decoder. Each decoder layer contains two multi-head attention layers and a feedforward network layer. The step of introducing relative position coding information comprises: Each word in the input sequence is converted into a word embedding vector through the embedding layer of the model, and each word embedding vector is rotated and position encoded before being processed by the multi-head attention layer; For a given length The corresponding embedding representation of the input sequence is:
[0006] in Indicates The corresponding word dimensional word embedding vector; For word embedding vector with position information m , the rotation position encoding method is expressed as:
[0007] in, .
[0008] Furthermore, the construction of a large-scale data set, pre-training the electric customer service semantic model on a fixed context length, and obtaining the pre-trained electric customer service semantic model specifically includes: The constructed electric power customer service semantic big model is used as the basic model to collect large-scale data in the electric power field and form a large-scale electric power corpus data set. The large-scale data in the electric power field includes electric power industry standards, technical reports, regulations, basic electric power theory, customer service knowledge base, and customer service business system data. A large-scale electric power corpus dataset is introduced into the basic model, and the idea of transfer learning is used to pre-train the basic model. A fixed context length is used during pre-training to obtain a large semantic model of electric power customer service after pre-training.
[0009] Furthermore, the step of improving the pre-trained electric customer service semantic big model by improving the relative position coding to obtain the improved electric customer service semantic big model specifically includes: A low-dimensional interpolation method that considers high-frequency loss and relative local distance is introduced to improve rotation position encoding and expand the context window specified during pre-training of the large power customer service semantic model, including: First define a scaling factor To extend the context length With the original context length The ratio between:
[0010] For the vector The rotation encoding function is rewritten as about the input vector ,Location and Function:
[0011] Will Defined as The wavelength of the rotation position embedding over the hidden dimensions:
[0012] is a constant, and the wavelength represents Dimensional rotation position embedding performs a full rotation angle The required word length; |D| represents the maximum number of hidden dimensions; The low-dimensional interpolation method is: if the wavelength Less than context length , no interpolation is performed; if the wavelength Greater than or equal to the smaller of the upper and lower lengths , then interpolation is performed; Introducing an original context length and wavelength The ratio between , in Among the hidden states, the ratio depending on ,Right now
[0013]
[0014] Introducing two parameters and , for all hidden dimensions ,if , then the wavelength Smaller than context size , no interpolation is performed; if , then the wavelength Equal to or greater than the context size , then interpolation is performed; and the ramp function is defined accordingly : ; With the help of ramp function , the context window extension modifies the rotation position encoding as follows:
[0015] .
[0016] Furthermore, the steps of constructing a data set of instructions in the field of electric customer service and fine-tuning the improved electric customer service semantic model to obtain an intelligent question-answering model of electric customer service specifically include: First, we collect actual user Q&A materials, clean and structure the data, then build the customer service Q&A business logic and form a data set for electric customer service instructions; Among them, the power customer service instruction dataset includes power customer service knowledge, basic power theory, standard system information, manual customer service question and answer records, and manually annotated business standard questions and standard answers. Power customer service business experts check and correct the wrong answers in the instruction dataset, and rewrite the instruction sentences to expand the form of instructions in the dataset. After the experts correct and expand the instruction data, they obtain the power customer service field instruction dataset; in the model training stage, the improved power customer service semantic big model is fine-tuned on the power customer service field instruction dataset to obtain the power customer service intelligent question and answer big model.
[0017] Furthermore, in the step of fine-tuning the improved electric customer service semantic model to obtain the electric customer service intelligent question-answering model: The outputs of a series of large models are evaluated internally through reward models and reinforcement learning, and the improved electric customer service semantic large model is updated and optimized. Specifically: Train a reward model whose input is the user's question and the answer generated by the big model, and whose output is a scalar number that can judge the quality of the answer; After inputting user questions into the intelligent question-answering model of power customer service, the output result is obtained. After inputting the user questions and the answers generated by the large model into the trained reward model, the fine-tuning task of the large model is modeled as a reinforcement learning problem. The proximal optimization strategy is adopted, and the trust region optimization method is used to directly update the current model, limiting the changes of the model to the preset range of the previous model. Use the value function to estimate the difference between the expected output and the current output, and use the value function to update the policy by comparing the output of the current model with the output of the previous model:
[0018] in, are model parameters, is the output of the large model; the value function is initialized by the reward model. After the user question and the output of the large model are given, the reward model generates a reward based on the value function. The large model adds a relative entropy penalty factor to each word.
[0019] Furthermore, the questions are processed based on the power customer service intelligent question-answering model, and the responses to the power user's questions are output, including: The prompt words or instructions added to the user's question are converted into a form that can be understood by the power customer service intelligent question and answer model, input into the power customer service intelligent question and answer model, and output the reply to the power user's question.
[0020] Furthermore, based on the obtained power customer service intelligent question and answer big model, power customer service intelligent question and answer services are provided, specifically including: Receive real-time questions or inquiries from users through the user interaction module and pass them to the online customer service module; The online customer service module pre-processes the user's questions, adds prompt words or instructions to the original customer questions, and converts them into a form that can be understood by the power customer service intelligent question-answering model, and then calls the power customer service intelligent question-answering model; Through the power customer service intelligent question-answering big model module, the relevant text of the power user's question to be answered is input into the trained power customer service intelligent question-answering big model, and the answer to the power user's question is output; The online customer service module receives the replies generated by the power customer service intelligent question and answer model module and determines whether it needs to be transferred to manual operation. At the same time, it receives manual replies when manual operations are performed, and finally returns the obtained replies to the user interaction module.
[0021] According to a second aspect of an embodiment of the present invention, an embodiment of the present invention provides an intelligent question-answering system for electric customer service based on a semantic big model, the system comprising: An acquisition module is used to obtain questions from power users; An intelligent question-answering module is used to process the questions based on the intelligent question-answering model of the power customer service and output the responses to the questions asked by the power users; The power customer service intelligent question and answer model is constructed through the following steps: By introducing relative position encoding information, a large-scale semantic model of power customer service is constructed based on the transformer model; a large-scale data set is constructed to pre-train the large-scale semantic model of power customer service on a fixed context length to obtain the pre-trained large-scale semantic model of power customer service; The pre-trained electric customer service semantic big model is improved by improving the relative position encoding to obtain the improved electric customer service semantic big model; a command dataset in the field of electric customer service is constructed, and the improved electric customer service semantic big model is fine-tuned to obtain the electric customer service intelligent question and answer big model.
[0022] Furthermore, in the step of constructing a large semantic model of electric customer service based on the transformer model Transformer by introducing relative position encoding information: The large semantic model of electric customer service is based on the Transformer architecture, which is divided into an embedding layer and a multi-layer decoder. Each decoder layer contains two multi-head attention layers and a feedforward network layer. The step of introducing relative position coding information comprises: Each word in the input sequence is converted into a word embedding vector through the embedding layer of the model, and each word embedding vector is rotated and position encoded before being processed by the multi-head attention layer; For a given length The corresponding embedding representation of the input sequence is:
[0023] in Indicates The corresponding word dimensional word embedding vector; For word embedding vector with position information m , the rotation position encoding method is expressed as:
[0024] in, .
[0025] Furthermore, the construction of a large-scale data set, pre-training the electric customer service semantic model on a fixed context length, and obtaining the pre-trained electric customer service semantic model specifically includes: The constructed electric power customer service semantic big model is used as the basic model to collect large-scale data in the electric power field and form a large-scale electric power corpus data set. The large-scale data in the electric power field includes electric power industry standards, technical reports, regulations, basic electric power theory, customer service knowledge base, and customer service business system data. A large-scale electric power corpus dataset is introduced into the basic model, and the idea of transfer learning is used to pre-train the basic model. A fixed context length is used during pre-training to obtain a large semantic model of electric power customer service after pre-training.
[0026] Furthermore, the step of improving the pre-trained electric customer service semantic model by improving the relative position coding to obtain an improved electric customer service semantic model specifically includes: A low-dimensional interpolation method that considers high-frequency loss and relative local distance is introduced to improve rotation position encoding and expand the context window specified during pre-training of the large power customer service semantic model, including: First define a scaling factor To extend the context length With the original context length The ratio between:
[0027] For the vector The rotation encoding function is rewritten as about the input vector ,Location and Function:
[0028] Will Defined as The wavelength of the rotation position embedding over the hidden dimensions:
[0029] is a constant, and the wavelength represents Dimensional rotation position embedding performs a full rotation angle The required word length; |D| represents the maximum number of hidden dimensions; The low-dimensional interpolation method is: if the wavelength Less than context length , no interpolation is performed; if the wavelength Greater than or equal to the smaller of the upper and lower lengths , then interpolation is performed; Introducing an original context length and wavelength The ratio between , in Among the hidden states, the ratio depending on ,Right now
[0030]
[0031] Introducing two parameters and , for all hidden dimensions ,if , then the wavelength Smaller than context size , no interpolation is performed; if , then the wavelength Equal to or greater than the context size , then interpolation is performed; and the ramp function is defined accordingly : ; With the help of ramp function , the context window extension modifies the rotation position encoding as follows:
[0032] .
[0033] Furthermore, the steps of constructing a data set of instructions in the field of electric customer service and fine-tuning the improved electric customer service semantic model to obtain the electric customer service intelligent question-answering model specifically include: First, we collect actual user Q&A materials, clean and structure the data, then build the customer service Q&A business logic and form a data set for electric customer service instructions; Among them, the power customer service instruction dataset includes power customer service knowledge, basic power theory, standard system information, manual customer service question and answer records, and manually annotated business standard questions and standard answers. Power customer service business experts check and correct the wrong answers in the instruction dataset, and rewrite the instruction sentences to expand the form of instructions in the dataset. After the experts correct and expand the instruction data, they obtain the power customer service field instruction dataset; in the model training stage, the improved power customer service semantic big model is fine-tuned on the power customer service field instruction dataset to obtain the power customer service intelligent question and answer big model.
[0034] Further, in the step of fine-tuning the improved electric customer service semantic model to obtain the electric customer service intelligent question-answering model: The outputs of a series of large models are evaluated internally through reward models and reinforcement learning, and the improved electric customer service semantic large model is updated and optimized. Specifically: Train a reward model whose input is the user's question and the answer generated by the big model, and whose output is a scalar number that can judge the quality of the answer; After inputting user questions into the intelligent question-answering model of power customer service, the output result is obtained. After inputting the user questions and the answers generated by the large model into the trained reward model, the fine-tuning task of the large model is modeled as a reinforcement learning problem. The proximal optimization strategy is adopted, and the trust region optimization method is used to directly update the current model, limiting the changes of the model to the preset range of the previous model. Use the value function to estimate the difference between the expected output and the current output, and use the value function to update the policy by comparing the output of the current model with the output of the previous model:
[0035] in, are model parameters, is the output of the large model; the value function is initialized by the reward model. After the user question and the output of the large model are given, the reward model generates a reward based on the value function. The large model adds a relative entropy penalty factor to each word.
[0036] Furthermore, the questions are processed based on the intelligent question-answering model of the power customer service, and the responses to the questions of the power users are output, including: The prompt words or instructions added to the user's question are converted into a form that can be understood by the power customer service intelligent question and answer model, input into the power customer service intelligent question and answer model, and output the reply to the power user's question.
[0037] According to a third aspect of an embodiment of the present invention, an embodiment of the present invention provides an electronic device, including a processor and a memory, wherein the processor is used to execute a computer program stored in the memory to implement the intelligent question-answering method for electric customer service based on a semantic big model.
[0038] According to a fourth aspect of an embodiment of the present invention, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores at least one instruction, and when the at least one instruction is executed by a processor, the method for intelligent question and answer of electric customer service based on a semantic big model is implemented.
[0039] Compared with the prior art, the present invention provides a method and system for intelligent question and answer of electric customer service based on semantic big model, which is based on the Transformer architecture of rotational position encoding, and constructs the big model of intelligent question and answer of electric customer service through model pre-training, context window expansion, fine-tuning of instructions in the field of electric customer service, and human feedback reinforcement learning based on optimized value function, and provides intelligent question and answer service of electric customer service. Among them, corresponding to the big model of intelligent question and answer of electric customer service, the model pre-training technology adopted based on the large-scale data set in the electric power field effectively improves the understanding ability of the big model of intelligent question and answer of electric customer service for electric customer service knowledge; the context window expansion method is low-dimensional interpolation considering high-frequency loss, which realizes the length extension of intelligent question and answer of electric customer service, and effectively maintains the coherence of topics in the question and answer dialogue process by retaining more historical dialogue information; the value function optimization strategy is the proximal optimization strategy, and the instruction fine-tuning and human feedback reinforcement learning training method based on the strategy improve the training efficiency and response accuracy of the model, align the model with human knowledge and preferences, and effectively imitate the behavior and decision-making of people in the electric customer service scene, and provide users with personalized and customized services. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The accompanying drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the accompanying drawings: Figure 1 A flowchart of an intelligent question-answering method for electric customer service based on a semantic big model provided by an embodiment of the present invention; Figure 2 A schematic diagram of the Transformer model architecture in an intelligent question-answering method for electric customer service based on a semantic big model provided in an embodiment of the present invention; Figure 3 A flow chart of a method for fine-tuning instructions in the electric customer service field in an intelligent question-answering method for electric customer service based on a semantic big model provided by an embodiment of the present invention; Figure 4 A flowchart of a human feedback reinforcement learning big model training based on a proximal optimization strategy in a power customer service intelligent question-answering method based on a semantic big model provided in an embodiment of the present invention; Figure 5 A flowchart of intelligent question and answer for electric customer service based on a big model in an intelligent question and answer method for electric customer service based on a big semantic model provided in an embodiment of the present invention; Figure 6 A schematic diagram of the structure of an electric customer service intelligent question-answering system based on a semantic big model provided by an embodiment of the present invention; Figure 7 A flowchart of another method for intelligent question and answer of electric customer service based on a semantic big model provided by an embodiment of the present invention; Figure 8 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0041] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present invention can be combined with each other without conflict.
[0042] The following detailed description is an exemplary description, which is intended to provide further detailed description of the present invention. Unless otherwise specified, all technical terms used in the present invention have the same meaning as those generally understood by those skilled in the art to which the present invention belongs. The terms used in the present invention are only for describing specific embodiments, and are not intended to limit the exemplary embodiments according to the present invention.
[0043] The first embodiment of the present invention provides an intelligent question-answering method for electric customer service based on a semantic big model, providing technical support for the research on intelligent question-answering of electric customer service with high accuracy, completeness and generalization in various scenarios. The present invention is directed to an electric customer service semantic big model for intelligent question-answering, and mainly designs a context window expansion method and a training method for the electric customer service semantic big model, and applies them to the fine-tuning stage of the electric customer service semantic big model, so that the model can better adapt to the context and question types of specific fields, accurately understand the needs and preferences of users, and thus provide more personalized and accurate services, and improve user experience and service quality. The following is combined with Figure 1 A first embodiment of the present invention provides a method for intelligent question and answering of electric customer service based on a semantic big model and is described in detail.
[0044] like Figure 1 As shown, in step S100, by introducing relative position encoding information, a Transformer-based electric customer service semantic model is constructed, and the large model is pre-trained.
[0045] The above steps specifically include: S110. Build a large semantic model of power customer service.
[0046] The semantic big model is based on the Transformer architecture, which is mainly divided into an embedding layer and a multi-layer decoder, such as Figure 2 As shown. Each decoder layer contains two multi-head attention layers and a feedforward network layer. Each sublayer is connected through a residual network and normalized. The multi-head self-attention layer will perform multiple self-attention operations with different parameters in parallel, and concatenate the results of each self-attention operation as the input of the subsequent network; each layer of the Transformer network connects the vector before the self-attention mechanism or the feedforward neural network through a residual connection; hierarchical normalization is performed, and the multi-dimensional vectors of each node in the same layer are mapped to an interval through normalization, and added to each sublayer, and mapped to a vector of the size of the vocabulary through a linear layer. Each vector represents the output possibility of a word in the vocabulary, and the output probability of each word is obtained through a softmax layer.
[0047] Self-attention is an important part of the Transformer architecture. It is essentially a weighted sum of the input vectors. The calculation method is as follows:
[0048] in, is the dimension of the input matrix, The function normalizes the dot product value; , , The input query matrix, key matrix and value matrix are respectively obtained through three transformation matrices , , Each input text sequence Obtained by mapping.
[0049] In order to prevent the overfitting problem caused by a single self-attention calculation, the multi-head attention mechanism will , , It is divided into multiple attention heads to represent the information of different subspaces. Then, in each subspace, The attention calculation of the sub-parameters is not shared, and finally multiple results are spliced as the final output:
[0050]
[0051] in, , , and is the learnable parameter matrix of the linear layer, is the number of attention heads, Represents a concatenation operation.
[0052] The large model is fed with text data related to questions and answers about power marketing. The model’s embedding layer converts each word in the input sequence into a corresponding word vector, and adds the position vector of each word to get the position of the word in the sequence. The word vector is then fed into a multi-layer attention network, and the relative position information is integrated into the self-attention mechanism. The self-attention mechanism is used to learn the relationship between words, encode their contextual information, and then pass through a feedforward network that undergoes nonlinear changes to output the vector representation of each word with comprehensive contextual features.
[0053] The relative position information encoding method is further explained. The idea of the rotation position encoding is to use the absolute position encoding to implement relative position encoding, mainly relying on the idea of complex numbers, deleting the absolute position embedding in the original position encoding, and adding the rotation position embedding in each layer of the network. Specifically, for a given length The corresponding embedding representation of the input sequence is:
[0054] in Indicates The corresponding word dimensional word embedding vector. Before performing self-attention calculation, the word embedding vector is used to calculate The position information is added to the vector, and the corresponding rotation position code is calculated for each word position to obtain , expressed as follows:
[0055] in, Represents the word vector corresponding to the mth word The query vector after integrating the position information m; and and It represents the word vector corresponding to the nth word The key-value vector after integrating the position information n. The Transformer-based position encoding methods all focus on constructing a suitable Function form. In order to utilize the relative position information between the previous words, assume that the query vector and key vector The inner product operation between Indicates that the absolute position information is explicitly passed in to achieve the same situation as the relative position information passed in. This function The input is the word embedding vector , and their relative positions , expressed as:
[0056] In order to make the above relationship hold, we need to find an equivalent position encoding method. Assuming that the dimension of the word embedding vector is two-dimensional, we can use the geometric properties of the vector on the two-dimensional plane to derive a function form that satisfies the above relationship. Then for the vector at position m , the encoding can be expressed as:
[0057] in, Using this formula, the query vector for each word position is and key vector The elements of the vector are rotated in pairs, and the real part is taken to calculate the inner product between the query and key vectors to obtain the self-attention result and the attention score.
[0058] Step S120: Pre-training of a large semantic model for electric customer service.
[0059] The structure described in step S110 is used as a base model to collect large-scale data in the power field to form a large-scale data set. The large-scale data set in the power field is introduced into the base model, and the base model is pre-trained using the idea of transfer learning. The large-scale data set in the power field includes power industry standards, technical reports, rules and regulations, basic power theory, existing customer service knowledge base, and customer service business system data.
[0060] Using this large-scale dataset, pre-training is performed based on the characteristics and data features of the power customer service field. Specifically, SentencePiece is used to expand the vocabulary of the general base model. SentencePiece regards the input text as a series of Unicode characters, which is independent of the logic of the language. The word segmenter is trained from a large-scale dataset to quickly and lightly expand the vocabulary of the knowledge model in the power customer service field. During the training process, the input sequence is converted into a continuous vector representation using the expanded word segmenter, and then the position information is added using the rotation position encoding described in step 1, and the self-attention is calculated to obtain the attention score.
[0061] like Figure 1 As shown, in step S200, the context length of intelligent question and answer is extended by improving relative position coding, and the large model of intelligent question and answer of electric power customer service is obtained through large model training and optimization update.
[0062] The above steps specifically include: Step S210: A method for expanding the context window of the electric customer service semantic model.
[0063] The semantic big model is pre-trained on a fixed context length, and it is difficult for position encoding to directly expand the context window specified during its own training. In view of the need for context length expansion in the power customer service scenario, the context window of the power customer service semantic big model is expanded by fine-tuning on a relatively small amount of data. The specific steps are as follows: First define a scaling factor To extend the context length With the original context length The ratio between:
[0064] Further apply the vector The encoding function is rewritten as ,Location and Function:
[0065] In addition, Defined as The wavelength of the rotation position embedding over the hidden dimensions:
[0066] in, is a constant, usually 10000. The wavelength represents dimensional rotation position embedding performs a full rotation ( ) required word length. For a given context length , there are some dimensions The wavelength is longer than the maximum context length seen during pre-training ( ), which indicates that the embeddings of some dimensions may be unevenly distributed in the rotation domain, meaning that the absolute position information remains intact. In contrast, when the wavelength is short, only the relative position information can be accessed by the network. Therefore, we choose not to interpolate the higher frequency dimensions, but always interpolate the lower frequency dimensions to perform large model context window expansion. That is: (1) If the wavelength Much smaller than the context length , no interpolation is performed; (2) If the wavelength Equal to or greater than the upper and lower lengths , interpolation; (3) The intermediate size can have both, taking a suitable value. Therefore, an original context length is introduced and wavelength The ratio between In the Among the hidden states, the ratio depending on ,Right now
[0067]
[0068] In order to define the boundaries of the above different interpolation strategies, two additional parameters are introduced and . For all hidden dimensions ,if , then the wavelength Much smaller than the context size , no interpolation is performed; if , then the wavelength Equal to or greater than the context size , interpolation is performed. Therefore, a ramp function is defined :
[0069] With this ramp function , the modification of the rotation position encoding in this context window extension method is:
[0070]
[0071] in, and The value of should be adjusted according to the specific situation. Experiments show that for the model involved in this invention, and The best values for are 1 and 32.
[0072] Step S220: A method for training a large semantic model of electric customer service.
[0073] Step S221: Design a method for fine-tuning instructions in the field of electric power customer service.
[0074] like Figure 3 As shown, first collect the actual user question and answer materials, and perform data cleaning and structuring. Then build the customer service question and answer business logic, and form an electric customer service instruction data set in the form of (instruction, input, output) triples. Among them, the electric customer service instruction data includes electric customer service knowledge, basic electric power theory, standard system information, manual customer service question and answer records, and manually annotated business standard questions and standard answers, etc., to ensure that the model can learn a wide range of real operating scenarios. In order to build a high-quality and diverse instruction data set, electric customer service business experts are invited to check and correct the wrong answers in the instruction data set, and rewrite the instruction sentences to expand the form of instructions in the data set. After the experts correct and expand the instruction data, the electric customer service field instruction data set is obtained. In the model training stage, the electric customer service semantic big model improved according to step S210 is fine-tuned on the electric customer service field instruction data set to obtain the electric customer service intelligent question and answer big model, so that the big model is more adapted to the expanded context length and can follow the instructions to perform corresponding tasks.
[0075] Step S222: training the reward model.
[0076] In order to reduce model hallucinations and biases, and explicitly introduce human preferences and subjective opinions, a reinforcement learning method based on human feedback is adopted to enable the large model to better imitate human behaviors and decisions in the power customer service question and answer scenario.
[0077] like Figure 4 As shown in the figure, first, a reward model is trained to quantitatively judge whether the answer output by the model is of good quality in the eyes of humans. That is, the input is (user question, answer generated by the model), and the reward model outputs a scalar number that can represent the quality of the answer. The specific steps are as follows: 1. Input the selected sample library questions into the power customer service intelligent question-answering model obtained in step S221. For the same question, one model can generate multiple answers; 2. Ask the annotators to rank different answers to the same question from best to worst, resulting in a new dataset sorted by label. The size of this dataset is about 5 to 10 times the size of the selected dataset used by the SFT model; 3. Use these different sorting results for reward model training to obtain a reward model.
[0078] Through the reward model and reinforcement learning, the output of a series of models is evaluated internally, and the output that is most likely to obtain the maximum reward is selected to automatically improve the large model. First, input the user's question, input it into the power customer service intelligent question and answer large model to obtain the output result, and after inputting it into the reward model, the fine-tuning task of the large model is modeled as a reinforcement learning problem. The proximal optimization strategy is adopted, and the trust domain optimization method is used to directly update the current model, and the changes in the model are limited to a certain range with the previous model to ensure stability; the value function is used to estimate the difference between the expected output and the current output. By comparing the output of the current model with the original output of the previous model, the value function is used to update the strategy:
[0079] in, are model parameters, is the output of the large model. In this step, the value function is initialized by the reward model. After the question and model output are given, the reward model generates rewards based on the value function. The large model will add a relative entropy penalty factor to each word to avoid over-optimization of the reward model.
[0080] An intelligent question-answering method for electric customer service based on a semantic big model according to an embodiment of the present invention will improve the intelligent question-answering level of customer service from the following two aspects: (1) Realize the length extension of intelligent Q&A for power customer service. This invention improves the rotation position encoding method. To solve the problem that the position encoding in the large model cannot directly extend the maximum context length specified during its own training, a low-dimensional interpolation method that considers high-frequency loss is constructed to extend the context length and reduce the loss of relative local distance. This effectively maintains the coherence of the topic during the Q&A dialogue, and by remembering more historical dialogue information, responds to users in a more personalized manner and provides more customized services.
[0081] (2) Implementing human feedback reinforcement learning model training based on optimized value function. This patent applies human feedback to the model training process, explicitly introduces human preferences and subjective opinions, realizes the alignment of the model with human knowledge and preferences, and optimizes the value function of the reward model for the power customer service question and answer scenario and the characteristics of the large model involved in this invention, improves the model training efficiency, reduces model hallucinations and biases, and better simulates human behavior and decision-making in the power customer service question and answer scenario.
[0082] like Figure 1 As shown, in step S300, based on the obtained power customer service intelligent question and answer large model, the power customer service intelligent question and answer service is provided.
[0083] like Figure 5 As shown, first, the user interaction module is used to receive questions or queries raised by users in the system in real time and pass them to the online customer service module. The online customer service module pre-processes the user's questions, adds prompt words or instructions to the original customer questions, converts them into a form that is easier to understand for the power customer service intelligent question and answer big model, and then calls the power customer service intelligent question and answer big model. The power customer service intelligent question and answer big model module is used to input the relevant text of the power customer's question to be answered into the power customer service intelligent question and answer big model trained by the above method, and output the reply to the power user's question. The online customer service module receives the reply generated by the big model module and determines whether it needs to be transferred to manual operation. At the same time, it receives the manual reply when the manual reply is made, and finally returns the obtained reply to the user interaction module.
[0084] This invention introduces big model technology into the research of intelligent question and answer of electric customer service, and proposes a method of intelligent question and answer of electric customer service based on semantic big model, which effectively analyzes and responds to the demands raised by electric users, extends the maximum length of electric customer service question and answer, retains more historical dialogue information, and solves the problem of discontinuous dialogue caused by direct window truncation of existing customer service question and answer models when facing long dialogues or multi-round dialogues. Through fine-tuning and reinforcement learning of the electric customer service semantic big model instructions, the adaptability and response accuracy of the model in the electric customer service scenario are enhanced, and the personalized service level is improved. The main key points are as follows: (1) Focusing on the research field of intelligent question-answering for electric customer service, a low-dimensional interpolation method that considers high-frequency loss and relative local distance is introduced to improve the rotation position encoding, expand the context window specified during model pre-training, and effectively maintain the coherence of the dialogue in question-answering by fine-tuning on a relatively small amount of data.
[0085] (2) Design a reward model value function for the power customer service question-and-answer scenario, optimize the human feedback reinforcement learning process of the power customer service intelligent question-and-answer model, enable the model to learn effective power customer service question-and-answer strategies, improve model training efficiency, and explicitly introduce human preferences and subjective opinions to solve the model's hallucination and bias problems, thereby improving the safety, reliability, and intelligent personalized service level of power customer service.
[0086] Corresponding to the electric power customer service intelligent question-answering method based on a semantic big model disclosed in the above embodiment, the embodiment of the present invention also discloses an electric power customer service intelligent question-answering method system based on a semantic big model, such as Figure 6 As shown, it specifically includes: The large model building module is used to build a Transformer-based power customer service semantic large model by introducing relative position encoding information and perform large model pre-training; The large model training module is used to expand the context length of intelligent question and answer by improving the relative position encoding, and obtain the large model of intelligent question and answer of power customer service through large model training and optimization update; The intelligent question and answer module is used to provide electric power customer service intelligent question and answer services based on the obtained electric power customer service intelligent question and answer large model.
[0087] It should be noted that, for the detailed description of an intelligent question and answer system for electric customer service based on a semantic big model provided in an embodiment of the present invention, reference can be made to the relevant description of an intelligent question and answer method for electric customer service based on a semantic big model provided in an embodiment of the present invention, which will not be repeated here.
[0088] See also Figure 7 As shown, the embodiment of the present invention also discloses an intelligent question-answering method for electric customer service based on a semantic big model, the method comprising: S1. Obtain questions from electricity users; S2. Processing the question based on the power customer service intelligent question-answering model and outputting a reply to the power user's question; The power customer service intelligent question and answer model is constructed through the following steps: By introducing relative position encoding information, a large-scale semantic model of power customer service is constructed based on the transformer model; a large-scale data set is constructed to pre-train the large-scale semantic model of power customer service on a fixed context length to obtain the pre-trained large-scale semantic model of power customer service; The pre-trained electric customer service semantic big model is improved by improving the relative position encoding to obtain the improved electric customer service semantic big model; a command dataset in the field of electric customer service is constructed, and the improved electric customer service semantic big model is fine-tuned to obtain the electric customer service intelligent question and answer big model.
[0089] In a specific implementation, in the step of constructing a large semantic model of electric customer service based on a transformer model Transformer by introducing relative position encoding information: The large semantic model of electric customer service is based on the Transformer architecture, which is divided into an embedding layer and a multi-layer decoder. Each decoder layer contains two multi-head attention layers and a feedforward network layer. The step of introducing relative position coding information comprises: Each word in the input sequence is converted into a word embedding vector through the embedding layer of the model, and each word embedding vector is rotated and position encoded before being processed by the multi-head attention layer; For a given length The corresponding embedding representation of the input sequence is:
[0090] in Indicates The corresponding word dimensional word embedding vector; For word embedding vector with position information m , the rotation position encoding method is expressed as:
[0091] in, .
[0092] In a specific implementation, the construction of a large-scale data set, pre-training the electric customer service semantic model at a fixed context length, and obtaining the pre-trained electric customer service semantic model specifically includes: The constructed electric power customer service semantic big model is used as the basic model to collect large-scale data in the electric power field and form a large-scale electric power corpus data set. The large-scale data in the electric power field includes electric power industry standards, technical reports, regulations, basic electric power theory, customer service knowledge base, and customer service business system data. A large-scale electric power corpus dataset is introduced into the basic model, and the idea of transfer learning is used to pre-train the basic model. A fixed context length is used during pre-training to obtain a large semantic model of electric power customer service after pre-training.
[0093] In a specific implementation, the step of improving the pre-trained electric customer service semantic big model by improving the relative position coding to obtain the improved electric customer service semantic big model specifically includes: A low-dimensional interpolation method that considers high-frequency loss and relative local distance is introduced to improve rotation position encoding and expand the context window specified during pre-training of the large power customer service semantic model, including: First define a scaling factor To extend the context length With the original context length The ratio between:
[0094] For the vector The rotation encoding function is rewritten as about the input vector ,Location and Function:
[0095] Will Defined as The wavelength of the rotation position embedding over the hidden dimensions:
[0096] is a constant, and the wavelength represents Dimensional rotation position embedding performs a full rotation angle The required word length; |D| represents the maximum number of hidden dimensions; The low-dimensional interpolation method is: if the wavelength Less than context length , no interpolation is performed; if the wavelength Greater than or equal to the smaller of the upper and lower lengths , then interpolation is performed; Introducing an original context length and wavelength The ratio between , in Among the hidden states, the ratio depending on ,Right now
[0097]
[0098] Introducing two parameters and , for all hidden dimensions ,if , then the wavelength Smaller than context size , no interpolation is performed; if , then the wavelength Equal to or greater than the context size , then interpolation is performed; and the ramp function is defined accordingly : ; With the help of ramp function , the context window extension modifies the rotation position encoding as follows:
[0099] .
[0100] In a specific implementation, the steps of constructing a power customer service field instruction dataset and fine-tuning the improved power customer service semantic big model to obtain the power customer service intelligent question-answering big model specifically include: First, we collect actual user Q&A materials, clean and structure the data, then build the customer service Q&A business logic and form a data set for electric customer service instructions; Among them, the power customer service instruction dataset includes power customer service knowledge, basic power theory, standard system information, manual customer service question and answer records, and manually annotated business standard questions and standard answers. Power customer service business experts check and correct the wrong answers in the instruction dataset, and rewrite the instruction sentences to expand the form of instructions in the dataset. After the experts correct and expand the instruction data, they obtain the power customer service field instruction dataset; in the model training stage, the improved power customer service semantic big model is fine-tuned on the power customer service field instruction dataset to obtain the power customer service intelligent question and answer big model.
[0101] In a specific implementation, in the step of fine-tuning the improved electric customer service semantic model to obtain the electric customer service intelligent question-answering model: The outputs of a series of large models are evaluated internally through reward models and reinforcement learning, and the improved electric customer service semantic large model is updated and optimized. Specifically: Train a reward model whose input is the user's question and the answer generated by the big model, and whose output is a scalar number that can judge the quality of the answer; After inputting user questions into the intelligent question-answering model of power customer service, the output result is obtained. After inputting the user questions and the answers generated by the large model into the trained reward model, the fine-tuning task of the large model is modeled as a reinforcement learning problem. The proximal optimization strategy is adopted, and the trust region optimization method is used to directly update the current model, limiting the changes of the model to the preset range of the previous model. Use the value function to estimate the difference between the expected output and the current output, and use the value function to update the policy by comparing the output of the current model with the output of the previous model:
[0102] in, are model parameters, is the output of the large model; the value function is initialized by the reward model. After the user question and the output of the large model are given, the reward model generates a reward based on the value function. The large model adds a relative entropy penalty factor to each word.
[0103] In a specific implementation, the question is processed based on the power customer service intelligent question-answering model, and the answer to the power user's question is output, which specifically includes: The prompt words or instructions added to the user's question are converted into a form that can be understood by the power customer service intelligent question and answer model, input into the power customer service intelligent question and answer model, and output the reply to the power user's question.
[0104] Corresponding to the electric customer service intelligent question-answering method based on a semantic big model disclosed in the above embodiment, the embodiment of the present invention further discloses an electric customer service intelligent question-answering method system based on a semantic big model, which specifically includes: An acquisition module is used to obtain questions from power users; An intelligent question-answering module is used to process the questions based on the intelligent question-answering model of the power customer service and output the responses to the questions asked by the power users; The power customer service intelligent question and answer model is constructed through the following steps: By introducing relative position encoding information, a large-scale semantic model of power customer service is constructed based on the transformer model; a large-scale data set is constructed to pre-train the large-scale semantic model of power customer service on a fixed context length to obtain the pre-trained large-scale semantic model of power customer service; The pre-trained electric customer service semantic big model is improved by improving the relative position encoding to obtain the improved electric customer service semantic big model; a command dataset in the field of electric customer service is constructed, and the improved electric customer service semantic big model is fine-tuned to obtain the electric customer service intelligent question and answer big model.
[0105] It should be noted that, for the detailed description of an intelligent question and answer system for electric customer service based on a semantic big model provided in an embodiment of the present invention, reference can be made to the relevant description of an intelligent question and answer method for electric customer service based on a semantic big model provided in an embodiment of the present invention, which will not be repeated here.
[0106] Also, see Figure 8 As shown, an embodiment of the present invention also provides an electronic device 100 for implementing an intelligent question-answering method for electric customer service based on a semantic big model; the electronic device 100 includes a memory 101, at least one processor 102, a computer program 103 stored in the memory 101 and executable on the at least one processor 102, and at least one communication bus 104.
[0107] The memory 101 can be used to store the computer program 103, and the processor 102 implements the steps of the power customer service intelligent question-answering method based on the semantic big model by running or executing the computer program stored in the memory 101 and calling the data stored in the memory 101. The memory 101 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data (such as audio data) created according to the use of the electronic device 100, etc. In addition, the memory 101 can include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), at least one disk storage device, a flash memory device, or other non-volatile solid-state storage devices.
[0108] The at least one processor 102 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor 102 may be a microprocessor or any conventional processor, etc. The processor 102 is the control center of the electronic device 100, and uses various interfaces and lines to connect various parts of the entire electronic device 100.
[0109] The memory 101 in the electronic device 100 stores a plurality of instructions to implement an intelligent question-answering method for electric customer service based on a semantic big model, and the processor 102 can execute the plurality of instructions to implement: By introducing relative position encoding information, a Transformer-based electric customer service semantic model is constructed and pre-trained. The context length of intelligent question and answer is extended by improving relative position encoding, and the intelligent question and answer large model of power customer service is obtained through large model training and optimization update; Based on the obtained large model of intelligent question and answer for electric power customer service, intelligent question and answer service for electric power customer service is provided.
[0110] If the module / unit integrated in the electronic device 100 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory and read-only memory (ROM, Read-Only Memory).
[0111] It should be noted that, for a detailed description of a computer-readable storage medium provided in an embodiment of the present invention, reference can be made to the relevant description of an intelligent question-and-answer method for electric customer service based on a semantic big model provided in an embodiment of the present application, which will not be repeated here.
[0112] It is known from common technical knowledge that the present invention can be implemented by other embodiments that do not deviate from its spirit or essential features. Therefore, the above disclosed embodiments are only illustrative in all respects and are not exclusive. All changes within the scope of the present invention or within the scope equivalent to the present invention are included in the present invention.
[0113] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0114] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0115] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0116] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0117] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. An intelligent question-answering method for electric customer service based on a semantic big model, characterized in that: The method comprises: Get questions from electricity users; Process the questions based on the intelligent question-answering model of power customer service and output responses to the questions asked by power users; The power customer service intelligent question and answer model is constructed through the following steps: By introducing relative position encoding information, a large-scale semantic model of power customer service is constructed based on the transformer model; a large-scale data set is constructed to pre-train the large-scale semantic model of power customer service on a fixed context length to obtain the pre-trained large-scale semantic model of power customer service; The pre-trained electric customer service semantic big model is improved by improving the relative position encoding to obtain the improved electric customer service semantic big model; a command dataset in the field of electric customer service is constructed, and the improved electric customer service semantic big model is fine-tuned to obtain the electric customer service intelligent question and answer big model.
2. According to claim 1, a method for intelligent question and answer of electric customer service based on semantic big model is characterized in that: In the step of constructing a large semantic model of electric customer service based on the transformer model Transformer by introducing relative position encoding information: The large semantic model of electric customer service is based on the Transformer architecture, which is divided into an embedding layer and a multi-layer decoder; Each decoder layer contains two multi-head attention layers and a feed-forward network layer; The step of introducing relative position coding information comprises: Each word in the input sequence is converted into a word embedding vector through the embedding layer of the model, and each word embedding vector is rotated and position encoded before being processed by the multi-head attention layer; For a given length The corresponding embedding representation of the input sequence is: in Indicates The corresponding word dimensional word embedding vector; For word embedding vector with position information m , the rotation position encoding method is expressed as: in, .
3. According to claim 1, a method for intelligent question and answer of electric customer service based on semantic big model is characterized in that: The construction of a large-scale data set, pre-training the electric customer service semantic model on a fixed context length, and obtaining the pre-trained electric customer service semantic model specifically includes: The constructed electric power customer service semantic big model is used as the basic model to collect large-scale data in the electric power field and form a large-scale electric power corpus data set. The large-scale data in the electric power field includes electric power industry standards, technical reports, regulations, basic electric power theory, customer service knowledge base, and customer service business system data. A large-scale electric power corpus dataset is introduced into the basic model, and the basic model is pre-trained using the idea of transfer learning. A fixed context length is used during pre-training to obtain a large semantic model of electric power customer service after pre-training.
4. According to claim 2, a method for intelligent question and answer of electric customer service based on semantic big model is characterized in that: The step of improving the pre-trained electric customer service semantic big model by improving the relative position coding to obtain the improved electric customer service semantic big model specifically includes: A low-dimensional interpolation method that considers high-frequency loss and relative local distance is introduced to improve rotation position encoding and expand the context window specified during pre-training of the large power customer service semantic model, including: First define a scaling factor To extend the context length With the original context length The ratio between: For the vector The rotation encoding function is rewritten as ,Location and Function: Will Defined as The wavelength of the rotation position embedding over the hidden dimensions: is a constant, and the wavelength represents Dimensional rotation position embedding performs a full rotation angle The required word length; |D| represents the maximum number of hidden dimensions; The low-dimensional interpolation method is: if the wavelength Less than context length , no interpolation is performed; if the wavelength Greater than or equal to the smaller of the upper and lower lengths , then interpolation is performed; Introducing an original context length and wavelength The ratio between , in Among the hidden states, the ratio depending on ,Right now Introducing two parameters and , for all hidden dimensions ,if , then the wavelength Smaller than context size , no interpolation is performed; if , then the wavelength Equal to or greater than the context size , then interpolation is performed; and the ramp function is defined accordingly : ; With the help of ramp function , the context window extension modifies the rotation position encoding as follows: 。 5. According to claim 1, a method for intelligent question and answer of electric customer service based on semantic big model is characterized in that: The steps of constructing a command dataset in the field of electric customer service and fine-tuning the improved electric customer service semantic model to obtain the electric customer service intelligent question-answering model include: First, we collect actual user Q&A materials, clean and structure the data, then build the customer service Q&A business logic and form a data set for electric customer service instructions; Among them, the power customer service instruction dataset includes power customer service knowledge, basic power theory, standard system information, manual customer service question and answer records, and manually annotated business standard questions and standard answers. Power customer service business experts check and correct the wrong answers in the instruction dataset, and rewrite the instruction sentences to expand the form of instructions in the dataset. After the experts correct and expand the instruction data, they obtain the power customer service field instruction dataset; in the model training stage, the improved power customer service semantic big model is fine-tuned on the power customer service field instruction dataset to obtain the power customer service intelligent question and answer big model.
6. According to claim 1, a method for intelligent question and answer of electric customer service based on semantic big model is characterized in that: The steps of fine-tuning the improved electric customer service semantic model to obtain the electric customer service intelligent question-answering model are: The outputs of a series of large models are evaluated internally through reward models and reinforcement learning, and the improved electric customer service semantic large model is updated and optimized. Specifically: Train a reward model whose input is the user's question and the answer generated by the big model, and whose output is a scalar number that can judge the quality of the answer; After inputting user questions into the intelligent question-answering model of power customer service, the output result is obtained. After inputting the user questions and the answers generated by the large model into the trained reward model, the fine-tuning task of the large model is modeled as a reinforcement learning problem. The proximal optimization strategy is adopted, and the trust region optimization method is used to directly update the current model, limiting the changes of the model to the preset range of the previous model. Use the value function to estimate the difference between the expected output and the current output, and use the value function to update the policy by comparing the output of the current model with the output of the previous model: in, are model parameters, is the output of the large model; the value function is initialized by the reward model. After the user question and the output of the large model are given, the reward model generates a reward based on the value function. The large model adds a relative entropy penalty factor to each word.
7. The method for intelligent question and answer of electric customer service based on semantic big model according to claim 1 is characterized in that: The questions are processed based on the intelligent question-answering model of the power customer service, and the responses to the questions of the power users are output, including: The prompt words or instructions added to the user's question are converted into a form that can be understood by the power customer service intelligent question and answer model, input into the power customer service intelligent question and answer model, and output the reply to the power user's question.
8. An intelligent question-answering system for electric customer service based on a semantic big model, characterized in that: The system comprises: An acquisition module is used to obtain questions from power users; An intelligent question-answering module is used to process the questions based on the intelligent question-answering model of the power customer service and output the responses to the questions asked by the power users; The power customer service intelligent question and answer model is constructed through the following steps: By introducing relative position encoding information, a large-scale semantic model of power customer service is constructed based on the transformer model; a large-scale data set is constructed to pre-train the large-scale semantic model of power customer service on a fixed context length to obtain the pre-trained large-scale semantic model of power customer service; The pre-trained electric customer service semantic big model is improved by improving the relative position encoding to obtain the improved electric customer service semantic big model; a command dataset in the field of electric customer service is constructed, and the improved electric customer service semantic big model is fine-tuned to obtain the electric customer service intelligent question and answer big model.
9. The electric power customer service intelligent question-answering system based on a semantic big model according to claim 8 is characterized in that: In the step of constructing a large semantic model of electric customer service based on the transformer model Transformer by introducing relative position encoding information: The large semantic model of electric customer service is based on the Transformer architecture, which is divided into an embedding layer and a multi-layer decoder; Each decoder layer contains two multi-head attention layers and a feed-forward network layer; The step of introducing relative position coding information comprises: Each word in the input sequence is converted into a word embedding vector through the embedding layer of the model, and each word embedding vector is rotated and position encoded before being processed by the multi-head attention layer; For a given length The corresponding embedding representation of the input sequence is: in Indicates The corresponding word dimensional word embedding vector; For word embedding vector with position information m , the rotation position encoding method is expressed as: in, .
10. The electric customer service intelligent question-answering system based on semantic big model according to claim 8, characterized in that: The construction of a large-scale data set, pre-training the electric customer service semantic model on a fixed context length, and obtaining the pre-trained electric customer service semantic model specifically includes: The constructed electric power customer service semantic big model is used as the basic model to collect large-scale data in the electric power field and form a large-scale electric power corpus data set. The large-scale data in the electric power field includes electric power industry standards, technical reports, regulations, basic electric power theory, customer service knowledge base, and customer service business system data. A large-scale electric power corpus dataset is introduced into the basic model, and the basic model is pre-trained using the idea of transfer learning. A fixed context length is used during pre-training to obtain a large semantic model of electric power customer service after pre-training.
11. The electric customer service intelligent question-answering system based on a semantic big model according to claim 9, characterized in that: The step of improving the pre-trained electric customer service semantic big model by improving the relative position coding to obtain the improved electric customer service semantic big model specifically includes: A low-dimensional interpolation method that considers high-frequency loss and relative local distance is introduced to improve rotation position encoding and expand the context window specified during pre-training of the large power customer service semantic model, including: First define a scaling factor To extend the context length With the original context length The ratio between: For the vector The rotation encoding function is rewritten as ,Location and Function: Will Defined as The wavelength of the rotation position embedding over the hidden dimensions: is a constant, and the wavelength represents Dimensional rotation position embedding performs a full rotation angle The required word length; |D| represents the maximum number of hidden dimensions; The low-dimensional interpolation method is: if the wavelength Less than context length , no interpolation is performed; if the wavelength Greater than or equal to the smaller of the upper and lower lengths , then interpolation is performed; Introducing an original context length and wavelength The ratio between , in Among the hidden states, the ratio depending on ,Right now Introducing two parameters and , for all hidden dimensions ,if , then the wavelength Smaller than context size , no interpolation is performed; if , then the wavelength Equal to or greater than the context size , then interpolation is performed; and the ramp function is defined accordingly : ; With the help of ramp function , the context window extension modifies the rotation position encoding as follows: 。 12. The electric customer service intelligent question-answering system based on a semantic big model according to claim 8, characterized in that: The steps of constructing a command dataset in the field of electric customer service and fine-tuning the improved electric customer service semantic model to obtain the electric customer service intelligent question-answering model include: First, we collect actual user Q&A materials, clean and structure the data, then build the customer service Q&A business logic and form a data set for electric customer service instructions; Among them, the power customer service instruction dataset includes power customer service knowledge, basic power theory, standard system information, manual customer service question and answer records, and manually annotated business standard questions and standard answers. Power customer service business experts check and correct the wrong answers in the instruction dataset, and rewrite the instruction sentences to expand the form of instructions in the dataset. After the experts correct and expand the instruction data, they obtain the power customer service field instruction dataset; in the model training stage, the improved power customer service semantic big model is fine-tuned on the power customer service field instruction dataset to obtain the power customer service intelligent question and answer big model.
13. The electric power customer service intelligent question-answering system based on a semantic big model according to claim 8, characterized in that: The steps of fine-tuning the improved electric customer service semantic model to obtain the electric customer service intelligent question-answering model are: The outputs of a series of large models are evaluated internally through reward models and reinforcement learning, and the improved electric customer service semantic large model is updated and optimized. Specifically: Train a reward model whose input is the user's question and the answer generated by the big model, and whose output is a scalar number that can judge the quality of the answer; After inputting user questions into the intelligent question-answering model of power customer service, the output result is obtained. After inputting the user questions and the answers generated by the large model into the trained reward model, the fine-tuning task of the large model is modeled as a reinforcement learning problem. The proximal optimization strategy is adopted, and the trust region optimization method is used to directly update the current model, limiting the changes of the model to the preset range of the previous model. Use the value function to estimate the difference between the expected output and the current output, and use the value function to update the policy by comparing the output of the current model with the output of the previous model: in, are model parameters, is the output of the large model; the value function is initialized by the reward model. After the user question and the output of the large model are given, the reward model generates a reward based on the value function. The large model adds a relative entropy penalty factor to each word.
14. The electric power customer service intelligent question-answering system based on a semantic big model according to claim 8, characterized in that: The questions are processed based on the intelligent question-answering model of the power customer service, and the responses to the questions of the power users are output, including: The prompt words or instructions added to the user's question are converted into a form that can be understood by the power customer service intelligent question and answer model, input into the power customer service intelligent question and answer model, and output the reply to the power user's question.
15. An electronic device, characterized in that: It comprises a processor and a memory, wherein the processor is used to execute a computer program stored in the memory to implement an intelligent question-answering method for electric customer service based on a semantic big model as described in any one of claims 1 to 7.
16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction, and when the at least one instruction is executed by the processor, it implements the intelligent question-answering method for electric customer service based on a semantic big model as described in any one of claims 1 to 7.
Citation Information
Cited By
User interaction method and device, electronic equipment, medium and product
CN119808719A
Distribution transformer fault detection method and system for photovoltaic transformer area
CN120429645A
A distribution transformer fault detection method and system for photovoltaic areas
CN120429645B
Industrial chain large model construction method and system based on domain knowledge enhancement
CN120851201A
Domain knowledge enhancement-based industry chain large model construction method and system
CN120851201B