Conversational question-answering method, device, equipment and storage medium combining RPA and AI
By combining the dialogue question and answer method of RPA and AI, the target concepts in user questions are extracted and cleaned, and the semantic relevance is calculated, which solves the problem of inaccurate user question analysis in the existing technology and improves the accuracy of answers and user experience.
Patent Information
- Application Number
- CN202010840307.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2019-12-31
- Filing Date
- 2020-08-19
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2040-08-19
AI Technical Summary
In the existing technology, the concept extraction of user questions has problems such as unclear boundaries or too fine granularity, which leads to inaccurate analysis of user questions, affects the accuracy of recommended answers, and reduces user experience.
Using a dialogue question and answer method that combines RPA and AI, it receives user questions, extracts target concepts, performs cleaning processing, calculates semantic relevance, and determines standard questions to obtain target answers. Specific steps include regular matching, keyword matching, word segmentation processing, filtering and merging words, using preset target domain concept sets and question templates for matching, and combining the WMD algorithm to calculate semantic relevance.
It effectively solves the problems of unclear concept boundaries and too fine granularity, improves the accurate analysis of user questions and the accuracy of answers, and improves user experience.
Smart Images

Figure CN111966788B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of natural speech processing technology, and in particular to a conversational question-and-answer method, apparatus, device, and storage medium that combines RPA (Robotic Process Automation) and AI (Artificial Intelligence). Background Art
[0002] Robotic Process Automation (RPA) simulates human operations on computers through specific "robot software" and automatically executes process tasks according to rules. Artificial Intelligence (AI) is a technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence. With the maturity of artificial intelligence technology, natural language processing technology has also developed rapidly. Natural speech processing technology is an important direction in the field of artificial intelligence. It enables effective communication between people and computers using natural language. The dialogue question-answering system is a system that uses natural language understanding technology as its core to analyze and process user questions and generate correct answers.
[0003] When a conversational question-answering system analyzes user questions, it is necessary to extract concepts from the user questions. In the prior art, when extracting concepts from user questions, there are problems such as unclear boundaries of the extracted concepts or too fine granularity of phrases. This results in the inability to accurately extract the concepts from the user questions, which in turn leads to inaccurate analysis of the user questions, poor accuracy of the answers recommended to the user, and reduced user experience in the question-answering system. Summary of the invention
[0004] The embodiments of the present application provide a method, device, equipment and storage medium for dialogue question answering that combines RPA and AI, which solves the problems in the prior art of extracting concepts from user questions, such as unclear boundaries of extracted concepts or too fine granularity of phrases. This results in the inability to accurately extract concepts from user questions, which in turn leads to inaccurate analysis of user questions, poor accuracy of answers recommended to users, and reduced user experience of the question system.
[0005] In a first aspect, an embodiment of the present application provides a conversational question-answering method combining RPA and AI, the method being applied to an electronic device, the method comprising:
[0006] Receive a target question input by a user; determine at least one candidate question corresponding to the target question; extract a target concept in the target question and extract candidate concepts in each of the candidate questions; clean the target concept; calculate the semantic relevance between the target question and each of the candidate questions based on the cleaned target concept and the candidate concepts in each of the candidate questions; determine a standard question based on the semantic relevance between the target question and each of the candidate questions; determine a target answer corresponding to the target question based on the standard question; and output the target answer.
[0007] Furthermore, in the above method, extracting the target concept in the target question includes:
[0008] The target question is canonically matched with each question template in a preset target domain question template set; a question template matching the target question is obtained; an additional text between the target question and the matching question template is determined; and the additional text is determined as a target concept.
[0009] Furthermore, the method as described above, if there is no question template matching the target question in the target domain question template set, further includes:
[0010] Perform keyword matching on the target problem and each candidate concept in the pre-constructed target domain concept set; obtain the candidate concept with the highest matching degree with the target problem; and determine the candidate concept with the highest matching degree as the target concept of the target problem.
[0011] Furthermore, in the above method, the cleaning process of the target concept includes:
[0012] Performing word segmentation processing on the target concept to obtain each candidate word corresponding to the target concept;
[0013] Determine whether each of the words to be selected meets the filtering condition. If the word to be selected meets the filtering condition, filter the word to be selected; determine whether two consecutive words to be selected meet the merging condition in turn. If the two consecutive words to be selected meet the merging condition, merge the two consecutive words to be selected.
[0014] Furthermore, in the above method, the step of determining whether each of the words to be selected satisfies the filtering condition comprises:
[0015] Determine whether each candidate word is a stop word or a preset common word; if the candidate word is a stop word or a preset common word, determine that the candidate word meets the filtering condition; if the candidate word is not a stop word or a preset common word, determine that the candidate word does not meet the filtering condition.
[0016] Furthermore, in the above method, the step of determining whether each candidate word is a preset common word includes:
[0017] Determine the IDF value of each candidate word in the target field common word set or the general field common word set; if the IDF value of the candidate word in the target field common word set is less than a first preset IDF threshold, determine that the candidate word is a preset common word; or, if the IDF value of the candidate word in the general field common word set is less than a second preset IDF threshold, determine that the candidate word is a preset common word; wherein the second preset IDF threshold is less than the first preset IDF threshold.
[0018] Furthermore, the method as described above further comprises:
[0019] If the difference between the IDF value of the candidate word in the target field common word set and the first preset IDF threshold is less than the third preset IDF threshold, and the difference between the IDF value of the candidate word in the general field common word set and the second preset IDF threshold is less than the third preset IDF threshold, then the candidate word is determined to be a preset common word; wherein the difference is a positive number.
[0020] Furthermore, in the above method, the step of sequentially judging whether two consecutive words to be selected meet the merging condition includes:
[0021] It is judged in turn whether each two consecutive words to be selected are the determined concepts or the frequent items in the pre-constructed two-word set; if the two consecutive words to be selected are the determined concepts or the frequent items in the two-word set, it is determined that the two consecutive words to be selected meet the merging condition; if the two consecutive words to be selected are not the determined concepts and are not the frequent items in the two-word set, it is determined whether the two consecutive words to be selected meet the merging condition according to each of the two consecutive words to be selected.
[0022] Further, in the above method, the step of determining whether the two consecutive words to be selected meet the merging condition according to each of the two consecutive words to be selected includes:
[0023] Whether the two consecutive words to be selected meet the merging condition is determined according to whether each of the two consecutive words to be selected is a frequent item in a pre-built word set.
[0024] Further, in the above method, the step of determining whether the two consecutive words to be selected meet the merging condition according to whether each of the two consecutive words to be selected is a frequent item in a pre-built word set includes:
[0025] Determine whether each of the two consecutive words to be selected is a frequent item in a pre-built word set; if each of the two consecutive words to be selected is not a frequent item in the word set, determine that the two consecutive words to be selected meet the merging condition; if at least one of the two consecutive words to be selected is a frequent item in the word set, determine that the two consecutive words to be selected do not meet the merging condition.
[0026] Furthermore, in the above method, the step of sequentially judging whether two consecutive words to be selected are frequent items in a pre-constructed bigram includes:
[0027] It is determined in turn whether the frequency values of two consecutive words to be selected in the two-word set are greater than a first preset frequency threshold; if the frequency values of two consecutive words to be selected in the two-word set are greater than the first preset frequency threshold, it is determined that the two consecutive words to be selected are frequent items in the two-word set; if the frequency values of two consecutive words to be selected in the two-word set are less than or equal to the first preset frequency threshold, it is determined that the two consecutive words to be selected are not frequent items in the two-word set.
[0028] Furthermore, in the above method, the step of determining whether each of two consecutive words to be selected is a frequent item in a pre-built word set includes:
[0029] Determine whether the frequency values of each of two consecutive words to be selected in the word set are all greater than a second preset frequency threshold; if they are all greater than the second preset frequency threshold, determine that each of the two consecutive words to be selected is a frequent item in the word set; if at least one is less than or equal to the second preset frequency threshold, determine that each of the two consecutive words to be selected is not a frequent item in the word set.
[0030] Furthermore, the method as described above, if two consecutive words to be selected meet the merging condition, then after merging the two consecutive words to be selected, further includes:
[0031] It is determined whether the target concept includes redundant words; if the target concept includes the redundant words, the redundant words are removed.
[0032] Furthermore, in the above method, the step of determining whether the target concept includes redundant words comprises:
[0033] The candidate word in the target concept is matched with the candidate redundant words in the preset redundant word library; if the candidate word in the target concept matches the candidate redundant words, it is determined that the target concept corresponding to the candidate word includes redundant words; if the candidate word in the target concept does not match any candidate redundant words, it is determined that the target concept corresponding to the candidate word does not include redundant words.
[0034] Furthermore, the method as described above, after extracting the candidate concepts from each of the candidate questions, further includes:
[0035] The candidate concepts are cleaned.
[0036] Furthermore, in the above method, the determining of at least one candidate question corresponding to the target question includes:
[0037] The target problem is matched with each candidate problem in a preset target domain problem set for similarity; and the candidate problem that meets the similarity requirement is determined as the candidate problem.
[0038] Furthermore, in the above method, the step of calculating the semantic relevance between the target question and each of the candidate questions based on the cleaned target concept and the candidate concepts in each of the candidate questions includes:
[0039] Determine the semantic feature data corresponding to the cleaned target concept and the cleaned candidate concepts in each of the candidate questions; input the semantic feature data corresponding to the cleaned target concept and the semantic feature data corresponding to the cleaned candidate concepts in each of the candidate questions into a preset WMD algorithm model to output the semantic relevance between the target question and each of the candidate questions.
[0040] Furthermore, in the above method, the step of determining the cleaned target concept and the semantic feature data corresponding to the cleaned candidate concepts in each of the candidate questions includes:
[0041] Determine the word vectors corresponding to the cleaned target concept and the cleaned candidate concepts in each of the candidate questions; determine the IDF values of the cleaned target concept and the cleaned candidate concepts in each of the candidate questions in the target field common word set; determine the product of the word vector corresponding to the cleaned target concept and the corresponding IDF value as the semantic feature data corresponding to the cleaned target concept; determine the product of the word vector corresponding to the cleaned candidate concept in each of the candidate questions and the corresponding IDF value as the semantic feature data corresponding to the cleaned candidate concept in each of the candidate questions.
[0042] Furthermore, in the above method, determining the standard question according to the semantic relevance between the target question and each of the candidate questions includes:
[0043] The candidate question with the greatest semantic relevance is determined as the standard question.
[0044] Furthermore, the method as described above, before determining the word vectors corresponding to the cleaned target concept and the cleaned candidate concepts in each of the candidate questions, further includes:
[0045] Construct a target domain concept set; cluster each candidate concept in the target domain concept set to obtain a representative concept; calculate the word vector corresponding to each representative concept to form a representative concept word vector set.
[0046] Furthermore, in the above method, determining the cleaned target concept and the word vectors corresponding to the cleaned candidate concepts in each of the candidate questions includes:
[0047] The word vectors corresponding to the cleaned target concept and the cleaned candidate concepts in each of the candidate questions are obtained from the representative concept word vector set.
[0048] Furthermore, in the above method, constructing the target domain concept set includes:
[0049] Obtain a preset target domain question set; extract the candidate concepts in each candidate question in the target domain question set; if the preset concept set convergence condition is not met, expand each question template in the preset target domain question template set, and execute the extraction of the candidate concepts in each candidate question in the target domain question set; if the preset concept set convergence condition is met, construct the target domain concept set according to each candidate concept.
[0050] Furthermore, the method as described above, after extracting the candidate concepts in each candidate question in the target domain question set, further comprises:
[0051] A cleaning process is performed on each of the candidate concepts.
[0052] Furthermore, in the above method, clustering the candidate concepts in the target domain concept set to obtain representative concepts includes:
[0053] The candidate concepts that meet the alignment conditions in the target domain concept set are determined as the same candidate concept; the same candidate concepts and other candidate concepts in the target domain concept set are determined as candidate concepts; and the candidate concepts are clustered to obtain representative concepts.
[0054] Furthermore, in the above method, clustering the candidate concepts to obtain representative concepts includes:
[0055] The candidate concepts are clustered using the HDBSCAN clustering algorithm to obtain a candidate concept at each cluster center; and the candidate concept at each cluster center is determined as a representative concept.
[0056] Furthermore, in the above method, the step of calculating the word vectors corresponding to the representative concepts to form a representative concept word vector set includes:
[0057] Obtain at least one representative knowledge point question, each representative knowledge point question includes a corresponding representative concept; use a Fasttext model trained to convergence to encode each concept in each of the representative knowledge point questions to obtain a word vector for each concept; obtain the corresponding representative concept word vector from the word vector of each concept in each representative knowledge point question to form a representative concept word vector set.
[0058] Furthermore, in the above method, before encoding each concept in each of the representative knowledge point questions using the Fasttext model trained to convergence to obtain the word vector of each concept, the method further includes:
[0059] Acquire training samples, where the training samples are training knowledge point questions in a target domain knowledge base; use the training samples to train an initial Fasttext model; determine whether the trained Fasttext model satisfies a preset model convergence condition; if it is determined that the preset model convergence condition is satisfied, determine the Fasttext model that satisfies the preset model convergence condition as the Fasttext model trained to convergence.
[0060] Furthermore, the method as described above, after obtaining the corresponding word vector representing the concept from the word vector of each concept representing the knowledge point question to form a representative concept word vector set, further includes:
[0061] The inner product values between the word vectors of each representative concept are calculated respectively; the inner product values of the word vectors of each representative concept are determined as the corresponding semantic relevance; and the target domain concept relationship network is constructed according to each representative concept and the corresponding semantic relevance.
[0062] Furthermore, in the above method, constructing the target domain concept relationship network according to each of the representative concepts and the corresponding semantic relevance includes:
[0063] Each of the representative concepts is determined as a node of a graph structure in the target domain concept relationship network; and the semantic relevance between each of the representative concepts is determined as a relationship value of an edge between nodes of the corresponding graph structure.
[0064] In a second aspect, an embodiment of the present application provides a conversation question-and-answer device combining RPA and AI, the device being located in an electronic device, and the device comprising:
[0065] A target question receiving module is used to receive a target question input by a user; a candidate question determining module is used to determine at least one candidate question corresponding to the target question; a concept extraction module is used to extract the target concept in the target question and extract the candidate concepts in each of the candidate questions; a concept cleaning module is used to clean the target concept; a semantic relevance calculation module is used to calculate the semantic relevance between the target question and each of the candidate questions based on the cleaned target concept and the candidate concepts in each of the candidate questions; a standard question determining module is used to determine a standard question based on the semantic relevance between the target question and each of the candidate questions; a target answer determining module is used to determine a target answer corresponding to the target question based on the standard question; and a target answer output module is used to output the target answer.
[0066] Furthermore, in the above-mentioned device, the concept extraction module is specifically used for:
[0067] The target question is canonically matched with each question template in a preset target domain question template set; a question template matching the target question is obtained; an additional text between the target question and the matching question template is determined; and the additional text is determined as a target concept.
[0068] Furthermore, in the above-mentioned device, the concept extraction module is further configured to:
[0069] Perform keyword matching on the target problem and each candidate concept in the pre-constructed target domain concept set; obtain the candidate concept with the highest matching degree with the target problem; and determine the candidate concept with the highest matching degree as the target concept of the target problem.
[0070] Furthermore, in the above-mentioned device, the concept cleaning module is specifically used for:
[0071] The target concept is segmented to obtain the candidate words corresponding to the target concept; whether each candidate word satisfies the filtering condition is determined, and if the candidate word satisfies the filtering condition, the candidate word is filtered; whether two consecutive candidate words meet the merging condition is determined in turn, and if the two consecutive candidate words meet the merging condition, the two consecutive candidate words are merged.
[0072] Furthermore, in the above-mentioned device, the concept cleaning module, when judging whether each of the candidate words meets the filtering condition, is specifically used to:
[0073] Determine whether each candidate word is a stop word or a preset common word; if the candidate word is a stop word or a preset common word, determine that the candidate word meets the filtering condition; if the candidate word is not a stop word or a preset common word, determine that the candidate word does not meet the filtering condition.
[0074] Furthermore, in the above-mentioned device, the concept cleaning module, when determining whether each candidate word is a preset common word, is specifically used to:
[0075] Determine the IDF value of each candidate word in the target field common word set or the general field common word set; if the IDF value of the candidate word in the target field common word set is less than a first preset IDF threshold, determine that the candidate word is a preset common word; or, if the IDF value of the candidate word in the general field common word set is less than a second preset IDF threshold, determine that the candidate word is a preset common word; wherein the second preset IDF threshold is less than the first preset IDF threshold.
[0076] Furthermore, in the above-mentioned device, the concept cleaning module is also used for:
[0077] If the difference between the IDF value of the candidate word in the target field common word set and the first preset IDF threshold is less than the third preset IDF threshold, and the difference between the IDF value of the candidate word in the general field common word set and the second preset IDF threshold is less than the third preset IDF threshold, then the candidate word is determined to be a preset common word; wherein the difference is a positive number.
[0078] Furthermore, in the above-mentioned device, the concept cleaning module is further used to:
[0079] It is judged in turn whether each two consecutive words to be selected are the determined concepts or the frequent items in the pre-constructed two-word set; if the two consecutive words to be selected are the determined concepts or the frequent items in the two-word set, it is determined that the two consecutive words to be selected meet the merging condition; if the two consecutive words to be selected are not the determined concepts and are not the frequent items in the two-word set, it is determined whether the two consecutive words to be selected meet the merging condition according to each of the two consecutive words to be selected.
[0080] Further, in the above-mentioned device, the concept cleaning module, when determining whether the two consecutive words to be selected meet the merging condition according to each of the two consecutive words to be selected, is specifically used to:
[0081] Whether the two consecutive words to be selected meet the merging condition is determined according to whether each of the two consecutive words to be selected is a frequent item in a pre-built word set.
[0082] Further, in the above-mentioned device, the concept cleaning module, when determining whether the two consecutive words to be selected meet the merging condition according to whether each of the two consecutive words to be selected is a frequent item in the pre-built word set, is specifically used to:
[0083] Determine whether each of the two consecutive words to be selected is a frequent item in a pre-built word set; if each of the two consecutive words to be selected is not a frequent item in the word set, determine that the two consecutive words to be selected meet the merging condition; if at least one of the two consecutive words to be selected is a frequent item in the word set, determine that the two consecutive words to be selected do not meet the merging condition.
[0084] Furthermore, in the above-mentioned device, the concept cleaning module is specifically used to:
[0085] It is determined in turn whether the frequency values of two consecutive words to be selected in the two-word set are greater than a first preset frequency threshold; if the frequency values of two consecutive words to be selected in the two-word set are greater than the first preset frequency threshold, it is determined that the two consecutive words to be selected are frequent items in the two-word set; if the frequency values of two consecutive words to be selected in the two-word set are less than or equal to the first preset frequency threshold, it is determined that the two consecutive words to be selected are not frequent items in the two-word set.
[0086] Further, in the above-mentioned device, the concept cleaning module, when determining whether each of two consecutive words to be selected is a frequent item in the pre-constructed word set, is specifically used to:
[0087] Determine whether the frequency values of each of two consecutive words to be selected in the word set are all greater than a second preset frequency threshold; if they are all greater than the second preset frequency threshold, determine that each of the two consecutive words to be selected is a frequent item in the word set; if at least one is less than or equal to the second preset frequency threshold, determine that each of the two consecutive words to be selected is not a frequent item in the word set.
[0088] Further, in the above-mentioned device, the concept cleaning module is further used for: after merging two consecutive words to be selected if the two consecutive words to be selected meet the merging condition:
[0089] It is determined whether the target concept includes redundant words; if the target concept includes the redundant words, the redundant words are removed.
[0090] Furthermore, in the above-mentioned device, the concept cleaning module, when determining whether the target concept includes redundant words, is specifically used to:
[0091] The candidate word in the target concept is matched with the candidate redundant words in the preset redundant word library; if the candidate word in the target concept matches the candidate redundant words, it is determined that the target concept corresponding to the candidate word includes redundant words; if the candidate word in the target concept does not match any candidate redundant words, it is determined that the target concept corresponding to the candidate word does not include redundant words.
[0092] Furthermore, in the above-mentioned device, the concept cleaning module is also used for:
[0093] The candidate concepts are cleaned.
[0094] Furthermore, in the above-mentioned device, the candidate question determination module is specifically used for:
[0095] The target problem is matched with each candidate problem in a preset target domain problem set for similarity; and the candidate problem that meets the similarity requirement is determined as the candidate problem.
[0096] Furthermore, in the above-mentioned device, the semantic relevance calculation module is specifically used for:
[0097] Determine the semantic feature data corresponding to the cleaned target concept and the cleaned candidate concepts in each of the candidate questions; input the semantic feature data corresponding to the cleaned target concept and the semantic feature data corresponding to the cleaned candidate concepts in each of the candidate questions into a preset WMD algorithm model to output the semantic relevance between the target question and each of the candidate questions.
[0098] Furthermore, in the above-mentioned device, the semantic relevance calculation module, when determining the semantic feature data corresponding to the cleaned target concept and the cleaned candidate concepts in each of the candidate questions, is specifically used to:
[0099] Determine the word vectors corresponding to the cleaned target concept and the cleaned candidate concepts in each of the candidate questions; determine the IDF values of the cleaned target concept and the cleaned candidate concepts in each of the candidate questions in the target field common word set; determine the product of the word vector corresponding to the cleaned target concept and the corresponding IDF value as the semantic feature data corresponding to the cleaned target concept; determine the product of the word vector corresponding to the cleaned candidate concept in each of the candidate questions and the corresponding IDF value as the semantic feature data corresponding to the cleaned candidate concept in each of the candidate questions.
[0100] Furthermore, in the above-mentioned device, the standard question determination module is specifically used for:
[0101] The candidate question with the greatest semantic relevance is determined as the standard question.
[0102] Furthermore, the above device further comprises:
[0103] The word vector set construction module is used to construct a target domain concept set; cluster the selected concepts in the target domain concept set to obtain representative concepts; calculate the word vector corresponding to each representative concept to form a representative concept word vector set.
[0104] Furthermore, in the above-mentioned device, the semantic relevance calculation module, when determining the word vectors corresponding to the cleaned target concept and the cleaned candidate concepts in each of the candidate questions, is specifically used to:
[0105] The word vectors corresponding to the cleaned target concept and the cleaned candidate concepts in each of the candidate questions are obtained from the representative concept word vector set.
[0106] Furthermore, in the above-mentioned device, the word vector set construction module is specifically used to:
[0107] Obtain a preset target domain question set; extract the candidate concepts in each candidate question in the target domain question set; if the preset concept set convergence condition is not met, expand each question template in the preset target domain question template set, and execute the extraction of the candidate concepts in each candidate question in the target domain question set; if the preset concept set convergence condition is met, construct the target domain concept set according to each candidate concept.
[0108] Furthermore, in the above-mentioned device, the concept cleaning module is also used for:
[0109] A cleaning process is performed on each of the candidate concepts.
[0110] Furthermore, in the above-mentioned device, when the word vector set construction module clusters the candidate concepts in the target domain concept set to obtain the representative concept, it is specifically used to:
[0111] The candidate concepts that meet the alignment conditions in the target domain concept set are determined as the same candidate concept; the same candidate concepts and other candidate concepts in the target domain concept set are determined as candidate concepts; and the candidate concepts are clustered to obtain representative concepts.
[0112] Furthermore, in the above-mentioned device, the word vector set construction module, when clustering the candidate concepts to obtain the representative concepts, is specifically used to:
[0113] The candidate concepts are clustered using the HDBSCAN clustering algorithm to obtain a candidate concept at each cluster center; and the candidate concept at each cluster center is determined as a representative concept.
[0114] Furthermore, in the above-mentioned device, the word vector set construction module, when calculating the word vector corresponding to each representative concept to form the representative concept word vector set, is specifically used to:
[0115] Obtain at least one representative knowledge point question, each representative knowledge point question includes a corresponding representative concept; use a Fasttext model trained to convergence to encode each concept in each of the representative knowledge point questions to obtain a word vector for each concept; obtain the corresponding representative concept word vector from the word vector of each concept in each representative knowledge point question to form a representative concept word vector set.
[0116] Furthermore, in the above-mentioned device, the word vector set construction module is further used to encode each concept in each of the representative knowledge point questions before using the Fasttext model trained to convergence to obtain the word vector of each concept:
[0117] Acquire training samples, where the training samples are training knowledge point questions in a target domain knowledge base; use the training samples to train an initial Fasttext model; determine whether the trained Fasttext model satisfies a preset model convergence condition; if it is determined that the preset model convergence condition is satisfied, determine the Fasttext model that satisfies the preset model convergence condition as the Fasttext model trained to convergence.
[0118] Furthermore, the above device further comprises:
[0119] The concept relationship network construction module is used to calculate the inner product value between the word vectors of each representative concept respectively; determine the inner product value of the word vector of each representative concept as the corresponding semantic relevance; and construct the target domain concept relationship network based on each representative concept and the corresponding semantic relevance.
[0120] Furthermore, in the above-mentioned device, the concept relationship network construction module, when constructing the target domain concept relationship network according to each of the representative concepts and the corresponding semantic relevance, is specifically used to:
[0121] Each of the representative concepts is determined as a node of a graph structure in the target domain concept relationship network; and the semantic relevance between each of the representative concepts is determined as a relationship value of an edge between nodes of the corresponding graph structure.
[0122] In a third aspect, an embodiment of the present application provides an electronic device, including:
[0123] Memory, processor and computer program;
[0124] The computer program is stored in the memory and is configured to be executed by the processor to implement the method as described in any one of the first aspects.
[0125] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement a method as described in any one of the first aspects.
[0126] It should be understood that the contents described in the above summary of the invention are not intended to limit the key or important features of the embodiments of the present application, nor are they intended to limit the scope of the present application. Other features of the present application will become easy to understand through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0127] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0128] Figure 1 This is an application scenario diagram of the conversational question-answering method combining RPA and AI that can implement the embodiment of the present application;
[0129] Figure 2 A flowchart of a conversational question-and-answer method combining RPA and AI provided in Example 1 of the present application;
[0130] Figure 3 A flowchart of a conversational question-and-answer method combining RPA and AI provided in Example 2 of the present application;
[0131] Figure 4 This is a flowchart of step 201 in the conversational question-and-answer method combining RPA and AI provided in Example 2 of the present application;
[0132] Figure 5 This is a flowchart of step 202 in the conversational question-and-answer method combining RPA and AI provided in Example 2 of the present application;
[0133] Figure 6 This is a flowchart of step 2023 in the conversational question-and-answer method combining RPA and AI provided in Example 2 of the present application;
[0134] Figure 7This is a flowchart of step 203 in the conversational question-and-answer method combining RPA and AI provided in Example 2 of the present application;
[0135] Figure 8 This is a flowchart of step 205 in the conversational question-and-answer method combining RPA and AI provided in Example 2 of the present application;
[0136] Fig. 9 This is a flowchart of step 206 in the conversational question-and-answer method combining RPA and AI provided in Example 2 of the present application;
[0137] Fig.10 This is a flowchart of step 207 in the conversational question-and-answer method combining RPA and AI provided in Example 2 of the present application;
[0138] Fig.11 This is a flowchart of step 2072 in the conversational question-and-answer method combining RPA and AI provided in Embodiment 2 of the present application;
[0139] Fig.12 This is a flowchart of step 2072a in the conversational question-and-answer method combining RPA and AI provided in Embodiment 2 of the present application;
[0140] Fig.13 This is a flowchart of step 2073 in the conversational question-and-answer method combining RPA and AI provided in Example 3 of the present application;
[0141] Fig.14 This is a flowchart of step 2073a in the conversational question-and-answer method combining RPA and AI provided in Example 3 of the present application;
[0142] Fig.15 This is a flowchart of step 2073c in the conversational question-and-answer method combining RPA and AI provided in Example 3 of the present application;
[0143] Fig.16 This is a flowchart of step 2073c1 in the conversational question-and-answer method combining RPA and AI provided in Example 3 of the present application;
[0144] Fig.17 This is a flowchart of step 2074 in the conversational question-and-answer method combining RPA and AI provided in Example 3 of the present application;
[0145] Fig.18 This is a flowchart of step 208 in the conversational question-and-answer method combining RPA and AI provided in Example 3 of the present application;
[0146] Fig.19 This is a flowchart of step 2081 in the conversational question-and-answer method combining RPA and AI provided in Example 3 of the present application;
[0147] Fig. 20A flowchart of a conversational question-and-answer method combining RPA and AI provided in Example 3 of the present application;
[0148] Fig.21 This is a flowchart of step 306 in the conversational question-and-answer method combining RPA and AI provided in Example 3 of the present application;
[0149] Fig. 22 This is a schematic diagram of the target domain concept relationship network in Example 3 of the present application;
[0150] Fig.23 This is a schematic diagram of the structure of a conversational question-and-answer device combining RPA and AI provided in Example 4 of the present application;
[0151] Fig.24 This is a schematic diagram of the structure of a conversational question-and-answer device combining RPA and AI provided in Example 5 of the present application;
[0152] Fig.25 It is a block diagram of an electronic device used to implement the conversational question-and-answer method combining RPA and AI in an embodiment of the present application. DETAILED DESCRIPTION
[0153] The embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be construed as being limited to the embodiments described herein. Instead, these embodiments are provided to provide a more thorough and complete understanding of the present application. It should be understood that the drawings and embodiments of the present application are only for exemplary purposes and are not intended to limit the scope of protection of the present application.
[0154] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the embodiments 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 sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the implementation of the present application described herein can be implemented in an order other than those illustrated or described herein, for example. 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.
[0155] First of all, it is necessary to explain the terms in the description of this application. Among them, in the description of this application, the term "target question" refers to the question that the user needs to ask. For example, an electronic device is equipped with an application with a dialogue question and answer function that combines RPA and AI. When the user needs to ask questions, open the corresponding application and enter the operation interface of the application. Send the questions to be asked to the electronic device by voice, text or other means. The question that needs to be asked can be understood as the target question.
[0156] In the description of this application, the term "candidate question" refers to a question that matches the question that the user needs to ask from a question set in a certain field according to certain matching rules. The matched question is the candidate question, where the field of the question set is the same as the field of the question that the user needs to ask.
[0157] In the description of this application, the term "concept" refers to the text that distinguishes a question from its matching question template. The term "target concept" refers to the text that distinguishes a target question from its matching question template. The term "candidate concept" refers to the text that distinguishes a candidate question from its matching question template.
[0158] In the description of this application, the term "standard question" refers to the candidate question that is most semantically similar to the question the user wants to ask among the candidate questions. The term "target answer" refers to the answer corresponding to the standard question. For example, a certain domain problem set has multiple questions to be selected and the answers corresponding to each question to be selected. After the standard question is known, the answer corresponding to the standard question can be searched from the answers corresponding to each question to be selected in the domain problem set, and the answer corresponding to the standard question can be determined as the answer corresponding to the target question, and the answer corresponding to the target question is the target answer.
[0159] In the description of this application, the term "cleaning processing" refers to one or more processing such as segmentation, filtering, merging, and removing redundant words on the concepts in the question.
[0160] It is necessary to introduce the application scenarios of the dialogue question-answering method combining RPA and AI provided in the embodiment of the present application. Figure 1As shown, in the application scenario corresponding to the conversational question-and-answer method combining RPA and AI provided in the embodiment of the present application, an application with a conversational question-and-answer function is installed in the electronic device. The type of such application equipped with a conversational question-and-answer function is not limited, such as a maternal and child type application, an early childhood education type application, and the like. Specifically, the user opens the application of this function in the electronic device, and inputs the target question in the form of text, voice, etc. through the operation interface of the application of this function. The electronic device receives the target question input by the user, parses the target question, extracts the target concept in the target question, and extracts the candidate concepts in each candidate question; cleans the target concept; calculates the semantic relevance between the target question and each candidate question based on the cleaned target concept and the candidate concepts in each candidate question; and determines the standard question based on the semantic relevance between the target question and each candidate question. After determining the standard question, the target answer corresponding to the target question is determined based on the standard question, and the target answer is output. When outputting the target answer, it can be output in the form of text and / or pictures on the operation interface, and the text and / or pictures can also be output in the form of voice, etc. As Figure 1 In the example, assuming that the application is a maternal and child type application, and the target question input by the user through voice is "What should I do if I have a puerperal infection?", the target question "What should I do if I have a puerperal infection?" can be displayed in the operation interface of the application of this function of the electronic device. The user clicks the "Search" button on the operation interface, and the electronic device executes the dialogue question-and-answer method combining RPA and AI provided in this application, and after determining the target answer to the target question, the target answer is output and displayed in the operation interface. The target answer is "Drug treatment, surgical treatment, other treatments, etc. can be performed." The dialogue question-and-answer method combining RPA and AI provided in the embodiment of the present application can effectively solve problems such as unclear boundaries of the extracted target concepts or too fine granularity of phrases after the target concepts in the target questions are extracted. Accurate extraction of concepts in user questions and accurate parsing of user questions are achieved. And when determining the standard question corresponding to the target question, the semantic relevance between the target question and at least one candidate question is used for determination. Therefore, the target question and the standard question can be more closely matched, and the standard question matching the target question can be accurately determined. Then, the answer corresponding to the standard question is determined as the answer to the target question. This can make the determined target answer more accurate, improve the accuracy of the answers recommended to users, and greatly improve the user experience of the question-and-answer system.
[0161] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0162] Embodiment 1
[0163] Figure 2This is a flowchart of a conversational question-and-answer method combining RPA and AI provided in Example 1 of the present application, as shown in FIG. Figure 2 As shown, the execution subject of the embodiment of the present application is a dialogue question-answering device combining RPA and AI, and the dialogue question-answering device can be integrated in an electronic device. Then the dialogue question-answering method combining RPA and AI provided in this embodiment includes the following steps.
[0164] Step 101: receiving a target question input by a user.
[0165] In this embodiment, an application program that combines RPA and AI with a dialogue question-and-answer function is installed in the electronic device. For example, it can be a maternal and child type application program, an early childhood education type application program, etc. When the user needs to ask a question, he / she opens the corresponding application program and enters the operation interface of the application program. The question to be asked is sent to the electronic device through voice, text or other means. The question to be asked is the target question.
[0166] If the user asks the target question in voice form, the user clicks the button for recording voice on the operation interface, and the corresponding sound receiving component in the electronic device records the voice. The electronic device receives the target question in voice form, performs semantic analysis on the target question in voice form, obtains the target question in text form, and displays the target question in text form on the operation interface.
[0167] If the user asks the target question in text form, the user inputs the target question in the text input box of the operation interface, so that the electronic device receives the target question in text form.
[0168] It is understandable that the operation interface may also include a button for triggering the dialogue question-and-answer method in this embodiment, such as a "search" button on the operation interface.
[0169] Step 102: Determine at least one candidate question corresponding to the target question.
[0170] In this embodiment, the corresponding target domain question set may be stored in the backend server of each application equipped with the dialogue question-answering function. Alternatively, the target domain question set may be downloaded to an electronic device, and all the questions in the target domain that have been successfully searched for answers are stored in the target domain question set. The questions stored in the target domain question set may be referred to as questions to be selected.
[0171] As an optional implementation, in this embodiment, after the electronic device obtains the target question, each candidate question in the corresponding target field question set is obtained, and the target question can be matched with each candidate question according to preset sentence rules, and the candidate question that meets the preset sentence rules is determined as a candidate question for the target question.
[0172] Or as another implementation, in this embodiment, after the electronic device obtains the target problem, each candidate problem in the corresponding target field problem set is obtained, and the target problem and each candidate problem can be similarly matched using a preset matching algorithm, and the candidate problems that meet the similarity requirements are determined as candidate problems.
[0173] In this implementation, the preset matching algorithm is not limited in this embodiment. Determining whether the similarity requirement is met can be determining whether the matching degree between the target question and each candidate question is greater than a preset matching degree threshold. If it is greater than the preset matching degree threshold, it is determined that the target question and the candidate question meet the similarity requirement, otherwise it is determined that the similarity requirement is not met. It can be understood that determining whether the similarity requirement is met can also be other ways, which are not limited in this embodiment.
[0174] Step 103: extract the target concept in the target question and extract the candidate concepts in each candidate question.
[0175] It is worth noting that, in this embodiment, the method of extracting the target concept in the target question and the method of extracting the candidate concepts in each candidate question may be the same, so the method is described by taking the extraction of the target concept in the target question as an example.
[0176] As an optional implementation, in this embodiment, the method of extracting the target concept in the target question can be to first set a target domain question template set according to the problem characteristics of the target domain, and the target domain question template set includes multiple question templates. Then, the target question is matched with each question template in the preset target domain question template set. After the regular matching, the question template matching the target question is obtained. The text that is distinguished between the target question and the matching question template is determined, and the distinguished text is the additional text between the target question and the matching question template. Finally, the additional text is determined as the target concept corresponding to the target question.
[0177] As another optional implementation, in this embodiment, the method for extracting the target concept in the target question can also be: extracting the target concept in the target question by performing keyword matching between the target question and each candidate concept in a pre-constructed target domain concept set. Specifically, first obtain the target domain concept set. The target domain concept set includes multiple candidate concepts. Then perform keyword matching between the target question and each candidate concept in the pre-constructed target domain concept set. After keyword matching, obtain the candidate concept with the highest matching degree with the target question, and determine the candidate concept with the highest matching degree as the target concept of the target question.
[0178] It can be understood that the two optional implementations can be combined to extract the target concept in the target question.
[0179] It is worth noting that after extracting the target concept in the target question using each optional implementation method, the extracted target concept may have unclear concept boundaries or too fine phrase granularity.
[0180] The target concepts extracted from the target questions in the maternal and infant type application are used for exemplary explanation. The target concepts extracted from the target questions using the above two optional implementations include, for example: "Some babies are zinc deficient", "Insufficient breast milk from mothers", "What are the symptoms of thalassemia", "Baby coughs", etc., then "Some babies are zinc deficient" and "What are the symptoms of thalassemia" have the problem of unclear concept boundaries. The "Some" in "Some babies are zinc deficient" can be filtered. The "What" in "What are the symptoms of thalassemia" can be filtered. However, "Insufficient breast milk from mothers" and "Baby coughs" have the problem of too fine phrase granularity, and "Insufficient breast milk from mothers" can be divided into two target concepts, namely "Mom" and "Insufficient breast milk". "Baby coughs" is divided into two target concepts, namely "Baby" and "Cough". The filtering and segmentation processes are both cleaning processes in this embodiment.
[0181] Step 104, cleaning the target concept.
[0182] In this embodiment, the target concept is cleaned. If the target concept has unclear boundaries, redundant prefixes and suffixes can be effectively filtered. If the target concept has too fine a phrase granularity, the compound target concept with too fine a granularity can be effectively segmented. The specific cleaning method is not limited in this embodiment.
[0183] Step 105 , calculating the semantic relevance between the target question and each candidate question based on the cleaned target concept and the candidate concepts in each candidate question.
[0184] As an optional implementation, in this embodiment, the semantic relevance between the target question and each candidate question is calculated based on the cleaned target concept and the candidate concepts in each candidate question, which may include the following schemes:
[0185] First, the semantic relevance between the cleaned target concept and each candidate concept is determined based on the pre-established target domain concept relationship network. Then, the semantic relevance between the target question and each candidate question is determined based on the semantic relevance between the cleaned target concept and each candidate concept.
[0186] Specifically, in this embodiment, the semantic relevance between each representative concept is pre-stored in the target domain concept relationship network, the cleaned target concept and each candidate concept are found from the target domain concept relationship network, and the corresponding semantic relevance is determined according to the graph structure between the cleaned target concept and each candidate concept in the target domain concept relationship network. If the cleaned target concept and the candidate concept in each candidate question are both one, the semantic relevance between the cleaned target concept and the corresponding candidate concept in each candidate question can be determined as the semantic relevance between the target question and each candidate question. If there are multiple cleaned target concepts and each candidate question has multiple candidate concepts, the semantic relevance between the cleaned target concept and the candidate concept can be weighted and summed to obtain the semantic relevance between the target question and each candidate question. Among them, the weight of the semantic relevance between each cleaned target concept and the candidate concept can be the product of the IDF values of the corresponding cleaned target concept and the candidate concept in the target domain common word set.
[0187] The IDF value in the target domain common word set is the inverse document frequency value of the word frequency of each common word in the target domain common word set. If the IDF value of a common word in the target domain is larger, it means that the importance of the common word is higher. On the contrary, if the IDF value of a common word is smaller, it means that the importance of the common word is lower.
[0188] It is understandable that the method of calculating the semantic relevance between the target question and each candidate question based on the cleaned target concept and the candidate concepts in each candidate question may also be other methods, which are not limited in this embodiment.
[0189] Step 106: determine the standard question based on the semantic relevance between the target question and each candidate question.
[0190] In this embodiment, after at least one candidate question is determined, the semantic relevance between the target question and each candidate question is calculated, the semantic relevance is sorted from large to small, and the candidate question with the largest semantic relevance is obtained and determined as the standard question.
[0191] Step 107, determining a target answer corresponding to the target question based on the standard question.
[0192] In this embodiment, the answer corresponding to each candidate question in the target domain question set can be stored in the background server of each application equipped with the dialogue question-and-answer function combining RPA and AI. Alternatively, the answer corresponding to each candidate question in the target domain question set can be downloaded to an electronic device. After the standard question is determined, the answer corresponding to the standard question is searched from the answers corresponding to each candidate question in the target domain question set, and the answer corresponding to the standard question is determined as the answer corresponding to the target question. The answer corresponding to the target question is the target answer.
[0193] Step 108: output the target answer.
[0194] In this embodiment, the target answer may be output in the form of text, picture or voice, or the target answer may be output in the form of at least two of the text, picture or voice in combination, which is not limited in this embodiment.
[0195] The dialogue question-answering method combining RPA and AI provided in this embodiment receives the target question input by the user; determines at least one candidate question corresponding to the target question; extracts the target concept in the target question and extracts the candidate concepts in each candidate question; cleans the target concept; calculates the semantic relevance between the target question and each candidate question based on the cleaned target concept and the candidate concepts in each candidate question; determines the standard question based on the semantic relevance between the target question and each candidate question; determines the target answer corresponding to the target question based on the standard question; and outputs the target answer. Since the target concept in the target question is cleaned after being extracted, the target concept can effectively solve the problems of unclear boundaries of the extracted target concept or too fine phrase granularity. Accurate extraction of concepts in user questions and accurate analysis of user questions are achieved. And when determining the standard question corresponding to the target question, the semantic relevance between the target question and at least one candidate question is used for determination, so that the target question and the standard question can be more closely matched, and the standard question matching the target question is accurately determined, and then the answer corresponding to the standard question is determined as the answer to the target question, which can make the determined target answer more accurate, improve the accuracy of the answer recommended to the user, and greatly improve the user's experience of the question-answering system.
[0196] Embodiment 2
[0197] Figure 3 This is a flowchart of a conversational question-and-answer method combining RPA and AI provided in Example 2 of this application, such as Figure 3 As shown, the conversational question-answering method combining RPA and AI provided in this embodiment is a further refinement of steps 102 to 106 based on the conversational question-answering method combining RPA and AI provided in Example 1 of the present application. The conversational question-answering method combining RPA and AI provided in this embodiment includes the following steps.
[0198] Step 201: construct a target domain concept set.
[0199] As an optional implementation, in this embodiment, constructing the target domain concept set in step 201 is an iterative process. The specific iterative process includes the following steps:
[0200] As an optional implementation, Figure 4As shown, step 201 includes the following steps:
[0201] Step 2011, obtaining a preset target domain problem set.
[0202] The target domain question set is consistent with the type of application equipped with the dialogue question-answering function combining RPA and AI. For example, if the type of application is maternal and child type, the target domain question set is the maternal and child field question set. For another example, if the type of application is early childhood education field, the target domain question set is the early childhood education field question set.
[0203] In this embodiment, if it is determined that the user has successfully searched for an answer to a question in the target domain, the candidate questions for which the answers have been successfully searched are stored, and a target domain question set is constructed from the candidate questions. The target domain question set can also be stored in the background server or electronic device of the corresponding application so that the electronic device can obtain the preset target domain question set.
[0204] Step 2012: extract the concepts to be selected from each of the questions to be selected in the problem set in the target domain.
[0205] As an optional implementation, in this embodiment, step 2012 includes the following steps:
[0206] Step 2012a, performing canonical matching on each candidate question and each question template in the preset target domain question template set.
[0207] Step 2012b, obtaining a question template that matches each question to be selected.
[0208] Step 2012c, determining the additional text between each candidate question and the matching question template.
[0209] Step 2012d, determining the added text as the corresponding concept to be selected.
[0210] This is explained in conjunction with step 2012a to step 2012d. In this embodiment, a target domain question template set is first set according to the problem characteristics of the target domain, and the target domain question template set includes multiple question templates. Each question to be selected is then canonically matched with each question template in the preset target domain question template set. After the canonically matched, a question template matching each question to be selected is obtained. The text that is distinguished between each question to be selected and the matching question template is determined. The distinguished text is the added text between the question to be selected and the matching question template. Finally, the added text is determined as the concept to be selected corresponding to the question to be selected.
[0211] Among them, the regular matching is regular expression matching, and the specific regular matching method will not be repeated in this embodiment.
[0212] In this embodiment, the target domain is the maternal and infant domain, and the selected question is "symptoms of oligohydramnios" as an example, and steps 2012a to 2012d are exemplarily described:
[0213] First, the question templates in the target domain question template set are illustrated with three examples, and the three question templates are: (1) (.*?) symptoms; (2) (.*?) Can I take medicine; (3) (.*?) How to treat. Then, for the candidate question, the candidate question is matched with each question template in the preset target domain question template set, and the matching question template is determined to be "(.*?) symptoms", and the candidate question "symptoms of oligohydramnios" and the matching question template are determined to be "(.*?) symptoms". The added text is "oligohydramnios", and "oligohydramnios" is determined as the candidate concept of the candidate question.
[0214] Step 2012e: if there is no question template matching each candidate question in the target domain question template set, keyword matching is performed between each candidate question and each key concept in the pre-constructed target domain key concept set.
[0215] It is understandable that since the question templates in the preset target domain question template set are limited and cannot cover the question-asking habits of all users, there is a situation where there is no question template matching each candidate question in the target domain question template set. Therefore, if there is no question template matching each candidate question in the target domain question template set, a keyword matching method is used to determine the candidate concepts in each candidate question.
[0216] Step 2012f, obtaining the key concept with the highest matching degree with each candidate question.
[0217] Step 2012g, determining the key concept with the highest matching degree as the candidate concept for each candidate question.
[0218] In conjunction with step 2012e to step 2012g, the method of using keyword matching to determine the candidate concepts in each candidate question is described. First, a target domain key concept set can be constructed based on common concepts in the target domain. The target domain key concept set includes multiple target domain key concepts. Then, keyword matching is performed on each candidate question with each key concept in the pre-constructed target domain key concept set. After keyword matching, the key concept with the highest matching degree with each candidate question is obtained, and the key concept with the highest matching degree is determined as the candidate concept corresponding to the candidate question.
[0219] Among them, the keyword matching method can be broad matching, precise matching, etc., and the keyword matching method is not limited in this embodiment.
[0220] In this embodiment, the target domain is the maternal and infant domain, and the selected question is "what to do if the baby spits up milk" as an example, and steps 2012e to 2012g are exemplarily described:
[0221] First, the key concepts included in the key concept set in the maternal and infant field are exemplified, including "baby", "mom", "baby spitting up milk", "baby coughing", "baby drooling", etc. Then, for the candidate question, the candidate question is matched with the key concepts in the key concept set of the target field. The matching degree with "baby" is 30%, the matching degree with "mom" is 1%, the matching degree with "baby spitting up milk" is 80%, and the matching degree with "baby coughing" is 31%. Finally, the key concept with the highest matching degree with the candidate question is "baby spitting up milk", and "baby spitting up milk" is determined as the candidate concept corresponding to the candidate question "what to do if the baby spit up milk".
[0222] Step 2013, cleaning each candidate concept.
[0223] In this embodiment, the method of cleaning the selected concepts is the same as the method of cleaning the target concepts in step 207 of the present application, which will not be described in detail here. Please refer to the detailed description of the cleaning of the target concepts in step 207.
[0224] Taking the target domain of maternal and infant care as an example, the cleaned candidate concepts are illustrated. As shown in Table 1, it is a schematic table of cleaned candidate concepts obtained after cleaning the candidate concepts in the maternal and infant care field.
[0225] Table 1: Schematic table of the concepts to be selected after cleaning in the field of maternal and child care
[0226]
[0227] Step 2014, determining whether the preset concept set convergence condition is met, if the preset concept set convergence condition is not met, executing step 2015, otherwise executing step 2016.
[0228] Step 2015: Expand each question template in the preset target domain question template set.
[0229] It should be noted that after executing step 2015, continue to execute step 2012.
[0230] Specifically, in this embodiment, in order to make the selected concepts in the constructed target domain concept set richer and more accurate, the concept set convergence condition is pre-set. After the selected concepts in each selected problem are extracted according to step 2012, it is determined whether the preset concept set convergence condition is met. If the preset concept set convergence condition is not met, step 2015 is performed, the number of iterations is increased by 1, and step 2012 is continued. After the preset concept set convergence condition is met, step 2016 is performed.
[0231] The preset concept set convergence condition may be that the number of iterations reaches a preset number of iterations, or may be other concept set convergence conditions, which are not limited in this embodiment.
[0232] Step 2016: construct a target domain concept set based on each candidate concept.
[0233] In this embodiment, after the candidate concepts extracted from each candidate question in the target domain question set are cleaned, the cleaned candidate concepts form a target domain concept set.
[0234] Step 202: cluster the candidate concepts in the target domain concept set to obtain representative concepts.
[0235] In this embodiment, since there are many candidate concepts in the target domain concept set, it is necessary to cluster the candidate concepts to obtain representative concepts.
[0236] As an optional implementation, Figure 5 As shown, step 202 includes the following steps:
[0237] Step 2021, determine the candidate concepts that meet the alignment conditions in the target domain concept set as the same candidate concept.
[0238] In this embodiment, each candidate concept in the target domain concept set is aligned head to tail according to the number of words, and it can be determined whether the alignment condition is met between the two candidate concepts. If the percentage of the aligned words between the two candidate concepts in the total number of words in the corresponding candidate concepts is greater than the preset alignment percentage threshold, it is determined that the alignment condition is met between the two candidate concepts, otherwise it is determined that the alignment condition is not met.
[0239] For example, the preset percentage threshold is 70%. The candidate concepts are: "polyhydramnios" and "excessive amniotic fluid". After the head-to-tail alignment, the percentage of the aligned words in the total number of words in the candidate concepts is 75%. If it is greater than 70%, the two candidate concepts are determined to be the same category of candidate concepts, and any one of them can be used to represent them. For example, "polyhydramnios" can be used to represent it.
[0240] Step 2022: determine each of the same candidate concepts and other candidate concepts in the target domain concept set as candidate concepts.
[0241] Step 2023: cluster the candidate concepts to obtain representative concepts.
[0242] In this embodiment, the same candidate concept and other candidate concepts are uniformly determined as candidate concepts. The candidate concepts are clustered using a preset clustering algorithm to form cluster centers, and the candidate concepts at each cluster center are determined as representative concepts.
[0243] As an optional implementation, Figure 6 As shown, step 2023 includes the following steps:
[0244] Step 2023a, clustering the candidate concepts using the HDBSCAN clustering algorithm to obtain the candidate concepts of each cluster center.
[0245] Step 2023b, determining the candidate concept of each cluster center as the representative concept.
[0246] Furthermore, in this embodiment, each candidate concept is input into the HDBSCAN clustering algorithm, the parameters in the HDBSCAN clustering algorithm are set, and the HDBSCAN clustering algorithm is used to perform semantic relevance clustering on the candidate concepts to form each type of candidate concept set, and the candidate concept at the cluster center corresponding to each candidate concept set is obtained. The candidate concept at the cluster center can best represent the candidate concept set of this type, so the candidate concept at the cluster center is determined as the representative concept of this type of candidate concept. When the HDBSCAN clustering algorithm is used for clustering, the number of categories finally clustered is the number of representative concepts.
[0247] In this embodiment, the biggest advantage of the HDBSCAN clustering algorithm over the DBSCAN clustering algorithm is that it does not require the user to select the radius R of the clustering circle and the minimum number of core point coverage points MinPts, but only needs to set the size of the minimum generated cluster, and the HDBSCAN clustering algorithm can automatically recommend the optimal clustering result. Therefore, using the HDBSCAN clustering algorithm to cluster candidate concepts can cluster candidate concepts more quickly and accurately to obtain representative concepts.
[0248] Step 203, calculating the word vector corresponding to each representative concept to form a representative concept word vector set.
[0249] As an optional implementation, Figure 7 As shown, step 203 includes the following steps:
[0250] Step 2031, obtaining at least one representative knowledge point question, each representative knowledge point question including a corresponding representative concept.
[0251] In this embodiment, the target domain knowledge base is a structured knowledge base that organizes the selected questions in the target domain problem set according to the knowledge points. The knowledge point questions in the target domain knowledge base are divided into a training set and a test set. The knowledge point questions in the training set are used to train the initial Fasttext model to obtain a Fasttext model trained to convergence. Representative knowledge point questions are obtained in the test set. Among them, the representative knowledge point questions include representative concepts.
[0252] Step 2032, using the Fasttext model trained to convergence to encode each concept in each representative knowledge point question to obtain a word vector for each concept.
[0253] In this embodiment, the representative concepts in each representative knowledge point question can be marked, and each representative knowledge point question can be input into a Fasttext model trained to convergence. Before classifying each representative knowledge point question, the Fasttext model trained to convergence performs word segmentation on each representative knowledge point question and encodes each concept after the word segmentation to obtain a word vector for each concept.
[0254] Step 2033, obtaining the corresponding word vector representing the concept from the word vector of each concept representing the knowledge point question to form a representative concept word vector set.
[0255] In this embodiment, the corresponding word vector of the representative concept is obtained from the word vector of each corresponding concept according to the tag of the representative concept in each representative knowledge point question. The word vector of each representative concept forms a representative concept word vector set. And the word vector set of the representative concept is stored.
[0256] In this embodiment, when calculating the word vector corresponding to each representative concept to form a representative concept word vector set, since the representative concept word vector is obtained by encoding the representative concept using the Fasttext model trained to convergence, the Fasttext model trained to convergence can accurately classify the representative knowledge point questions, so it is also possible to accurately encode the representative concepts before classifying the representative knowledge point questions, thereby improving the accuracy of the representative concept word vector.
[0257] It is worth noting that if there is no Fasttext model trained to convergence, before step 2032, a step of training the initial Fasttext model is also included. The step of training the initial Fasttext model is defined as step 2030, and step 2030 includes the following steps:
[0258] Step 2030a: obtaining training samples, where the training samples are training knowledge point questions in the target domain knowledge base.
[0259] The target domain knowledge base is a structured knowledge base that organizes the candidate questions in the target domain problem set according to the knowledge points. The training set of the target domain knowledge base includes a set of similar knowledge point questions and knowledge point category labels for each type of knowledge point.
[0260] For example, "What to do if there is too much amniotic fluid", "How to deal with too much amniotic fluid", "Should I see a doctor if there is too much amniotic fluid" are a set of similar knowledge point questions, and the knowledge point category label of this set of similar knowledge point questions is "How to deal with too much amniotic fluid". Another example is "The cause of too much amniotic fluid", "Why is there too much amniotic fluid" is another set of similar knowledge point questions, and the knowledge point category label of this set of similar knowledge point questions is "The cause of too much amniotic fluid".
[0261] Therefore, in this embodiment, knowledge point questions can be extracted from the target domain knowledge base as training samples, and each training sample includes a corresponding knowledge point question and a corresponding knowledge point category label.
[0262] Step 2030b: Use training samples to train the initial Fasttext model.
[0263] Step 2030c, determine whether the trained Fasttext model meets the preset model convergence condition, if so, execute step 2030d, otherwise continue to execute step 2030b.
[0264] Step 2030d: determine the Fasttext model that meets the preset model convergence condition as the Fasttext model trained to convergence.
[0265] This is described in conjunction with step 2030b-step 2030d. Specifically, in the present embodiment, the Fasttext model is a text classification model. The initial Fasttext model is a Fasttext model after the parameters in the Fasttext model are initialized. The training sample is input into the initial Fasttext model, the initial Fasttext model is trained, and the parameters in the initial Fasttext model are adjusted. In each iteration process, it is determined whether the trained Fasttext model satisfies the preset model convergence condition. If the preset model convergence condition is met, the Fasttext model that satisfies the preset model convergence condition is determined as the Fasttext model trained to convergence. If it is determined that the preset model convergence condition is not met, the next iteration is entered, and step 2030b is continued to be executed to continue training the Fasttext model until the preset model convergence condition is met.
[0266] Among them, the preset model convergence condition may be that the number of iterations reaches a preset number of iterations, or may be that the loss function reaches a minimum. The preset model convergence condition is not limited in this embodiment.
[0267] Step 204: receiving a target question input by a user.
[0268] In this embodiment, the implementation of step 204 is similar to the implementation of step 101 in the first embodiment of the present application, and will not be described in detail here.
[0269] Step 205: Determine at least one candidate question corresponding to the target question.
[0270] As an optional implementation, Figure 8 As shown, in this embodiment, step 205 includes the following steps:
[0271] Step 2051 , performing similarity matching between the target question and each candidate question in the preset target domain question set.
[0272] Step 2052: determine the unselected questions that meet the similarity requirement as candidate questions.
[0273] Furthermore, in this embodiment, the target question and each candidate question are formed into a question pair and input into a preset matching algorithm, and each question pair is matched for similarity using the preset matching algorithm, and the matching degree corresponding to each question pair is output. If the matching degree of a certain question pair is greater than the preset matching degree threshold, it is determined that the similarity requirement is met, and the candidate question in the question pair is the candidate question corresponding to the target question. If the matching degree of a certain question pair is less than or equal to the preset matching degree threshold, it is determined that the similarity requirement is not met, and the candidate question in the question pair is not the candidate question corresponding to the target question. In this way, at least one candidate question for the target question is determined.
[0274] In this embodiment, the determination of at least one candidate question corresponding to the target question is exemplified: if the target question is "what to do if the baby spits up milk", then through steps 2051 to 2052, at least one candidate question corresponding to the target question is determined to be "what to do if the baby chokes on milk", "what to do if the baby spits up milk", and "what to do if the baby has milk curds". And the matching degrees of these three candidate questions become smaller in sequence.
[0275] In this embodiment, the target question is matched with each candidate question in the preset target domain question set for similarity, and the candidate questions that meet the similarity requirements are determined as candidate questions, so that candidate questions with a high similarity to the target question can be pre-screened.
[0276] Step 206: extract the target concept in the target question and extract the candidate concepts in each candidate question.
[0277] In this embodiment, the method of extracting the target concept in the target question is the same as the method of extracting the candidate concepts in each candidate question, so step 206 is described by taking the method of extracting the target concept in the target question as an example.
[0278] As an optional implementation, Fig. 9 As shown, in this embodiment, extracting the target concept in the target question in step 206 includes the following steps:
[0279] Step 2061 , performing canonical matching on the target question and each question template in the preset target domain question template set.
[0280] Step 2062: Obtain a question template that matches the target question.
[0281] Step 2063: determine the additional text between the target question and the matching question template.
[0282] Step 2064, determine the added text as the target concept.
[0283] This is explained in conjunction with step 2061 to step 2064. In this embodiment, a target domain question template set is first set according to the problem characteristics of the target domain, and the target domain question template set includes multiple question templates. Then, the target question is matched with each question template in the preset target domain question template set by regular matching. After regular matching, a question template matching the target question is obtained. The text that is distinguished between the target question and the matched question template is determined, and the distinguished text is the added text between the target question and the matched question template. Finally, the added text is determined as the target concept corresponding to the target question.
[0284] Step 2065: If there is no question template matching the target question in the target domain question template set, keyword matching is performed between the target question and each candidate concept in the pre-constructed target domain concept set.
[0285] It is understandable that since the question templates in the preset target domain question template set are limited and cannot cover the question-asking habits of all users, there is a situation where there is no question template matching the target question in the target domain question template set. Therefore, if there is no question template matching the target question in the target domain question template set, the target concept in the target question is determined by keyword matching.
[0286] Step 2066, obtaining the candidate concept with the highest matching degree with the target question.
[0287] Step 2067, determining the candidate concept with the highest matching degree as the target concept of the target problem.
[0288] In conjunction with steps 2065 to 2067, the method of determining the target concept in the target question by keyword matching is described. First, a target domain concept set is obtained. The target domain concept set includes multiple candidate concepts. Then, keyword matching is performed between the target question and each candidate concept in the pre-constructed target domain concept set. After keyword matching, the candidate concept with the highest matching degree with the target question is obtained, and the candidate concept with the highest matching degree is determined as the target concept of the target question.
[0289] Step 207, cleaning the target concept and cleaning the candidate concepts in each candidate question.
[0290] It is worth noting that the method of cleaning the candidate concepts in each candidate question is the same as the method of cleaning the target concept, so in this embodiment, the cleaning process of the target concept is described.
[0291] As an optional implementation, Fig.10 As shown, step 207 includes the following steps:
[0292] Step 2071, perform word segmentation processing on the target concept to obtain the candidate words corresponding to the target concept.
[0293] In this embodiment, a word segmentation tool is used to perform word segmentation processing on the target concept. After the word segmentation processing, the candidate words corresponding to the target concept are obtained. For example, after the target concept "What is thalassemia" is subjected to word segmentation processing, the candidate words formed are: "Mediterranean Sea", "Anemia", "What is there".
[0294] Step 2072, determine whether each candidate word meets the filtering condition. If the candidate word meets the filtering condition, filter the candidate word.
[0295] In this embodiment, the first cleaning process performed on the target concept is filtering.
[0296] As an optional implementation, in this embodiment, if Fig.11 As shown, in step 2072, determining whether each word to be selected meets the filtering condition includes the following steps:
[0297] Step 2072a, determine whether each candidate word is a stop word or a preset common word, if so, execute step 2072b, otherwise execute step 2072c.
[0298] Among them, stop words are predefined, such as "ah", "um", etc. It is judged whether each candidate word is a stop word. If it is a stop word, it means that the candidate word has no clear semantics and meets the filtering conditions, so it is filtered. If it is not a stop word, it is further judged whether the candidate word is a preset common word.
[0299] Among them, Fig.12 As shown, in step 2072a, determining whether each candidate word is a preset common word includes the following steps:
[0300] Step 2072a1, determining the IDF value of each candidate word in the target domain common word set or the general domain common word set.
[0301] In this embodiment, a target domain commonly used word set and a general domain commonly used word set are predefined. In the target domain commonly used word set, there is an IDF value of each commonly used word in the target domain. Among them, IDF is the inverse document frequency of word frequency. If the IDF value of a common word in the target domain is larger, it means that the importance of the common word in the target domain is higher. On the contrary, if the IDF value of a common word is smaller, it means that the importance of the common word in the target domain is lower.
[0302] In this embodiment, the general domain is a domain with a larger scope than the target domain. Similarly, the general domain common word set has an IDF value of each common word in the general domain. If the IDF value of a common word in the general domain is larger, it means that the importance of the common word in the general domain is higher. On the contrary, if the IDF value of a common word is smaller, it means that the importance of the common word in the general domain is lower.
[0303] Specifically, in this embodiment, the IDF value corresponding to each candidate word is queried in the target field common word set or the general field common word set to determine the IDF value of each candidate word in the target field common word set or the general field common word set.
[0304] Step 2072a2: If the IDF value of the candidate word in the target domain common word set is less than the first preset IDF threshold, the candidate word is determined to be a preset common word; or, if the IDF value of the candidate word in the general domain common word set is less than the second preset IDF threshold, the candidate word is determined to be a preset common word.
[0305] The second preset IDF threshold is smaller than the first preset IDF threshold.
[0306] In this embodiment, since the IDF value of the same candidate word in the common word set in the general field is usually smaller than the IDF value in the common word set in the target field, the second preset IDF threshold corresponding to the common word set in the general field is smaller than the first preset IDF threshold corresponding to the common word set in the target field, so as to accurately determine the preset common word. Specifically, if the IDF value of the candidate word in the common word set in the target field is smaller than the first preset IDF threshold, it means that the candidate word is a common word in the target field, and the candidate word is determined to be a preset common word; or, if the IDF value of the candidate word in the common word set in the general field is smaller than the second preset IDF threshold, it means that the candidate word is a common word in the general field, and the candidate word is determined to be a preset common word.
[0307] Step 2072a3, if the difference between the IDF value of the candidate word in the target domain common word set and the first preset IDF threshold is less than the third preset IDF threshold, and the difference between the IDF value of the candidate word in the general domain common word set and the second preset IDF threshold is less than the third preset IDF threshold, then the candidate word is determined to be a preset common word.
[0308] The difference is a positive number.
[0309] Specifically, in this embodiment, if the IDF value of the candidate word in the target domain commonly used word set is slightly greater than the first preset IDF threshold, that is, the difference between the IDF value of the candidate word in the target domain commonly used word set and the first preset IDF threshold is less than the third preset IDF threshold. And the IDF value of the candidate word in the general domain commonly used word set is also slightly greater than the second preset IDF threshold, that is, the difference between the IDF value of the candidate word in the general domain commonly used word set and the second preset IDF threshold is less than the third preset IDF threshold, then it means that the candidate word is also a relatively common word, and it is determined that the candidate word is also a preset common word.
[0310] Step 2072b, determining whether the candidate word meets the filtering condition.
[0311] Step 2072c, determining that the candidate word does not satisfy the filtering condition.
[0312] In this embodiment, if the word to be selected is a stop word or a preset common word, it is determined that the word to be selected meets the filtering condition. If the word to be selected is not a stop word or a preset common word, it is determined that the word to be selected does not meet the filtering condition. If the word to be selected meets the filtering condition, the word to be selected is filtered.
[0313] Step 2073, determining in turn whether two consecutive words to be selected meet the merging condition, if the two consecutive words to be selected meet the merging condition, then merging the two consecutive words to be selected.
[0314] Here, each of the two consecutive words to be selected is exemplified. If the target concept "what is thalassemia" does not filter out the words to be selected, then each of the two consecutive words to be selected are "thalassemia" and "what is anemia".
[0315] As an optional implementation, in this embodiment, if Fig.13 As shown, step 2073 includes the following steps:
[0316] Step 2073a, determining in turn whether two consecutive words to be selected are frequent items in the determined concept or pre-constructed bigram, if so, executing step 2073b, otherwise executing step 2073c.
[0317] Among them, the determined concepts are concepts that have been cleansed.
[0318] The pre-built bigram set is constructed by segmenting a large amount of text and then using a frequent item mining algorithm to count the frequency of frequent bigrams in a large amount of text. The pre-built bigram set includes the frequency of each bigram. The greater the frequency of a bigram in the bigram set, the greater the probability that the bigram is a frequent item.
[0319] like Fig.14 As shown, step 2073a sequentially determines whether two consecutive words to be selected are frequent items in the pre-built bigram set, including the following steps:
[0320] Step 2073a1, determine in turn whether the frequency values of two consecutive words to be selected in the two-word set are greater than the first preset frequency threshold, if so, execute step 2073a2, otherwise execute 2073a3.
[0321] Step 2073a2: Determine whether the two consecutive words to be selected are frequent items in the bigram.
[0322] Step 2073a3, determining that the two consecutive words to be selected are not frequent items in the bigram.
[0323] Furthermore, in this embodiment, a first preset frequency threshold is pre-set, and the frequency values of each two consecutive words to be selected in the two-word set are compared with the first preset frequency threshold. If the frequency values of two consecutive words to be selected in the two-word set are greater than the first preset frequency threshold, it means that the two consecutive words to be selected are frequent items in the two-word set and are more suitable for use together. Otherwise, it means that the two consecutive words to be selected are not frequent items in the two-word set.
[0324] Step 2073b, determining whether two consecutive words to be selected meet the merging condition.
[0325] Step 2073c, determining whether the two consecutive words to be selected meet the merging condition based on each of the two consecutive words to be selected.
[0326] In this embodiment, if two consecutive words to be selected are determined concepts or frequent items in a pre-constructed bigram set, it means that the two consecutive words to be selected are more suitable for use in combination, and it is determined that the two consecutive words to be selected meet the merging condition; if two consecutive words to be selected are not determined concepts and are not frequent items in the bigram set, it is determined whether the two consecutive words to be selected meet the merging condition based on each word in the two consecutive words to be selected.
[0327] As an optional implementation, Fig.15 As shown, step 2073c is specifically as follows:
[0328] Whether the two consecutive words to be selected meet the merging condition is determined according to whether each of the two consecutive words to be selected is a frequent item in a pre-built word set.
[0329] Furthermore, if Fig.15 As shown, step 2073c includes the following steps:
[0330] Step 2073c1, determining whether each of the two consecutive words to be selected is a frequent item in the pre-built word set, if not, executing step 2073c2, otherwise executing step 2073c3.
[0331] The pre-built word set is constructed by segmenting a large amount of text and then using a frequent item mining algorithm to count the frequency of frequent words in a large amount of text. The pre-built word set includes the frequency of each word. The greater the frequency of a word in the word set, the greater the probability that the word is a frequent item.
[0332] Specifically, in this embodiment, if it is determined that two consecutive words to be selected are not the determined concept and are not frequent items in the bi-word set, then it is determined whether the two consecutive words to be selected meet the merging condition according to whether each word to be selected in the two consecutive words to be selected is a frequent item in the pre-built word set. Specifically, it is judged whether each word to be selected in the two consecutive words to be selected is a frequent item in the pre-built word set. If each word to be selected in the two consecutive words to be selected is not a frequent item in the word set, it means that the two consecutive words to be selected are not very frequent when used separately, then it is still determined that the two consecutive words to be selected meet the merging condition, and the two consecutive words to be selected are merged. If at least one of the two consecutive words to be selected is a frequent item in the word set, it means that at least one word to be selected is suitable for independent use, then it is determined that the two consecutive words to be selected do not meet the merging condition, and the two consecutive words to be selected are not merged.
[0333] Among them, Fig.16 As shown, step 2073c1 includes the following steps:
[0334] Step 2073c11, determining whether the frequency value of each of two consecutive words to be selected in the word set is greater than the second preset frequency threshold, if so, executing step 2073c12, otherwise executing step 2073c13.
[0335] Step 2073c12, determining that each of the two consecutive words to be selected is a frequent item in the word set.
[0336] Step 2073c13, determining that each of the two consecutive words to be selected is not a frequent item in the word set.
[0337] Furthermore, in this embodiment, a second preset frequency threshold is set in advance, and the frequency value of each candidate word in each consecutive two candidate words in the preset word set is compared with the second preset frequency threshold. If the frequency value of each candidate word in the word set of two consecutive candidate words is greater than the second preset frequency threshold, it is determined that each candidate word in the two consecutive candidate words is a frequent item in the word set. If at least one candidate word is less than or equal to the second preset frequency threshold, it is determined that each candidate word in the two consecutive candidate words is not a frequent item in the word set.
[0338] Step 2073c2, determining whether the two consecutive words to be selected meet the merging condition;
[0339] Step 2073c3, determining that the two consecutive words to be selected do not meet the merging condition.
[0340] In step 2073, the candidate words that meet the merging condition are merged, and the merging is a part of the cleaning process.
[0341] Step 2074, determine whether the target concept includes redundant words, if so, execute step 2075, otherwise end.
[0342] As an optional implementation, Fig.17 As shown, in this embodiment, step 2074 includes the following steps:
[0343] Step 2074a, matching the candidate words in the target concept with the candidate redundant words in the preset redundant word library.
[0344] Step 2074b: If the candidate word in the target concept matches the candidate redundant word, it is determined that the target concept corresponding to the candidate word includes redundant words.
[0345] Step 2074c: If the candidate word in the target concept does not match any candidate redundant word, it is determined that the target concept corresponding to the candidate word does not include redundant words.
[0346] Step 2075, clear the redundant words.
[0347] Furthermore, in this embodiment, a redundant vocabulary library is first pre-set, and the redundant vocabulary library includes redundant words in the concept, such as "Excuse me" and "Hello" are both redundant words in the concept. Then, each candidate word in the target concept to be filtered and merged is matched with the candidate redundant words in the preset redundant vocabulary library. If the candidate word in the target concept matches the candidate redundant words, it is determined that the target concept corresponding to the candidate word includes redundant words, and the redundant words are cleared. If the candidate word in the target concept does not match any of the candidate redundant words, it is determined that the target concept corresponding to the candidate word does not include redundant words. No processing is required.
[0348] It is understandable that removing redundant words from the target concept is also part of the cleaning process of the target concept.
[0349] Step 208 , calculating the semantic relevance between the target question and each candidate question based on the cleaned target concept and the candidate concepts in each candidate question.
[0350] It is understandable that the target concept in the target question can be at least one after cleaning. Similarly, the candidate concept in each candidate question can also be at least one after cleaning.
[0351] As an optional implementation, Fig.18 As shown, in this embodiment, step 208 includes the following steps:
[0352] Step 2081, determining the cleaned target concept and the semantic feature data corresponding to the cleaned candidate concepts in each candidate question.
[0353] As an optional implementation, Fig.19 As shown, step 2081 includes the following steps:
[0354] Step 2081a, determine the cleaned target concept and the word vectors corresponding to the cleaned candidate concepts in each candidate question.
[0355] As an optional implementation, in this embodiment, step 2081a specifically includes:
[0356] The cleaned target concept and the word vectors corresponding to the cleaned candidate concepts in each candidate question are obtained from the representative concept word vector set.
[0357] Specifically, in this embodiment, the cleaned target concept and the cleaned candidate concepts in each candidate question are queried from the representative concept word vector set. After the cleaned target concept and each cleaned candidate concept are queried, the corresponding word vector is obtained.
[0358] Step 2081b, determining the IDF values of the cleaned target concept and the cleaned candidate concepts in each candidate question in the target domain common word set.
[0359] In this embodiment, a target domain common word set is pre-constructed, and in the target domain common word set, there is an IDF value of each common word. Among them, IDF is the inverse document frequency of word frequency. If the IDF value of a common word in the target domain is larger, it means that the importance of the common word is higher. On the contrary, if the IDF value of a common word is smaller, it means that the importance of the common word is lower.
[0360] Step 2081c, the product of the word vector corresponding to the cleaned target concept and the corresponding IDF value is determined as the semantic feature data corresponding to the cleaned target concept.
[0361] Step 2081d: The product of the word vector corresponding to the cleaned candidate concept in each candidate question and the corresponding IDF value is determined as the semantic feature data corresponding to the cleaned candidate concept in each candidate question.
[0362] In this embodiment, the product of the word vector corresponding to the cleaned target concept and the corresponding IDF value is determined as the semantic feature data corresponding to the cleaned target concept, and the product of the word vector corresponding to the cleaned candidate concept in each candidate question and the corresponding IDF value is determined as the semantic feature data corresponding to the cleaned candidate concept in each candidate question. If the word vector of the cleaned target concept is closer to the word vector of a cleaned candidate concept, and the IDF value of the cleaned target concept is closer to the IDF value of the cleaned candidate concept, it means that the semantic relevance between the cleaned target concept and the cleaned candidate concept is greater. On the contrary, if the word vector of the cleaned target concept is farther away from the word vector of a cleaned candidate concept, or the IDF value of the cleaned target concept is farther away from the IDF value of a cleaned candidate concept, it means that the semantic relevance between the cleaned target concept and the cleaned candidate concept is smaller.
[0363] Step 2082, inputting the cleaned semantic feature data corresponding to the target concept and the cleaned semantic feature data corresponding to the candidate concepts in each candidate question into a preset WMD algorithm model to output the semantic relevance between the target question and each candidate question.
[0364] Furthermore, in this embodiment, the product of the word vector corresponding to the cleaned target concept and the corresponding IDF value, and the product of the word vector corresponding to the cleaned candidate concept in each candidate question and the corresponding IDF value are input into the preset WMD algorithm model, and the preset WMD algorithm model first determines the correspondence between at least one cleaned target concept and at least one cleaned candidate concept in each candidate question, and then calculates the semantic relevance between each cleaned target concept and the corresponding cleaned candidate concept. Then, the semantic relevance between the target question and the candidate question is determined based on the semantic relevance between at least one cleaned target concept and the corresponding cleaned candidate concept in the candidate question. And the semantic relevance between the target question and each candidate question is output from the preset WMD algorithm model.
[0365] Among them, the preset WMD algorithm model calculates the inner product value of the semantic feature data of each cleaned target concept and the semantic feature data of the corresponding cleaned candidate concept when determining the semantic relevance between each cleaned target concept and the corresponding cleaned candidate concept, and determines the inner product value as the semantic relevance between the cleaned target concept and the corresponding cleaned candidate concept.
[0366] Step 209: determining a standard question based on the semantic relevance between the target question and each candidate question.
[0367] As an optional implementation, in this embodiment, step 209 specifically includes:
[0368] The candidate questions with the greatest semantic relevance are determined as standard questions.
[0369] Furthermore, in this embodiment, since the candidate question with the greatest semantic relevance is the candidate question that is most semantically consistent with the target question, the candidate question with the greatest semantic relevance is determined as the standard question corresponding to the target question.
[0370] Following the example in step 205 above, after steps 207 to 209, the target question "What should I do if my baby spits up milk" and the three candidate questions "What should I do if my baby chokes on milk", "What should I do if my baby spits up milk", and "What should I do if my baby has milk curds" are arranged in descending order according to the semantic relevance, and the candidate questions are "What should I do if my baby spits up milk", "What should I do if my baby chokes on milk", and "What should I do if my baby has milk curds". "What should I do if my baby spits up milk" is determined as the standard question of the target question "What should I do if my baby spits up milk".
[0371] Step 210, determining a target answer corresponding to the target question based on the standard question.
[0372] Step 211, output the target answer.
[0373] In this embodiment, the implementation of step 210-step 211 is similar to the implementation of step 107-step 108 in the first embodiment of the present application, and will not be described in detail here.
[0374] In this embodiment, when cleaning the target concept and candidate concepts, stop words and preset common words are filtered, two consecutive words suitable for merging are merged, and redundant words are removed. The target concept and candidate concepts can be cleaned more accurately, effectively solving problems such as unclear boundaries of the extracted target concept or too fine phrase granularity.
[0375] In this embodiment, when determining the standard question according to the semantic relevance between the target question and each candidate question, the target concept in the target question and the candidate concepts in each candidate question are extracted, and the target concept and each candidate concept are cleaned. The semantic feature data corresponding to the cleaned target concept and the cleaned candidate concepts in each candidate question are determined; the semantic feature data corresponding to the cleaned target concept and the semantic feature data corresponding to the cleaned candidate concepts in each candidate question are input into the preset WMD algorithm model to output the semantic relevance between the target question and each candidate question. The preset WMD algorithm model can be used to first determine the correspondence between at least one cleaned target concept and at least one cleaned candidate concept in each candidate question, and then calculate the semantic relevance between each cleaned target concept and the corresponding cleaned candidate concept. Then, the semantic relevance between the target question and the candidate question is determined according to the semantic relevance between at least one cleaned target concept and the corresponding cleaned candidate concept in the candidate question. There is no need to calculate the semantic relevance between the cleaned target concept and each cleaned candidate concept in the candidate question in turn, which improves the efficiency of determining the semantic relevance between the target question and each candidate question. And when calculating the semantic relevance between the target question and each candidate question based on the cleaned target concept and the cleaned candidate concepts in each candidate question, the semantic feature data of the cleaned target concept and the cleaned candidate concept not only include the corresponding word vectors, but also add the IDF value as the weight of the word vector, so that the semantic relevance between the determined target question and each candidate question is more accurate.
[0376] Embodiment 3
[0377] Fig. 20 This is a flowchart of a conversational question-and-answer method combining RPA and AI provided in Example 3 of this application, such as Fig. 20 As shown, the conversational question-answering method combining RPA and AI provided in this embodiment is based on the conversational question-answering method combining RPA and AI provided in Example 2 of the present application, and also includes the step of constructing a concept relationship network of the target domain. The conversational question-answering method combining RPA and AI provided in this embodiment includes the following steps.
[0378] Step 301: construct a target domain concept set.
[0379] Step 302: cluster the candidate concepts in the target domain concept set to obtain representative concepts.
[0380] Step 303, calculating the word vector corresponding to each representative concept to form a representative concept word vector set.
[0381] In this embodiment, the implementation of steps 301 to 303 is similar to the implementation of steps 201 to 203 in the second embodiment of the present application, and will not be described in detail here.
[0382] Step 304, respectively calculate the inner product value between the word vectors representing each concept.
[0383] Step 305: determine the inner product value of each word vector representing the concept as the corresponding semantic relevance.
[0384] Furthermore, in this embodiment, the inner product value between the word vectors representing the concepts is calculated. If the inner product value between the word vectors representing the concepts is larger, it means that the semantics of the two concepts are more related. On the contrary, if the inner product value between the word vectors representing the concepts is smaller, it means that the semantics of the two concepts are less related. Therefore, the inner product value of the word vectors representing each concept is determined as the corresponding semantic relevance.
[0385] Step 306: construct a target domain concept relationship network based on each representative concept and its corresponding semantic relevance.
[0386] As an optional implementation, Fig.21 As shown, in this embodiment, step 306 includes the following steps:
[0387] Step 3061: determine each representative concept as a node of the graph structure in the target domain concept relationship network.
[0388] Step 3062: Determine the semantic relevance between the representative concepts as the relationship value of the edges between the nodes of the corresponding graph structure.
[0389] exist Fig. 22 The figure below shows the concept relationship network of some maternal and child fields. Fig. 22 As shown in , each representative concept is determined as a node of the graph structure in the target domain concept relationship network, and the semantic relevance between each representative concept is determined as the relationship value of the edge between the nodes of the corresponding graph structure. Fig. 22Each circle in the graph is a node of the graph structure, and the text in each circle is a representative concept. The line between two representative concepts is the edge between nodes, and the number on the line between two representative concepts is the semantic relevance between the representative concepts, that is, the relationship value of the edge between nodes. It can be understood that in order to clearly see the relationship between the two representative concepts, Fig. 22 Only a part of the graph structure representing concepts is shown.
[0390] In order to associate the target domain concept relationship network with the entities in the target domain, an entity library is established in advance according to the target domain. The entity types in the entity library can be determined according to the target domain. For example, in the maternal and child domain, the entities in the entity library are various parts of the body. Fig. 22 In the example, the concepts associated with body parts are associated with the corresponding entities.
[0391] Step 307: receiving a target question input by a user.
[0392] Step 308: Determine at least one candidate question corresponding to the target question.
[0393] Step 309: extract the target concept in the target question and extract the candidate concepts in each candidate question.
[0394] Step 310, cleaning the target concept and cleaning each candidate concept.
[0395] Step 311, calculating the semantic relevance between the target question and each candidate question based on the cleaned target concept and the candidate concepts in each candidate question.
[0396] Step 312: determine the standard question based on the semantic relevance between the target question and each candidate question.
[0397] Step 313, determining a target answer corresponding to the target question based on the standard question.
[0398] Step 314, output the target answer.
[0399] In this embodiment, the implementation of steps 307 to 314 is similar to the implementation of steps 204 to 211 in the second embodiment of the present application, and will not be described in detail here.
[0400] In this embodiment, after calculating the word vector corresponding to each representative concept to form a representative concept word vector set, the inner product value between the word vectors of each representative concept is calculated respectively; the inner product value of the word vector of each representative concept is determined as the corresponding semantic relevance; a target domain concept relationship network is constructed according to each representative concept and the corresponding semantic relevance, and the constructed target domain concept relationship network can be applied to a dialogue question-and-answer system combining RPA and AI. Provide a basis for the application of a dialogue question-and-answer system combining RPA and AI. And through the target domain concept relationship network, the question-and-answer ability, knowledge recommendation ability, and information guidance ability of the dialogue question-and-answer system can be improved.
[0401] Embodiment 4
[0402] Fig.23 This is a structural diagram of a conversational question-and-answer device combining RPA and AI provided in Example 4 of the present application, such as Fig.23 As shown, the dialogue question-answering device 400 combining RPA and AI provided in this embodiment includes: a target question receiving module 401, a candidate question determination module 402, a concept extraction module 403, a concept cleaning module 404, a semantic relevance calculation module 405, a standard question determination module 406, a target answer determination module 407 and a target answer output module 408.
[0403] The target question receiving module 401 is used to receive the target question input by the user. The candidate question determining module 402 is used to determine at least one candidate question corresponding to the target question.
[0404] The concept extraction module 403 is used to extract the target concept in the target question and extract the candidate concepts in each candidate question. The concept cleaning module 404 is used to clean the target concept. The semantic relevance calculation module 405 is used to calculate the semantic relevance between the target question and each candidate question based on the cleaned target concept and the candidate concepts in each candidate question. The standard question determination module 406 is used to determine the standard question based on the semantic relevance between the target question and each candidate question. The target answer determination module 407 is used to determine the target answer corresponding to the target question based on the standard question. The target answer output module 408 is used to output the target answer.
[0405] The dialogue question-answering device combining RPA and AI provided in this embodiment can perform Figure 2 The technical solution of the method embodiment shown has similar implementation principles and technical effects, which will not be repeated here.
[0406] Embodiment 5
[0407] Fig.24 This is a structural diagram of a dialogue question-and-answer device combining RPA and AI provided in Example 5 of the present application, such as Fig.24As shown, the conversation question and answer device 500 combining RPA and AI provided in this embodiment is based on the conversation question and answer device 400 combining RPA and AI provided in Example 4 of the present application, and further includes: a word vector set construction module 501 and a concept relationship network construction module 502.
[0408] Furthermore, the concept extraction module 403 is specifically used for:
[0409] Regular matching is performed on the target question with each question template in the preset target domain question template set; the question template matching the target question is obtained; the additional text between the target question and the matching question template is determined; and the additional text is determined as the target concept.
[0410] Furthermore, if there is no question template matching the target question in the target domain question template set, the concept extraction module 403 is further configured to:
[0411] Perform keyword matching on the target problem with each candidate concept in the pre-constructed target domain concept set; obtain the candidate concept with the highest matching degree with the target problem; and determine the candidate concept with the highest matching degree as the target concept of the target problem.
[0412] Furthermore, the concept cleaning module 404 is specifically used for:
[0413] The target concept is segmented to obtain the candidate words corresponding to the target concept; whether each candidate word meets the filtering condition is determined, and if the candidate word meets the filtering condition, the candidate word is filtered; whether two consecutive candidate words meet the merging condition is determined in turn, and if the two consecutive candidate words meet the merging condition, the two consecutive candidate words are merged.
[0414] Furthermore, the concept cleaning module 404, when determining whether each candidate word satisfies the filtering condition, is specifically used to:
[0415] Determine whether each word to be selected is a stop word or a preset common word; if the word to be selected is a stop word or a preset common word, determine that the word to be selected meets the filtering condition; if the word to be selected is not a stop word or a preset common word, determine that the word to be selected does not meet the filtering condition.
[0416] Furthermore, the concept cleaning module 404, when determining whether each candidate word is a preset common word, is specifically used to:
[0417] Determine the IDF value of each candidate word in the target field common word set or the general field common word set; if the IDF value of the candidate word in the target field common word set is less than a first preset IDF threshold, determine that the candidate word is a preset common word; or, if the IDF value of the candidate word in the general field common word set is less than a second preset IDF threshold, determine that the candidate word is a preset common word; wherein the second preset IDF threshold is less than the first preset IDF threshold.
[0418] Furthermore, the concept cleaning module 404 is also used for:
[0419] If the difference between the IDF value of the candidate word in the target field common word set and the first preset IDF threshold is less than the third preset IDF threshold, and the difference between the IDF value of the candidate word in the general field common word set and the second preset IDF threshold is less than the third preset IDF threshold, then the candidate word is determined to be a preset common word; wherein the difference is a positive number.
[0420] Furthermore, the concept cleaning module 404 is further configured to:
[0421] It is judged in turn whether each two consecutive words to be selected are the determined concepts or the frequent items in the pre-constructed bigram set; if the two consecutive words to be selected are the determined concepts or the frequent items in the bigram set, it is determined that the two consecutive words to be selected meet the merging condition; if the two consecutive words to be selected are not the determined concepts and are not the frequent items in the bigram set, it is determined whether the two consecutive words to be selected meet the merging condition according to each of the two consecutive words to be selected.
[0422] Further, the concept cleaning module 404, when determining whether the two consecutive words to be selected meet the merging condition according to each of the two consecutive words to be selected, is specifically used to:
[0423] Whether the two consecutive words to be selected meet the merging condition is determined according to whether each of the two consecutive words to be selected is a frequent item in a pre-built word set.
[0424] Further, the concept cleaning module 404, when determining whether the two consecutive words to be selected meet the merging condition according to whether each of the two consecutive words to be selected is a frequent item in the pre-built word set, is specifically used to:
[0425] Determine whether each of the two consecutive words to be selected is a frequent item in a pre-built word set; if each of the two consecutive words to be selected is not a frequent item in the word set, determine that the two consecutive words to be selected meet the merging condition; if at least one of the two consecutive words to be selected is a frequent item in the word set, determine that the two consecutive words to be selected do not meet the merging condition.
[0426] Furthermore, the concept cleaning module 404, when sequentially determining whether two consecutive words to be selected are frequent items in the pre-built bigram, is specifically used to:
[0427] It is determined in turn whether the frequency values of two consecutive words to be selected in the two-word set are greater than a first preset frequency threshold; if the frequency values of two consecutive words to be selected in the two-word set are greater than the first preset frequency threshold, it is determined that the two consecutive words to be selected are frequent items in the two-word set; if the frequency values of two consecutive words to be selected in the two-word set are less than or equal to the first preset frequency threshold, it is determined that the two consecutive words to be selected are not frequent items in the two-word set.
[0428] Furthermore, the concept cleaning module 404, when determining whether each of two consecutive words to be selected is a frequent item in the pre-built word set, is specifically used to:
[0429] Determine whether the frequency value of each of the two consecutive words to be selected in the word set is greater than a second preset frequency threshold; if both are greater than the second preset frequency threshold, determine that each of the two consecutive words to be selected is a frequent item in the word set; if at least one is less than or equal to the second preset frequency threshold, determine that each of the two consecutive words to be selected is not a frequent item in the word set.
[0430] Furthermore, the concept cleaning module 404 is further configured to: after merging two consecutive words to be selected if the two consecutive words to be selected meet the merging condition;
[0431] Determine whether the target concept includes redundant words; if it does, remove the redundant words.
[0432] Furthermore, the concept cleaning module 404, when determining whether the target concept includes redundant words, is specifically used to:
[0433] The candidate word in the target concept is matched with the candidate redundant words in the preset redundant word library; if the candidate word in the target concept matches the candidate redundant words, it is determined that the target concept corresponding to the candidate word includes redundant words; if the candidate word in the target concept does not match any candidate redundant words, it is determined that the target concept corresponding to the candidate word does not include redundant words.
[0434] Furthermore, the concept cleaning module 404 is also used for:
[0435] Clean the candidate concepts.
[0436] Furthermore, the candidate question determination module 402 is specifically configured to:
[0437] The target problem is matched with each candidate problem in the preset target domain problem set for similarity; the candidate problems that meet the similarity requirements are determined as candidate problems.
[0438] Furthermore, the semantic relevance calculation module 405 is specifically used for:
[0439] Determine the semantic feature data corresponding to the cleaned target concept and the cleaned candidate concepts in each candidate question; input the semantic feature data corresponding to the cleaned target concept and the semantic feature data corresponding to the cleaned candidate concepts in each candidate question into a preset WMD algorithm model to output the semantic relevance between the target question and each candidate question.
[0440] Furthermore, the semantic relevance calculation module 405, when determining the semantic feature data corresponding to the cleaned target concept and the cleaned candidate concepts in each candidate question, is specifically used to:
[0441] Determine the word vectors corresponding to the cleaned target concept and the cleaned candidate concepts in each candidate question; determine the IDF values of the cleaned target concept and the cleaned candidate concepts in each candidate question in the common word set of the target field; determine the product of the word vector corresponding to the cleaned target concept and the corresponding IDF value as the semantic feature data corresponding to the cleaned target concept; determine the product of the word vector corresponding to the cleaned candidate concept in each candidate question and the corresponding IDF value as the semantic feature data corresponding to the cleaned candidate concept in each candidate question.
[0442] Furthermore, the standard question determination module 406 is specifically configured to:
[0443] The candidate questions with the greatest semantic relevance are determined as standard questions.
[0444] Furthermore, the word vector set construction module 501 is used to construct a target domain concept set; cluster each candidate concept in the target domain concept set to obtain a representative concept; and calculate the word vector corresponding to each representative concept to form a representative concept word vector set.
[0445] Furthermore, the semantic relevance calculation module 405, when determining the word vectors corresponding to the cleaned target concept and the cleaned candidate concepts in each candidate question, is specifically used to:
[0446] The cleaned target concept and the word vectors corresponding to the cleaned candidate concepts in each candidate question are obtained from the representative concept word vector set.
[0447] Furthermore, the word vector set construction module 501, when constructing the target domain concept set, is specifically used for:
[0448] Obtain a preset target domain question set; extract the candidate concepts in each candidate question in the target domain question set; if the preset concept set convergence condition is not met, expand each question template in the preset target domain question template set, and execute the extraction of the candidate concepts in each candidate question in the target domain question set; if the preset concept set convergence condition is met, construct the target domain concept set according to each candidate concept.
[0449] Furthermore, the concept cleaning module 404 is also used for:
[0450] Clean each candidate concept.
[0451] Furthermore, the word vector set construction module 501, when clustering the candidate concepts in the target domain concept set to obtain representative concepts, is specifically used to:
[0452] The candidate concepts that meet the alignment conditions in the target domain concept set are determined as the same candidate concept; each same candidate concept and other candidate concepts in the target domain concept set are determined as candidate concepts; and each candidate concept is clustered to obtain a representative concept.
[0453] Furthermore, the word vector set building module 501, when clustering the candidate concepts to obtain representative concepts, is specifically used to:
[0454] The HDBSCAN clustering algorithm is used to cluster the candidate concepts to obtain the candidate concepts of each cluster center; the candidate concepts of each cluster center are determined as representative concepts.
[0455] Furthermore, the word vector set construction module 501, when calculating the word vectors corresponding to each representative concept to form a representative concept word vector set, is specifically used to:
[0456] Obtain at least one representative knowledge point question, each representative knowledge point question includes a corresponding representative concept; use the Fasttext model trained to convergence to encode each concept in each representative knowledge point question to obtain a word vector for each concept; obtain the corresponding representative concept word vector from the word vector of each concept in each representative knowledge point question to form a representative concept word vector set.
[0457] Furthermore, the word vector set building module 501, before using the Fasttext model trained to convergence to encode each concept in each representative knowledge point question to obtain the word vector of each concept, is also used to:
[0458] Acquire training samples, which are training knowledge point questions in the target domain knowledge base; use the training samples to train the initial Fasttext model; determine whether the trained Fasttext model meets the preset model convergence conditions; if it is determined that the preset model convergence conditions are met, determine the Fasttext model that meets the preset model convergence conditions as the Fasttext model trained to convergence.
[0459] Furthermore, the concept relationship network construction module 502 is used to respectively calculate the inner product value between the word vectors of each representative concept; determine the inner product value of the word vector of each representative concept as the corresponding semantic relevance; and construct the target domain concept relationship network according to each representative concept and the corresponding semantic relevance.
[0460] Furthermore, the concept relationship network construction module 502, when constructing the target domain concept relationship network according to each representative concept and the corresponding semantic relevance, is specifically used to:
[0461] Each representative concept is determined as a node of a graph structure in a target domain concept relationship network; the semantic relevance between each representative concept is determined as the relationship value of the edges between the nodes of the corresponding graph structure.
[0462] The dialogue question-answering device combining RPA and AI provided in this embodiment can perform Figure 3 - Fig.21 The technical solution of the method embodiment shown has similar implementation principles and technical effects, which will not be repeated here.
[0463] Embodiment 6
[0464] Fig.25 is a block diagram of an electronic device used to implement the conversational question-answering method combining RPA and AI in an embodiment of the present application, such as Fig.25 As shown, the electronic device provided in Embodiment 6 of the present application includes: a memory 601, a processor 602 and a computer program.
[0465] The computer program is stored in the memory 601 and is configured to be executed by the processor 602 to implement the conversational question-and-answer method combining RPA and AI provided in any one of the first to third embodiments.
[0466] For related instructions, please refer to Figures 2 to 21 The relevant descriptions and effects corresponding to the steps are understood, and no further elaboration is given here.
[0467] Electronic devices are intended to be various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or claimed herein.
[0468] In this embodiment, the memory 601 and the processor 602 are connected via a bus 603 .
[0469] Embodiment 7 of the present application provides a computer-readable storage medium on which a computer program is stored. The computer program is executed by a processor to implement the conversational question-and-answer method combining RPA and AI provided in any one of Embodiments 1 to 3.
[0470] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0471] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0472] In addition, each functional module in each embodiment of the present application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0473] The program code for implementing the method of the present application can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, implements the functions / operations specified in the flow chart and / or block diagram. The program code can be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0474] In the context of the present application, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0475] In addition, although each operation is described in a specific order, this should be understood as requiring such operation to be performed in the specific order shown or in a sequential order, or requiring that all illustrated operations should be performed to obtain desired results. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single implementation in combination. On the contrary, the various features described in the context of a single implementation can also be implemented in multiple implementations individually or in any suitable sub-combination mode.
[0476] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A conversational question-answering method combining RPA and AI, characterized in that: The method is applied to an electronic device, and the method comprises: Receiving a target question input by a user through an operation interface of an application program in the electronic device; Determine at least one candidate question corresponding to the target question from a target domain question set, wherein the target domain question set is stored in the electronic device; Extracting a target concept from the target question and extracting candidate concepts from each of the candidate questions; The target concept and the candidate concept are cleaned, wherein the target concept is cleaned, including: performing word segmentation on the target concept to obtain each candidate word corresponding to the target concept, judging in turn whether two consecutive candidates meet a merging condition, if two consecutive candidates meet the merging condition, merging the two consecutive candidates, and judging whether the target concept includes redundant words, if the target concept includes the redundant words, removing the redundant words; Determine the word vectors corresponding to the cleaned target concept and the cleaned candidate concepts in each candidate question, determine the IDF values of the cleaned target concept and the cleaned candidate concepts in each candidate question in the target field common word set, determine the product of the word vector corresponding to the cleaned target concept and the corresponding IDF value as the semantic feature data corresponding to the cleaned target concept, determine the product of the word vector corresponding to the cleaned candidate concept in each candidate question and the corresponding IDF value as the semantic feature data corresponding to the cleaned candidate concept in each candidate question, input the semantic feature data corresponding to the cleaned target concept and the semantic feature data corresponding to the cleaned candidate concept in each candidate question into a preset WMD algorithm model to output the semantic relevance between the target question and each of the candidate questions; Determine a standard question according to the semantic relevance between the target question and each of the candidate questions; Determine a target answer corresponding to the target question according to the standard question; Outputting the target answer; The method also includes: before determining the cleaned target concept and the word vectors corresponding to the cleaned candidate concepts in each of the candidate questions, constructing a target domain concept set; clustering the selected concepts in the target domain concept set to obtain representative concepts; obtaining at least one representative knowledge point question, each representative knowledge point question includes a corresponding representative concept, and encoding each concept in each of the representative knowledge point questions using a Fasttext model trained to convergence to obtain a word vector for each concept; obtaining the corresponding representative concept word vector from the word vector of each concept in each representative knowledge point question to form a representative concept word vector set; respectively calculating the inner product value between the word vectors of each representative concept, determining the inner product value of the word vector of each representative concept as the corresponding semantic relevance, and constructing a target domain concept relationship network based on each of the representative concepts and the corresponding semantic relevance; The semantic relevance between each representative concept is pre-stored in the target domain concept relationship network, the cleaned target concept and each candidate concept are found from the target domain concept relationship network, and the corresponding semantic relevance is determined according to the graph structure between the cleaned target concept and each candidate concept in the target domain concept relationship network.
2. The method according to claim 1, characterized in that: After obtaining the words to be selected corresponding to the target concept, the method further includes: It is determined whether each of the words to be selected meets the filtering condition. If the word to be selected meets the filtering condition, the word to be selected is filtered.
3. The method according to claim 2, characterized in that The step of judging whether each of the words to be selected satisfies the filtering condition comprises: Determine whether each word to be selected is a stop word or a preset common word; If the word to be selected is a stop word or a preset common word, determining that the word to be selected meets the filtering condition; If the word to be selected is not a stop word or a preset common word, it is determined that the word to be selected does not meet the filtering condition.
4. The method according to claim 2, characterized in that: The step of sequentially judging whether two consecutive words to be selected meet the merging condition comprises: Determine in sequence whether two consecutive words to be selected are frequent items in the determined concept or the pre-constructed bigram; If the two consecutive words to be selected are the determined concepts or frequent items in the two-word set, it is determined that the two consecutive words to be selected meet the merging condition; If the two consecutive words to be selected are not the determined concepts and are not frequent items in the two-word set, then it is determined whether the two consecutive words to be selected meet the merging condition according to each of the two consecutive words to be selected.
5. The method according to claim 4, characterized in that The step of determining whether the two consecutive words to be selected meet the merging condition according to each of the two consecutive words to be selected comprises: Whether the two consecutive words to be selected meet the merging condition is determined according to whether each of the two consecutive words to be selected is a frequent item in a pre-built word set.
6. A conversational question-answering device combining RPA and AI, characterized in that: The device is located in an electronic device, and comprises: A target question receiving module, used to receive a target question input by a user through an operation interface of an application program in the electronic device; a candidate question determination module, configured to determine at least one candidate question corresponding to the target question from a target domain question set, wherein the target domain question set is stored in the electronic device; A concept extraction module, used to extract the target concept in the target question and extract the candidate concepts in each of the candidate questions; A concept cleaning module is used to perform cleaning processing on the target concept and the candidate concepts, wherein the cleaning processing on the target concept includes: performing word segmentation processing on the target concept to obtain each candidate word corresponding to the target concept, judging in turn whether two consecutive candidate words meet a merging condition, if two consecutive candidate words meet the merging condition, merging the two consecutive candidate words, and judging whether the target concept includes redundant words, if the target concept includes the redundant words, removing the redundant words; A semantic relevance calculation module is used to determine the word vectors corresponding to the cleaned target concept and the cleaned candidate concepts in each candidate question, determine the IDF values of the cleaned target concept and the cleaned candidate concepts in each candidate question in the target field common word set, determine the product of the word vector corresponding to the cleaned target concept and the corresponding IDF value as the semantic feature data corresponding to the cleaned target concept, determine the product of the word vector corresponding to the cleaned candidate concept in each candidate question and the corresponding IDF value as the semantic feature data corresponding to the cleaned candidate concept in each candidate question, input the semantic feature data corresponding to the cleaned target concept and the semantic feature data corresponding to the cleaned candidate concept in each candidate question into a preset WMD algorithm model to output the semantic relevance between the target question and each of the candidate questions; A standard question determination module, used to determine a standard question according to the semantic relevance between the target question and each of the candidate questions; A target answer determination module, used to determine a target answer corresponding to the target question according to the standard question; A target answer output module, used to output the target answer; The device also includes: before determining the cleaned target concept and the word vectors corresponding to the cleaned candidate concepts in each of the candidate questions, constructing a target domain concept set; clustering the selected concepts in the target domain concept set to obtain representative concepts; obtaining at least one representative knowledge point question, each representative knowledge point question includes a corresponding representative concept, and encoding each concept in each of the representative knowledge point questions using a Fasttext model trained to convergence to obtain a word vector for each concept; obtaining the corresponding representative concept word vector from the word vector of each concept in each representative knowledge point question to form a representative concept word vector set; respectively calculating the inner product value between the word vectors of each representative concept, and determining the inner product value of the word vector of each representative concept as the corresponding semantic relevance, and constructing a target domain concept relationship network according to each of the representative concepts and the corresponding semantic relevance; The semantic relevance between each representative concept is pre-stored in the target domain concept relationship network, the cleaned target concept and each candidate concept are found from the target domain concept relationship network, and the corresponding semantic relevance is determined according to the graph structure between the cleaned target concept and each candidate concept in the target domain concept relationship network.
7. An electronic device, characterized in that: include: Memory, processor and computer program; The computer program is stored in the memory and is configured to be executed by the processor to implement the method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is executed by a processor to implement the method according to any one of claims 1 to 5.
