Method and device for improving user intention recognition accuracy and electronic equipment
By extracting the keywords of user questions and converting them into word vectors, combining the keywords in the knowledge base, calculating the similarity and correlation sequences, and determining the standard problem set, the problem of low accuracy in identifying user intentions in the traditional knowledge base question-and-answer system is solved, achieving higher recognition accuracy.
Patent Information
- Application Number
- CN202411717734.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-03-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional knowledge base question and answer systems have low accuracy when identifying user intentions, especially when users ask questions, they are prone to answering non-questions.
By obtaining the keywords of the user's problem, converting them into problem word vectors, and converting them into word vectors with the keywords in the knowledge base, calculating the similarity and correlation sequences, combining the keyword matching results, the standard problem set corresponding to the user's problem is determined, so as to accurately identify the user's intentions.
It improves the accuracy of user intention recognition, can more accurately correspond to the user's intentions with the knowledge points in the knowledge base, and solves the problem of low recognition accuracy in traditional systems.
Smart Images

Figure CN119623480A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of improving the accuracy of user intention recognition, and in particular, to a method, device and electronic device for improving the accuracy of user intention recognition. Background Art
[0002] With the vigorous development of NLP technology, knowledge base has become a standard feature of most commercial banks and has been widely used in business scenarios such as call center intelligent customer service, mobile banking assistants, and offline question-and-answer consulting robots.
[0003] The knowledge base system can provide users with professional answers and effectively relieve the pressure of manual customer service. However, traditional knowledge base question-and-answer systems generally have the problem of poor user interaction experience, which is mainly manifested in the inability to accurately identify the user's intention. In response to user questions, traditional knowledge base question-and-answer systems use the method of capturing keywords and matching with the preset database to find answers to relevant questions. When faced with user questions containing a lot of information, this processing method will greatly reduce the accuracy of recognition and give irrelevant answers. How to accurately identify the user's intention and give full play to the question-and-answer capabilities of the knowledge base is a difficult problem that needs to be solved urgently. Summary of the invention
[0004] The main purpose of the present application is to provide a method, device and electronic device for improving the accuracy of user intention recognition, so as to at least solve the problem of low accuracy of user intention recognition in the prior art.
[0005] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a method for improving the accuracy of user intention recognition is provided, including: obtaining a current user question, extracting and processing keywords of the current user question to obtain question keywords, matching the question keywords with keywords in a knowledge base to obtain keyword matching results; converting the question keywords into question word vectors, and converting the keywords in the knowledge base into knowledge base word vectors, respectively determining the similarity and correlation between the question word vectors and the knowledge base word vectors in the knowledge base to obtain a similarity sequence and a correlation sequence of the question word vectors; determining a standard question set in the knowledge base corresponding to the current user question based on at least the similarity sequence, the correlation sequence and the keyword matching result, and determining user intent based on the standard question set, wherein the standard question set includes multiple standard questions.
[0006] Optionally, determining the similarity between the question word vector and the knowledge base word vector in the knowledge base to obtain the similarity sequence of the question word vector includes: according to a first formula: Determine the similarity with the knowledge base word vector in the knowledge base, where x is the question word vector and y is the knowledge base word vector; arrange the knowledge base word vectors in the knowledge base in descending order according to the similarity to obtain the similarity sequence of the question word vector.
[0007] Optionally, determining the correlation between the question word vector and the knowledge base word vector in the knowledge base to obtain the correlation sequence of the question word vector includes: according to the second formula: Determine the correlation with the knowledge base word vector in the knowledge base, wherein p(x) is the probability of the problem word vector appearing, p(y) is the probability of the knowledge base word vector appearing, p(x, y) is the joint probability of the problem word vector and the knowledge base word vector appearing, p(x│y) is the probability of the problem word vector appearing under the condition that the knowledge base word vector appears, and a is a constant; arrange the knowledge base word vectors in the knowledge base in descending order according to the correlation to obtain the correlation sequence of the problem word vector.
[0008] Optionally, determining a set of standard questions in the knowledge base corresponding to the current user question at least based on the similarity sequence, the relevance sequence and the keyword matching result includes: classifying the current user question using a classification algorithm based on the knowledge base to obtain a question category, wherein the classification algorithm includes a decision tree and an AdaBoost algorithm; determining a set of standard questions in the knowledge base corresponding to the current user question based on the question category, the similarity sequence, the relevance sequence and the keyword matching result.
[0009] Optionally, a standard question set in the knowledge base corresponding to the current user question is determined based on the question category, the similarity sequence, the relevance sequence and the keyword matching result, including: merging the similarity sequence and the relevance sequence to obtain a target sequence; and determining a standard question set in the knowledge base corresponding to the current user question based on the question category, the target sequence and the keyword matching result.
[0010] Optionally, determining the user intention according to the standard question set includes: using the Wasserstein distance formula:
[0011] Determine the standard question closest to the user's intention based on the standard question set, and determine the user's intention based on the standard question; wherein, d i,j is the distance between the user question and the standard question, w i is the user question vector, w j is the standard problem vector.
[0012] Optionally, converting the question keywords into question word vectors includes: converting the question keywords into the question word vectors using a vector conversion technology, wherein the vector conversion technology includes BERT and Word2Vec.
[0013] According to another aspect of the present application, a device for improving the accuracy of user intention recognition is provided, including: an acquisition unit, used to acquire a current user question, extract and process keywords of the current user question to obtain question keywords, match the question keywords with keywords in a knowledge base, and obtain keyword matching results; a conversion unit, used to convert the question keywords into question word vectors, and convert the keywords in the knowledge base into knowledge base word vectors, respectively determine the similarity and correlation between the question word vectors and the knowledge base word vectors in the knowledge base, and obtain a similarity sequence and a correlation sequence of the question word vectors; a determination unit, used to determine a standard question set in the knowledge base corresponding to the current user question based on at least the similarity sequence, the correlation sequence and the keyword matching result, and determine the user intention based on the standard question set, wherein the standard question set includes multiple standard questions.
[0014] According to another aspect of the present application, a computer-readable storage medium is provided, which includes a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the methods for improving the accuracy of user intention recognition.
[0015] According to another aspect of the present application, an electronic device is provided, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include methods for executing any one of the methods for improving the accuracy of user intent recognition.
[0016] Apply the technical solution of the present application, obtain the current user question, extract and process the keywords of the current user question, obtain the question keywords, match the question keywords with the keywords in the knowledge base, and obtain the keyword matching results; convert the question keywords into question word vectors, and convert the keywords in the knowledge base into knowledge base word vectors, respectively determine the similarity and correlation between the question word vectors and the knowledge base word vectors in the knowledge base, and obtain the similarity sequence and correlation sequence of the question word vectors; determine the standard question set in the knowledge base corresponding to the current user question at least based on the similarity sequence, the correlation sequence and the keyword matching results, and determine the user intention based on the standard question set. By introducing the judgment method of keywords, using the correlation and similarity between words, the keywords involved in the user question are obtained, and then compared with the standard questions in the knowledge base to obtain the closest knowledge points. Secondly, using the semantic information of the user question and the knowledge point, comparison and sorting can more accurately match the user's intention with the knowledge point in the knowledge base. Solve the problem of low accuracy in identifying user intentions in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings constituting part of the present application are used to provide a further understanding of the present application. The exemplary embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0018] Figure 1 A hardware structure block diagram of a mobile terminal for executing a method for improving the accuracy of user intention recognition provided in an embodiment of the present application is shown;
[0019] Figure 2 A flow chart of a method for improving the accuracy of user intention recognition provided in an embodiment of the present application is shown;
[0020] Figure 3 A schematic diagram showing a specific method for improving the accuracy of user intent recognition provided according to an embodiment of the present application;
[0021] Figure 4 A structural block diagram of a device for improving the accuracy of user intention recognition provided according to an embodiment of the present application is shown.
[0022] The above drawings include the following reference numerals:
[0023] 102, processor; 104, memory; 106, transmission device; 108, input and output devices. DETAILED DESCRIPTION
[0024] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0025] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings 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 ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0026] 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 are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0027] As introduced in the background technology, the accuracy of the prior art in identifying user intention is low. In order to solve the problem of the low accuracy of the prior art in identifying user intention, the embodiments of the present application provide a method, device and electronic device for improving the accuracy of user intention recognition.
[0028] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0029] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 1 is a hardware structure block diagram of a mobile terminal of a method for improving the accuracy of user intention recognition according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0030] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for improving the accuracy of user intention recognition in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the above method is implemented. 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 memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. The transmission device 106 is used to receive or send data via a network. The above-mentioned specific examples of the network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0031] In this embodiment, a method for improving the accuracy of user intention recognition running on a mobile terminal, a computer terminal or a similar computing device 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 a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0032] Figure 2 is a flow chart of a method for improving the accuracy of user intent recognition according to an embodiment of the present application. Figure 2 As shown, the method comprises the following steps:
[0033] Step S201, obtaining a current user question, extracting keywords from the current user question to obtain question keywords, matching the question keywords with keywords in the knowledge base to obtain keyword matching results;
[0034] Specifically, the current user question includes multiple user questions in the user's current conversation, and the knowledge base includes multiple standard questions, as well as classifications, keywords, similar questions and keyword descriptions corresponding to the standard questions.
[0035] Step S202, converting the above-mentioned question keywords into question word vectors, and converting the keywords in the above-mentioned knowledge base into knowledge base word vectors, respectively determining the similarity and relevance between the above-mentioned question word vectors and the knowledge base word vectors in the above-mentioned knowledge base, and obtaining a similarity sequence and a relevance sequence of the above-mentioned question word vectors;
[0036] Specifically, keywords are cross-validated through similarity and relevance to improve the accuracy of keyword detection. At the same time, the knowledge base can pre-process keyword descriptions to speed up intent location and compare semantic similarities, while considering the description of the conversation context to improve the accuracy of intent recognition.
[0037] Step S203, determining a standard question set in the knowledge base corresponding to the current user question at least based on the similarity sequence, the relevance sequence and the keyword matching result, and determining the user intention based on the standard question set, wherein the standard question set includes multiple standard questions.
[0038] Specifically, at least based on the similarity sequence, the correlation sequence and the keyword matching results, multiple standard questions close to the user question are searched from the knowledge base, and the Wasserstein distance of the keywords between the standard questions and the user questions is calculated respectively, and they are arranged in descending order according to the size of the distance. According to the descending order sequence, the standard question closest to the user question can be determined, thereby determining the user's true intention, which greatly improves the accuracy of user intention recognition.
[0039] Through this embodiment, the current user question is obtained, the keyword extraction and processing of the current user question is performed to obtain the question keyword, the question keyword is matched with the keyword in the knowledge base, and the keyword matching result is obtained; the question keyword is converted into a question word vector, and the keyword in the knowledge base is converted into a knowledge base word vector, and the similarity and correlation between the question word vector and the knowledge base word vector in the knowledge base are respectively determined to obtain the similarity sequence and correlation sequence of the question word vector; at least according to the similarity sequence, the correlation sequence and the keyword matching result, the standard question set in the knowledge base corresponding to the current user question is determined, and the user intention is determined according to the standard question set, and the standard question set includes multiple standard questions. By introducing the judgment method of keywords, the correlation and similarity between words are used to obtain the keywords involved in the user question, and then compared with the standard questions in the knowledge base to obtain the closest knowledge point. Secondly, the semantic information of the user question and the knowledge point is used for comparison and sorting, so that the user's intention can be more accurately matched with the knowledge point in the knowledge base. The problem of low accuracy in identifying user intentions in the prior art is solved.
[0040] In the specific implementation process, determining the similarity between the question word vector and the knowledge base word vector in the knowledge base to obtain the similarity sequence of the question word vector includes: according to the first formula: Determine the above-mentioned similarity with the knowledge base word vector in the above-mentioned knowledge base, wherein x is the above-mentioned question word vector and y is the above-mentioned knowledge base word vector; arrange the knowledge base word vectors in the above-mentioned knowledge base in descending order according to the above-mentioned similarity to obtain the above-mentioned similarity sequence of the above-mentioned question word vector.
[0041] This method uses cosine similarity to determine the similarity between the keyword vector in the user question and the keyword vector in the knowledge base. Cosine similarity is a text similarity measurement method that calculates the cosine value of the angle between two vectors to measure their similarity in the vector space. By calculating the cosine similarity between the user question keyword vector and the knowledge base keyword vector, their semantic similarity can be evaluated. If the cosine similarity between the two vectors is close to 1, it means that the similarity between them is very high, otherwise it means that the similarity is low. In practical applications, cosine similarity can be used to help the system identify the similarity between user question keywords and knowledge base keywords, so as to more accurately match questions and answers. In this way, the system can provide users with accurate solutions more quickly and improve user experience and service quality.
[0042] Specifically, determining the correlation between the question word vector and the knowledge base word vector in the knowledge base to obtain the correlation sequence of the question word vector includes: according to the second formula: Determine the above-mentioned correlation with the knowledge base word vector in the above-mentioned knowledge base, wherein p(x) is the probability of the problem word vector appearing, p(y) is the probability of the knowledge base word vector appearing, p(x, y) is the joint probability of the problem word vector and the knowledge base word vector appearing, p(x│y) is the probability of the problem word vector appearing under the condition that the knowledge base word vector appears, and a is a constant; arrange the knowledge base word vectors in the above-mentioned knowledge base in descending order according to the above-mentioned correlation to obtain the above-mentioned correlation sequence of the above-mentioned problem word vector.
[0043] This method describes the word relevance through mutual information. The greater the mutual information between two word vectors, the more often the two words x and y appear together. By traversing the keyword word vectors of the knowledge points, the relevance sequence of the knowledge point sorting sequence is calculated, where α is a constant slightly less than 1, such as α = 0.9, which is used to emphasize the high-frequency word part.
[0044] More specifically, the standard question set in the above-mentioned knowledge base corresponding to the above-mentioned current user question is determined at least based on the above-mentioned similarity sequence, the above-mentioned relevance sequence and the above-mentioned keyword matching result, including: classifying the above-mentioned current user question using a classification algorithm according to the above-mentioned knowledge base to obtain a question category, wherein the above-mentioned classification algorithm includes a decision tree and an AdaBoost algorithm; determining the standard question set in the above-mentioned knowledge base corresponding to the above-mentioned current user question based on the above-mentioned question category, the above-mentioned similarity sequence, the above-mentioned relevance sequence and the above-mentioned keyword matching result.
[0045] Decision tree is a classification algorithm that classifies data by building a tree. The decision tree algorithm is simple to understand and easy to explain, and is suitable for processing small-scale data sets. However, when processing large-scale data sets, decision trees are prone to overfitting, resulting in poor model generalization ability.
[0046] The AdaBoost algorithm is an ensemble learning method that trains multiple weak classifiers in series. Each weak classifier classifies the data set, then weights the data according to the classification results, and finally combines the results of all weak classifiers to obtain the final classification result. The AdaBoost algorithm can effectively improve the generalization ability of the model and reduce the risk of overfitting.
[0047] For keyword classification tasks, both decision tree and AdaBoost algorithms can be used to build classification models. In practical applications, the effects of the two algorithms on keyword classification tasks can be compared through methods such as cross-validation. Generally, the AdaBoost algorithm performs better than the decision tree algorithm because the AdaBoost algorithm can effectively improve the generalization ability of the model and reduce the risk of overfitting.
[0048] Furthermore, the standard question set in the above-mentioned knowledge base corresponding to the above-mentioned current user question is determined according to the above-mentioned question category, the above-mentioned similarity sequence, the above-mentioned relevance sequence and the above-mentioned keyword matching result, including: merging the above-mentioned similarity sequence and the above-mentioned relevance sequence to obtain a target sequence; and determining the standard question set in the above-mentioned knowledge base corresponding to the above-mentioned current user question according to the above-mentioned question category, the above-mentioned target sequence and the above-mentioned keyword matching result.
[0049] This method first classifies user questions to obtain question categories, then extracts keywords in user questions and matches them with keywords in the knowledge base to obtain keyword matching results, then merges the similarity sequence and the correlation sequence, recalls and sorts the first 25 result knowledge points of the two sequences, merges the parts with the same knowledge points to obtain the target sequence, and determines multiple standard questions corresponding to the user questions from the knowledge base according to the order of keywords corresponding to the word vectors in the target sequence, the question category and the keyword matching results, and generates a standard question set.
[0050] Furthermore, the user intent is determined based on the above standard question set, including: using the Wasserstein distance formula: Determine the standard question closest to the user's intention based on the standard question set, and determine the user's intention based on the standard question; wherein, d ij is the distance between the user question and the above standard question, w i is the user question vector, w′ j is the standard problem vector.
[0051] The Wasserstein distance in this method is a method for measuring the distance between two probability distributions. It has good properties and is suitable for processing many different types of data. When calculating the distance of keywords, each keyword can be regarded as a probability distribution, in which the probability value of each word represents the frequency of its appearance in the text. By calculating the Wasserstein distance between these keywords, the similarity or difference between them can be obtained. This method can help us understand the correlation between keywords, so as to better understand the relationship between text content or topics. In addition, the range of WRD (Word Rotator's Distance) is [0, 2]. The knowledge point with the smallest calculated value is selected for sorting, which is the problem description closest to the user's intention.
[0052] Specifically, converting the above-mentioned question keywords into question word vectors includes: using vector conversion technology to convert the above-mentioned question keywords into the above-mentioned question word vectors, wherein the above-mentioned vector conversion technology includes BERT and Word2Vec.
[0053] BERT and Word2Vec are both word embedding technologies that can convert words into dense word vector representations to better capture the semantic relationship between words. Their effectiveness depends on the specific tasks and datasets.
[0054] BERT is a pre-trained language model based on the Transformer model that can learn richer semantic representations. In some NLP tasks, BERT can usually achieve good results, such as text classification and named entity recognition.
[0055] Word2Vec is a word embedding model based on neural networks, which generates word vector representations by learning the distribution of words in context. It performs well on some simple semantic tasks, such as word sense similarity calculation, document clustering, etc.
[0056] In general, BERT can usually learn richer semantic representations and is suitable for more complex NLP tasks, while Word2Vec is more suitable for some simple semantic tasks. In specific applications, you can choose the appropriate word embedding technology based on the characteristics of the task and the situation of the data set.
[0057] In order to enable those skilled in the art to more clearly understand the technical solution of the present application, the implementation process of the method for improving the accuracy of user intent recognition of the present application will be described in detail below in combination with specific embodiments.
[0058] This embodiment relates to a specific method for improving the accuracy of user intention recognition, such as Figure 3 As shown, it specifically includes the following contents:
[0059] (1) Extract corresponding keyword descriptions for standard questions of knowledge points in the knowledge base, from the perspectives of similarity and relevance.
[0060] (2) After the user asks a question, the corresponding keywords are extracted from the question and matched with the keyword descriptions in the knowledge base to select knowledge points as matching items.
[0061] (3) The user’s question and the previous text are used to classify the paragraph intent and find the category to which it belongs as the item to be matched.
[0062] (4) The semantic similarity (from the perspectives of similarity and relevance) of the user's question and the standard question of the knowledge point to be matched is calculated.
[0063] (5) Output the knowledge point that is closest to the user’s intention.
[0064] First, by performing word segmentation on the standard questions of the knowledge points, as shown in Table 1, the corresponding keyword content in the standard questions is extracted for subsequent intent matching.
[0065] Table 1
[0066] Standard Issues Category Similar questions Keyword description Knowledge Points
[0067] The specific method of keyword extraction is as follows:
[0068] The main idea of the text can be guessed by keywords, that is, which words in the current sentence can best represent the information content of the sentence. Therefore, keywords are measured from two aspects, one is similarity and the other is relevance.
[0069] s represents a piece of text, w i is a word in the text, if w i is a keyword in the text, then p(s|w i ) has the highest probability. Using the naive Bayes hypothesis, we have:
[0070]
[0071] By estimating the transition probability p(w k |w i ), we can get the conditional probability p(s|w i ) to complete the keyword extraction. k |w i ) can use Skip-Gram in Word2Vec to model and calculate, so as to obtain the keyword word vector y of the knowledge point.
[0072] Similarly, the keyword vector x in the user's question is calculated in the same way, and the similarity between the two can be obtained by using cosine similarity, so that the keywords of the knowledge points can be traversed to obtain the sorted sequence A.
[0073] x is the embedding of the user’s question query, and y is the i-th embedding vector in the intent table.
[0074] Then, for the word relevance part, the mutual information is used to describe it. The larger the mutual information between two word vectors, the more often the two words x and y appear together. By traversing the keyword word vectors of the knowledge points, the knowledge point ranking sequence B is calculated.
[0075]
[0076] Here, α is a constant slightly less than 1, such as α=0.9, which is used to emphasize high-frequency words.
[0077] Secondly, recall and sort the first 25 result knowledge points of the two sequences, merge the ones with the same knowledge points to form sequence C.
[0078] Then, the context information is processed for knowledge point category classification, such as decision tree and AdaBoost algorithm, and the knowledge points under the obtained category are sequence D.
[0079] Finally, the user's question and the standard questions in the knowledge points of sequence C and D are traversed to calculate the semantic similarity.
[0080] The calculation is as follows:
[0081] Standard question s=(t 1 ,t 2 ,…,t n ), user question s′=(t′ 1 ,t′ 2 ,…,t′ n′ ), where t represents the key words in the question;
[0082] Map keywords to word vectors through BERT, Word2Vec, etc.:
[0083] (w 1 ,w 2 ,…,w n ),(w′ 1 ,w′ 2 ,…,w′ n′ ), w is the word vector after mapping;
[0084] The Wasserstein distance is used to measure the difference between two indefinite-length text vectors.
[0085] Measures the difference between two vectors: w i is the standard question word vector, w j ′ is the user question word vector;
[0086] Right now:
[0087] in:
[0088] The range of WRD (Word Rotator's Distance) is [0,2]. The knowledge points with the smallest calculated value are selected for sorting, which is the problem description that is closest to the user's intention.
[0089] Right now:
[0090] This embodiment introduces a keyword judgment method, uses the correlation and similarity between words, obtains the keywords involved in the user's question, and then compares them with the standard questions in the knowledge base to obtain the closest knowledge points. Secondly, using the semantic information of the user's question and the knowledge points, they are compared and sorted, which can more accurately match the user's intention with the knowledge points in the knowledge base.
[0091] Typical features of common business scenarios applicable to this embodiment are summarized as follows:
[0092] (1) Customers have clear service scope and scenarios, and users’ expressions generally have clear intentions, mainly for urging, consulting, and inquiring, and rarely involve idle chats. This situation is the easiest to identify, and most problems can be solved by capturing keywords.
[0093] (2) When customers are unclear about their core intent, service personnel or a multi-round dialogue system is needed to guide customers to identify their intent through chat. For example, if a customer does not have a clear intent, a single chat record may not be able to fully identify the customer's intent. It is very likely that three messages were sent, which together form one intent. In this case, it is necessary to combine the above interaction content to assist in determining the user's intent.
[0094] (3) Diversity of customer expression intentions. Due to different backgrounds and different understandings of business processes, customers may ask questions in multiple ways for the same knowledge point, and the same professional vocabulary may be expressed in multiple popular ways that are very different. Due to the existence of multiple ways of expression, it is necessary to identify the keywords in the questions and compare the keywords with the knowledge points.
[0095] Keywords are cross-validated through similarity and relevance, thereby improving the accuracy of keyword detection. At the same time, the knowledge base can be pre-processed to make keyword descriptions to speed up the speed of intent positioning. And through the comparison of semantic similarity, while considering the description of the dialogue context, the accuracy of intent recognition is improved.
[0096] The embodiment of the present application also provides a device for improving the accuracy of user intention recognition. It should be noted that the device for improving the accuracy of user intention recognition in the embodiment of the present application can be used to execute the method for improving the accuracy of user intention recognition provided by the embodiment of the present application. The device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0097] The following introduces a device for improving the accuracy of user intention recognition provided by an embodiment of the present application.
[0098] Figure 4 is a schematic diagram of a device for improving the accuracy of user intention recognition according to an embodiment of the present application. Figure 4 As shown, the device comprises:
[0099] The acquisition unit 41 is used to acquire the current user question, extract keywords from the current user question to obtain question keywords, match the question keywords with keywords in the knowledge base, and obtain keyword matching results;
[0100] A conversion unit 42, used to convert the above-mentioned question keywords into question word vectors, and convert the keywords in the above-mentioned knowledge base into knowledge base word vectors, and respectively determine the similarity and relevance between the above-mentioned question word vectors and the knowledge base word vectors in the above-mentioned knowledge base, to obtain a similarity sequence and a relevance sequence of the above-mentioned question word vectors;
[0101] The determination unit 43 is used to determine the standard question set in the above knowledge base corresponding to the above current user question at least based on the above similarity sequence, the above relevance sequence and the above keyword matching result, and determine the user intention based on the above standard question set, and the above standard question set includes multiple standard questions.
[0102] In this embodiment, the acquisition unit is used to obtain the current user question, extract and process the keywords of the current user question, obtain the question keywords, match the question keywords with the keywords in the knowledge base, and obtain the keyword matching results; the conversion unit is used to convert the question keywords into question word vectors, and convert the keywords in the knowledge base into knowledge base word vectors, respectively determine the similarity and relevance between the question word vectors and the knowledge base word vectors in the knowledge base, and obtain the similarity sequence and relevance sequence of the question word vectors; the determination unit is used to determine the standard question set in the knowledge base corresponding to the current user question at least according to the similarity sequence, the relevance sequence and the keyword matching results, and determine the user intention according to the standard question set, and the standard question set includes multiple standard questions. By introducing the judgment method of keywords, using the relevance and similarity between words, the keywords involved in the user question are obtained, and then compared with the standard questions in the knowledge base to obtain the closest knowledge points. Secondly, using the semantic information of the user question and the knowledge point, comparison and sorting can more accurately correspond the user's intention to the knowledge point in the knowledge base. The problem of low accuracy in identifying user intentions in the prior art is solved.
[0103] As an optional solution, the conversion unit includes a first determination module and a first arrangement module; the first determination module is used to determine the first formula according to: Determine the above-mentioned similarity with the knowledge base word vector in the above-mentioned knowledge base, wherein x is the above-mentioned question word vector and y is the above-mentioned knowledge base word vector; the first arrangement module is used to arrange the knowledge base word vector in the above-mentioned knowledge base in descending order according to the above-mentioned similarity to obtain the above-mentioned similarity sequence of the above-mentioned question word vector.
[0104] In an optional solution, the conversion unit includes a second determination module and a second arrangement module; the second determination module is used to determine the second arrangement module according to the second formula: Determine the above-mentioned correlation with the knowledge base word vector in the above-mentioned knowledge base, wherein p(x) is the probability of the problem word vector appearing, p(y) is the probability of the knowledge base word vector appearing, p(x, y) is the joint probability of the problem word vector and the knowledge base word vector appearing, p(x│y) is the probability of the problem word vector appearing under the condition that the knowledge base word vector appears, and a is a constant; the second arrangement module is used to arrange the knowledge base word vectors in the above-mentioned knowledge base in descending order according to the above-mentioned correlation to obtain the above-mentioned correlation sequence of the above-mentioned problem word vector.
[0105] An optional solution, the determination unit includes a classification processing module and a third determination module; the classification processing module is used to classify the current user question according to the knowledge base using a classification algorithm to obtain a question category, wherein the classification algorithm includes a decision tree and an AdaBoost algorithm; the third determination module is used to determine the standard question set in the knowledge base corresponding to the current user question according to the question category, the similarity sequence, the correlation sequence and the keyword matching result.
[0106] An optional solution, the third determination module includes a merging processing submodule and a determination submodule; the merging processing submodule is used to merge the above-mentioned similarity sequence and the above-mentioned correlation sequence to obtain a target sequence; the determination submodule is used to determine the standard question set in the above-mentioned knowledge base corresponding to the above-mentioned current user question based on the above-mentioned question category, the above-mentioned target sequence and the above-mentioned keyword matching results.
[0107] In an optional solution, the determination unit further includes a fourth determination module, which is used to adopt the Wasserstein distance formula:
[0108] Determine the standard question closest to the user's intention based on the standard question set and determine the user's intention based on the standard question; wherein d i,j is the distance between the user question and the above standard question, w i is the user question vector, w′ jis the standard problem vector.
[0109] An optional solution is that the conversion unit also includes a conversion module, which is used to convert the above-mentioned question keywords into the above-mentioned question word vectors using vector conversion technology, wherein the above-mentioned vector conversion technology includes BERT and Word2Vec.
[0110] The above-mentioned device for improving the accuracy of user intention recognition includes a processor and a memory. The above-mentioned acquisition unit, conversion unit, determination unit, etc. are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to implement corresponding functions. The above-mentioned modules are all located in the same processor; or, the above-mentioned modules are located in different processors in any combination.
[0111] The processor includes a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set, and the problem of low accuracy in identifying user intent by adjusting kernel parameters can be solved.
[0112] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0113] An embodiment of the present invention provides a computer-readable storage medium, which includes a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute the method for improving the accuracy of user intention recognition.
[0114] Specifically, methods for improving the accuracy of user intent recognition include:
[0115] Step S201, obtaining a current user question, extracting keywords from the current user question to obtain question keywords, matching the question keywords with keywords in the knowledge base to obtain keyword matching results;
[0116] Step S202, converting the above-mentioned question keywords into question word vectors, and converting the keywords in the above-mentioned knowledge base into knowledge base word vectors, respectively determining the similarity and relevance between the above-mentioned question word vectors and the knowledge base word vectors in the above-mentioned knowledge base, and obtaining a similarity sequence and a relevance sequence of the above-mentioned question word vectors;
[0117] Step S203, determining a standard question set in the knowledge base corresponding to the current user question at least based on the similarity sequence, the relevance sequence and the keyword matching result, and determining the user intention based on the standard question set, wherein the standard question set includes multiple standard questions.
[0118] An embodiment of the present invention provides a processor, which is used to run a program, wherein the method for improving the accuracy of user intention recognition is executed when the program is running.
[0119] Specifically, methods for improving the accuracy of user intent recognition include:
[0120] Step S201, obtaining a current user question, extracting keywords from the current user question to obtain question keywords, matching the question keywords with keywords in the knowledge base to obtain keyword matching results;
[0121] Step S202, converting the above-mentioned question keywords into question word vectors, and converting the keywords in the above-mentioned knowledge base into knowledge base word vectors, respectively determining the similarity and relevance between the above-mentioned question word vectors and the knowledge base word vectors in the above-mentioned knowledge base, and obtaining a similarity sequence and a relevance sequence of the above-mentioned question word vectors;
[0122] Step S203, determining a standard question set in the knowledge base corresponding to the current user question at least based on the similarity sequence, the relevance sequence and the keyword matching result, and determining the user intention based on the standard question set, wherein the standard question set includes multiple standard questions.
[0123] An embodiment of the present invention provides an electronic device, the device comprising a processor, a memory, and a program stored in the memory and executable on the processor, and when the processor executes the program, at least the following steps are implemented:
[0124] Step S201, obtaining a current user question, extracting keywords from the current user question to obtain question keywords, matching the question keywords with keywords in the knowledge base to obtain keyword matching results;
[0125] Step S202, converting the above-mentioned question keywords into question word vectors, and converting the keywords in the above-mentioned knowledge base into knowledge base word vectors, respectively determining the similarity and relevance between the above-mentioned question word vectors and the knowledge base word vectors in the above-mentioned knowledge base, and obtaining a similarity sequence and a relevance sequence of the above-mentioned question word vectors;
[0126] Step S203, determining a standard question set in the knowledge base corresponding to the current user question at least based on the similarity sequence, the relevance sequence and the keyword matching result, and determining the user intention based on the standard question set, wherein the standard question set includes multiple standard questions.
[0127] The devices in this article can be servers, PCs, PADs, mobile phones, etc.
[0128] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program for initializing at least the following method steps:
[0129] Step S201, obtaining a current user question, extracting keywords from the current user question to obtain question keywords, matching the question keywords with keywords in the knowledge base to obtain keyword matching results;
[0130] Step S202, converting the above-mentioned question keywords into question word vectors, and converting the keywords in the above-mentioned knowledge base into knowledge base word vectors, respectively determining the similarity and relevance between the above-mentioned question word vectors and the knowledge base word vectors in the above-mentioned knowledge base, and obtaining a similarity sequence and a relevance sequence of the above-mentioned question word vectors;
[0131] Step S203, determining a standard question set in the knowledge base corresponding to the current user question at least based on the similarity sequence, the relevance sequence and the keyword matching result, and determining the user intention based on the standard question set, wherein the standard question set includes multiple standard questions.
[0132] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0133] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0134] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to 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.
[0135] 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.
[0136] 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.
[0137] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0138] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0139] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0140] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0141] From the above description, it can be seen that the above embodiments of the present application achieve the following technical effects:
[0142] 1) A method for improving the accuracy of user intention recognition in the present application includes: obtaining the current user question, extracting and processing the keywords of the current user question to obtain the question keywords, matching the question keywords with the keywords in the knowledge base, and obtaining the keyword matching results; converting the question keywords into question word vectors, and converting the keywords in the knowledge base into knowledge base word vectors, respectively determining the similarity and correlation between the question word vectors and the knowledge base word vectors in the knowledge base, and obtaining the similarity sequence and correlation sequence of the question word vectors; determining the standard question set in the knowledge base corresponding to the current user question at least according to the similarity sequence, the correlation sequence and the keyword matching results, and determining the user intention according to the standard question set, wherein the standard question set includes multiple standard questions. By introducing the judgment method of keywords, using the correlation and similarity between words, the keywords involved in the user question are obtained, and then compared with the standard questions in the knowledge base to obtain the closest knowledge points. Secondly, using the semantic information of the user question and the knowledge point, comparison and sorting can more accurately match the user's intention with the knowledge point in the knowledge base. The problem of low accuracy in identifying user intentions in the prior art is solved.
[0143] 2) A device for improving the accuracy of user intention recognition in the present application includes: an acquisition unit, which is used to acquire the current user question, extract and process the keywords of the current user question, obtain the question keywords, match the question keywords with the keywords in the knowledge base, and obtain the keyword matching results; a conversion unit, which is used to convert the question keywords into question word vectors, and convert the keywords in the knowledge base into knowledge base word vectors, respectively determine the similarity and correlation between the question word vectors and the knowledge base word vectors in the knowledge base, and obtain the similarity sequence and correlation sequence of the question word vectors; a determination unit, which is used to determine the standard question set in the knowledge base corresponding to the current user question at least according to the similarity sequence, the correlation sequence and the keyword matching result, and determine the user intention according to the standard question set, and the standard question set includes multiple standard questions. By introducing the judgment method of keywords, using the correlation and similarity between words, the keywords involved in the user question are obtained, and then compared with the standard questions in the knowledge base to obtain the closest knowledge points. Secondly, using the semantic information of the user question and the knowledge point, comparison and sorting can more accurately match the user's intention with the knowledge point in the knowledge base. The problem of low accuracy in identifying user intentions in the prior art is solved.
[0144] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for improving the accuracy of user intention recognition, characterized in that: include: Obtaining a current user question, extracting and processing keywords of the current user question to obtain question keywords, matching the question keywords with keywords in the knowledge base to obtain keyword matching results; Convert the question keywords into question word vectors, and convert the keywords in the knowledge base into knowledge base word vectors, respectively determine the similarity and relevance between the question word vectors and the knowledge base word vectors in the knowledge base, and obtain a similarity sequence and a relevance sequence of the question word vectors; A standard question set in the knowledge base corresponding to the current user question is determined at least based on the similarity sequence, the relevance sequence and the keyword matching result, and a user intention is determined based on the standard question set, wherein the standard question set includes a plurality of standard questions.
2. The method according to claim 1, characterized in that Determining the similarity between the question word vector and the knowledge base word vector in the knowledge base to obtain a similarity sequence of the question word vector includes: According to the first formula: Determine the similarity COS(x,y) with the knowledge base word vector in the knowledge base, where x is the question word vector and y is the knowledge base word vector; The knowledge base word vectors in the knowledge base are arranged in descending order according to the similarity to obtain the similarity sequence of the question word vectors.
3. The method according to claim 1, characterized in that Determining the correlation between the question word vector and the knowledge base word vector in the knowledge base to obtain a correlation sequence of the question word vector includes: According to the second formula: Determine the correlation with the knowledge base word vector in the knowledge base, wherein p(x) is the probability of the problem word vector appearing, p(y) is the probability of the knowledge base word vector appearing, p(x, y) is the joint probability of the problem word vector and the knowledge base word vector appearing, p(x│y) is the probability of the problem word vector appearing under the condition that the knowledge base word vector appears, and a is a constant; The knowledge base word vectors in the knowledge base are arranged in descending order according to the relevance to obtain the relevance sequence of the question word vectors.
4. The method according to claim 1, characterized in that: Determining a set of standard questions in the knowledge base corresponding to the current user question at least according to the similarity sequence, the relevance sequence, and the keyword matching result, includes: Using a classification algorithm according to the knowledge base to classify the current user question to obtain a question category, wherein the classification algorithm includes a decision tree and an AdaBoost algorithm; A standard question set in the knowledge base corresponding to the current user question is determined according to the question category, the similarity sequence, the relevance sequence, and the keyword matching result.
5. The method according to claim 4, characterized in that Determining a standard question set in the knowledge base corresponding to the current user question according to the question category, the similarity sequence, the relevance sequence, and the keyword matching result includes: Merging the similarity sequence and the correlation sequence to obtain a target sequence; A standard question set in the knowledge base corresponding to the current user question is determined according to the question category, the target sequence and the keyword matching result.
6. The method according to claim 1, characterized in that Determine user intent based on the standard set of questions, including: Using the Wasserstein distance formula: Determine the standard question that is closest to the user's intention based on the standard question set, and determine the user's intention based on the standard question; Among them, d i,j is the distance between the user question and the standard question, w i is the user question vector, w j is the standard problem vector.
7. The method according to any one of claims 1 to 6, characterized in that: Converting the question keywords into question word vectors includes: The question keywords are converted into the question word vectors using vector conversion technology, wherein the vector conversion technology includes BERT and Word2Vec.
8. A device for improving the accuracy of user intention recognition, characterized in that: include: An acquisition unit is used to acquire a current user question, extract keywords from the current user question to obtain question keywords, match the question keywords with keywords in the knowledge base, and obtain keyword matching results; A conversion unit, used to convert the question keywords into question word vectors, and convert the keywords in the knowledge base into knowledge base word vectors, respectively determine the similarity and relevance between the question word vectors and the knowledge base word vectors in the knowledge base, and obtain a similarity sequence and a relevance sequence of the question word vectors; A determination unit is used to determine a set of standard questions in the knowledge base corresponding to the current user question based at least on the similarity sequence, the relevance sequence and the keyword matching result, and to determine the user intention based on the set of standard questions, wherein the set of standard questions includes a plurality of standard questions.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method for improving the accuracy of user intention recognition as described in any one of claims 1 to 7.
10. An electronic device, characterized in that: include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include a method for executing any one of claims 1 to 7 to improve the accuracy of user intent recognition.
Citation Information
Patent Citations
Method and device for positioning question in knowledge base
CN111984703A
Question reply matching method and system, server and storage medium
CN115577080A
Limited question answering system based on question intention understanding
CN116992007A
Cited By
LLM-based NL2API and NL2SQL fused AI question-answering system and method
CN119829727A