Method, apparatus, storage medium and electronic device for generating knowledge base
By extracting semantic representations from customer and customer service conversation data and clustering, and configuring the target answer to generate knowledge base, the problems of high cost and slow construction of knowledge bases in the existing technology are solved, and the knowledge base is efficiently constructed and the efficiency of intelligent customer service is improved.
Patent Information
- Application Number
- CN202111022168.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-01
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2041-09-01
AI Technical Summary
The knowledge base construction method in the prior art has led to increased construction costs and slowed down construction speed, and the lack of effective automated construction solutions.
By obtaining the semantic representation of the conversation data between customers and customer service, clustering and configuring the target answers, generating a knowledge base, and using a large amount of conversation history data of everyone to build a knowledge base.
It reduces the construction cost of the knowledge base, improves the construction speed, and improves the service efficiency of intelligent customer service robots.
Smart Images

Figure CN113868415B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and more particularly, to a method, apparatus, storage medium, and electronic device for generating a knowledge base. Background Art
[0002] Intelligent customer service robots are increasingly widely used in the customer service field, improving the service experience of consumers while saving labor costs and creating profits for enterprises.
[0003] By sorting out the questions that consumers may ask and annotating a set of semantic recognition databases, also known as knowledge bases, the data scale and data quality of the knowledge base are of great significance for the semantic model based on deep learning to learn correct parameters. Therefore, the industry often invests a large amount of human costs in the construction and maintenance of the knowledge base, which not only greatly increases the construction cost of the knowledge base of intelligent customer service robots, but also greatly slows down the construction speed of the knowledge base.
[0004] In response to the above problems, no effective solution has been proposed yet. Summary of the Invention
[0005] Embodiments of this application provide a method, apparatus, storage medium, and electronic device for generating a knowledge base to at least solve the technical problem in the prior art that the knowledge base construction method increases the construction cost of the knowledge base and slows down the construction speed of the knowledge base.
[0006] According to one aspect of the embodiments of this application, a method for generating a knowledge base is provided, including: obtaining semantic representations of multiple customer statements; clustering the semantic representations of the multiple customer statements to obtain the knowledge points to which each customer statement belongs; configuring corresponding target answers for each knowledge point; and generating a knowledge base according to the corresponding relationship between the knowledge points and the target answers.
[0007] According to another aspect of the embodiments of this application, a device for generating a knowledge base is further provided, including: an acquisition module for obtaining semantic representations of multiple customer statements; a clustering module for clustering the semantic representations of the multiple customer statements to obtain the knowledge points to which each customer statement belongs; a configuration module for configuring corresponding target answers for each knowledge point; and a generation module for generating a knowledge base according to the corresponding relationship between the knowledge points and the target answers.
[0008] According to another aspect of the embodiments of this application, a non-volatile storage medium is further provided. The non-volatile storage medium includes a stored program, wherein when the program runs, it controls the device where the non-volatile storage medium is located to execute any one of the above methods for generating a knowledge base.
[0009] According to another aspect of the embodiments of the present application, an electronic device is further provided, including: a processor; and a memory connected to the processor for providing instructions for the processor to process the following steps: obtaining semantic representations of multiple client statements; clustering the semantic representations of the multiple client statements to obtain the knowledge points to which each client statement belongs; configuring corresponding target answers for each knowledge point; and generating a knowledge base according to the corresponding relationship between the knowledge points and the target answers.
[0010] In the embodiments of the present application, by obtaining semantic representations of multiple client statements; clustering the semantic representations of the multiple client statements to obtain the knowledge points to which each client statement belongs; configuring corresponding target answers for each knowledge point; and generating a knowledge base according to the corresponding relationship between the knowledge points and the target answers. It is easy to notice that the embodiments of the present application propose a general method for constructing a knowledge base from the conversation data between customers and customer service. By obtaining the semantic representations of multiple client statements in the process of communication between customers and customer service, and then clustering the semantic representations of the multiple client statements to obtain the knowledge points to which each client statement belongs, configuring corresponding target answers for each knowledge point, and finally generating a knowledge base based on the corresponding relationship between the knowledge points and the target answers.
[0011] Since enterprises with the need to build intelligent customer service robots usually have a large amount of conversation data between customers and customer service, the above method can utilize a large amount of human-human conversation history data, greatly reducing the construction cost of the knowledge base, and thus achieving the purpose of reducing the construction cost of the knowledge base and improving the construction speed of the knowledge base, thereby realizing the technical effect of improving the service efficiency of using the knowledge base to provide customer service for users, and further solving the technical problems in the existing knowledge base construction methods, such as increasing the construction cost of the knowledge base and slowing down the construction speed of the knowledge base. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The drawings described herein are used to provide a further understanding of the present application and form a part of the present application. The illustrative embodiments and descriptions thereof of the present application are used to explain the present application and do not constitute an improper limitation of the present application. In the drawings:
[0013] Figure 1 is a hardware structure block diagram of a computer terminal (or mobile device) for implementing a method for generating a knowledge base according to an embodiment of the present application;
[0014] Figure 2 is a schematic diagram of a method for generating a knowledge base according to an embodiment of the present application;
[0015] Figure 3 is a schematic diagram of an alternative method for generating a knowledge base according to an embodiment of the present application;
[0016] Figure 4 It is a schematic diagram of an optional method for generating a knowledge base according to an embodiment of the present application;
[0017] Figure 5 It is a schematic structural diagram of a device for generating a knowledge base according to an embodiment of the present application;
[0018] Figure 6 It is a structural block diagram of another computer terminal according to an embodiment of the present application. Detailed implementation manners
[0019] In order to enable those skilled in the art to better understand the solution of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0020] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0021] First, some nouns or terms that appear during the description of the embodiments of the present application are applicable to the following explanations:
[0022] Training set, validation set, test set: Three data sets with the same form randomly divided from the same data, which are used to train the model, verify the model effect during training and select the optimal model, and test the final model effect respectively.
[0023] Knowledge Base: It refers to a semantic recognition annotation database used to train intelligent robots, usually composed of multiple standard knowledge points and corresponding standard answers, and each knowledge point contains one or more similar questions.
[0024] Clustering: It refers to the method of unsupervised learning that measures the similarity of data in different dimensions and clusters similar data into a cluster. In the method of this application, clustering is used to cluster customer problems with similar semantics into a cluster, and this cluster is used as a knowledge point to participate in the process of building a knowledge base.
[0025] Semantic recognition model: It refers to a deep learning model trained according to the data in the knowledge base, which is used to estimate which knowledge point a customer problem belongs to during online services, so as to return the answer required by the customer.
[0026] Sentence vector representation model: It refers to a model that converts a sentence into a distributed vector to represent the sentence. The distributed vector can be regarded as the unique and general sentence semantic representation result.
[0027] In recent years, statistical learning methods represented by deep learning have shown great performance advantages in the field of data mining. Compared with the method of manually sorting out the knowledge base, the deep learning-based method usually replaces it by automatically building the knowledge base from data. However, due to the lack of relevant research, there has been no mature method for building a knowledge base from which data and in what way.
[0028] The inventor of this application found through research that a necessary condition for building an intelligent customer service robot is to train a semantic recognition model based on deep learning. By sorting out and annotating a set of semantic recognition databases, also known as knowledge bases, for the questions that consumers may ask, and using this knowledge base to train the semantic model in the intelligent customer service robot, the model can be made to have the ability to communicate with customers during the customer service process.
[0029] In the prior art, there is no mature automatic knowledge base construction scheme. The main reason is that existing schemes do not consider building a general sentence vector representation model to learn the general sentence semantics from a large amount of conversation data between customers and customer service. This results in most schemes being unable to endow sentences with good sentence vectors, thus causing the semantic cluster clustering effect to fail to meet the basic requirements of the knowledge base. In addition, during the process of building the knowledge base, the merging of knowledge points is not considered at the knowledge point level, resulting in many duplicate knowledge points in the knowledge base, which will further affect the semantic recognition effect.
[0030] Based on this, the embodiments of this application provide the following embodiments of a knowledge base generation method, device, storage medium, electronic device, etc.
[0031] Embodiment 1
[0032] According to an embodiment of the present application, an embodiment of a method for generating a knowledge base is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.
[0033] The method embodiment provided by Embodiment 1 of the present application can be executed on a mobile terminal, a computer terminal, or a similar computing device. Figure 1 The following shows a hardware structure block diagram of a computer terminal (or mobile device) for implementing the method for generating a knowledge base. As Figure 1 shown, the computer terminal 10 (or mobile device 10) may include one or more processors 102 (shown as 102a, 102b,..., 102n in the figure) (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission module 106 for communication functions. In addition, it may further include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply, and / or a camera. Those of ordinary skill in the art can understand that Figure 1 the structure shown is only schematic and does not limit the structure of the above-mentioned electronic device. For example, the computer terminal 10 may further include more or fewer components than Figure 1 shown, or have a different configuration from Figure 1 shown.
[0034] It should be noted that the above one or more processors 102 and / or other data processing circuits are generally referred to as "data processing circuits" in this article. The data processing circuit may be embodied in software, hardware, firmware, or any combination thereof, in whole or in part. In addition, the data processing circuit may be a single independent processing module, or be incorporated in whole or in part into any one of the other elements in the computer terminal 10 (or mobile device). As involved in the embodiments of the present application, the data processing circuit is used for processor control (such as the selection of a variable resistance terminal path connected to an interface).
[0035] The memory 104 can be used to store software programs and modules of application software, such as the program instruction / data storage device corresponding to the method for generating a knowledge base in the embodiments of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, implements the above-mentioned method for generating a knowledge base. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely disposed relative to the processor 102, and these remote memories can be connected to the computer terminal 10 through a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0036] The transmission device 106 is used to receive or send data via a network. Specific examples of the above-mentioned network may include a wireless network provided by a communication provider of the computer terminal 10. In one instance, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station and thus can communicate with the Internet. In one instance, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0037] The display can be, for example, a touch-screen liquid crystal display (LCD), and the liquid crystal display enables a user to interact with the user interface of the computer terminal 10 (or a mobile device).
[0038] It should be noted here that in some alternative embodiments, the above-mentioned Figure 1 shown computer device (or mobile device) may include hardware elements (including circuits), software elements (including computer code stored on a computer-readable medium), or a combination of both hardware elements and software elements. It should be pointed out that Figure 1 is only an example of a specific specific instance, and is intended to show the types of components that may exist in the above-mentioned computer device (or mobile device).
[0039] Under the above operating environment, the present application provides a method for generating a knowledge base as Figure 2 shown. Figure 2 is a flowchart of a method for generating a knowledge base according to an embodiment of the present application, as Figure 2 shown, and the above method can be implemented through the following steps:
[0040] Step S202, obtaining semantic representations of multiple client statements;
[0041] Step S204: Cluster the semantic representations of the multiple customer statements above to obtain the knowledge points to which each customer statement belongs;
[0042] Step S206: Configure corresponding target answers for each knowledge point;
[0043] Step S208: Generate a knowledge base based on the corresponding relationship between the above knowledge points and target answers. Train the initial sentence vector representation model based on the original data to obtain the target sentence vector representation model;
[0044] In the embodiment of the present application, by obtaining the semantic representations of multiple customer statements; clustering the semantic representations of the multiple customer statements above to obtain the knowledge points to which each customer statement belongs; configuring corresponding target answers for each knowledge point; and generating a knowledge base based on the corresponding relationship between the knowledge points and target answers.
[0045] It is easy to notice that the embodiment of the present application proposes a general method for constructing a knowledge base from customer-service conversation data. By obtaining the semantic representations of multiple customer statements during the communication between the customer and the customer service, clustering the semantic representations of the multiple customer statements to obtain the knowledge points to which each customer statement belongs, configuring corresponding target answers for each knowledge point, and finally generating a knowledge base based on the corresponding relationship between the knowledge points and target answers.
[0046] Since enterprises with the need to build intelligent customer service robots usually have a large amount of customer-service conversation data, the construction in the above manner can utilize a large amount of human-human conversation history data and greatly reduce the construction cost of the knowledge base. Thus, the purpose of reducing the construction cost of the knowledge base and improving the construction speed of the knowledge base is achieved, thereby realizing the technical effect of improving the service efficiency of using the knowledge base to provide customer service for users, and further solving the technical problems in the existing knowledge base construction methods, which lead to an increase in the construction cost of the knowledge base and a slowdown in the construction speed of the knowledge base.
[0047] As an optional embodiment, the method embodiment for generating the knowledge base provided by the embodiment of the present application can be, but is not limited to, applied in the field of intelligent dialogue, such as intelligent customer service robots, chatbots, and for example, Baidu UNIT, Tencent Cloud Xiaowei, etc.
[0048] Taking the intelligent dialogue scenario as an example, an intelligent customer service robot is a computer program that communicates via dialogue or text. It can act as a customer service side to simulate human conversations, providing a customer experience where the customer temporarily believes they are chatting with another real human. When the customer poses a question to the intelligent customer service robot, the robot finds the most appropriate target answer from the knowledge base and promptly replies to the customer. In the embodiments of the present application, popular current Internet terms can also be added to the knowledge base. After the content such as phrases and sentences sent by the customer is recognized by the knowledge base to obtain the corresponding target answer, the intelligent customer service robot directly feeds back the preset target answer to the customer through an algorithm.
[0049] Optionally, in the embodiments of the present application, any one of the clustering processing methods can be used to perform multiple clustering processes on the above-mentioned semantic representations of the customer's sentences. For example, but not limited to, the KMeans clustering algorithm, the KMeans++ clustering algorithm, the GMM clustering algorithm (Gaussian Mixture Model), etc.
[0050] As an optional embodiment, the semantic representations of the above-mentioned multiple customer sentences are obtained in the following manner: the above-mentioned multiple customer sentences are input into the target sentence vector representation model, and the output of the target sentence vector representation model is the semantic representations of the above-mentioned multiple customer sentences;
[0051] Among them, the above-mentioned target sentence vector representation model is obtained by training the initial sentence vector representation model based on the original data. The above-mentioned original data is the dialogue log data between the customer and the customer service side, and the dialogue log data includes: multiple customer sentences and multiple customer service sentences.
[0052] Optionally, in the embodiments of the present application, the above-mentioned initial sentence vector representation model is a general sentence vector representation model, that is, any sentence vector representation model can be used. For example, machine translation models such as the LSTM long short-term memory artificial neural network model, Transformer, BERT, XLNET, etc.
[0053] Optionally, the above-mentioned original data is the dialogue log data between the customer and the customer service side, and the dialogue log data includes: multiple customer sentences and multiple customer service sentences.
[0054] Optionally, the above-mentioned dialogue log data can be human-to-human dialogue log data, that is, log data obtained from conversations between people. For example, it can be log data obtained from chat conversations between the customer and the customer service side. The human-to-human dialogue log data contains: multiple customer sentences and / or multiple customer service sentences.
[0055] As an alternative embodiment, from the perspective of processing performance, KMeans, that is, the K-means clustering algorithm, can be selected for the first clustering process. The process flow chart of the secondary clustering is as follows Figure 3 As shown, after preparing the human-human dialogue log data for training, first randomly initialize the initial sentence vector representation model to be trained. This initial sentence vector representation model optimizes the distributed sentence representation vectors of both the customer side and the customer service side according to the input human-human dialogue log data. After the model iteration training converges, re-enter all the sentences of both the customer side and the customer service side into the model to obtain the final optimized general distributed sentence representation vectors, and then complete the construction of primary knowledge points through the KMeans clustering algorithm.
[0056] In the embodiments of the present application, as Figure 3 shown, the method for constructing primary knowledge points can adopt any clustering algorithm, including but not limited to: KMeans clustering algorithm, GMM clustering algorithm, DBScan clustering algorithm, etc. However, since the human-human dialogue log usually contains a large number of dialogue sentences, and the purpose of constructing primary knowledge points is to divide a large number of general sentence representations into semantic cluster units, the most suitable first clustering algorithm is KMeans.
[0057] As another alternative embodiment, after the construction of primary knowledge points is completed, since the distances between semantic clusters are not balanced. For example, at the high-frequency customer questions with dense semantics, the distances between semantic clusters are small; while at the low-frequency questions with sparse semantics, the distances between semantic clusters are large. Therefore, as Figure 3 shown, the embodiments of the present application adopt the DBScan clustering algorithm to perform secondary clustering and merging at the knowledge point level for the semantic cluster centers; after the merging at the knowledge point level is completed, then select the corresponding standard answers for the knowledge points, that is, a complete knowledge base is constructed.
[0058] It should be noted that in the embodiments of the present application, the secondary clustering algorithm can also adopt (but not limited to) KMeans, Gaussian Mixture Model, DBScan, etc. However, since the purpose of merging at the knowledge point level is to synthesize neighboring knowledge points into one, and the neighboring knowledge points may form various topological forms and do not necessarily satisfy the pairwise neighboring relationship, the most suitable clustering algorithm is the DBScan clustering algorithm.
[0059] In an alternative embodiment, as Figure 4 shown, the training of the above initial sentence vector representation model based on the original data includes:
[0060] Step S302, obtaining sample data based on the above original data;
[0061] Step S304: Input the above sample data into the above initial sentence vector representation model and output a prediction result;
[0062] Step S306: Compare the above prediction result with the standard result to obtain a loss result;
[0063] Step S308: Update the parameters of the above initial sentence vector representation model using the above loss result to obtain the above target sentence vector representation model.
[0064] Optionally, the above sample data includes: a training set, a validation set, and a test set. In the embodiments of the present application, the sample data: the training set, the validation set, and the test set can be segmented from the original data. Optionally, before inputting the above sample data into the above initial sentence vector representation model, conventional data cleaning processing can also be performed on the above sample data, such as: data anonymization, stop word removal, word segmentation, etc.
[0065] As an alternative embodiment, the initial sentence vector representation is the basis for constructing a knowledge base. However, the methods in the prior art either represent sentences based on features such as words and tf-idf of the sentences, or directly extract sentence vectors through models such as BERT and XLNET, all ignoring the potential and effect of using a large amount of human-human conversation logs to learn sentence representation. Based on this, the embodiments of the present application optimize the sentence vectors of the customer side and the customer service side simultaneously by introducing human-human conversation log data, train or fine-tune an initial sentence vector representation model with good performance through a large amount of conversation log data, and obtain a target sentence vector representation model by means of a large amount of human-human conversation log data, so as to realize the automatic construction of the knowledge base.
[0066] In an alternative embodiment, obtaining the above sample data based on the above original data includes:
[0067] Step S402: Select a first customer service statement and a second customer service statement from the above original data;
[0068] Step S404: Obtain the customer context statements associated with the above first customer service statement, where the above customer context statements include: customer upper context statements, and / or, customer lower context statements;
[0069] Step S406: Determine the above customer context statements, the above first customer service statement, and the above second customer service statement as the above sample data.
[0070] As an alternative embodiment, it is necessary to process the human-to-human conversation log data into the form required by the sentence vector representation model. For example, each piece of human-to-human conversation log data can be centered around the response r (the first customer service statement) of a certain customer service party, and t statements u of the customer party are taken forward and backward, and u is used as the customer party context statement of r. At the same time, randomly select the response r' (the second customer service statement) of the customer service party from all the human-to-human conversation log data, and determine the above-mentioned customer party context statement, the above-mentioned first customer service statement, and the above-mentioned second customer service statement as the above-mentioned sample data.
[0071] In the above alternative embodiment, the embodiment of the present application inputs u, r, and r' as sample data into the initial sentence vector representation model for training, and outputs a prediction result; then, by comparing the above prediction result with the standard result, a loss result is obtained; the parameters of the above initial sentence vector representation model are updated using the above loss result to obtain the above target sentence vector representation model.
[0072] It should be noted that the above initial sentence vector representation model can be implemented using LSTM, Transformer, BERT, XLNET, etc. Since the quantity of human-to-human conversation log data is usually large, in order to balance the processing efficiency and processing speed, the LSTM network model is used in the embodiment of the present application to train the initial sentence vector representation model to obtain the target sentence vector representation model.
[0073] In an alternative embodiment, inputting the above sample data into the above initial sentence vector representation model and outputting the above prediction result includes:
[0074] Step S502, converting the above sample data into a sentence representation vector to be used.
[0075] Step S504, aggregating the above multiple upper-context sentence vectors into a third sentence vector, and aggregating the above multiple lower-context sentence vectors into a fourth sentence vector;
[0076] Step S506, performing a splicing process on the above third sentence vector, the above fourth sentence vector, and the above first sentence vector to obtain a first spliced vector, and performing a splicing process on the above third sentence vector, the above fourth sentence vector, and the above second sentence vector to obtain a second spliced vector;
[0077] Step S508, inputting the above first spliced vector and the above second spliced vector into the above initial sentence vector representation model, and outputting the above prediction result.
[0078] In the above step S502, the sentence representation vectors to be used include: multiple previous sentence vectors corresponding to the above-mentioned customer's previous sentences, multiple following sentence vectors corresponding to the above-mentioned customer's following sentences, the first sentence vector corresponding to the above-mentioned first customer service sentence, and the second sentence vector corresponding to the above-mentioned second customer service sentence.
[0079] As an optional embodiment, when u, r, and r' are fed into the initial sentence vector representation model together, the general sentence vector representation model is encouraged to distinguish positive / negative samples between r and r', so as to optimize the sentence vectors of u and r simultaneously. For example, during the process of training the model, first, u, r, and r' are simultaneously converted into sentence representation vectors through an encoder module, and then through an aggregation operation, multiple previous sentence vectors are aggregated into a previous sentence vector representation, and multiple following sentence vectors are aggregated into a following sentence vector representation, that is, the above-mentioned multiple previous sentence vectors are aggregated into a third sentence vector, and the above-mentioned multiple following sentence vectors are aggregated into a fourth sentence vector; then the third sentence vector, the fourth sentence vector, and the first sentence vector corresponding to r are concatenated to obtain a first concatenated vector, and the third sentence vector, the above-mentioned fourth sentence vector, and the second sentence vector corresponding to r' are also concatenated to obtain a second concatenated vector.
[0080] In the embodiment of the present application, after obtaining the first concatenated vector and the second concatenated vector, the above-mentioned first concatenated vector and the above-mentioned second concatenated vector are input into the feed-forward neural network (FFN) of the above-mentioned initial sentence vector representation model, and the above-mentioned prediction result, that is, the positive / negative sample prediction result, is output. By comparing this prediction result with the standard result, a loss result is obtained, and the parameters of the above-mentioned initial sentence vector representation model are updated using the above-mentioned loss result to obtain the above-mentioned target sentence vector representation model.
[0081] In an optional embodiment, the clustering of the semantic representations of the above-mentioned multiple customer sentences to obtain the knowledge points to which each customer sentence belongs includes:
[0082] Step S602, perform a first clustering process on the semantic representation of the above-mentioned customer sentence to obtain a first clustering result, where the above-mentioned first clustering result includes: the cluster center features of each semantic cluster in multiple semantic clusters and the semantic cluster to which each customer sentence belongs;
[0083] Step S604, perform a secondary clustering process on the above-mentioned first clustering result to obtain a second clustering result, where the above-mentioned second clustering result includes: the knowledge points to which each customer sentence in the above-mentioned multiple customer sentences belongs.
[0084] Optionally, the above-mentioned first clustering process refers to a problem clustering process, and the above-mentioned second clustering process refers to a knowledge point clustering process.
[0085] In the above optional embodiments, after the target sentence vector representation model is trained, first, all human-human conversation log data is distinguished according to the statements of the customer side and the customer service side, and the sentences of the customer side are sent into the target sentence vector representation model. By extracting the output of the encoder module, the semantic representation of the customer side sentences is obtained. Through the target sentence vector representation model, sentence vectors are extracted for all customer questions, and question clustering (first clustering) and knowledge point clustering (second clustering) are performed based on the sentence vectors to achieve automatic construction of knowledge points, knowledge point merging, and thus automatic construction of the knowledge base.
[0086] As an optional embodiment, the semantic representation of customer sentences can be clustered twice in the following way. When obtaining the semantic representations of all customer sentences, first, a first semantic center clustering is performed on all sentences. The first clustering process in the embodiments of the present application can adopt the KMeans clustering method. The first clustering result includes the cluster center features of each semantic cluster and the semantic cluster to which each sentence belongs. Then, a second clustering process is performed on the semantic cluster centers to obtain the second clustering result. The second clustering process in the embodiments of the present application can adopt the DBScan clustering method. Through the above embodiments, the knowledge point hierarchy is secondarily clustered and merged to obtain the knowledge point structure and the knowledge points to which each customer question belongs.
[0087] In an optional embodiment, the above-mentioned configuration of corresponding target answers for each knowledge point includes:
[0088] Step S702, obtaining the highest-frequency answer corresponding to each semantic cluster among the above-mentioned multiple semantic clusters;
[0089] Step S704, configuring the above-mentioned highest-frequency answer as the above-mentioned target answer.
[0090] As an optional embodiment, the following method can be adopted to configure the corresponding standard answer, that is, the target answer, for the above-mentioned knowledge points to generate a knowledge base: After the knowledge points and the customer questions included in the knowledge points are automatically constructed, it is necessary to configure the standard answers corresponding to each knowledge point to construct a knowledge base. The above-mentioned configuration method can be to mine the highest-frequency answer corresponding to the customer question semantic cluster from the human-human conversation log data as the standard answer, or to obtain the standard answer through manual writing.
[0091] In an optional embodiment, the above-mentioned method for generating the knowledge base further includes:
[0092] Step S802, training the initial semantic recognition model based on the above-mentioned knowledge base to obtain a target semantic recognition model;
[0093] Step S804, obtaining the customer-side question statement to be answered;
[0094] Step S806: Use the above target semantic recognition model to predict the knowledge points corresponding to the customer's problem statement.
[0095] Step S808: Feedback the answer adapted to the predicted knowledge points.
[0096] Semantic recognition model: It refers to a deep learning model trained based on the knowledge base data, which is used to estimate which knowledge point the customer's problem belongs to during online services, so as to return the answer required by the customer.
[0097] As another optional embodiment, after the primary knowledge points are constructed, since the distances between semantic clusters are not balanced. For example, at the high-frequency customer problems with dense semantics, the distance between semantic clusters is small; while at the low-frequency problems with sparse semantics, the distance between semantic clusters is large. Therefore, the initial semantic recognition model can also be trained based on the above knowledge base to obtain the target semantic recognition model. However, since the purpose of knowledge point level merging is to combine neighboring knowledge points into one, and the neighboring knowledge points may form various topological forms, which do not necessarily satisfy the pairwise neighboring relationship. Therefore, in an optional embodiment provided in this application, the customer's problem statement to be answered can also be obtained; use the above target semantic recognition model to predict the knowledge points corresponding to the customer's problem statement; after the knowledge point level merging is completed, feedback the answer adapted to the predicted knowledge points.
[0098] It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that this application is not limited by the described action sequence, because according to this application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0099] Through the description of the above implementation manners, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such an understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disc), and includes several instructions to enable a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0100] Embodiment 2
[0101] According to an embodiment of the present application, there is also provided an apparatus for implementing the above-mentioned method for generating a knowledge base. Figure 5 It is a schematic structural diagram of an apparatus for generating a knowledge base according to an embodiment of the present application, as Figure 5 shown. The apparatus includes: an acquisition module 500, a clustering module 502, a configuration module 504, and a generation module 506, where:
[0102] The acquisition module 500 is configured to obtain semantic representations of multiple customer-side statements; the clustering module 502 is configured to cluster the semantic representations of the multiple customer-side statements to obtain the knowledge points to which each customer-side statement belongs; the configuration module 504 is configured to configure corresponding target answers for each knowledge point; and the generation module 506 is configured to generate a knowledge base according to the corresponding relationship between the knowledge points and the target answers.
[0103] In the embodiment of the present application, by obtaining semantic representations of multiple customer-side statements; clustering the semantic representations of the multiple customer-side statements to obtain the knowledge points to which each customer-side statement belongs; configuring corresponding target answers for each knowledge point; and generating a knowledge base according to the corresponding relationship between the knowledge points and the target answers. It is easy to notice that the embodiment of the present application proposes a general method for constructing a knowledge base from customer-service conversation data. By obtaining semantic representations of multiple customer-side statements during the communication between the customer and the customer service, and then clustering the semantic representations of the multiple customer-side statements to obtain the knowledge points to which each customer-side statement belongs, configuring corresponding target answers for each knowledge point, and finally generating a knowledge base based on the corresponding relationship between the knowledge points and the target answers.
[0104] Since enterprises with the need to build intelligent customer service robots usually have a large amount of customer-service conversation data, the construction in the above manner can utilize a large amount of human-human conversation history data, and greatly reduce the construction cost of the knowledge base, thereby achieving the purpose of reducing the construction cost of the knowledge base and improving the construction speed of the knowledge base, and thus realizing the technical effect of improving the service efficiency of using the knowledge base to provide customer service for users, and further solving the technical problems in the existing knowledge base construction methods, which lead to an increase in the construction cost of the knowledge base and a slowdown in the construction speed of the knowledge base.
[0105] It should be noted here that the above-mentioned acquisition module 500, clustering module 502, configuration module 504, and generation module 506 correspond to steps S202 to S208 in Embodiment 1. The examples and application scenarios implemented by the above modules and the corresponding steps are the same, but are not limited to the content disclosed in the above Embodiment 1. It should be noted that the above modules, as part of the apparatus, can run in the computer terminal 10 provided in Embodiment 1.
[0106] It should be noted that the preferred implementation of this embodiment can refer to the relevant description in Method Embodiment 1, which will not be elaborated here.
[0107] Embodiment 3
[0108] According to an embodiment of the present application, an embodiment of an electronic device is further provided. The electronic device can be any one of the computing devices in a computing device cluster. The electronic device includes: a processor and a memory, where:
[0109] A processor; and a memory, connected to the above-mentioned processor, for providing instructions for the above-mentioned processor to process the following steps: obtaining semantic representations of multiple client statements; clustering the semantic representations of the multiple client statements to obtain the knowledge points to which each client statement belongs; configuring corresponding target answers for each knowledge point; and generating a knowledge base according to the corresponding relationship between the above-mentioned knowledge points and the target answers.
[0110] In the embodiment of the present application, by obtaining semantic representations of multiple client statements; clustering the semantic representations of the multiple client statements to obtain the knowledge points to which each client statement belongs; configuring corresponding target answers for each knowledge point; and generating a knowledge base according to the corresponding relationship between the above-mentioned knowledge points and the target answers. It is easy to notice that the embodiment of the present application proposes a general method for constructing a knowledge base from customer-service conversation data. By obtaining the semantic representations of multiple client statements during the communication between the customer and the customer service, and then clustering the semantic representations of the multiple client statements to obtain the knowledge points to which each client statement belongs, configuring corresponding target answers for each knowledge point, and finally generating a knowledge base based on the corresponding relationship between the knowledge points and the target answers.
[0111] Since enterprises with the need to build intelligent customer service robots usually have a large amount of customer-service conversation data, the construction in the above manner can utilize a large amount of human-human conversation history data, greatly reducing the construction cost of the knowledge base, and thus achieving the purpose of reducing the construction cost of the knowledge base and improving the construction speed of the knowledge base, thereby realizing the technical effect of improving the service efficiency of using the knowledge base to provide customer service for users, and further solving the technical problems in the existing knowledge base construction methods, such as increasing the construction cost of the knowledge base and slowing down the construction speed of the knowledge base.
[0112] It should be noted that the preferred implementation of this embodiment can refer to the relevant description in Method Embodiment 1, which will not be elaborated here.
[0113] Embodiment 4
[0114] According to an embodiment of the present application, an embodiment of a computer terminal is further provided. The computer terminal may be any computer terminal device in a computer terminal group. Optionally, in this embodiment, the above computer terminal may also be replaced with a terminal device such as a mobile terminal.
[0115] Optionally, in this embodiment, the above computer terminal may be located in at least one of multiple network devices in a computer network.
[0116] In this embodiment, the above computer terminal may execute the program code of the following steps in the vulnerability detection method of the application program: obtaining semantic representations of multiple client statements; clustering the semantic representations of the multiple client statements to obtain the knowledge points to which each client statement belongs; configuring corresponding target answers for each knowledge point; and generating a knowledge base according to the corresponding relationship between the knowledge points and the target answers.
[0117] Optionally, Figure 6 is a structural block diagram of another computer terminal according to an embodiment of the present application. As Figure 6 shown, the computer terminal may include: one or more (only one is shown in the figure) processors 602, a memory 604, and a peripheral interface 606.
[0118] Among them, the memory may be used to store software programs and modules, such as the program instructions / modules corresponding to the security vulnerability detection method and device in the embodiment of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, implements the above-mentioned system vulnerability attack detection method. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some instances, the memory may further include a memory remotely set relative to the processor, and these remote memories may be connected to the computer terminal through a network. Examples of the above network include but are not limited to the Internet, an enterprise internal network, a local area network, a mobile communication network, and combinations thereof.
[0119] The processor may call the information and application programs stored in the memory through a transmission device to execute the following steps: obtaining semantic representations of multiple client statements; clustering the semantic representations of the multiple client statements to obtain the knowledge points to which each client statement belongs; configuring corresponding target answers for each knowledge point; and generating a knowledge base according to the corresponding relationship between the knowledge points and the target answers.
[0120] Optionally, the above-mentioned processor may also execute the program code of the following steps: input the above-mentioned multiple client statements into a target sentence vector representation model, and the output of the target sentence vector representation model is the semantic representation of the above-mentioned multiple client statements; wherein, the target sentence vector representation model is obtained by training an initial sentence vector representation model based on original data, and the original data is the dialogue log data between the client side and the customer service side, and the dialogue log data includes: multiple client statements and multiple customer service statements.
[0121] Optionally, the above-mentioned processor may also execute the program code of the following steps: obtain sample data based on the above-mentioned original data; input the above-mentioned sample data into the above-mentioned initial sentence vector representation model to output a prediction result; compare the above-mentioned prediction result with a standard result to obtain a loss result; use the above-mentioned loss result to update the parameters of the above-mentioned initial sentence vector representation model to obtain the above-mentioned target sentence vector representation model.
[0122] Optionally, the above-mentioned processor may also execute the program code of the following steps: select a first customer service statement and a second customer service statement from the above-mentioned original data; obtain client context statements associated with the above-mentioned first customer service statement, wherein the client context statements include: client upstream statements, and / or, client downstream statements; determine the above-mentioned client context statements, the above-mentioned first customer service statement, and the above-mentioned second customer service statement as the above-mentioned sample data.
[0123] Optionally, the above-mentioned processor may also execute the program code of the following steps: convert the above-mentioned sample data into a sentence representation vector to be used, wherein the sentence representation vector to be used includes: multiple upstream sentence vectors corresponding to the above-mentioned client upstream statements, multiple downstream sentence vectors corresponding to the above-mentioned client downstream statements, a first sentence vector corresponding to the above-mentioned first customer service statement, and a second sentence vector corresponding to the above-mentioned second customer service statement; aggregate the above-mentioned multiple upstream sentence vectors into a third sentence vector, and aggregate the above-mentioned multiple downstream sentence vectors into a fourth sentence vector; perform splicing processing on the above-mentioned third sentence vector, the above-mentioned fourth sentence vector, and the above-mentioned first sentence vector to obtain a first spliced vector, and perform splicing processing on the above-mentioned third sentence vector, the above-mentioned fourth sentence vector, and the above-mentioned second sentence vector to obtain a second spliced vector; input the above-mentioned first spliced vector and the above-mentioned second spliced vector into the above-mentioned initial sentence vector representation model to output the above-mentioned prediction result.
[0124] Optionally, the above-mentioned processor may also execute the program code of the following steps: perform a first clustering process on the semantic representation of the above-mentioned customer-side sentence to obtain a first clustering result, where the above-mentioned first clustering result includes: the cluster center feature of each semantic cluster in multiple semantic clusters and the semantic cluster to which each customer-side statement belongs; perform a second clustering process on the above-mentioned first clustering result to obtain a second clustering result, where the above-mentioned second clustering result includes: the knowledge points to which each of the above-mentioned multiple customer-side statements belongs.
[0125] Optionally, the above-mentioned processor may also execute the program code of the following steps: obtain the highest-frequency answer corresponding to each semantic cluster in the above-mentioned multiple semantic clusters; configure the above-mentioned highest-frequency answer as the above-mentioned target answer.
[0126] Optionally, the above-mentioned processor may also execute the program code of the following steps: train an initial semantic recognition model based on the above-mentioned knowledge base to obtain a target semantic recognition model; obtain a customer-side question statement to be answered; use the above-mentioned target semantic recognition model to predict the knowledge points corresponding to the above-mentioned customer-side question statement; feedback an answer adapted to the predicted knowledge points.
[0127] By adopting the embodiments of the present application, a generation scheme of a knowledge base is provided. In the embodiments of the present application, by obtaining the semantic representations of multiple customer-side statements; clustering the semantic representations of the above-mentioned multiple customer-side statements to obtain the knowledge points to which each customer-side statement belongs; configuring corresponding target answers for each knowledge point; and generating a knowledge base according to the corresponding relationship between the above-mentioned knowledge points and the target answers. It is easy to notice that the embodiments of the present application propose a general method for constructing a knowledge base from customer-service conversation data. By obtaining the semantic representations of multiple customer-side statements during the communication between the customer and the customer service, and then clustering the semantic representations of the multiple customer-side statements to obtain the knowledge points to which each customer-side statement belongs, configuring corresponding target answers for each knowledge point, and finally generating a knowledge base based on the corresponding relationship between the knowledge points and the target answers.
[0128] Since enterprises with the need to build intelligent customer service robots usually have a large amount of customer-service conversation data, the construction in the above manner can utilize a large amount of human-human conversation historical data, greatly reduce the construction cost of the knowledge base, and thus achieve the purpose of reducing the construction cost of the knowledge base and improving the construction speed of the knowledge base, thereby realizing the technical effect of improving the service efficiency of providing customer service to users using the knowledge base, and further solving the technical problems in the existing knowledge base construction methods, which lead to an increase in the construction cost of the knowledge base and a slowdown in the construction speed of the knowledge base.
[0129] Those of ordinary skill in the art can understand Figure 6The structure shown is only illustrative. The computer terminal can also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, and terminal devices such as Mobile Internet Devices (MID), PAD, etc. Figure 6 It does not limit the structure of the above-mentioned electronic device. For example, the computer terminal may further include more or fewer components (such as a network interface, a display device, etc.) than those shown Figure 6 in the figure, or have a different configuration from that shown Figure 6 in the figure.
[0130] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program. The program can be stored in a computer-readable non-volatile storage medium, and the non-volatile storage medium can include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disc, etc.
[0131] Embodiment 5
[0132] According to an embodiment of the present application, an embodiment of a non-volatile storage medium is further provided. Optionally, in this embodiment, the above non-volatile storage medium can be used to save the program code executed by the method for generating the knowledge base provided in the above Embodiment 1.
[0133] Optionally, in this embodiment, the above storage medium can be located in any one of the computer terminals in a computer terminal group in a computer network, or in any one of the mobile terminals in a mobile terminal group.
[0134] Optionally, in this embodiment, the storage medium is set to store program code for performing the following steps: obtaining semantic representations of multiple client statements; clustering the semantic representations of the multiple client statements to obtain the knowledge points to which each client statement belongs; configuring corresponding target answers for each knowledge point; and generating a knowledge base according to the corresponding relationship between the above knowledge points and the target answers.
[0135] Optionally, in this embodiment, the storage medium is set to store program code for performing the following steps: inputting the above multiple client statements into a target sentence vector representation model, and the output of the target sentence vector representation model is the semantic representations of the above multiple client statements; wherein, the above target sentence vector representation model is obtained by training an initial sentence vector representation model based on original data, and the above original data is the dialogue log data between the client and the customer service, and the dialogue log data includes: multiple client statements and multiple customer service statements.
[0136] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: obtaining sample data based on the above-mentioned original data; inputting the above-mentioned sample data into the above-mentioned initial sentence vector representation model to output a prediction result; comparing the above-mentioned prediction result with a standard result to obtain a loss result; and updating the parameters of the above-mentioned initial sentence vector representation model by using the above-mentioned loss result to obtain the above-mentioned target sentence vector representation model.
[0137] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: selecting a first customer service statement and a second customer service statement from the above-mentioned original data; obtaining a customer context statement associated with the above-mentioned first customer service statement, where the above-mentioned customer context statement includes: a customer upper-context statement, and / or, a customer lower-context statement; and determining the above-mentioned customer context statement, the above-mentioned first customer service statement, and the above-mentioned second customer service statement as the above-mentioned sample data.
[0138] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: converting the above-mentioned sample data into a sentence representation vector to be used, where the above-mentioned sentence representation vector to be used includes: a plurality of upper-sentence vectors corresponding to the above-mentioned customer upper-context statement, a plurality of lower-sentence vectors corresponding to the above-mentioned customer lower-context statement, a first sentence vector corresponding to the above-mentioned first customer service statement, and a second sentence vector corresponding to the above-mentioned second customer service statement; aggregating the above-mentioned plurality of upper-sentence vectors into a third sentence vector, and aggregating the above-mentioned plurality of lower-sentence vectors into a fourth sentence vector; performing a concatenation process on the above-mentioned third sentence vector, the above-mentioned fourth sentence vector, and the above-mentioned first sentence vector to obtain a first concatenated vector, and performing a concatenation process on the above-mentioned third sentence vector, the above-mentioned fourth sentence vector, and the above-mentioned second sentence vector to obtain a second concatenated vector; and inputting the above-mentioned first concatenated vector and the above-mentioned second concatenated vector into the above-mentioned initial sentence vector representation model to output the above-mentioned prediction result.
[0139] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: performing a first clustering process on the above-mentioned customer sentence semantic representation to obtain a first clustering result, where the above-mentioned first clustering result includes: the cluster center feature of each semantic cluster in a plurality of semantic clusters and the semantic cluster to which each customer statement belongs; and performing a second clustering process on the above-mentioned first clustering result to obtain a second clustering result, where the above-mentioned second clustering result includes: the knowledge point to which each of the above-mentioned plurality of customer statements belongs.
[0140] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: obtaining the highest-frequency answer corresponding to each semantic cluster in the above-mentioned plurality of semantic clusters; and configuring the above-mentioned highest-frequency answer as the above-mentioned target answer.
[0141] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: training an initial semantic recognition model based on the above knowledge base to obtain a target semantic recognition model; acquiring a client problem statement to be answered; predicting a knowledge point corresponding to the client problem statement by using the above target semantic recognition model; and feeding back an answer adapted to the predicted knowledge point.
[0142] The serial numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.
[0143] In the above embodiments of the present application, the descriptions of the respective embodiments have their own emphases. For parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
[0144] In several embodiments provided by the present application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces, and the indirect coupling or communication connection of units or modules can be in an electrical or other form.
[0145] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0146] In addition, the functional units in the various embodiments of the present application can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.
[0147] When the integrated unit 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 technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, read-only memories (ROMs), random access memories (RAMs), mobile hard disks, magnetic disks, or optical discs.
[0148] The above are only the preferred embodiments of this application. It should be noted that for those of ordinary skill in the art, without departing from the principle of this application, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of this application.
Claims
1. A method for generating a knowledge base, characterized in that, Including: Inputting multiple client statements into a target sentence vector representation model to obtain semantic representations of the multiple client statements, where the target sentence vector representation model is used to extract sentence vectors from the semantic representations of the multiple client statements, and the target sentence vector representation model is obtained by training an initial sentence vector representation model based on original data, the original data being dialogue log data between a client and a customer service, the dialogue log data including: multiple client statements and multiple customer service statements; Clustering the semantic representations of the multiple client statements to obtain the knowledge points to which each client statement belongs; Configuring corresponding target answers for each knowledge point; Generating a knowledge base according to the corresponding relationship between the knowledge points and the target answers; The training of the initial sentence vector representation model based on the original data includes: converting sample data into sentence representation vectors to be used, the sample data including client context statements, a first customer service statement, and a second customer service statement, the client context statements including: client previous statements, and / or, client subsequent statements, the sentence representation vectors to be used including: multiple previous sentence vectors corresponding to the client previous statements, multiple subsequent sentence vectors corresponding to the client subsequent statements, a first sentence vector corresponding to the first customer service statement, and a second sentence vector corresponding to the second customer service statement; aggregating the multiple previous sentence vectors into a third sentence vector; aggregating the multiple subsequent sentence vectors into a fourth sentence vector; performing splicing processing on the third sentence vector, the fourth sentence vector, and the first sentence vector to obtain a first spliced vector, and performing splicing processing on the third sentence vector, the fourth sentence vector, and the second sentence vector to obtain a second spliced vector; using the prediction result and the standard result to obtain the target sentence vector representation model, the prediction result being obtained by inputting the first spliced vector and the second spliced vector into the initial sentence vector representation model.
2. The method for generating a knowledge base according to claim 1, wherein The training of the initial sentence vector representation model based on the original data includes: Obtaining sample data based on the original data; Inputting the sample data into the initial sentence vector representation model and outputting a prediction result; Comparing the prediction result with the standard result to obtain a loss result; Updating the parameters of the initial sentence vector representation model using the loss result to obtain the target sentence vector representation model.
3. The method for generating a knowledge base according to claim 2, wherein Obtaining the sample data based on the original data includes: Selecting a first customer service statement and a second customer service statement from the original data; Obtaining client context statements associated with the first customer service statement; Determining the client context statements, the first customer service statement, and the second customer service statement as the sample data.
4. The method for generating the knowledge base according to claim 1, wherein The clustering of the semantic representations of the multiple client statements to obtain the knowledge points to which each client statement belongs includes: Performing a first clustering process on the semantic representations of the client sentences to obtain a first clustering result, where the first clustering result includes: the cluster center features of each semantic cluster in multiple semantic clusters and the semantic cluster to which each client statement belongs; Perform a secondary clustering process on the first clustering result to obtain a second clustering result, where the second clustering result includes: the knowledge points to which each of the multiple customer statements belongs.
5. The method for generating a knowledge base according to claim 4, wherein Configuring a corresponding target answer for each knowledge point includes: Obtaining the highest-frequency answer corresponding to each semantic cluster among the multiple semantic clusters; Configuring the highest-frequency answer as the target answer.
6. The method for generating the knowledge base according to claim 4, wherein The method for generating the knowledge base further includes: Training an initial semantic recognition model based on the knowledge base to obtain a target semantic recognition model; Obtaining a customer question statement to be answered; Using the target semantic recognition model to predict the knowledge point corresponding to the customer question statement; Feeding back an answer adapted to the predicted knowledge point.
7. A generating device for a knowledge base, characterized in that Including: An acquisition module, configured to input multiple customer statements into a target sentence vector representation model to obtain semantic representations of the multiple customer statements, where the target sentence vector representation model is used to extract sentence vectors from the semantic representations of the multiple customer statements, and the target sentence vector representation model is obtained by training an initial sentence vector representation model based on original data, the original data being dialogue log data between a customer and a customer service representative, the dialogue log data including: multiple customer statements and multiple customer service representative statements; training the initial sentence vector representation model based on the original data includes: converting sample data into sentence representation vectors to be used, the sample data including a customer context statement, a first customer service representative statement, and a second customer service representative statement, the customer context statement including: a customer previous statement, and / or, a customer subsequent statement; the sentence representation vectors to be used include: multiple previous sentence vectors corresponding to the customer previous statement, multiple subsequent sentence vectors corresponding to the customer subsequent statement, a first sentence vector corresponding to the first customer service representative statement, and a second sentence vector corresponding to the second customer service representative statement; aggregating the multiple previous sentence vectors into a third sentence vector; aggregating the multiple subsequent sentence vectors into a fourth sentence vector; performing a concatenation process on the third sentence vector, the fourth sentence vector, and the first sentence vector to obtain a first concatenated vector, and performing a concatenation process on the third sentence vector, the fourth sentence vector, and the second sentence vector to obtain a second concatenated vector; using a prediction result and a standard result to obtain the target sentence vector representation model, the prediction result being obtained by inputting the first concatenated vector and the second concatenated vector into the initial sentence vector representation model; A clustering module, configured to cluster the semantic representations of the multiple customer statements to obtain the knowledge points to which each customer statement belongs; A configuration module, configured to configure a corresponding target answer for each knowledge point; A generation module, configured to generate a knowledge base according to the corresponding relationship between the knowledge points and the target answers.
8. A non-volatile storage medium, characterized in that, The non-volatile storage medium includes a stored program, where when the program runs, it controls the device where the non-volatile storage medium is located to execute the method for generating the knowledge base according to any one of claims 1 to 6.
9. An electronic device, characterized in that, Including: A processor; And A memory, connected to the processor, for providing instructions for the processor to perform the following processing steps: Input multiple client statements into the target sentence vector representation model to obtain the semantic representations of the multiple client statements. Among them, the target sentence vector representation model is used to extract sentence vectors from the semantic representations of the multiple client statements. The target sentence vector representation model is obtained by training an initial sentence vector representation model based on original data, where the original data is the dialogue log data between the client and the customer service, and the dialogue log data includes: multiple client statements and multiple customer service statements; Cluster the semantic representations of the multiple client statements to obtain the knowledge points to which each client statement belongs; Configure corresponding target answers for each knowledge point; Generate a knowledge base according to the corresponding relationship between the knowledge points and the target answers; The training of the initial sentence vector representation model based on the original data includes: converting the sample data into sentence representation vectors to be used. The sample data includes client context statements, a first customer service statement, and a second customer service statement. The client context statements include: client previous statements, and / or, client subsequent statements; the sentence representation vectors to be used include: multiple previous sentence vectors corresponding to the client previous statements, multiple subsequent sentence vectors corresponding to the client subsequent statements, a first sentence vector corresponding to the first customer service statement, and a second sentence vector corresponding to the second customer service statement; aggregate the multiple previous sentence vectors into a third sentence vector; aggregate the multiple subsequent sentence vectors into a fourth sentence vector; perform splicing processing on the third sentence vector, the fourth sentence vector, and the first sentence vector to obtain a first spliced vector, and perform splicing processing on the third sentence vector, the fourth sentence vector, and the second sentence vector to obtain a second spliced vector; use the prediction result and the standard result to obtain the target sentence vector representation model, and the prediction result is obtained by inputting the first spliced vector and the second spliced vector into the initial sentence vector representation model.
Citation Information
Patent Citations
Customer service knowledge base establishing method, device and equipment
CN110019149A
Man-machine conversation method and device and storage medium
CN112487173A