Knowledge base self-service question-answering system and method based on similarity and intention label
By adopting a knowledge base self-service question-and-answer system based on similarity and intention labels in the customer service system, and using natural language processing and intention classification model, the accuracy and efficiency of the existing customer service system when dealing with user problems is solved, and higher quality user problem processing and answer recommendations are achieved.
Patent Information
- Application Number
- CN202411968648.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-25
AI Technical Summary
When handling user problems, the existing customer service system has weak accurate recommendation capabilities, the knowledge base update and maintenance work is large, and the answer quality is low.
A self-service question-and-answer system based on similarity and intention labels is adopted to cluster user questions through natural language processing technology, build a knowledge base, and use intention classification model to identify user intentions and recommend answers to similar questions.
It improves the accuracy of user problem understanding and the quality of answers, reduces the pressure on manual customer service, and improves customer satisfaction.
Smart Images

Figure CN119884319A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of natural language processing, and more specifically, to a knowledge base self-service question-answering system and method based on similarity and intention tags. Background Art
[0002] The existing customer service system is mainly divided into two modes: robot automatic answering and manual answering. However, due to the ambiguity of natural language and the diversity of question expressions, the accurate recommendation ability of the robot customer service system is weak, and manual customer service is still the most commonly used answering mode by enterprises. In addition, it is also difficult to prepare a knowledge base for the robot customer service system, the workload of updating and maintaining the knowledge base is large, and the answer quality is low.
[0003] In response to the problems existing in the existing customer service system, a knowledge base self-service question-and-answer system based on similarity and intent tags, combined with natural language processing technology, can better understand user questions and provide corresponding solutions to improve customer satisfaction. Summary of the invention
[0004] In order to overcome the above-mentioned defects of the prior art, an embodiment of the present invention provides a knowledge base self-service question-answering system and method based on similarity and intention tags, which clusters user questions through natural language processing methods to solve the problems raised in the above-mentioned background technology.
[0005] To achieve the above-mentioned purpose, the present invention provides the following technical solution: a knowledge base self-service question-answering system based on similarity and intention tags, comprising a knowledge base construction module, a training classification model module, a recommendation module, and a user feedback module;
[0006] Knowledge base construction module: extract historical work order data from the work order database, collect the questions and corresponding answer data in the historical work orders, and mark the user intention labels. By clustering user questions, similar questions are clustered into the same type of question set, and answers are prepared for each question set. The mapping relationship between the question set and the answer is established to build a complete knowledge base;
[0007] Training classification model module: Use the constructed knowledge base to train the intent classification model, and use the labeled historical question data and corresponding intent labels for supervised learning to identify the intent of user questions;
[0008] Recommendation module: By traversing all the questions in the knowledge base, each question is represented as a vector. Based on the question raised by the user, the similarity between the user's question vector and each knowledge base question vector is calculated, and weighted sorting is performed. The recommended answer corresponding to the question is returned to the user.
[0009] User feedback module: Users provide feedback on recommendation results, the knowledge base is updated based on the feedback results, and the intent labels corresponding to the user feedback results are updated to the intent classification model.
[0010] In a preferred embodiment, the knowledge base construction module extracts historical work order data from the work order database, collects questions and corresponding answer data in the historical work orders, and marks user intention labels, clusters user questions, clusters similar questions into the same type of question set, prepares answers for each question set, establishes a mapping relationship between question sets and answers, and constructs a complete knowledge base. The specific steps are as follows:
[0011] Step A1, question clustering: clustering historical questions using a clustering algorithm, clustering similar questions into the same type of question set QSet, further including the following steps:
[0012] Step A101, data representation: Assume that the historical work order contains N records, each record includes a question q i And its corresponding answer a i , where (i=1,2,...,N), each question q i Represented as a vector Each answer a i Represented as a vector
[0013] Step A102, clustering algorithm: transform the problem vector Aggregate into K categories and get the clustering result C j , each question q i Assigned to category C j In the formula, it is expressed as c(q i )=C j , where (j=1,2,...,K);
[0014] Step A103, define the problem set QSet: j The vector representation of all the questions in the problem set QSet j , represented as QSet j =q i |c(q i )=C j ;
[0015] Step A2, building a knowledge base: prepare answers for each question set, establish a mapping relationship between question sets and answers, return corresponding answers by querying questions and finding corresponding question sets, and build a complete knowledge base, further including the following steps:
[0016] Step A201, prepare answers: For each question set QSet j, extract relevant answer data and get the corresponding answer set ASet j , represented by ASet j =a i |c(q i )=C j ;
[0017] Step A202: Mapping relationship between question set and answer: Establish question set QSet j and the corresponding answer set ASet j The mapping relationship between them is expressed as f:QSet j →ASet j ;
[0018] Step A203, build knowledge base: all question sets QSet j And the corresponding mapping relationship f are stored to form a complete knowledge base.
[0019] In a preferred embodiment, the training classification model module uses the constructed knowledge base to train the user intention classification model, and uses the marked historical question data and the corresponding intention labels for supervised learning to identify the intention of the user question. The specific steps are as follows:
[0020] Step B1, feature extraction: The historical question data is represented as D = (q1, y1), (q2, y2), ..., (q N ,y N ), and extract features from historical issues to obtain the vector representation of the issue as h(N)=f feat (q N ), where N represents the total number of samples in the historical problem dataset, q N is the feature vector representation of the Nth historical question, y N is the corresponding intention label, h(N) represents the vector representation of the Nth question in the historical question data after feature extraction, and f feat is the feature extraction function;
[0021] Step B2, model definition: define the intention classification neural network model, expressed as y = f model (h), where y represents the label of the input question, and f model () is the model function, which represents the structure and parameters of the intention classification model, and h is the input question feature vector;
[0022] Step B3, model training: Use historical problem data D for model training, and optimize model parameters by minimizing the loss function L. The specific calculation formula is as follows:
[0023]
[0024] Among them, θ * represents the optimal model parameters after training, which minimizes the loss function. N represents the total number of samples in the historical problem dataset. L represents the loss function. h i It represents the vector representation of the i-th question in the historical question data after feature extraction, which is used to input the model for training. i represents the true label of the i-th question in the historical question data, θ is the model parameter, and f model () is the model function, which represents the structure and parameters of the intention classification model;
[0025] Step B4, model prediction: After training is completed, use the trained model to predict the intent classification of new questions. The specific calculation formula is as follows:
[0026] T=f model (h new θ * )
[0027] Where T represents the intention label obtained by using the trained model to predict the intention of the new question, and h new represents the characteristics of the new problem, f model () is the model function, which represents the structure and parameters of the intention classification model, θ * Represents the optimal model parameters after training, which minimizes the loss function.
[0028] In a preferred embodiment, the recommendation module traverses all questions in the knowledge base, represents each question as a vector, calculates the similarity between the user question vector and each knowledge base question vector according to the question raised by the user, performs weighted sorting, and returns the answer corresponding to the recommended question to the user. The specific steps are as follows:
[0029] Step C1: For each question set QSet in the knowledge base j , let the question raised by the user be represented as a vector When a user asks a question, the similarity S between the user's question and all the questions in the knowledge base is calculated. The specific calculation formula is as follows:
[0030]
[0031] in, represents the user question vector, Indicates the similarity between the user's question and all questions in the knowledge base. represents the i-th question vector;
[0032] Step C2, calculate the question similarity weighted parameter: When the user asks a question, use the trained intention classification model to calculate the question similarity weighted parameter W. The specific calculation formula is as follows:
[0033] y user =f model (h user θ * )
[0034] W = similarity(h user ,h new )
[0035] Among them, y user represents the intention label of the user's question, W represents the question similarity weighting parameter, similarity(h user ,h new ) represents the similarity between the user question and the new question, f model () represents the model function, h user is the feature representation of the question raised by the user, h new represents the characteristics of the new problem, θ * represents the model parameters;
[0036] Step C3: Select the set S1 whose similarity value is greater than the threshold, use the trained intention classification model, input the user question vector into the model, and obtain the intention weighted vector of the user question. and will Perform weighted calculation and sorting with S1 to obtain candidate set Q1. The specific calculation formula is as follows:
[0037]
[0038] Among them, score(q i ) represents the score of the candidate question vector calculated based on the intention weighting of the user's question, W1 represents the intention weighting vector of the user's question, represents the i-th question vector;
[0039] Step C4: Obtain the question set to which each question in the candidate set belongs, and return the answer corresponding to the question to the user.
[0040] In a preferred embodiment, the user feedback module, the user provides feedback on the recommendation results, updates the knowledge base according to the feedback results, and updates the intention label corresponding to the user feedback result to the intention classification model. The specific steps are as follows:
[0041] Step D1: User feedback on the recommended results: The user provides feedback on the recommended answers and questions.
[0042] Step D2: Update the knowledge base based on feedback results: Based on user feedback, add relevant questions, answers, and tags to the knowledge base and update the existing content;
[0043] Step D3, update the intention classification model: organize and update the intention labels corresponding to the user feedback results into the intention classification model. By continuously updating the model, the user's intentions and preferences can be accurately understood, and recommendation results that meet user needs can be provided.
[0044] The present application also provides a knowledge base self-service question-answering method based on similarity and intention tags, and the method specifically comprises the following steps:
[0045] Extract historical work order data from the work order database, collect the questions and corresponding answer data in the historical work orders, and mark the user intention labels. By clustering user questions, similar questions are clustered into the same type of question set, and answers are prepared for each question set. A mapping relationship between question sets and answers is established to build a complete knowledge base;
[0046] Use the constructed knowledge base to train the intent classification model, and use the labeled historical question data and corresponding intent labels for supervised learning to identify the intent of user questions;
[0047] By traversing all the questions in the knowledge base, each question is represented as a vector. Based on the question raised by the user, the similarity between the user's question vector and each knowledge base question vector is calculated, and weighted sorting is performed. The recommended answer corresponding to the question is returned to the user.
[0048] Users provide feedback on the recommendation results, the knowledge base is updated based on the feedback results, and the intent labels corresponding to the user feedback results are updated to the intent classification model.
[0049] The beneficial effects of the present invention are: extracting historical work order data from a work order database, collecting questions and corresponding answer data in the historical work orders, and marking user intention labels, clustering similar questions into the same type of question set, and preparing answers for each question set, establishing a mapping relationship between the question set and the answer, building a knowledge base, using the constructed knowledge base to train an intention classification model, and using the labeled historical question data and the corresponding intention labels for supervised learning to identify the intention of the user's question, according to the question raised by the user, calculating the similarity between the user's question vector and each knowledge base question vector, and performing weighted sorting, returning the recommended answer corresponding to the question to the user, the user feedbacks the recommendation result, and updating the knowledge base according to the feedback result, and updating the intention label corresponding to the user's feedback result to the intention classification model, and continuously optimizing the knowledge base and the large model through user feedback, reducing the pressure of manual customer service and improving customer service quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 Schematic diagram of the process of the present invention
[0051] Figure 2 It is a schematic diagram of the system structure of the present invention. DETAILED DESCRIPTION
[0052] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0053] In the description of this application, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, "plurality" means two or more, unless otherwise clearly and specifically defined.
[0054] In the description of the present application, the term "for example" is used to mean "used as an example, illustration or description". Any embodiment described as "for example" in the present application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is given to enable any technician in the field to implement and use the present invention. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the present invention can be implemented without using these specific details. In other examples, well-known structures and processes will not be elaborated in detail to avoid unnecessary details to obscure the description of the present invention. Therefore, the present invention is not intended to be limited to the embodiments shown, but is consistent with the widest scope consistent with the principles and features disclosed in the present application.
[0055] Example 1
[0056] This embodiment provides Figure 1 A knowledge base self-service question-answering system based on similarity and intention labels is shown, which specifically includes a knowledge base construction module, a classification model training module, a recommendation module, and a user feedback module;
[0057] Knowledge base construction module: extract historical work order data from the work order database, collect the questions and corresponding answer data in the historical work orders, and mark the user intention labels. By clustering user questions, similar questions are clustered into the same type of question set, and answers are prepared for each question set. The mapping relationship between the question set and the answer is established to build a complete knowledge base;
[0058] Training classification model module: Use the constructed knowledge base to train the intent classification model, and use the labeled historical question data and corresponding intent labels for supervised learning to identify the intent of user questions;
[0059] Recommendation module: By traversing all the questions in the knowledge base, each question is represented as a vector. Based on the question raised by the user, the similarity between the user's question vector and each knowledge base question vector is calculated, and weighted sorting is performed. The recommended answer corresponding to the question is returned to the user.
[0060] User feedback module: Users provide feedback on recommendation results, the knowledge base is updated based on the feedback results, and the intent labels corresponding to the user feedback results are updated to the intent classification model.
[0061] In this embodiment, the knowledge base construction module specifically needs to be explained. The knowledge base construction module extracts historical work order data from the work order database, collects questions and corresponding answer data in the historical work orders, and marks user intention labels. By clustering user questions, similar questions are clustered into the same type of question set, and answers are prepared for each question set, and a mapping relationship between the question set and the answer is established to build a complete knowledge base. The specific steps are as follows:
[0062] Step A1, question clustering: clustering historical questions using a clustering algorithm, clustering similar questions into the same type of question set QSet, further including the following steps:
[0063] Step A101, data representation: Assume that the historical work order contains N records, each record includes a question q i And its corresponding answer a i , where (i=1,2,...,N), each question q i Represented as a vector Each answer a i Represented as a vector
[0064] Step A102, clustering algorithm: transform the problem vector Aggregate into K categories and get the clustering result C j , each question q i Assigned to category C j In the formula, it is expressed as c(q i )=C j , where (j=1,2,...,K);
[0065] Step A103, define the problem set QSet: j The vector representation of all the questions in the problem set QSet j , represented as QSetj =q i |c(q i )=C j ;
[0066] Step A2, building a knowledge base: prepare answers for each question set, establish a mapping relationship between question sets and answers, return corresponding answers by querying questions and finding corresponding question sets, and build a complete knowledge base, further including the following steps:
[0067] Step A201, prepare answers: For each question set QSet j , extract relevant answer data and get the corresponding answer set ASet j , represented by ASet j =a i |c(q i )=C j ;
[0068] Step A202: Mapping relationship between question set and answer: Establish question set QSet j and the corresponding answer set ASet j The mapping relationship between them is expressed as f:QSet j →ASet j ;
[0069] Step A203, build knowledge base: all question sets QSet j And the corresponding mapping relationship f are stored to form a complete knowledge base.
[0070] In this embodiment, what needs to be explained specifically is the training classification model module. The training classification model module uses the constructed knowledge base to train the user intention classification model, and uses the marked historical question data and the corresponding intention labels for supervised learning to identify the intention of the user question. The specific steps are as follows:
[0071] Step B1, feature extraction: The historical question data is represented as D = (q1, y1), (q2, y2), ..., (q N ,y N ), and extract features from historical issues to obtain the vector representation of the issue as h(N)=f feat (q N ), where N represents the total number of samples in the historical problem dataset, q N is the feature vector representation of the Nth historical question, y N is the corresponding intention label, h(N) represents the vector representation of the Nth question in the historical question data after feature extraction, and f feat is the feature extraction function;
[0072] Step B2, model definition: define the intention classification neural network model, expressed as y = f model (h), where y represents the label of the input question, and f model () is the model function, which represents the structure and parameters of the intention classification model, and h is the input question feature vector;
[0073] Step B3, model training: Use historical problem data D for model training, and optimize model parameters by minimizing the loss function L. The specific calculation formula is as follows:
[0074]
[0075] Among them, θ * represents the optimal model parameters after training, which makes the loss function reach the minimum value, N represents the total number of samples in the historical problem dataset, L represents the loss function, and h i It represents the vector representation of the i-th question in the historical question data after feature extraction, which is used to input the model for training. i represents the true label of the i-th question in the historical question data, θ is the model parameter, and f model () is the model function, which represents the structure and parameters of the intention classification model;
[0076] Step B4, model prediction: After training is completed, use the trained model to predict the intent classification of new questions. The specific calculation formula is as follows:
[0077] T=f model (h new θ * )
[0078] Where T represents the intention label obtained by using the trained model to predict the intention of the new question, and h new represents the characteristics of the new problem, f model () is the model function, which represents the structure and parameters of the intention classification model, θ * Represents the optimal model parameters after training, which minimizes the loss function.
[0079] In this embodiment, the recommendation module specifically needs to be explained. The recommendation module traverses all questions in the knowledge base, represents each question as a vector, calculates the similarity between the user question vector and each knowledge base question vector according to the question raised by the user, performs weighted sorting, and returns the answer corresponding to the recommended question to the user. The specific steps are as follows:
[0080] Step C1: For each question set QSet in the knowledge base j , let the question raised by the user be represented as a vector When a user asks a question, the similarity S between the user's question and all the questions in the knowledge base is calculated. The specific calculation formula is as follows:
[0081]
[0082] in, represents the user question vector, Indicates the similarity between the user's question and all questions in the knowledge base. represents the i-th question vector;
[0083] Step C2, calculate the question similarity weighted parameter: When the user asks a question, use the trained intention classification model to calculate the question similarity weighted parameter W. The specific calculation formula is as follows:
[0084] y user =f model (h user θ * )
[0085] W = similarity(h user ,h new )
[0086] Among them, y user represents the intention label of the user's question, W represents the question similarity weighting parameter, similarity(h user ,h new ) represents the similarity between the user question and the new question, f model () represents the model function, h user is the feature representation of the question raised by the user, h new represents the characteristics of the new problem, θ * represents the model parameters;
[0087] Step C3: Select the set S1 whose similarity value is greater than the threshold, use the trained intention classification model, input the user question vector into the model, and obtain the intention weighted vector of the user question. and will Perform weighted calculation and sorting with S1 to obtain candidate set Q1. The specific calculation formula is as follows:
[0088]
[0089] Among them, score(q i ) represents the score of the candidate question vector calculated based on the intention weighting of the user's question, W1 represents the intention weighting vector of the user's question, represents the i-th question vector;
[0090] Step C4: Obtain the question set to which each question in the candidate set belongs, and return the answer corresponding to the question to the user.
[0091] In this embodiment, the user feedback module specifically needs to be explained. In the user feedback module, the user provides feedback on the recommendation results, updates the knowledge base according to the feedback results, and updates the intention label corresponding to the user feedback result to the intention classification model. The specific steps are as follows:
[0092] Step D1: User feedback on the recommended results: The user provides feedback on the recommended answers and questions.
[0093] Step D2: Update the knowledge base based on feedback results: Based on user feedback, add relevant questions, answers, and tags to the knowledge base and update the existing content;
[0094] Step D3, update the intention classification model: organize and update the intention labels corresponding to the user feedback results into the intention classification model. By continuously updating the model, the user's intentions and preferences can be accurately understood, and recommendation results that meet user needs can be provided.
[0095] The present application also provides a knowledge base self-service question-answering method based on similarity and intention tags, and the method specifically comprises the following steps:
[0096] Extract historical work order data from the work order database, collect the questions and corresponding answer data in the historical work orders, and mark the user intention labels. By clustering user questions, similar questions are clustered into the same type of question set, and answers are prepared for each question set. A mapping relationship between question sets and answers is established to build a complete knowledge base;
[0097] Use the constructed knowledge base to train the intent classification model, and use the labeled historical question data and corresponding intent labels for supervised learning to identify the intent of user questions;
[0098] By traversing all the questions in the knowledge base, each question is represented as a vector. Based on the question raised by the user, the similarity between the user's question vector and each knowledge base question vector is calculated, and weighted sorting is performed. The recommended answer corresponding to the question is returned to the user.
[0099] Users provide feedback on the recommendation results, the knowledge base is updated based on the feedback results, and the intent labels corresponding to the user feedback results are updated to the intent classification model.
[0100] It should be noted that in the above embodiments, the description of each embodiment has its own emphasis, and for parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0101] Those skilled in the art will appreciate 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. Moreover, 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.
[0102] 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 computer, or other programmable data processing device to generate 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.
[0103] 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.
[0104] 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.
[0105] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0106] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A knowledge base self-service question-answering system based on similarity and intention tags, characterized by: It includes knowledge base construction module, classification model training module, recommendation module, and user feedback module; Knowledge base construction module: extract historical work order data from the work order database, collect the questions and corresponding answer data in the historical work orders, and mark the user intention labels. By clustering user questions, similar questions are clustered into the same type of question set, and answers are prepared for each question set. The mapping relationship between the question set and the answer is established to build a knowledge base; Training classification model module: Use the constructed knowledge base to train the intent classification model, and use the labeled historical question data and corresponding intent labels for supervised learning to identify the intent of user questions; Recommendation module: By traversing all the questions in the knowledge base, each question is represented as a vector. Based on the question raised by the user, the similarity between the user's question vector and each knowledge base question vector is calculated, and weighted sorting is performed. The recommended answer corresponding to the question is returned to the user. User feedback module: Users provide feedback on recommendation results, the knowledge base is updated based on the feedback results, and the intent labels corresponding to the user feedback results are updated to the intent classification model.
2. According to claim 1, a knowledge base self-service question-answering system based on similarity and intention tags is characterized by: The knowledge base construction module extracts historical work order data from the work order database, collects questions and corresponding answer data in the historical work orders, and marks user intention labels. By clustering user questions, similar questions are clustered into the same type of question set, and answers are prepared for each question set. A mapping relationship between the question set and the answer is established to build a knowledge base. The specific steps are as follows: Step A1, question clustering: clustering historical questions using a clustering algorithm, clustering similar questions into the same type of question set QSet, further including the following steps: Step A101, data representation: Assume that the historical work order contains N records, each record includes a question q i And its corresponding answer a i , where (i=1,2,...,N), each question q i Represented as a vector Each answer a i Represented as a vector Step A102, clustering algorithm: transform the problem vector q→ i Aggregate into K categories and get the clustering result C j , where (j=1,2,...,K), each question q i Assigned to category C j In the formula, it is expressed as c(q i )=C j ; Step A103, define the problem set QSet: j The vector representation of all the questions in the problem set QSet j , represented as QSet j =q i |c(q i )=C j ; Step A2, build knowledge base: prepare answers for each question set, establish a mapping relationship between question sets and answers, return the corresponding answers by querying questions and finding the corresponding question sets, and build a complete knowledge base.
3. The knowledge base self-service question-answering system based on similarity and intention tags according to claim 2 is characterized by: In the step A2 of constructing the knowledge base, an answer is prepared for each question set, a mapping relationship between the question set and the answer is established, and the corresponding answer is returned by querying the question and finding the corresponding question set to construct a complete knowledge base, which further includes the following steps: Step A201, prepare answers: For each question set QSet j , extract relevant answer data and get the corresponding answer set ASet j , represented by ASet j =a i |c(q i )=C j ; Step A202: Mapping relationship between question set and answer: Establish question set QSet j and the corresponding answer set ASet j The mapping relationship between them is expressed as f:QSet j →ASet j ; Step A203, build knowledge base: all question sets QSet j And the corresponding mapping relationship f are stored to form a complete knowledge base.
4. The knowledge base self-service question-answering system based on similarity and intention tags according to claim 1, characterized in that: The training classification model module uses the constructed knowledge base to train the user intention classification model, and uses the marked historical question data and the corresponding intention labels for supervised learning to identify the intention of the user's question. The specific steps are as follows: Step B1, feature extraction: The historical question data is represented as D = (q1, y1), (q2, y2), ..., (q N ,y N ), and extract features from historical issues to obtain the vector representation of the issue as h(N)=f feat (q N ), where N represents the total number of samples in the historical problem dataset, q N is the feature vector representation of the Nth historical question, y N is the corresponding intention label, h(N) represents the vector representation of the Nth question in the historical question data after feature extraction, and f feat is the feature extraction function; Step B2, model definition: define the intention classification neural network model, expressed as y = f model (h), where y represents the label of the input question, and f model () is the model function, which represents the structure and parameters of the intention classification model, and h is the input question feature vector; Step B3, model training: Use historical problem data D for model training, and optimize model parameters by minimizing the loss function L. The specific calculation formula is as follows: Among them, θ * represents the optimal model parameters after training, which minimizes the loss function. N represents the total number of samples in the historical problem dataset. L represents the loss function. h i It represents the vector representation of the i-th question in the historical question data after feature extraction, which is used to input the model for training. i represents the true label of the i-th question in the historical question data, θ is the model parameter, and f model () is the model function, which represents the structure and parameters of the intention classification model; Step B4, model prediction: After training is completed, use the trained model to predict the intent classification of new questions. The specific calculation formula is as follows: T=f model (h new ;θ * ) Where T represents the intention label obtained by using the trained model to predict the intention of the new question, and h new represents the characteristics of the new problem, f model () is the model function, which represents the structure and parameters of the intention classification model, θ * Represents the optimal model parameters after training, which minimizes the loss function.
5. The knowledge base self-service question-answering system based on similarity and intention tags according to claim 1 is characterized by: The recommendation module traverses all questions in the knowledge base, represents each question as a vector, calculates the similarity between the user's question vector and each knowledge base question vector according to the question raised by the user, performs weighted sorting, and returns the answer corresponding to the recommended question to the user. The specific steps are as follows: Step C1: For each question set QSet in the knowledge base j , let the question raised by the user be represented as a vector When a user asks a question, the similarity S between the user's question and all the questions in the knowledge base is calculated. The specific calculation formula is as follows: in, represents the user question vector, Indicates the similarity between the user's question and all questions in the knowledge base. represents the i-th question vector; Step C2, calculate the question similarity weighted parameter: When the user asks a question, use the trained intention classification model to calculate the question similarity weighted parameter W. The specific calculation formula is as follows: y user =f model (h user ;θ * ) W=similarity(h user ,h new ) Among them, y user represents the intention label of the user's question, W represents the question similarity weighting parameter, similarity(h user ,h new ) represents the similarity between the user question and the new question, f model () represents the model function, h user is the feature representation of the question raised by the user, h new represents the characteristics of the new problem, θ * represents the model parameters; Step C3: Select the set S1 whose similarity value is greater than the threshold, use the trained intention classification model, input the user question vector into the model, and obtain the intention weighted vector of the user question. and will Perform weighted calculation and sorting with S1 to obtain candidate set Q1. The specific calculation formula is as follows: Among them, score(q i ) represents the score of the candidate question vector calculated based on the intention weighting of the user's question, W1 represents the intention weighting vector of the user's question, represents the i-th question vector; Step C4: Obtain the question set to which each question in the candidate set belongs, and return the answer corresponding to the question to the user.
6. The knowledge base self-service question-answering system based on similarity and intention tags according to claim 1, characterized in that: The user feedback module, in which users provide feedback on recommendation results, updates the knowledge base based on the feedback results, and updates the intention labels corresponding to the user feedback results to the intention classification model. The specific steps are as follows: Step D1: User feedback on the recommended results: The user provides feedback on the recommended answers and questions. Step D2: Update the knowledge base based on feedback results: Based on user feedback, add relevant questions, answers, and tags to the knowledge base and update the existing content; Step D3, update the intention classification model: organize and update the intention labels corresponding to the user feedback results into the intention classification model. By continuously updating the model, the user's intentions and preferences can be accurately understood, and recommendation results that meet user needs can be provided.
7. A knowledge base self-service question-answering method based on similarity and intention tags, the method specifically comprising the following steps: Extract historical work order data from the work order database, collect the questions and corresponding answer data in the historical work orders, and mark the user intention labels. By clustering user questions, similar questions are clustered into the same type of question set, and answers are prepared for each question set. A mapping relationship between question sets and answers is established to build a knowledge base; Use the constructed knowledge base to train the intent classification model, and use the labeled historical question data and corresponding intent labels for supervised learning to identify the intent of user questions; By traversing all the questions in the knowledge base, each question is represented as a vector. Based on the question raised by the user, the similarity between the user's question vector and each knowledge base question vector is calculated, and weighted sorting is performed. The recommended answer corresponding to the question is returned to the user. Users provide feedback on the recommendation results, the knowledge base is updated based on the feedback results, and the intent labels corresponding to the user feedback results are updated to the intent classification model.