Intent matching method based on pseudo-regular expression and intelligent question answering system

Through the pseudo-regular expression intention matching method, the problems of difficulty in writing rules and low matching efficiency are solved, and an efficient and accurate intelligent question-and-answer system is realized to adapt to large-scale data environments.

CN113610110BActive Publication Date: 2025-08-29JINAN ZHONGKE UBIQUITOUS INTELLIGENT COMPUTING RES INST
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110764254.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-06
Publication Date
2025-08-29
Estimated Expiration
2041-07-06

AI Technical Summary

Technical Problem

The existing intelligent rules-based question-and-answer system has problems such as difficulty in writing rules, time-consuming and labor-intensive, unintuitive rules, poor automatic scalability and low rule matching efficiency, and it is difficult to achieve cross-domain universality in large-scale data environments.

Method used

Using a pseudo-regular expression-based intent matching method, an intelligent question-and-answer system for pseudo-regular expression intent matching is used to use pseudo-regular expression generation and index structure, combined with word segmentation, unlogged word recognition and rule automatic generation, to achieve efficient intent matching.

Benefits of technology

It reduces labor cost investment, improves matching efficiency and accuracy, and the system can update and adapt to large-scale data in real time, with good readability and scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113610110B_ABST
    Figure CN113610110B_ABST
Patent Text Reader

Abstract

This disclosure proposes a pseudo-regular expression-based intent matching method and system, including: training a user query training set to generate a pseudo-regular expression; receiving user query information, matching the user query information with the pseudo-regular expression to identify the intent, obtaining a matching pseudo-regular expression, and thus obtaining the user's intent. This application solution achieves basic automation from rule writing to rule application, eliminating the need for manual rule construction and writing, saving manpower. At the same time, the rules are basically invisible to humans, making maintenance easier.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure belongs to the field of artificial intelligence technology, and in particular relates to an intention matching method based on pseudo-regular expressions and an intelligent question-answering system. Background Art

[0002] The statements in this section merely provide background information related to the present disclosure and do not necessarily constitute prior art.

[0003] With the rapid development of the internet, especially the mobile internet, terminal devices, including traditional computers, televisions, and phones, are increasingly being replaced by smartphones, tablets, and wearable devices. Services have evolved from traditional online stores, phone calls, websites, and email to instant messaging, Weibo, and WeChat. With the accelerated pace of technological advancement and life, users demand simple, convenient, and intelligent services. Intelligent question-answering systems, which can quickly address user questions, have garnered significant attention. As one of the most challenging and meaningful tasks in natural language processing (NLP), intelligent question-answering systems aim to enable machines to understand human language and communicate effectively with humans. These systems then interpret the intent expressed in human language and perform specific tasks or provide responses. Intelligent question-answering systems have flourished, resulting in numerous successful commercial products, such as Microsoft's XiaoIce, Apple's Siri, and Google's Google Assistant. Existing intelligent question-answering systems can be categorized as task-oriented or non-task-oriented (chatbots), depending on their design goals. Task-oriented dialogue systems aim to help users complete specific tasks, such as ordering movie tickets, while chatbots aim to engage in multifaceted and multi-faceted communication with users. Regardless of the type of intelligent question-answering system, the core issue is to understand the user's intention. Therefore, if the system cannot accurately obtain the user's intention, the user experience will be greatly reduced.

[0004] In recent years, third-generation dialogue systems have emerged, using deep learning as their core technology. The powerful representational capabilities of neural networks have overcome many technical challenges in dialogue systems. However, these systems still suffer from significant data dependency, high training complexity, and poor adaptability. Rule-based approaches remain a crucial and essential solution for practical question-answering system implementations. While rule-based systems offer advantages such as simple training, high accuracy, and controllable processes, current systems still face challenges such as complex rule writing, time-consuming and labor-intensive training, and difficulty understanding the rules.

[0005] Subsequent researchers have proposed various methods to improve rule-based intelligent question-answering systems. For example, some research efforts have focused on building intelligent question-answering systems by constructing rule libraries based on common patterns and grammatical rules. Most rule-based intelligent question-answering systems first establish a user intent system, then build a dynamically updated rule library for each intent. Next, the user's question is matched against the rule library and evaluated, resulting in the selection of the optimal matching rule. The user's intent is then determined by associating the intent with the rule library. Finally, the intent is associated with the response to execute the relevant action and provide the user with relevant information.

[0006] The inventors discovered that while existing technologies have achieved certain results, they still haven't solved the problems of difficulty in writing rules, time-consuming and labor-intensive rule writing, unintuitive rules, poor automatic scalability of rules, inefficient large-scale rule matching, and low accuracy in rule matching scoring. Furthermore, in an era of rapidly expanding data, the scale of data continues to expand and the data structure becomes increasingly complex. Manual or semi-automated rule writing methods are clearly unable to keep up with the ever-increasing volume of data, further magnifying the shortcomings of rule-based intelligent question-answering systems, such as their poor cross-domain universality. These shortcomings have prevented the widespread adoption of rule-based solutions. Summary of the Invention

[0007] In order to overcome the deficiencies of the above-mentioned prior art, the present disclosure provides an intention matching method based on pseudo-regular expressions. The intelligent question-answering system based on intention matching of pseudo-regular expressions can greatly reduce the investment of manpower costs and has high matching efficiency.

[0008] To achieve the above objectives, one or more embodiments of the present disclosure provide the following technical solutions:

[0009] In a first aspect, a pseudo-regular expression-based intent matching method is disclosed, comprising:

[0010] The user consultation training set is trained to generate pseudo regular expressions;

[0011] Receive user inquiry information, perform intent matching and identification on the user inquiry information and the pseudo-regular expression, obtain the matching pseudo-regular expression, and thus obtain the user intention.

[0012] A further technical solution is to train a set of consultation samples to generate pseudo-regular expressions, wherein during training, each user consultation in the training set is converted into a word set standard name and an unrecognized character sequence through word segmentation and word set standard name lookup, and then the sequence is converted into a word set standard name set sequence through interactive recognition of unregistered words, and then a pseudo-regular expression set is generated through pseudo-regular expressions and stored in a database.

[0013] A further technical solution is to use a pseudo-regular expression index to convert the mapping relationship between the standard name of the word and the pseudo-regular expression when performing intent matching recognition;

[0014] After obtaining user consultation, it is converted into a word set standard name sequence through word segmentation and word set standard name search and unrecognized characters are discarded. The constructed index is used to search, merge and sort the word set standard name sequence converted from the user consultation using pseudo-regular expressions, and finally it is determined to match a certain pseudo-regular expression.

[0015] A further technical solution is to obtain a matched user intent and then return a reply to the user by associating the intent with the reply.

[0016] In a further technical solution, a pseudo-regular expression expresses the intent of a set of language strings. During the training phase, user questions or queries in natural language are converted into pseudo-regular expressions and stored under the corresponding intent;

[0017] In the intent recognition stage, the pseudo-regular expression represents an abstract string that expresses the intent. Combined with the pseudo-regular expression matching function, if the user inquiry has a high degree of match with the current pseudo-regular expression, it is considered that the current user inquiry expresses the intent corresponding to the pseudo-regular expression, and the reply is searched according to the intent.

[0018] A further technical solution is that the process of word segmentation and word set standard name search is as follows:

[0019] First, a synonym database is established. For each synonym database, the most representative word is selected as the standard name of the word set.

[0020] Segment user queries based on the vocabulary, using the reverse maximum segmentation and reverse maximum matching segmentation model;

[0021] After obtaining the segmented words, the standard name of the word set is searched by the word, thereby obtaining an ordered word string composed of the standard name of the word set;

[0022] The word set standard noun string is used for grammar generation or pseudo-regular expression matching process.

[0023] A further technical solution is that the word segmentation model is based on the word library for word segmentation. Assuming that the number of Chinese characters contained in the largest entry in the word library is n, the n characters from the back to the front of the user's consultation are obtained as matching fields, and the word library is queried. If the word library contains the changed word, the changed word is separated; if the match is unsuccessful, one character is removed from the front of the character string of n characters and then re-matched. The above process is repeated until the user's consultation is successfully segmented. Of course, if the current character is not successfully segmented in the cycle, the last character will be separated as a word.

[0024] A further technical solution is to create a separate word set for the unregistered words during the word segmentation process, and use the name of the unregistered word as the standard name of the word set;

[0025] The similarity between the unregistered word and all the words in the library is obtained through the word similarity calculation model, and the word set containing the topk words that are most similar to it is recommended as the candidate synonym set to which the unregistered word belongs.

[0026] A further technical solution is to generate pseudo-regular expression rules after word segmentation and unregistered word recognition. The rule generation process is as follows:

[0027] Find the standard set name corresponding to each word based on the word segmentation results. If a word corresponds to multiple word set standard names, the standard names are separated by "|";

[0028] The word set standard names are connected with “.*”;

[0029] Search the optional word set standard name collection library, enclose the optional word set standard name in "[]", if a word set standard name string separated by vertical lines has only one word set standard name in the optional word set standard name collection library, then the entire word set standard name string is enclosed in "[]";

[0030] Add the start identifier "^" and the end identifier "$" of the pseudo regular expression rule.

[0031] A further technical solution is to construct a pseudo-regular expression index: an inverted index structure from the standard name of a word set to a pseudo-regular expression is established.

[0032] Secondly, an intelligent question-answering system based on pseudo-regular expression intent matching is disclosed, including:

[0033] The training module is configured to: perform training on a consultation sample set to generate a pseudo regular expression;

[0034] The intention recognition module is configured to: receive user consultation information, perform intention matching and recognition on the user consultation information and the pseudo-regular expression, obtain the matching pseudo-regular expression, and thus obtain the user intention.

[0035] One or more of the above technical solutions have the following beneficial effects:

[0036] The present invention proposes a technical solution for the construction of an intelligent question-answering system based on pseudo-regular expression intention matching. Aiming at the problem that rule writing is difficult and non-intuitive, a set of pseudo-regular expression rule representation methods are designed. This method has the advantages of regular expressions and good readability. Aiming at the problem that rule writing is time-consuming and labor-intensive and the automatic scalability of rules is poor, an interactive rule automatic generation method is designed. The method includes interactive recognition of unregistered words and generation of regular expressions. Aiming at the problem of poor rule matching efficiency, a rule matching algorithm based on union merging is proposed. The algorithm is simple, easy to understand and has high execution efficiency. The intelligent question-answering system based on pseudo-regular expression intention matching can greatly reduce the investment of manpower costs and has high matching efficiency. At the same time, experimental results show that the system has a high accuracy rate in understanding intentions and has achieved satisfactory results.

[0037] Compared to intelligent question-answering systems based entirely on deep learning, this application solution does not rely on large-scale annotated data and only requires human participation in training. At the same time, the solution has high efficiency and accuracy. Compared to existing rule-based intelligent question-answering systems, this application solution basically achieves automation from rule writing to rule application, eliminating the need for manual rule construction and writing, saving manpower. At the same time, people are basically unable to access the rules, making maintenance easier.

[0038] Compared with the completely black-box intelligent question-answering system based on deep learning, the system of the present invention can improve the system's intent matching results in real time by modifying rules or uploading user sample questions.

[0039] Advantages of additional aspects of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The accompanying drawings, which constitute a part of the present disclosure, are used to provide a further understanding of the present disclosure. The exemplary embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute an improper limitation to the present disclosure.

[0041] Figure 1 This is a flow chart of the intelligent question-answering system according to an embodiment of the present disclosure;

[0042] Figure 2 This is a diagram of the main functional modules of the intelligent question-answering system according to an embodiment of the present disclosure;

[0043] Figure 3 This is a data processing flow chart of the intelligent question-answering system according to an embodiment of the present disclosure;

[0044] Figure 4 Word similarity calculation model;

[0045] Figure 5 An example diagram of a pseudo-regular expression inverted index. DETAILED DESCRIPTION

[0046] It should be noted that the following detailed descriptions are exemplary and intended to provide further explanation of the present disclosure. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which the present disclosure belongs.

[0047] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present disclosure. As used herein, unless the context clearly indicates otherwise, the singular form is intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or combinations thereof.

[0048] In the absence of conflict, the embodiments of the present disclosure and the features thereof may be combined with each other.

[0049] Example 1

[0050] See attached Figure 1 As shown, this embodiment discloses a pseudo-regular expression-based intent matching method, including:

[0051] First, the system is trained on a set of query examples, generating pseudo-regular expressions from them. Then, when a user's query enters the system, it matches the query with the pseudo-regular expression in the system to obtain a matching pseudo-regular expression, thereby deriving the user's intent. By associating the intent with the response, the response is returned to the user.

[0052] About the data processing flow chart Figure 3 As shown. First, a user consultation training set is required for training. Each user consultation in the training set is converted into a word set standard name and an unrecognized character sequence through word segmentation and word set standard name lookup. Then, the sequence is converted into a word set standard name set sequence using unregistered word interactive recognition. Then, a pseudo-regular expression set is generated and stored in the database. Then, the pseudo-regular expression index is used to convert it into a mapping relationship from word set standard name to pseudo-regular expression. When a user consultation enters the system, it is first converted into a word set standard name sequence through word segmentation and word set standard name lookup and unrecognized characters are discarded. Then, the pseudo-regular expression matching and scoring is used to search, merge, score and sort the word set standard name sequence converted from the user consultation in conjunction with the constructed index. Finally, it is determined to match a certain pseudo-regular expression. In this way, the user intention is obtained, and the reply is returned to the user through the association between the intention and the reply.

[0053] The following is a further detailed description of an implementation scheme of the present invention based on pseudo regular expression intention matching. The specific implementation examples described in this section are only used to explain the present invention and are not intended to limit the present invention.

[0054] In order to better explain the present invention, referring to the division of various functional modules of the system, this section explains the design and representation of pseudo-regular expressions, word segmentation and word set standard name search, interactive recognition of unregistered words, pseudo-regular expression generation, pseudo-regular expression index construction, pseudo-regular expression matching scoring, and experimental results.

[0055] Design and representation of pseudo-regular expressions:

[0056] The current rule-based intent matching method has problems such as difficulty in rule writing, time-consuming and labor-intensive rule writing, non-intuitive rules, poor automatic scalability of rules, and low rule matching efficiency. To address the above problems, this application designs a pseudo-regular expression. This rule expression form is simple and effective, with strong readability. It can effectively support the needs of automatic rule generation and intent recognition. Even if manual adjustment of the rules is required, knowledge editing engineers can easily understand and quickly modify the rules.

[0057] Pseudo-regular expressions represent the intent-matching rules within the algorithm, expressing the intent of a set of language strings. During the training phase, natural language user questions or queries are converted into pseudo-regular expressions and stored under the corresponding intent. During the intent recognition phase, pseudo-regular expressions represent the abstract string that expresses the intent. Combined with the pseudo-regular expression matching scoring function, if the user query has a high score matching the current pseudo-regular expression, the query is considered to express the intent corresponding to the pseudo-regular expression, and a response is searched based on the intent.

[0058] The pseudo regular expression PseudoRE is a triple: PseudoRE=<ID,REBody,Condition,Property> , which consists of four parts: ID, REBody, Condition and Property.

[0059] ID is the unique identifier of a pseudo-regular expression. Two different expressions have different IDs, which are generally represented by the primary key number of the database, such as ID1 = 00001 and ID2 = 00002.

[0060] REBody is the rule representation of a pseudo-regular expression and is the core element of the expression. It is a generalization and abstraction of a group of language expressions with the same intention, used to match user inquiries. For example, "^.*如何.*办理.*ETC.*$" is an abstract representation of a group of natural languages such as "如何办理ETC", "怎么办理ETC", "怎么办etc啊", "ETC如何办理".

[0061] Table 1-1 Formal Definition of REBody

[0062]

[0063] REBody is a combination of regular expression syntax rules and the Augmented Backus-Naur Form (ABNF), which combines and simplifies the advantages of both. REBody is a context-free grammar. Its definition is shown in Table 1-1. The definitions of each symbol and text in Table 1-1 are as follows:

[0064] 1) Section: An element of REBody in a pseudo-regular expression, usually a variable or a constant. Usually, different Sections are connected together with the wildcard ".*" as the interval;

[0065] 2) Constant: A constant element, in the form of the standard name of a word set;

[0066] 3) NeccessaryConstant: A necessary constant element. When the expression is matched, this element must exist in the user inquiry;

[0067] 4) WordSet: The standard name of a word set, which represents a set of words with similar meanings. For example, the word set standard name "如何" represents a synonym set such as "如何", "怎么", "怎样";

[0068] 5) OptionalConstant: An optional constant element. When the expression is matched, this element does not necessarily have to exist in the user inquiry. It can exist or not exist; [[ID=2⑥]]

[0069] 6) Variable: A variable-type element, composed of the variable identifier "?" and the variable name (VariableName);

[0070] 7) VariableName: The variable name, which is the name of the variable-type element and is used to extract the information to be obtained from the user inquiry;

[0071] 8) ".*": A wildcard that can match any number of characters. The wildcard can match any number of characters. [[ID=③5]]

[0072] 9) "?" : Variable identifier, used to mark that the current element is a variable to be extracted;

[0073] 10) "|" : OR identifier. A constant element may be represented by the union of multiple word sets;

[0074] 11) "[", "]" : Identifiers for optional constant elements;

[0075] 12) string : String constant;

[0076] 13) "^" : Start identifier of the pseudo-regular expression rule;

[0077] 14) "$" : End identifier of the pseudo-regular expression rule.

[0078] Condition is the relevant constraint for matching the pseudo-regular expression rule. Generally, there are multiple constraint conditions. Each constraint condition is a binary tuple <name, value>, where name represents the name of the constraint condition and value represents the value of the constraint condition. Constraint conditions usually include matching order, arbitrary matching of the number of words, cities, channels, and applications, etc., and can be dynamically added or deleted according to the requirements of subsequent actual use.

[0079] Matching order indicates whether each word after word segmentation in the user's consultation must strictly appear in the order of each element in the rule. For example, for "^.*How.*to handle.*ETC.*$", if <Matching order, yes>, then the consultation "How to handle ETC" can match the entry expression rule, while "ETC How to handle" cannot match; if <Matching order, no>, then both "How to handle ETC" and "ETC How to handle" can match.

[0080] The arbitrary matching of the number of words refers to the maximum number of words that the wild card ".*" can arbitrarily match. For example, for "^.*How.*to handle.*ETC.*$", if <Arbitrary matching of the number of words, 2>, then the two consultations "How to handle ETC ah" and "How to handle highway ETC" can match the entry expression rule, because these two consultations can arbitrarily match at most 1 and 2 words respectively, while "I want to know how to handle ETC" cannot match, as here it needs to arbitrarily match 4 words, exceeding the limit of the constraint condition of the arbitrary matching of the number of words.

[0081] Cities, channels, and applications are the rule constraint conditions used to distinguish different regions, channels, and merchants during actual deployment and application, and are used for the management of matching permissions. For a consultation to match the current rule, the region, channel, and merchant of the consultation must be consistent with the rule.

[0082] Property is the property and property value matched by the pseudo-regular expression rule, and there can be multiple. Each property is a binary tuple <attribute, value>, where attribute represents the name of the property and value represents the value of the property. Constraint conditions usually include matching score values, source consultations, etc., which can be dynamically added or deleted according to the requirements of subsequent actual use.

[0083] The matching score value means that once the expression rule is matched, there is no need to calculate the matching score value, and the score corresponding to the matching score value is directly assigned to the matching score of the consultation and the rule. For example, for “^.*如何.*办理.*ETC.*$”, if <matching score value, 3>, for any user consultation q that matches this rule, regardless of the form of q, the matching score of q and “^.*如何.*办理.*ETC.*$” is 3.

[0084] The source consultation refers to the sample consultation through which the current expression rule is generated. For example, the source consultation of “^.*如何.*办理.*ETC.*$” is “如何办理ETC”.

[0085] Word segmentation and standard name lookup of word sets:

[0086] Word segmentation refers to the process of recombining the continuous sequence of user consultation words into a word sequence according to the synonym set. First, a synonym thesaurus will be established. For each group of synonym thesauruses, a most representative word will be selected as the standard name of the word set. For example, the synonym group set contains “如何”, “怎么”, “怎样”, “奈何”, and “如何” is taken as the standard name of the word set. It can be formally expressed as follows:

[0087] 如何={“如何”, “怎么”, “怎样”, “奈何”}

[0088] With a vocabulary, user queries can be segmented. There are many different methods for word segmentation, but because understanding user semantics is a complex process, the practical need is to provide a quick response, so a model that can segment quickly is desirable. A classic model for fast Chinese word segmentation is based on the maximum matching algorithm, which consists of two approaches: forward and reverse. Theoretically, given that the central word in Chinese sentences generally comes later, reverse matching is more accurate than forward matching. Therefore, this approach uses the reverse directional maximum matching (RMM) model. RMM is a classic Chinese word segmentation model that performs word segmentation based on a vocabulary. Assuming the largest entry in the vocabulary contains n characters, the n characters from the user query are retrieved from the back as matching fields, and the vocabulary is queried. If the vocabulary contains a modified word, the modified word is segmented. If a match fails, a character is removed from the beginning of the n-character string and the match is repeated. This process repeats until the user query is successfully segmented. Of course, if the current word continues to loop without success, the last word will be separated as a word.

[0089] After word segmentation, you can use words to search for the word set standard name, and thus obtain an ordered word string composed of the word set standard name. For example, "how to etc" will be segmented into "how to etc", and then the word set standard noun string "how to apply for ETC" is obtained through the mapping of words to word set standard names. If the word "do" exists in the word set "apply" and "arrange" at the same time, then it will be divided into the word set standard noun string "how to apply|arrange ETC".

[0090] The standard noun string of the word set is used in grammar generation or pseudo-regular expression matching. Because the pseudo-regular expression rule generation and user inquiry intent matching in the solution use the same set of solutions, even if there are errors in word segmentation, they will not be cascaded to the intent understanding and recognition process, and thus will not significantly affect the accuracy of intent understanding.

[0091] Interactive recognition of unregistered words:

[0092] During the training process, the solution is to use a sample set of user inquiries to automatically generate pseudo-regular expression rules. During the generation process, word segmentation will be performed first, which will produce the problem of unregistered words. This solution uses human-computer interaction to identify and enter new words.

[0093] As we can see from the above introduction to word segmentation, unregistered words will be identified as single-character words. This solution will automatically group consecutive single-character words together as an unregistered word and then recommend them based on two aspects:

[0094] 1) Create a separate word set for out-of-vocabulary words, and use the name of the out-of-vocabulary word as the standard name of the word set.

[0095] 2) Obtain the similarity between out-of-vocabulary words and all words in the library through a word similarity calculation model, and recommend the word set where the top-k words most similar to them are located as the candidate synonym set to which the out-of-vocabulary word belongs.

[0096] Based on the candidate word set, the model trainer can choose to create a new word set or add the current out-of-vocabulary word to an existing word set. At present, there will also be a problem that the current out-of-vocabulary word needs to be segmented into multiple words. At this time, the user can manually segment and then further confirm through the recommendation of the candidate synonym set to create or add it to the existing set. [[ID=,8]]

[0097] For example, assume that the current recognized out-of-vocabulary word is "解除 (解除)", and candidate standard names of word sets such as "解除 (解除)", "取消 (取消)", and "解放 (解放)" will be recommended. Among them, the standard name of the word set "解除 (解除)" is a newly created standard name, while "取消 (取消)" and "解放 (解放)" are existing standard names in the thesaurus. The model trainer selects one or more of them to add the out-of-vocabulary word "解除 (解除)" to the corresponding word set.

[0098] In the process of recommending the standard name of the word set, a word similarity calculation model is used in this solution. This model uses BERT to obtain the vector representation of words, and then calculates the Euclidean distance through cosine similarity (cosine) to judge the similarity of words. The model framework is as Figure 4 shown.

[0099] The BERT model will insert a [CLS] symbol before the word, and use the output vector corresponding to this symbol as the semantic representation of the word. Compared with other existing characters in the text, this symbol [CLS] without obvious semantic information can better integrate the semantic information of each character in the word. The function of BERT is to train using a large-scale unlabeled corpus to obtain a vector representation of the input string containing rich context semantic information. Therefore, the vector corresponding to the [CLS] symbol will have rich context information, which helps to calculate the similarity of synonyms and can better recommend the synonym set of words. In this solution, we use the publicly available BERT model based on Chinese characters from Google to obtain the vector representation of words.

[0100] In terms of calculating word similarity, this solution uses the classic cosine similarity (cosine) to calculate the Euclidean distance. Here, the vectors of two words are defined as A = (A1, A2,..., A n ), B = (B1, B2,..., B n ), and the similarity calculation formula of A and B is as follows.

[0101]

[0102] Pseudo regular expression generation:

[0103] Based on word segmentation and unregistered word recognition, the solution generates pseudo-regular expression rules. All words in the user inquiry sample can find the standard name of the word set. Therefore, rule generation is the process of finding the standard name of the word set based on the word. The rule generation process is as follows:

[0104] 1) Find the standard set name corresponding to each word based on the word segmentation results. If a word corresponds to multiple word set standard names, the standard names are separated by "|";

[0105] 2) Use “.*” to connect the standard names of word sets;

[0106] 3) Search the optional word set standard name collection library, enclose the optional word set standard name in "[]", if a word set standard name string separated by vertical lines has only one word set standard name in the optional word set standard name collection library, then the entire word set standard name string is enclosed in "[]";

[0107] 4) Add the start identifier “^” and end identifier “$” of the pseudo regular expression rule.

[0108] A sample user inquiry generates two pseudo-regular expression rules. These two rules are identical in form, but the Condition and Property values ​​in each rule differ. One rule's Condition 1 is {Match Ordered = Yes; Any Matching Word Count = 0} and Property 1 is {Match Score = Max}. The other rule's Condition 2 is {Match Ordered = No; Any Matching Word Count = k}. Condition 1 and Property 1 ensure that the user inquiry being trained will always match the generated pseudo-regular expression rule and receive the maximum possible score. Condition 2 is designed to enhance rule scalability, allowing the generated pseudo-regular expression rule to match a wider range of query variations. Condition 2 achieves greater scalability by allowing for multiple values ​​of order and any matching word count. The k in "Any Matching Word Count = k" has a default value, which can be modified by the trainer based on experience and needs. The matching score for the second rule is dynamically calculated based on the model described below. This pseudo-regular expression rule generation scheme not only ensures that the training examples can obtain accurate intentions but also takes into account the scalability of the scheme.

[0109] Pseudo regular expression index construction:

[0110] The number of pseudo-regular expressions is very large. In order to achieve fast matching and recognition between user consultation and pseudo-regular expressions, this solution establishes an inverted index structure from the standard name of the word set to the pseudo-regular expression. i , then Name i The pseudo-regular expression set corresponding to the index contains RE, Name i The corresponding RE set will be sorted from small to large according to ID, providing a basis for the subsequent expression set merging algorithm. Figure 5 shown.

[0111] The inverted index can be preloaded before the system starts, saving real-time processing time. Using the inverted index structure, the user can quickly generate a list of pseudo-regular expressions containing the standard word set name obtained after word segmentation. Next, the system merges, filters, and scores the lists corresponding to multiple standard word sets.

[0112] Pseudo-regular expression matching scoring

[0113] When a user query is passed into the system, it first tokenizes the query and then performs a standard name lookup on the word set, ultimately converting it into a standard name string. For example, a query for "ETC processing methods" is tokenized to "ETC processing methods," which is then converted to "processing|preparing ETC methods|methods" through a standard name lookup. Once the standard name string is obtained, an inverted index query can be used to obtain an ordered list of standard names in the word set for each standard name. For example, for "processing|preparing," where multiple standard name elements are listed in parallel, separated by vertical bars, the system uses a merge algorithm to remove duplicates and merge the corresponding pseudo-regular expression lists. The pseudo-code for this algorithm is shown in Table 1.

[0114] Table 1 Pseudo-regular expression list deduplication and merging algorithm

[0115]

[0116]

[0117] This solution proposes a voting-based method for obtaining a list of candidate pseudo-regular expressions. This solution improves upon the classic merge algorithm to index the corresponding pseudo-regular expression list and perform an ordered count of the number of hits for each pseudo-regular expression. This count is based on the previous algorithm, which merges the pseudo-regular expressions corresponding to the standard names of equal status. This effectively creates a list of pseudo-regular expressions for each term. Voting on the pseudo-regular expressions is performed by term, and the list is then sorted by the number of votes received. See Table 2 for the algorithm's pseudo-code.

[0118] Table 2 Pseudo-regular expression list voting algorithm

[0119]

[0120]

[0121] After the voting process, a list of candidate pseudo-regular expressions is obtained. This list is then screened based on constraints such as the order of the pseudo-regular expression matches, the number of matching characters, and whether constant elements are required. This is called a conditional filtering mechanism based on pseudo-regular expressions.

[0122] After filtering, the list obtained needs to be scored and evaluated for the relevance between each pseudo-regular expression and the user inquiry. This solution proposes a BERT-based method for calculating the relevance between user inquiries and pseudo-regular expressions. Each pseudo-regular expression has a Property matching score and a source inquiry. If the pseudo-regular expression contains a Property matching score, then the relevance between the current pseudo-regular expression and the user inquiry is scored as a value corresponding to the Property matching score. If the pseudo-regular expression does not contain a Property matching score, this solution uses the word similarity calculation method, see Figure 4 , calculates the similarity between the source query corresponding to the pseudo-regular expression and the user query, obtains vector representations of the source query and user query using BERT, and then calculates the cosine Euclidean distance as the correlation between the pseudo-regular expression and the user query. The BERT used in this stage will undergo parameter fine-tuning based on the existing training data.

[0123] By obtaining the pseudo-regular expression of the user's inquiry, we can then obtain the intent that matches the user's inquiry. By associating the intent with the reply, we can then give the user a reply.

[0124] In order to verify the effectiveness and correctness of the intelligent question-answering system based on pseudo-regular expression intent matching designed in this application proposal, the present invention adopts a manual evaluation method for detection and verification. The core of the present invention is the accuracy of intent recognition. Therefore, the manual evaluation is conducted by multiple users from different regions and fields. The users spontaneously and randomly construct inquiries, and then the system analyzes and identifies the returned intents and replies. The accuracy of the system is evaluated by comparing whether the expected feedback intent and reply are consistent with the system return. Because the system can provide the topk intent recognition and reply results, the accuracy of the top1-top5 is statistically analyzed, see Table 3.

[0125] Table 3 Intent recognition accuracy

[0126]

[0127]

[0128] The experimental results show the effectiveness of this solution. When five matching intents are returned, the accuracy rate of the solution reaches 99%.

[0129] Example 2

[0130] The purpose of this embodiment is to provide a computing device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the program.

[0131] Example 3

[0132] The purpose of this embodiment is to provide a computer-readable storage medium.

[0133] A computer-readable storage medium stores a computer program, which, when executed by a processor, performs the steps of the above method.

[0134] Example 4

[0135] The purpose of this embodiment is to provide an intelligent question-answering system based on pseudo-regular expression intent matching, including:

[0136] The training module is configured to: perform training on a consultation sample set to generate a pseudo regular expression;

[0137] The intention recognition module is configured to: receive user consultation information, perform intention matching and recognition on the user consultation information and the pseudo-regular expression, obtain the matching pseudo-regular expression, and thus obtain the user intention.

[0138] Based on the pseudo-regular expression rules, an intent classification system is established. At the same time, the encoding and decoding stages of the entire system model are established through the two functional modules of the training module and the intent recognition module. This proposal first assumes that the consultation sample collection has been classified and organized according to the expressed intent. In the training stage, a semantic understanding model is obtained through consultation sample segmentation, word set standard name search, unregistered word interactive recognition, pseudo-regular expression generation and intent reply association. In the intent recognition stage, user intent is obtained through pseudo-regular expression index construction, user consultation segmentation, word set standard name search and pseudo-regular expression matching scoring. The reply is obtained and returned to the user through the association of intent and reply. See the main functional module diagram of the system for details. Figure 2 .

[0139] Consultation sample word segmentation module: This module decomposes the consultation sample sentences used for training into word sequences.

[0140] Word set standard name search module: This module searches for the corresponding word set standard name from the constructed word library through words.

[0141] Unregistered word interactive recognition module: This module uses human-computer interaction to identify and enter words that do not appear in the vocabulary in the training consultation samples, and stores them in the vocabulary after identification.

[0142] Pseudo-regular expression generation module: This module generates a pseudo-regular expression set from a word set standard name set sequence and stores it in the database.

[0143] Intent reply association module: This module searches the database for the answer associated with the current intent for reply.

[0144] Pseudo-regular expression index construction module: This module establishes a set of mapping relationships from word standard names to pseudo-regular expressions for all pseudo-regular expressions, and establishes an index with word standard names as key values.

[0145] User consultation word segmentation module: This module decomposes the user's consultation sentences into word sequences.

[0146] Pseudo-regular expression matching scoring module: This module votes, merges, and integrates the candidate pseudo-regular expression sets obtained through index queries, scores each candidate pseudo-regular expression in terms of matching degree, and sorts the candidate pseudo-regular expression sets in descending order based on the scoring scores.

[0147] Specifically, first, a user consultation training set is required for training. Each user consultation in the training set is converted into a word set standard name and an unrecognized character sequence through the word segmentation and word set standard name search module. Then, the sequence enters the unregistered word interactive recognition module to be converted into a word set standard name set sequence. Then, a pseudo-regular expression set is generated by the pseudo-regular expression generation module and stored in the database. Then, it enters the pseudo-regular expression index construction module to be converted into a mapping relationship between word standard name and pseudo-regular expression. When a user consultation enters the system, it is first converted into a word set standard name sequence through word segmentation and word set standard name search and unrecognized characters are discarded. Then, it enters the pseudo-regular expression matching and scoring module and combines the index built by the pseudo-regular expression index construction module to search, merge, score and sort the word set standard name sequence converted by the user consultation for pseudo-regular expressions, and finally determines whether it matches a certain pseudo-regular expression. In this way, the user intention is obtained, and the reply is returned to the user through the association between the intention and the reply.

[0148] During use, the user's query is input, and after semantic understanding and intent recognition, the corresponding answer is found and returned to the user. The intelligent question-answering system based on pseudo-regular expression intent matching performs training and intent recognition based on the pseudo-regular expression representation rules proposed in this solution. Its functional aspects mainly include training, intent recognition, and answer return.

[0149] This application proposal proposes a design scheme for pseudo-regular expressions. Pseudo-regular expressions are composed of ID, pseudo-regular expression rules, Condition, and Property. Each dimension has its own special design pattern.

[0150] In the interactive recognition of unregistered words, the present application proposes a recommendation mechanism and a calculation model and method for a similar word set based on BERT.

[0151] In the pseudo-regular expression generation stage, the dual-rule generation scheme proposed in this application generates a pseudo-regular expression of {matching order = yes; arbitrary matching word number = 0} in order to ensure that the same user consultation as the training sample can match the current intention.

[0152] In the pseudo-regular expression matching scoring stage, this application proposes a method for obtaining a list of candidate pseudo-regular expressions based on a voting mechanism, a conditional filtering mechanism based on pseudo-regular expressions, and a method for calculating the correlation between user consultations and pseudo-regular expressions based on BERT.

[0153] The steps involved in the apparatuses of Examples 2, 3, and 4 above correspond to those of Method Example 1. For detailed implementations, please refer to the relevant description of Example 1. The term "computer-readable storage medium" should be understood to mean a single medium or multiple media containing one or more instruction sets; it should also be understood to include any medium capable of storing, encoding, or carrying an instruction set for execution by a processor and causing the processor to perform any of the methods disclosed herein.

[0154] The foregoing description is merely a preferred embodiment of the present disclosure and is not intended to limit the present disclosure. Those skilled in the art will readily appreciate that various modifications and variations are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present disclosure shall be included within the scope of protection of the present disclosure.

[0155] Although the above describes the specific implementation methods of the present disclosure in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present disclosure. Those skilled in the art should understand that on the basis of the technical solution of the present disclosure, various modifications or variations that can be made by those skilled in the art without creative work are still within the scope of protection of the present disclosure.

Claims

1. Pseudo-regular expression-based intention matching method, characterized by: include: Generate pseudo regular expressions based on user consultation training sets; During training, each user query in the training set is converted into a word set standard name and an unrecognized character sequence through word segmentation and word set standard name lookup. The sequence is then converted into a word set standard name set sequence through unregistered word interactive recognition. A pseudo-regular expression set is then generated through pseudo-regular expressions and stored in the database. The process of searching for word segmentation and word set standard names is as follows: First, a synonym database is established. For each synonym database, the most representative word is selected as the standard name of the word set. Segment user queries based on the vocabulary, using the reverse maximum segmentation and reverse maximum matching segmentation model; After obtaining the segmented words, the standard name of the word set is searched by the word, thereby obtaining an ordered word string consisting of the standard name of the word set; The word set standard noun string is used for grammar generation or pseudo-regular expression matching process; During the word segmentation process, a separate word set is created for the unregistered word, and the name of the unregistered word is used as the standard name of the word set; The similarity between the unregistered word and all the words in the library is obtained through a word similarity calculation model, and the word set containing the topk words that are most similar to it is recommended as the candidate synonym set to which the unregistered word belongs; wherein, the word similarity calculation model uses BERT to obtain the vector representation of the word, and calculates the Euclidean distance through cosine similarity to determine the similarity of the word; After word segmentation and unregistered word recognition, pseudo-regular expression rules are generated. The rule generation process is as follows: Find the standard set name corresponding to each word based on the word segmentation results. If a word corresponds to multiple word set standard names, the standard names are separated by "|"; The word set standard names are connected with ".*"; Search the optional word set standard name collection library, enclose the optional word set standard name in "[]". If a word set standard name string separated by vertical lines has only one word set standard name in the optional word set standard name collection library, then the entire word set standard name string is enclosed in "[]"; Add the start identifier "^" and end identifier "$" of the pseudo regular expression rule; Pseudo-regular expression index construction: An inverted index structure from the standard name of a word set to a pseudo-regular expression is established; Receive user inquiry information, perform intent matching and identification on the user inquiry information and the pseudo-regular expression, obtain the matching pseudo-regular expression, and thus obtain the user intention.

2. The pseudo-regular expression-based intention matching method according to claim 1, wherein: When performing intent matching and recognition, the mapping relationship between the standard name of the conversion word and the pseudo-regular expression is converted using the pseudo-regular expression index; After receiving user inquiries, the query is converted into a sequence of standard word names through word segmentation and word set standard name lookup, and unrecognized characters are discarded. The constructed index is used to search, merge, and sort the sequence of standard word names converted from the user inquiries using pseudo-regular expressions, and finally a match is determined with a certain pseudo-regular expression. After obtaining the matching user intent, the response is returned to the user by associating the intent with the response.

3. The pseudo-regular expression-based intention matching method according to claim 1, wherein: Pseudo-regular expressions express the intent of a set of language strings. During the training phase, natural language user questions or queries are converted into pseudo-regular expressions and stored under the corresponding intent. In the intent recognition stage, the pseudo-regular expression represents an abstract string that expresses the intent. Combined with the pseudo-regular expression matching function, if the user inquiry has a high degree of match with the current pseudo-regular expression, it is considered that the current user inquiry expresses the intent corresponding to the pseudo-regular expression, and the reply is searched according to the intent.

4. The pseudo-regular expression-based intention matching method according to claim 1, wherein: The word segmentation model is based on the word library. Assuming that the largest word in the word library contains n Chinese characters, the n characters from the user's query are obtained from the back to the front as matching fields, and the word library is searched. If the word library contains the modified word, the modified word is separated. If the match is unsuccessful, remove one word from the front of the string of n words and then match again. Repeat the above process until the user's query is successfully segmented. Of course, if the current word is not successfully segmented in the cycle, the last word will be segmented as a word.

5. An intelligent question-answering system based on pseudo-regular expression intention matching, using the pseudo-regular expression intention matching method according to claim 1, characterized in that: include: The training module is configured to: generate a pseudo regular expression by training a consultation sample set; The intention recognition module is configured to: receive user consultation information, perform intention matching and recognition on the user consultation information and the pseudo-regular expression, obtain the matching pseudo-regular expression, and thus obtain the user intention.

6. A computing device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the method according to any one of claims 1 to 4 are implemented.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method described in any one of claims 1 to 4 are executed.

Citation Information

Patent Citations

  • An intention recognition method and a system

    CN109388700A