A question matching method and system in digital human system

By constructing a reference problem set and using the probability model screening standard problems of similarity and European distance, the problems of slow retrieval speed and low accuracy in the digital human system are solved, and efficient and accurate matching of user problems is achieved.

CN119782511BActive Publication Date: 2025-09-05HUBEI TAIYUE SATELLITE TECH DEV CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411778711.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-09-05
Estimated Expiration
2044-12-05

AI Technical Summary

Technical Problem

In the digital human system, when there are many standard problems, the search speed is slow and the classification is complex, resulting in poor user experience and inaccurate search results.

Method used

By constructing a set of reference problems, calculate the similarity and Euclidean distance between the standard problems and the user problems, build a probability model, filter standard problems with close distances and similarities, and use intersection operations to select the most relevant standard problems for matching.

Benefits of technology

It significantly reduces the search time, improves matching accuracy and system efficiency, enhances robustness, and is suitable for large-scale and complex classification application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119782511B_ABST
    Figure CN119782511B_ABST
Patent Text Reader

Abstract

The present invention proposes a question matching method and system in a digital human system, including: before the user inputs a question, selecting multiple standard questions from a standard question set as reference questions to construct a reference question set; performing word vector processing on the standard question set and each question in the reference question set, respectively calculating the similarity and Euclidean distance between each reference question and other standard questions, and constructing a first candidate set; after the user inputs the question, first performing word vector processing, calculating the similarity and Euclidean distance between the user-input question and each reference question, and constructing a probability model; determining the distance proximity range and similarity proximity range of each standard question according to a probability threshold, and obtaining a distance candidate set and a similarity candidate set; performing an intersection operation on the distance candidate set and the similarity candidate set to obtain a candidate set, selecting the standard question with the highest similarity from the candidate set for input matching, and outputting the corresponding standard answer as an answer, thereby improving matching accuracy and retrieval efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a question matching method and system in a digital human system. Background Art

[0002] In the digital human system, some standard questions and their corresponding answers are usually built in. First, these standard questions are converted into word vectors through BERT or other models; when the user enters a question, it is also converted into a word vector; then, the similarity between the vector of the user's question and the vector of each standard question is calculated; if the similarity exceeds the preset threshold, the corresponding standard answer is output; if the similarity of all standard questions does not reach the threshold, the user question is submitted to the subsequent large language model for answering.

[0003] Publication number CN112131876A discloses a method and system for determining standard questions based on similarity, comprising the following steps: obtaining user question information, calculating the similarity between the user questions and existing training data based on a similarity model, storing questions with a similarity below a specified threshold as data to be processed, and determining unfamiliar data that does not conform to the characteristics of existing standard questions; performing cluster analysis on the user questions in the data to be processed, extracting the characteristics of each category as hot words, sorting the hot words from high to low, storing the hot questions with the highest ranking in a database to be labeled, and expanding them for use as standard questions in an intelligent question-answering system.

[0004] The above-mentioned existing solution has the problem that when there are a large number of built-in standard questions, the user needs to wait for a long search time before a standard question is matched, and the standard question retrieval speed is slow, which affects the user experience. In addition, when performing cluster analysis on user questions, when the user questions are between multiple categories, they cannot be accurately classified, thereby reducing the accuracy of the retrieval results. Summary of the Invention

[0005] In view of this, the present invention proposes a question matching method and system in a digital human system. By screening the intersection of multiple reference questions, the method significantly reduces the retrieval time, improves the matching accuracy and system efficiency, and enhances the robustness. It is suitable for application scenarios with a large number of standard questions and complex classifications.

[0006] The technical solution of the present invention is implemented as follows: In a first aspect, the present invention provides a question matching method in a digital human system, comprising the following steps:

[0007] S1, selecting multiple standard questions from a standard question set as reference questions and constructing a reference question set, wherein the digital human system stores a standard question set and an answer set, and the data in the standard question set and the answer set are in a one-to-one correspondence;

[0008] S2: Perform word embedding processing on each question in the standard question set and reference question set, calculate the similarity and Euclidean distance between each reference question and other standard questions, construct the first candidate set, and sort them according to similarity and Euclidean distance to generate similarity sequence and distance sequence;

[0009] S3: Process the word vector of the user input question, calculate the similarity and Euclidean distance between the user input question and each reference question, and build a probability model based on the similarity and Euclidean distance between the user input question and each reference question, and between each reference question and other standard questions;

[0010] S4, presetting a probability threshold of the probability model, determining the distance proximity range and similarity proximity range of each standard question according to the probability threshold, filtering the distance sequence according to the distance proximity range of the standard question to obtain a distance candidate set, and filtering the similarity sequence according to the similarity proximity range of the standard question to obtain a similarity candidate set;

[0011] S5, performing an intersection operation on the distance candidate set and the similarity candidate set to obtain a candidate set, selecting the standard question input with the highest similarity from the candidate set to match, and outputting the corresponding standard answer as the answer to the user input question.

[0012] Based on the above technical solution, preferably, step S1 includes the following sub-steps:

[0013] Collect standard questions and answers, build a standard question set and an answer set respectively, organize all standard questions and their corresponding answers, and establish a mapping relationship between standard questions and answers; add all standard questions to the standard question set, and add all answers to the answer set;

[0014] The K-means clustering algorithm is used to group the standard question set, the number of selected reference questions is preset, and standard questions are randomly selected from different grouped data as reference questions to construct the reference question set.

[0015] Based on the above technical solution, preferably, step S2 includes the following sub-steps:

[0016] Perform word embedding processing on each question in the standard question set and the reference question set. Use the Euclidean distance formula to calculate the Euclidean distance between each reference question and other standard questions in the standard question set. Use the cosine similarity formula to calculate the similarity between each reference question and other standard questions in the standard question set.

[0017] Constructing a first candidate set, associating the standard questions with the corresponding calculated Euclidean distances and similarity values, combining them into a reference subset and adding it to the first candidate set;

[0018] The elements in the first candidate set are arranged in ascending order according to the similarity value to generate a similarity sequence, and the elements in the first candidate set are arranged in ascending order according to the Euclidean distance value to generate a distance sequence.

[0019] On the basis of the above technical solution, preferably, step S3 includes the following steps:

[0020] Perform word vector processing on the user input question, use the Euclidean distance formula to calculate the Euclidean distance between the user input question and each reference question, and use the cosine similarity formula to calculate the similarity between the user input question and each reference question;

[0021] Based on the similarity and Euclidean distance between the user input question and each reference question, and between each reference question and other standard questions, a probability model is constructed. The probability model is used to determine the degree of closeness between the standard question and the user question in terms of distance and similarity. The probability model calculation formula is:

[0022]

[0023] Where, P j (q i |U) is the probability that the i-th element in the j-th reference subset is close to the user input question U, α and β are adjustment parameters, exp is the natural exponential function, d j,U The Euclidean distance between the user input question U and the reference question corresponding to the jth reference subset, s j,U The similarity between the user input question U and the reference question corresponding to the jth reference subset, d j,i is the Euclidean distance between the reference problem corresponding to the jth reference subset and the standard problem corresponding to the i-th element, s j,i is the similarity between the reference question corresponding to the j-th reference subset and the standard question corresponding to the i-th element.

[0024] Based on the above technical solution, preferably, step S4 includes the following sub-steps:

[0025] A probability threshold of the probability model is preset, and the preset probability threshold, the Euclidean distance between the user input question and the j-th reference question, and the similarity between the user input question and the j-th reference question are substituted into the probability model calculation formula to calculate the distance proximity range and similarity proximity range of the corresponding standard question respectively;

[0026] Construct a distance candidate set. According to the distance proximity range between the reference question and the standard question, filter the corresponding reference subset in the distance sequence, obtain the elements that meet the range, and add them to each distance candidate subset respectively. Combine all distance candidate subsets to form a distance candidate set.

[0027] Construct a similar candidate set. According to the similarity range of the reference question and the standard question, screen the corresponding reference subsets in the similar sequence, obtain the elements that meet the range, and add them to each similar candidate subset respectively. Combine all similar candidate subsets to form a similar candidate set.

[0028] Based on the above technical solution, preferably, in step S5, the distance candidate set and the similarity candidate set are subjected to an intersection operation to obtain a candidate set, which includes:

[0029] Perform an intersection operation on the distance candidate set and the similarity candidate set to obtain the candidate set. The calculation expression is:

[0030]

[0031] Where H is the candidate set, H j is the candidate subset corresponding to the j-th reference question, TS j is the similar candidate subset corresponding to the j-th reference question, TD j is the distance candidate set corresponding to the j-th reference question.

[0032] Based on the above technical solution, preferably, step S5 includes selecting the standard question input with the highest similarity from the candidate set and outputting the corresponding standard answer as the answer to the user input question, including the following sub-steps:

[0033] Determine whether all candidate subsets contain elements. If no element exists in any candidate subset, output the standard question that no match can be found. If all candidate subsets contain elements, perform an intersection operation on all candidate subsets of the reference question to obtain a candidate set.

[0034] Determine whether all candidate sets contain elements. If no element exists in any candidate subset, output the standard question that cannot be matched. If an element exists in the candidate set, select the standard question with the highest similarity from the candidate set to match the input, and output the corresponding standard answer as the answer to the user input question.

[0035] In a second aspect, the present invention further provides a question matching system in a digital human system, which is implemented using the above-mentioned question matching method in a digital human system. The system includes:

[0036] A selection module is used to select multiple standard questions from a standard question set as reference questions and construct a reference question set. The digital human system stores a standard question set and an answer set, and the data in the standard question set and the answer set are in a one-to-one correspondence;

[0037] The first calculation module is used to perform word vector processing on each question in the standard question set and the reference question set, calculate the similarity and Euclidean distance between each reference question and other standard questions, construct a first candidate set, and sort them according to the similarity and Euclidean distance to generate a similarity sequence and a distance sequence;

[0038] The model building module is used to process the word vector of the user input question, calculate the similarity and Euclidean distance between the user input question and each reference question, and build a probability model based on the similarity and Euclidean distance between the user input question and each reference question, and between each reference question and other standard questions;

[0039] A range screening module is used to determine the distance proximity range and similarity proximity range of each standard question based on the probability threshold of the preset probability model, and to screen the distance sequence based on the distance proximity range of the standard question to obtain a distance candidate set, and to screen the similar sequence based on the similarity proximity range of the standard question to obtain a similarity candidate set;

[0040] The output module is used to perform an intersection operation on the distance candidate set and the similarity candidate set to obtain a candidate set, select the standard question input with the highest similarity from the candidate set to match, and output the corresponding standard answer as the answer to the user input question.

[0041] In a third aspect, the present invention also provides an electronic device comprising at least one processor, at least one memory, a communication interface and a bus; wherein the processor, memory and communication interface communicate with each other via the bus; the memory stores a program of a method for matching a problem in a digital human system that can be executed by the processor, and the program of a method for matching a problem in a digital human system is configured to implement a method for matching a problem in a digital human system as described above.

[0042] In a fourth aspect, the present invention also provides a computer-readable storage medium, on which is stored a program for a method for matching a question in a digital human system, which, when executed, implements the method for matching a question in a digital human system as described above.

[0043] The problem matching method and system in the digital human system of the present invention have the following beneficial effects compared with the prior art:

[0044] (1) By randomly selecting several standard questions as references, evaluating the distance and similarity between the user question and the reference questions, and selecting standard questions with close distance and similarity to the user question in terms of reference questions, multiple subsets are formed; the intersection of each subset is taken, and finally the standard question with the highest similarity or the shortest distance is selected and the corresponding answer is replied. This method significantly reduces the retrieval time, improves the matching accuracy and system efficiency, and enhances the robustness by screening the intersection of multiple reference questions. It is suitable for application scenarios with a large number of standard questions and complex classification.

[0045] (2) By constructing a probability model, the two factors of similarity and Euclidean distance are comprehensively considered, making the basis for judging the degree of closeness between standard questions and user questions more comprehensive and accurate, which helps to screen out the standard questions that are most relevant to user questions during the matching process and improve the accuracy of matching. In addition, the adjustment parameters α and β in the probability model can be adjusted according to actual needs to adapt to the needs of different application scenarios, making this method flexible in the matching process. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0047] Figure 1 This is a flow chart of a question matching method in a digital human system according to the present invention;

[0048] Figure 2 This is a flowchart of step S2 of a question matching method in a digital human system according to the present invention;

[0049] Figure 3 This is a flowchart of step S3 of a question matching method in a digital human system according to the present invention;

[0050] Figure 4 This is a flowchart of step S4 of a question matching method in a digital human system of the present invention;

[0051] Figure 5 This is a flowchart of step S5 of a question matching method in a digital human system of the present invention. DETAILED DESCRIPTION

[0052] The following will be combined with the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0053] In the digital human system of this embodiment, a large number of standard questions and their answers are often preset to facilitate quick matching and replying when users ask questions. Existing methods first classify the standard questions and then calculate the word vector similarity within the corresponding category to select the best answer. However, when there are more than 100,000 standard questions and as many as 500 categories, classification and retrieval take a long time.

[0054] like Figure 1 As shown, a question matching method in a digital human system of the present invention comprises the following steps:

[0055] S1, selecting multiple standard questions from a standard question set as reference questions and constructing a reference question set, wherein the digital human system stores a standard question set and an answer set, and the data in the standard question set and the answer set are in a one-to-one correspondence;

[0056] Among them, standard questions and answers are collected, and standard question sets and answer sets are constructed respectively. All standard questions and their corresponding answers are sorted out, and a mapping relationship between standard questions and answers is established; all standard questions are added to the standard question set, and all answers are added to the answer set;

[0057] The K-means clustering algorithm is used to group the standard question set, the number of selected reference questions is preset, and standard questions are randomly selected from different grouped data as reference questions to construct the reference question set.

[0058] It should be noted that the standard questions are pre-built into the system and are equipped with corresponding answers. Let the standard question set be Q = {q1,q2,…,q N}, where N is very large and each element is a 768-dimensional vector. Several questions are randomly selected from the standard question set as the reference question set. The selection criterion is that the elements in the reference set have significant differences in classification, that is, standard questions are selected from different grouped data as reference questions. The selected reference question set is set to R = {r1, r2, …, r K}, where the value range of K is between 3 and 5, that is, the number of selected reference questions is between 3 and 5.

[0059] It is understandable that the reference question set can also be obtained through manual screening, as long as the reference questions clearly belong to different groups;

[0060] like Figure 2 As shown, specifically, in step S1 of this embodiment:

[0061] First, collect standard questions and answers, organize all standard questions and their corresponding answers, establish a mapping relationship between standard questions and answers, and build a knowledge base;

[0062] Then, assign unique codes to all standard questions to ensure that the corresponding questions and their answers can be quickly found through the codes. The codes are encoded in ascending order using natural numbers.

[0063] Next, 3 to 5 reference questions are selected from the standard question set. The reference questions belong to different categories and have significant differences. A candidate question is randomly selected from each group and its code is recorded. When the number of selections reaches the preset number, the selection is stopped and the reference question is added to the reference question set R.

[0064] By constructing a reference question set, this embodiment can reduce the number of questions that need to be compared during the matching process, thereby improving matching efficiency. The significant differences in the classification of the reference questions help to quickly locate the standard questions that are most relevant to the user's questions. The size of the reference question set is moderate, which maintains diversity and reduces computational complexity, making the system easy to implement and maintain.

[0065] S2, perform word vector processing on each question in the standard question set and reference question set, calculate the similarity and Euclidean distance between each reference question and other standard questions respectively, construct the first candidate set, and sort them according to the similarity and Euclidean distance to generate a similarity sequence and a distance sequence.

[0066] Among them, word vector processing is performed on each question in the standard question set and the reference question set. The Euclidean distance formula is used to calculate the Euclidean distance between each reference question and other standard questions in the standard question set. The cosine similarity formula is used to calculate the similarity between each reference question and other standard questions in the standard question set.

[0067] Constructing a first candidate set, associating the standard questions with the corresponding calculated Euclidean distances and similarity values, combining them into a reference subset and adding it to the first candidate set;

[0068] The elements in the first candidate set are arranged in ascending order according to the similarity value to generate a similarity sequence, and the elements in the first candidate set are arranged in ascending order according to the Euclidean distance value to generate a distance sequence.

[0069] It should be noted that for each reference question, the distance and similarity between it and all standard questions are calculated respectively. The distance is calculated using the Euclidean distance formula, and the similarity is calculated using the cosine similarity formula. After the calculation is completed, a set C is generated for each reference question. j={q i ∈Q|d j,i , s j,i}, where d j,i Represents the standard problem q i With reference question r j The Euclidean distance between j,i Represent the cosine similarity between them, sort by similarity and Euclidean distance, and generate similarity sequence and distance sequence.

[0070] like Figure 2 As shown, specifically, in step S1 of this embodiment:

[0071] Use the BERT model to convert all standard questions into 768-dimensional vectors, record the encoding of each standard question and its corresponding vector representation, and the vectorized standard question set is Q;

[0072] Select a record from the reference question set R. If it is the first selection, select the first record in R; otherwise, select the next record of the current record, obtain the number of the selected reference question, and search for the reference question r in the standard question set Q. j The corresponding word vector;

[0073] Create an empty reference subset C j , used to store three aspects of content: question number, Euclidean distance and similarity, select a record from the standard question set Q, if it is the first selection, then select the first record in Q, otherwise, select the next record q of the current record i+1 ,q i Number the current record;

[0074] Calculate the Euclidean distance d using the Euclidean distance formula j,i , where the input is the word vector r of the reference question j and the currently selected standard question q i , the result is recorded as d j,i ;

[0075] Use the cosine similarity formula to calculate s j,i , where the input is the word vector r of the reference question j and the currently selected standard question q i , the calculation result is recorded as s j,i ;

[0076] The number of the current standard problem i and the calculated Euclidean distance d j,i and similarity s j,i Compose a composite element and add it to set C j middle;

[0077] Determine whether all standard questions have been traversed. If so, determine whether all reference questions have been traversed. If so, sort by similarity and Euclidean distance. j The collection performs the following sorting operation, C j According to the similarity s j,i Sort from small to large and generate similar sequence DS j , C j According to the Euclidean distance d j,i Sort again from small to large to generate the distance sequence DD j , if not, continue to calculate the next standard problem.

[0078] This embodiment can more accurately measure the semantic similarity and spatial distance between the reference question and the standard question by calculating the similarity and Euclidean distance, which helps to screen out the standard question most relevant to the user question during the matching process and improve the matching accuracy.

[0079] S3, performs word vector processing on the user input question, calculates the similarity and Euclidean distance between the user input question and each reference question, and builds a probability model based on the similarity and Euclidean distance between the user input question and each reference question and between each reference question and other standard questions.

[0080] The user input question is processed into a word vector, and the Euclidean distance formula is used to calculate the Euclidean distance between the user input question and each reference question. The cosine similarity formula is used to calculate the similarity between the user input question and each reference question.

[0081] Based on the similarity and Euclidean distance between the user input question and each reference question, and between each reference question and other standard questions, a probability model is constructed. The probability model is used to determine the degree of closeness between the standard question and the user question in terms of distance and similarity. The probability model calculation formula is:

[0082]

[0083] Where, P j (q i |U) is the probability that the i-th element in the j-th reference subset is close to the user input question U, α and β are adjustment parameters, exp is the natural exponential function, d j,U The Euclidean distance between the user input question U and the reference question corresponding to the jth reference subset, s j,U The similarity between the user input question U and the reference question corresponding to the jth reference subset, d j,i is the Euclidean distance between the reference problem corresponding to the jth reference subset and the standard problem corresponding to the i-th element, s j,iis the similarity between the reference question corresponding to the j-th reference subset and the standard question corresponding to the i-th element.

[0084] It should be noted that in this implementation, a probability model is constructed to judge the degree of closeness. The purpose of this model is to determine the degree of closeness when the similarity and Euclidean distance are equal to s j,U and d j,U When the deviation is smaller, the probability is 1; when the deviation is larger, the probability is closer to 1; when the deviation is larger, the probability is closer to 0. Considering the deviation of distance and similarity at the same time makes the calculation more accurate.

[0085] In addition, after the user enters a question, the system will immediately use the same model to convert the question into a corresponding word vector representation to ensure that the input question and the reference question are comparable in the same vector space. After the conversion is completed, the system will calculate the distance and similarity between the word vector and the word vector of each reference question one by one. The Euclidean distance and cosine similarity are used to measure the semantic proximity and relevance between the input question and the reference question. In this way, the system can effectively identify the most relevant reference questions and provide accurate and relevant answers.

[0086] In this embodiment, after the user enters a question, the BERT model is used to vectorize it to obtain a vector U. Then, the similarity and Euclidean distance between U and each reference question are calculated respectively.

[0087] Similarity j,U =sim(r j ,U), where sim represents any element r in the reference problem set R j The similarity between .

[0088] Euclidean distance d j,U =dist(r j ,U), where dist represents any element r in the reference problem set R j The Euclidean distance between .

[0089] like Figure 3 As shown, specifically, in step S3 of this embodiment:

[0090] Users can input questions in the form of voice or text. If voice input is used, the system will first convert it into text, use the BERT model to convert the user's input question into a word vector representation U, and construct an empty set T to store the user's question vector U and each reference question r jThe distance and similarity between them. Each element in the set will include the reference question number, the reference question number, the distance and similarity. Select a record from the reference question set R. If it is the first selection, select the first record in R; otherwise, select the next one of the current record, obtain the number of the selected reference question, and search for the reference question r in the standard question set Q. j The corresponding word vector.

[0091] Using the Euclidean distance formula, calculate the reference problem r j The distance between the word vector and the user question vector U, the calculation result is recorded as d j,U , using the cosine similarity formula, calculate the reference question r j The similarity between the word vector and the user question vector U. The calculation result is recorded as s j,U .

[0092] The reference problem number, the number, and the calculated Euclidean distance d j,U and similarity s j,U A composite element is formed and added to T to determine whether all reference questions have been traversed. If so, set T is output. Otherwise, the next reference question is processed. Set T will store the distance and similarity data between the user question and each reference question. This data will be used to filter the candidate sets in each reference set.

[0093] It should be noted that by constructing a probability model, the two factors of similarity and Euclidean distance are comprehensively considered, making the basis for judging the degree of proximity between standard questions and user questions more comprehensive and accurate, which helps to screen out the standard questions that are most relevant to user questions during the matching process and improve the accuracy of matching. The adjustment parameters α and β in the probability model can be adjusted according to actual needs to adapt to the needs of different application scenarios, making this method flexible and customizable in the matching process.

[0094] S4, preset the probability threshold of the probability model, determine the distance proximity range and similarity proximity range of each standard question according to the probability threshold, and filter the distance sequence according to the distance proximity range of the standard question to obtain a distance candidate set, and filter the similarity sequence according to the similarity proximity range of the standard question to obtain a similarity candidate set.

[0095] Step S4 includes the following sub-steps:

[0096] A probability threshold of the probability model is preset, and the preset probability threshold, the Euclidean distance between the user input question and the j-th reference question, and the similarity between the user input question and the j-th reference question are substituted into the probability model calculation formula to calculate the distance proximity range and similarity proximity range of the corresponding standard question respectively;

[0097] Construct a distance candidate set. According to the distance proximity range between the reference question and the standard question, filter the corresponding reference subset in the distance sequence, obtain the elements that meet the range, and add them to each distance candidate subset respectively. Combine all distance candidate subsets to form a distance candidate set.

[0098] Construct a similar candidate set. According to the similarity range of the reference question and the standard question, screen the corresponding reference subsets in the similar sequence, obtain the elements that meet the range, and add them to each similar candidate subset respectively. Combine all similar candidate subsets to form a similar candidate set.

[0099] It should be noted that according to the probability model, since the calculation of probability is relatively complicated and all elements in the j-th reference set need to be calculated, the probability calculation amount is large. Therefore, it is only necessary to derive the range of the corresponding Euclidean distance and similarity through this function.

[0100] Assuming that similarity and distance have the same influence, we set the values ​​of α and β to 1, and set that only when the close probability exceeds 0.85 can it be used as a candidate set. Thus, we can get:

[0101]

[0102] as well as

[0103]

[0104] Therefore, the i-th element in the j reference set should also satisfy d j,i In [0.8375d j,U ,1.1625d j,U ] range, s j,i In [0.8375s j,U ,1.1625s j,U ] range. It is particularly important to note that since the maximum value of similarity is 1, if 1.1625s j,U If it exceeds 1, it should be replaced with 1.

[0105] Using this method, define the candidate set H j C j A subset of , set H j Contains all elements q that satisfy the following conditions i , H j ={q i ∈Q|0.8375d j,U ≤d j,i ≤1.1625d j,U , 0.8375s j,U ≤s j,i≤1.1625s j,U}.

[0106] like Figure 4 As shown, specifically, in step S4 of this embodiment:

[0107] Select a record from the set T. If it is the first selection, take the first record in T; otherwise, select the next record of the current record;

[0108] Use the distance value d in the current record j,U , determine the close range of the standard problem distance, if the Euclidean distance between a standard problem and the reference problem is within 0.8375d j,U to 1.1625d j,U If the distance is between , it is considered to be close, and the standard problem is added to the candidate set. For each reference subset, there is a distance sequence and a similarity sequence. Use the reference number j to select one of the distance sequences DD sorted by distance. j , from DD j Screen the standard questions that meet the distance range and generate the distance candidate set TD j , in the DDj sequence, filter out the distance between 0.8375d j,U to 1.1625d j,U Standard problems between them, add these standard problems to the distance candidate set TD j middle;

[0109] Use the similarity value s in the current record j,U , determine the close range of the standard problem distance, if the similarity between a standard problem and the reference problem is within 0.8375d j,U to 1.1625d j,U If the distance sequence and similarity sequence exist for each reference subset, the reference number j is used to select one of the distance sequences DS sorted by distance. j , from DS j Screen the standard questions that meet the distance range and generate the distance candidate set TS j , in the DSj sequence, filter out the distance of 0.8375d j,U to 1.1625d j,U Standard problems between them, add these standard problems to the distance candidate set TS j middle.

[0110] It should be noted that by presetting the probability threshold of the probability model and filtering based on the range of distance and similarity, a distance candidate set and a similarity candidate set are constructed, which can further narrow the scope of standard questions related to user questions and help improve the accuracy and efficiency of matching.

[0111] S5, performing an intersection operation on the distance candidate set and the similarity candidate set to obtain a candidate set, selecting the standard question input with the highest similarity from the candidate set to match, and outputting the corresponding standard answer as the answer to the user input question.

[0112] Among them, the distance candidate set and the similarity candidate set are intersected to obtain the candidate set. The calculation expression is:

[0113]

[0114] Where H is the candidate set, H j is the candidate subset corresponding to the j-th reference question, TS j is the similar candidate subset corresponding to the j-th reference question, TD j is the distance candidate set corresponding to the j-th reference question.

[0115] Determine whether all candidate subsets contain elements. If no element exists in any candidate subset, output the standard question that no match can be found. If all candidate subsets contain elements, perform an intersection operation on all candidate subsets of the reference question to obtain a candidate set.

[0116] Determine whether all candidate sets contain elements. If no element exists in any candidate subset, output the standard question that cannot be matched. If an element exists in the candidate set, select the standard question with the highest similarity from the candidate set to match the input, and output the corresponding standard answer as the answer to the user input question.

[0117] It should be noted that to ensure that the final candidate set meets the requirements in terms of distance and similarity, the distance candidate set and the similarity candidate set are intersected to obtain the candidate subset H of the reference problem. j , judge H j Is there an element in the set? If any H j If it is empty, it means that no standard question matching the user question can be found. Otherwise, for all candidate sets of reference questions H j Perform an intersection operation to obtain the final candidate set H, check whether the final candidate set H contains elements, and if H is not empty, output the question number of each element in the set H. The standard questions corresponding to these numbers are highly matched with the questions input by the user, so as to select the most appropriate standard question to answer. Otherwise, it means that no standard question matching the user's question is found in the existing standard question library.

[0118] like Figure 5As shown, in this embodiment, when only the final candidate set H has elements, it means that there is at least one standard question that is semantically close to the user question. The closest standard question is selected from the final candidate set, and its answer is used as the answer to the user question.

[0119] Specifically, it includes initializing variables tmps and final: setting the variable tmps=0 to store the current maximum similarity value; setting the variable final=-1 to store the standard question number with the maximum similarity.

[0120] From the final candidate set H, select a record for processing. If it is the first selection, take the first record in H; otherwise, select the next record of the current record, and according to the standard question number in the current record, find and obtain the word vector corresponding to the number. Use the cosine similarity method to calculate the similarity between the word vector obtained in the previous step and the user question word vector U, which is recorded as tmpU.

[0121] Compare the values ​​of tmpU and tmps. If tmpU>tmps, it means that the current standard question is closer to the user question. Assign the standard question number of the current record to the variable final, and assign the currently calculated similarity tmpU to the variable tmps to ensure that tmps always stores the maximum similarity value. Otherwise, determine whether all records in the candidate set H have been traversed. If not, return to continue processing the next record. If so, find the corresponding answer based on the standard question number stored in the variable final and output it as a response to the user.

[0122] Through intersection operations and similarity calculations, it can be ensured that the final selected standard questions are highly matched with the user questions in terms of distance and similarity, which improves the accuracy and efficiency of matching and helps provide users with more accurate and useful answers.

[0123] This method can effectively reduce the time overhead of classification and retrieval by screening the intersection of multiple reference questions, while improving the accuracy of matching, improving efficiency, improving accuracy, and enhancing robustness, avoiding the deviation that may be caused by a single reference, and making the matching process more robust. This method can achieve efficient and accurate user question matching in a large-scale standard question library, and is suitable for application scenarios with a huge number of standard questions and complex classification.

[0124] The present invention also provides a question matching system in a digital human system, which is implemented using the above-mentioned question matching method in a digital human system. The system includes:

[0125] A selection module is used to select multiple standard questions from a standard question set as reference questions and construct a reference question set. The digital human system stores a standard question set and an answer set, and the data in the standard question set and the answer set are in a one-to-one correspondence;

[0126] The first calculation module is used to perform word vector processing on each question in the standard question set and the reference question set, calculate the similarity and Euclidean distance between each reference question and other standard questions, construct a first candidate set, and sort them according to the similarity and Euclidean distance to generate a similarity sequence and a distance sequence;

[0127] The model building module is used to process the word vector of the user input question, calculate the similarity and Euclidean distance between the user input question and each reference question, and build a probability model based on the similarity and Euclidean distance between the user input question and each reference question, and between each reference question and other standard questions;

[0128] A range screening module is used to determine the distance proximity range and similarity proximity range of each standard question based on the probability threshold of the preset probability model, and to screen the distance sequence based on the distance proximity range of the standard question to obtain a distance candidate set, and to screen the similar sequence based on the similarity proximity range of the standard question to obtain a similarity candidate set;

[0129] The output module is used to perform an intersection operation on the distance candidate set and the similarity candidate set to obtain a candidate set, select the standard question input with the highest similarity from the candidate set to match, and output the corresponding standard answer as the answer to the user input question.

[0130] It should be noted that this system is a system corresponding to the above-mentioned new energy power generation technology supervision and management method. All implementation methods in the above-mentioned method embodiments are applicable to the embodiments of this system and can achieve the same technical effects.

[0131] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.

[0132] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems and modules can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0133] In the embodiments provided by the present invention, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interface, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0134] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0135] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0136] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard drive, ROM, RAM, a magnetic disk, or an optical disk.

[0137] In addition, it should be noted that, in the system and method of the present invention, it is obvious that each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent solutions of the present invention. Moreover, the steps of performing the above-mentioned series of processing can naturally be performed in chronological order according to the order of description, but it is not necessary to perform them in chronological order, and some steps can be performed in parallel or independently of each other. For those of ordinary skill in the art, it will be understood that all or any steps or components of the method and apparatus of the present invention can be implemented in any computing device (including processors, storage media, etc.) or a network of computing devices in hardware, firmware, software or a combination thereof, which can be achieved by those of ordinary skill in the art using their basic programming skills after reading the description of the present invention.

[0138] Therefore, the purpose of the present invention can also be achieved by running a program or a group of programs on any computing system. The computing system can be a well-known general-purpose system. Therefore, the purpose of the present invention can also be achieved simply by providing a program product containing program code that implements the method or device. That is to say, such a program product also constitutes the present invention, and the storage medium storing such a program product also constitutes the present invention. Obviously, the storage medium can be any well-known storage medium or any storage medium developed in the future. It should also be pointed out that in the device and method of the present invention, it is obvious that each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present invention. In addition, the steps of performing the above-mentioned series of processing can naturally be performed in chronological order according to the order of description, but do not necessarily need to be performed in chronological order. Certain steps can be performed in parallel or independently of each other.

[0139] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A question matching method in a digital human system, characterized in that: The following steps are involved: S1, selecting multiple standard questions from a standard question set as reference questions and constructing a reference question set, wherein the digital human system stores a standard question set and an answer set, and the data in the standard question set and the answer set are in a one-to-one correspondence; S2: Perform word embedding processing on each question in the standard question set and reference question set, calculate the similarity and Euclidean distance between each reference question and other standard questions, construct the first candidate set, and sort them according to similarity and Euclidean distance to generate similarity sequence and distance sequence; S3: Process the word vector of the user input question, calculate the similarity and Euclidean distance between the user input question and each reference question, and build a probability model based on the similarity and Euclidean distance between the user input question and each reference question, and between each reference question and other standard questions; S4, presetting a probability threshold of the probability model, determining the distance proximity range and similarity proximity range of each standard question according to the probability threshold, filtering the distance sequence according to the distance proximity range of the standard question to obtain a distance candidate set, and filtering the similarity sequence according to the similarity proximity range of the standard question to obtain a similarity candidate set; S5, performing an intersection operation on the distance candidate set and the similarity candidate set to obtain a candidate set, selecting the standard question input with the highest similarity from the candidate set to match, and outputting the corresponding standard answer as the answer to the user input question.

2. The question matching method in a digital human system according to claim 1, characterized in that: Step S1 includes the following sub-steps: Collect standard questions and answers, build standard question sets and answer sets respectively, organize all standard questions and their corresponding answers, and establish a mapping relationship between standard questions and answers; Add all standard questions to the standard question set and all answers to the answer set; The K-means clustering algorithm is used to group the standard question set, the number of selected reference questions is preset, and standard questions are randomly selected from different grouped data as reference questions to construct the reference question set.

3. The question matching method in a digital human system according to claim 2, characterized in that: Step S2 includes the following sub-steps: Perform word embedding processing on each question in the standard question set and the reference question set. Use the Euclidean distance formula to calculate the Euclidean distance between each reference question and other standard questions in the standard question set. Use the cosine similarity formula to calculate the similarity between each reference question and other standard questions in the standard question set. Constructing a first candidate set, associating the standard questions with the corresponding calculated Euclidean distances and similarity values, combining them into a reference subset and adding it to the first candidate set; The elements in the first candidate set are arranged in ascending order according to the similarity value to generate a similarity sequence, and the elements in the first candidate set are arranged in ascending order according to the Euclidean distance value to generate a distance sequence.

4. The question matching method in a digital human system according to claim 3, characterized in that: Step S3 includes the following steps: Perform word vector processing on the user input question, use the Euclidean distance formula to calculate the Euclidean distance between the user input question and each reference question, and use the cosine similarity formula to calculate the similarity between the user input question and each reference question; Based on the similarity and Euclidean distance between the user input question and each reference question, and between each reference question and other standard questions, a probability model is constructed. The probability model is used to determine the degree of closeness between the standard question and the user question in terms of distance and similarity. The probability model calculation formula is: Where, P j (q i |U) is the probability that the i-th element in the j-th reference subset is close to the user input question U, α and β are adjustment parameters, exp is the natural exponential function, d j,U The Euclidean distance between the user input question U and the reference question corresponding to the jth reference subset, s j,U The similarity between the user input question U and the reference question corresponding to the jth reference subset, d j,i is the Euclidean distance between the reference problem corresponding to the jth reference subset and the standard problem corresponding to the i-th element, s j,i is the similarity between the reference question corresponding to the j-th reference subset and the standard question corresponding to the i-th element.

5. The question matching method in a digital human system according to claim 4, characterized in that: Step S4 includes the following sub-steps: A probability threshold of the probability model is preset, and the preset probability threshold, the Euclidean distance between the user input question and the j-th reference question, and the similarity between the user input question and the j-th reference question are substituted into the probability model calculation formula to calculate the distance proximity range and similarity proximity range of the corresponding standard question respectively; Construct a distance candidate set. According to the distance proximity range between the reference question and the standard question, filter the corresponding reference subset in the distance sequence, obtain the elements that meet the range, and add them to each distance candidate subset respectively. Combine all distance candidate subsets to form a distance candidate set. Construct a similar candidate set. According to the similarity range of the reference question and the standard question, screen the corresponding reference subsets in the similar sequence, obtain the elements that meet the range, and add them to each similar candidate subset respectively. Combine all similar candidate subsets to form a similar candidate set.

6. The question matching method in a digital human system according to claim 5, characterized in that: In step S5, the distance candidate set and the similarity candidate set are intersected to obtain a candidate set, which includes: Perform an intersection operation on the distance candidate set and the similarity candidate set to obtain the candidate set. The calculation expression is: Where H is the candidate set, H j is the candidate subset corresponding to the j-th reference question, TS j is the similar candidate subset corresponding to the j-th reference question, TD j is the distance candidate set corresponding to the j-th reference question.

7. The question matching method in a digital human system according to claim 6, characterized in that: Step S5, in which the standard question input with the highest similarity is selected from the candidate set and matched, and the corresponding standard answer is output as the answer to the user input question, includes the following sub-steps: Determine whether all candidate subsets contain elements. If no element exists in any candidate subset, output the standard question that no match can be found. If all candidate subsets contain elements, perform an intersection operation on all candidate subsets of the reference question to obtain a candidate set. Determine whether all candidate sets contain elements. If no element exists in any candidate subset, output the standard question that cannot be matched. If an element exists in the candidate set, select the standard question with the highest similarity from the candidate set to match the input, and output the corresponding standard answer as the answer to the user input question.

8. A question matching system in a digital human system, implemented by a question matching method in a digital human system according to any one of claims 1 to 7, characterized in that: The system comprises: A selection module is used to select multiple standard questions from a standard question set as reference questions and construct a reference question set. The digital human system stores a standard question set and an answer set, and the data in the standard question set and the answer set are in a one-to-one correspondence; The first calculation module is used to perform word vector processing on each question in the standard question set and the reference question set, calculate the similarity and Euclidean distance between each reference question and other standard questions, construct a first candidate set, and sort them according to the similarity and Euclidean distance to generate a similarity sequence and a distance sequence; The model building module is used to process the word vector of the user input question, calculate the similarity and Euclidean distance between the user input question and each reference question, and build a probability model based on the similarity and Euclidean distance between the user input question and each reference question, and between each reference question and other standard questions; A range screening module is used to determine the distance proximity range and similarity proximity range of each standard question based on the probability threshold of the preset probability model, and to screen the distance sequence based on the distance proximity range of the standard question to obtain a distance candidate set, and to screen the similar sequence based on the similarity proximity range of the standard question to obtain a similarity candidate set; The output module is used to perform an intersection operation on the distance candidate set and the similarity candidate set to obtain a candidate set, select the standard question input with the highest similarity from the candidate set to match, and output the corresponding standard answer as the answer to the user input question.

9. An electronic device, characterized in that: It includes at least one processor, at least one memory, a communication interface and a bus; wherein, the processor, memory and communication interface communicate with each other through the bus; the memory stores a problem matching method program in a digital human system that can be executed by the processor, and the problem matching method program in a digital human system is configured to implement a problem matching method in a digital human system according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that The storage medium stores a program for a method of matching a question in a digital human system, which, when executed, implements a method of matching a question in a digital human system as claimed in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and system for determining standard problem based on similarity

    CN112131876A

  • Question processing method and device based on semantic matching, terminal and storage medium

    CN112632257A

  • Auxiliary medical management method and system based on natural questions and answers and knowledge graph

    CN118568228A