Intelligent response system, startup method, device and storage medium
By automatically generating similar corpora and regular expressions in the intelligent response system, the high configuration difficulty problem in the cold start phase is solved and the system startup efficiency is improved.
Patent Information
- Application Number
- CN202110921158.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-11
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2041-08-11
AI Technical Summary
During the cold start phase of the intelligent response system, existing technologies require operators to manually configure regular expressions and similar corpora, resulting in high configuration difficulty and low efficiency.
By obtaining standard question information and keywords of the intent category, similar corpus and regular expressions are generated using word segmentation algorithms and synonym replacement, and regular expressions and similar corpus corresponding to the intent category are automatically generated.
Improves the cold start efficiency of the intelligent response system and reduces the complexity and time of operational configuration.
Smart Images

Figure CN113779212B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data classification technology, and in particular to an intelligent response system, a startup method, a device and a storage medium. Background Art
[0002] Intelligent response systems typically include a natural language understanding (NLU) system and a dialogue management (DM) system. The main function of the NLU system is to identify and classify user intent, while the main function of the DM system is to determine and push the response content based on the recognition results of the NLU system.
[0003] After the intelligent answering system is launched and has a large amount of annotated data, a natural language understanding model can be trained as an NLU system to identify the user's intent category. However, during the cold start phase of the intelligent answering system, due to the limited amount of annotated data, it is not possible to train an accurate natural language understanding model.
[0004] Therefore, during the cold start phase of the intelligent response system, operations currently configure regular expressions and similar corpora for each intent category in the predefined intent classification system according to business needs. User intent classification is achieved through regular expression matching and / or similar corpus matching, as shown in Table 1 below.
[0005] Table 1
[0006]
[0007] However, there are technical barriers to operational configuration of regular expressions, and learning regular grammar is required for configuration. For each intent category, thousands of similar corpora usually need to be sorted out, and sorting of similar corpora is slow. Therefore, the configuration of existing regular expressions and similar corpora is difficult and laborious, resulting in low cold start efficiency of the intelligent response system. Summary of the Invention
[0008] In view of this, the present invention provides an intelligent response system, a startup method, a device and a storage medium for automatically generating regular expressions and similar corpus corresponding to intent categories, thereby improving the efficiency of cold start of the intelligent response system.
[0009] Specifically, the present invention is achieved through the following technical solutions:
[0010] According to a first aspect of the present invention, there is provided a method for starting an intelligent response system, the method comprising:
[0011] For each intent category predefined in the smart answering system, perform the following operations:
[0012] Obtaining standard question information of the intent category and keywords in the standard question information;
[0013] Using a word segmentation algorithm, the standard question information is segmented according to parts of speech, and synonym replacement is performed on the word as a unit to obtain a replaced corpus;
[0014] Generate similar corpus corresponding to the intent category based on the replaced corpus, and generate a regular expression corresponding to the intent category based on the replaced corpus and keywords in the standard question information.
[0015] In some embodiments, performing synonym replacement on a word-by-word basis to obtain a replaced corpus includes:
[0016] Synonym replacement is performed on word units, and a cross combination of Cartesian products is performed to obtain the replaced corpus.
[0017] In some embodiments, generating similar corpus corresponding to the intent category based on the replaced corpus set includes:
[0018] generating an alternative corpus based on the replaced corpus;
[0019] For each candidate corpus in the candidate corpus set, calling an existing similarity matching model to perform similarity matching between the candidate corpus and the standard question information;
[0020] If the similarity between the two is higher than a set similarity threshold, the candidate corpus is used as the similar corpus corresponding to the intention category and stored in the first preset database.
[0021] In some embodiments, generating an alternative corpus based on the replaced corpus includes:
[0022] Using the replaced corpus as an alternative corpus;
[0023] The corpus in the replaced corpus is reorganized into new corpus by adjusting the order of part-of-speech combinations, and added to the candidate corpus.
[0024] In some embodiments, generating a regular expression corresponding to the intent category based on the replaced corpus and the keywords in the standard question information includes:
[0025] generating an alternative corpus based on the replaced corpus and keywords in the standard question information;
[0026] Calling an existing similarity matching model to perform similarity matching between each candidate corpus in the candidate corpus set and the standard question information, screening corpuses with similarities higher than a set similarity threshold, and obtaining a screened corpus set;
[0027] A regular expression corresponding to the intent category is generated based on the filtered corpus and stored in a second preset database.
[0028] In some embodiments, generating an alternative corpus based on the replaced corpus and keywords in the standard question information includes:
[0029] Using the keywords in the standard question information to filter the corpus in the replaced corpus, to obtain a filtered corpus containing the keywords as a candidate corpus;
[0030] The corpus in the filtered corpus is reorganized into new corpus by adjusting the order of part-of-speech combinations, and is added to the candidate corpus.
[0031] In some embodiments, generating a regular expression corresponding to the intent category based on the filtered corpus includes:
[0032] Exhaustively enumerate the permutations and combinations of the keywords to obtain a keyword combination set;
[0033] For each keyword combination in the keyword combination set, obtaining a corpus containing the keyword combination from the filtered corpus set according to the keyword arrangement order in the keyword combination to obtain a matching corpus set;
[0034] Generating a regular expression corresponding to the keyword combination based on the matching corpus;
[0035] The regular expressions corresponding to all keyword combinations in the keyword combination set are combined in a logical OR manner to obtain a regular expression corresponding to the intent category.
[0036] In some embodiments, generating a regular expression corresponding to the keyword combination based on the matching corpus includes:
[0037] Using the matching corpus as the corpus to be segmented, and using keywords as segmentation points, segmenting the corpus in the corpus to be segmented into multiple segments to obtain segmented corpora for each segment;
[0038] For each of the segmented corpora, determining whether there is an empty segmented corpus in the segmented corpus;
[0039] In response to the absence of an empty segmented corpus in the segmented corpus set, calculating a pattern weight of the segmented corpus set, wherein the pattern weight is determined according to the length of a single segmented corpus and the number of segmented corpora in the segmented corpus set;
[0040] Comparing the mode weight with a set mode threshold;
[0041] In response to the pattern weight being less than the pattern threshold, determining whether there is a common character string in the segmented corpus;
[0042] In response to the presence of a common character string in the segmented corpus, extracting the common character string in the segmented corpus as a keyword;
[0043] The segmented corpus is used as the corpus to be segmented, and is returned for further segmentation until no more common character strings exist in the segmented corpus;
[0044] Generate a regular expression corresponding to the segment of the segmented corpus;
[0045] The regular expressions corresponding to the respective segments are combined with the keywords in the keyword combination to obtain the regular expressions corresponding to the keyword combination.
[0046] According to a second aspect of the present invention, there is provided a device for starting an intelligent answering system, the device comprising a module for executing the method for starting an intelligent answering system in the first aspect or any possible implementation of the first aspect.
[0047] According to a third aspect of the present invention, there is provided a storage medium storing a computer program, which, when executed by a processor, implements the steps of the method for starting the intelligent response system in the first aspect or any possible implementation of the first aspect.
[0048] According to a fourth aspect of the present invention, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the steps of the method for starting the intelligent response system in the first aspect or any possible implementation of the first aspect.
[0049] According to a fifth aspect of the present invention, there is provided an intelligent response system, comprising: a natural language understanding system, a dialogue management system, and a startup module;
[0050] The startup module is configured to, when the intelligent answering system is cold started, use the startup method of the intelligent answering system in the first aspect or any possible implementation of the first aspect to generate a regular expression and similar corpus corresponding to each predefined intent category in the intelligent answering system;
[0051] The natural language understanding system is configured to identify the intent category corresponding to the user question based on the regular expression and / or similar corpus generated by the startup module;
[0052] The dialogue management system is configured to determine and push the response content based on the intent category identified by the natural language understanding system.
[0053] According to a sixth aspect of the present invention, there is provided an intelligent response method, which is applied to an intelligent response system and includes:
[0054] When the intelligent answering system is cold started, the method for starting the intelligent answering system in the first aspect or any possible implementation of the first aspect is adopted to generate a regular expression and similar corpus corresponding to each predefined intent category in the intelligent answering system;
[0055] Based on the generated regular expression and / or similar corpus, identifying the intent category corresponding to the user question;
[0056] Based on the identified intent category, the response content is determined and pushed.
[0057] The technical solution provided by the present invention brings at least the following beneficial effects:
[0058] During the startup phase of the intelligent answering system, the following operations are performed for each intent category predefined in the intelligent answering system: standard question information of the intent category and keywords in the standard question information are obtained; a word segmentation algorithm is used to segment the standard question information according to parts of speech, and synonym replacement is performed on a word-by-word basis to obtain a replaced corpus; similar corpora corresponding to the intent category are generated based on the replaced corpus, and regular expressions corresponding to the intent category are generated based on the replaced corpus and keywords in the standard question information. In this way, during the startup phase of the intelligent answering system, there is no need to configure regular expressions and similar corpora, and regular expressions and similar corpora corresponding to intent categories can be automatically generated, thereby improving the efficiency of the cold start of the intelligent answering system. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0060] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0061] Figure 1 A schematic diagram of a flow chart of a method for starting an intelligent response system provided by an embodiment of the present invention;
[0062] Figure 2 A schematic diagram of the structure of a starting device for an intelligent response system provided by an embodiment of the present invention;
[0063] Figure 3 A schematic diagram of the structure of an intelligent response system provided by an embodiment of the present invention;
[0064] Figure 4 A flowchart of an intelligent response method provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0065] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0066] See also Figure 1 The embodiment of the present invention provides a method for starting an intelligent response system. The method can be applied to the intelligent response system and may include the following steps:
[0067] For each intent category predefined in the smart answering system, perform the following operations:
[0068] S101, obtaining standard question information of the intent category and keywords in the standard question information;
[0069] For example, the standard question information configured by operations for the intent category "logistics tracking" is "Where is my order?", where the keywords are "order, where is it?", as shown in Table 2 below.
[0070] Table 2
[0071] Intent Category Standard Issue Information Keywords Logistics tracking Where is my order? Where is the order?
[0072] S102, using a word segmentation algorithm to segment the standard question information according to parts of speech, and performing synonym replacement on each word to obtain a replaced corpus;
[0073] In the embodiment of the present invention, the word segmentation algorithm may be Jieba word segmentation. Of course, other word segmentation algorithms may also be used, and the embodiment of the present invention does not limit this.
[0074] For example, the above standard question information "Where is my order?" is segmented according to part of speech using the Jieba word segmentation, as shown in Table 3 below.
[0075] Table 3
[0076] Standard Issue Information Part of Speech I r of uj Order n arrive v where r Got it ul
[0077] In the embodiment of the present invention, a synonym database may be pre-set to define and store synonyms of key words, as shown in Table 4 below.
[0078] Table 4
[0079] vocabulary Part of Speech Examples Synonymous pronouns r I / myself, where / where / where, how / what / how Synonymous particles u Of that, it's done. Synonymous adjectives a Slow / too slow / not fast enough, not good / too bad Synonyms n Invoice / shopping invoice, order / item / order, logistics / logistics distribution Synonymous verbs v Modify / change, cancel / don't want it, arrive / arrive / deliver to .......
[0080] Therefore, by querying the synonym database, we can obtain synonyms for a certain part of speech and use them for synonym replacement. For example, if we input the part of speech "r" and the word "I" and query the synonym database, we get the output data: the synonym "myself".
[0081] In some embodiments, synonym replacement is performed on a word-by-word basis in step S102 to obtain a replaced corpus, including:
[0082] Synonym replacement is performed on word units, and a cross combination of Cartesian products is performed to obtain the replaced corpus.
[0083] For example:
[0084] Original sentence (standard question information): Where is my order?
[0085] Corpus after replacement: Where is my own order, where are my things, where is my order delivered, where does my own things arrive, ...
[0086] S103: Generate similar corpus corresponding to the intent category based on the replaced corpus, and generate a regular expression corresponding to the intent category based on the replaced corpus and keywords in the standard question information.
[0087] In some embodiments, generating similar corpus corresponding to the intent category based on the replaced corpus in step S103 includes:
[0088] generating an alternative corpus based on the replaced corpus;
[0089] For each candidate corpus in the candidate corpus set, calling an existing similarity matching model to perform similarity matching between the candidate corpus and the standard question information;
[0090] If the similarity between the two is higher than a set similarity threshold (eg, 0.6), the candidate corpus is used as the similar corpus corresponding to the intention category and stored in a first preset database (eg, a similar corpus).
[0091] In an embodiment of the present invention, the similarity matching model may be a semantic similarity matching model, such as a DSSM deep semantic matching model.
[0092] In the embodiment of the present invention, a similar matching model is used to screen similar corpora from the candidate corpus set, for example, as shown in Table 5 below.
[0093] Table 5
[0094]
[0095] After the corpus is screened, the screened corpus is stored in the similar corpus as the similar corpus of the intent category "logistics tracking" for later use in user intent classification.
[0096] In some embodiments, in order to increase the sources of candidate corpora, the above-mentioned generation of the candidate corpus based on the replaced corpus includes:
[0097] Using the replaced corpus as an alternative corpus;
[0098] The corpus in the replaced corpus is reorganized into new corpus by adjusting the order of part-of-speech combinations, and added to the candidate corpus.
[0099] In an embodiment of the present invention, multiple part-of-speech combination sets can be pre-set, each part-of-speech combination set includes at least two part-of-speech combinations, and each part-of-speech combination is set with a corresponding matching regular expression. When the corpus in the replaced corpus hits a part-of-speech combination in a part-of-speech combination set, the corpus can be reorganized according to other part-of-speech combination rules in the same part-of-speech combination set to generate a new corpus; for example, as shown in Table 6 below, the corpus "Where is my stuff?" hits the part-of-speech combination "pronoun + noun + verb" in part-of-speech combination set 1, so the corpus can be reorganized according to the part-of-speech combination "verb + pronoun + noun" in part-of-speech combination set 1 to generate a new corpus "Where is my stuff?" For another example, the corpus "I want to modify the invoice information" hits the part-of-speech combination "pronoun + verb + noun" in part-of-speech combination set 2, so the corpus can be reorganized according to the part-of-speech combination "noun + pronoun + verb" in part-of-speech combination set 2 to generate a new corpus "I want to modify the invoice information."
[0100] Table 6
[0101]
[0102]
[0103] After expanding the corpus by adjusting the order of part-of-speech combinations, the expanded corpus is also added to the candidate corpus set for subsequent screening of similar corpora.
[0104] In some embodiments, generating a regular expression corresponding to the intent category based on the replaced corpus and the keywords in the standard question information in step S103 includes:
[0105] generating an alternative corpus based on the replaced corpus and keywords in the standard question information;
[0106] Calling an existing similarity matching model to perform similarity matching between each candidate corpus in the candidate corpus set and the standard question information, screening corpuses with similarities higher than a set similarity threshold, and obtaining a screened corpus set;
[0107] A regular expression corresponding to the intent category is generated based on the filtered corpus and stored in a second preset database (eg, a regular expression library).
[0108] In some embodiments, generating an alternative corpus based on the replaced corpus and keywords in the standard question information includes:
[0109] Using the keywords in the standard question information to filter the corpus in the replaced corpus, to obtain a filtered corpus containing the keywords as a candidate corpus;
[0110] The corpus in the filtered corpus is reorganized into new corpus by adjusting the order of part-of-speech combinations, and is added to the candidate corpus.
[0111] In the embodiment of the present invention, the keywords in the standard question information are used to filter the corpus in the replaced corpus set, for example:
[0112] Original sentence (standard question information): Where is my order?
[0113] Corpus after replacement: Where is my own order, where are my things, where is my order delivered, where does my own things arrive, ...
[0114] Filter the corpus: Where is my order? Where is my order delivered? Where is my order delivered? Where is my order delivered? Where is my order? ...
[0115] It should be noted that the processing method of expanding the corpus by adjusting the order of part-of-speech combinations when generating regular expressions is the same as the processing method of expanding the corpus by adjusting the order of part-of-speech combinations when generating similar corpora, and will not be repeated here.
[0116] For example, the candidate corpus after adjusting the order is: where is my own order, where is my order delivered, where is my own order, where is my own order, where is my order delivered, where is my own order, ...
[0117] In the embodiment of the present invention, the processing method of using the similarity matching model to screen similar corpora from the candidate corpus set when generating regular expressions is the same as the processing method of using the similarity matching model to screen similar corpora from the candidate corpus set when generating similar corpora, and will not be repeated here.
[0118] For example, the filtered corpus: Where is my order delivered, where is my other order delivered, where is my order delivered, where is my other order delivered.
[0119] In some embodiments, generating a regular expression corresponding to the intent category based on the filtered corpus includes:
[0120] Exhaustively enumerate the permutations and combinations of the keywords to obtain a keyword combination set;
[0121] For each keyword combination in the keyword combination set, obtaining a corpus containing the keyword combination from the filtered corpus set according to the keyword arrangement order in the keyword combination to obtain a matching corpus set;
[0122] Generating a regular expression corresponding to the keyword combination based on the matching corpus;
[0123] The regular expressions corresponding to all keyword combinations in the keyword combination set are combined in a logical OR manner to obtain a regular expression corresponding to the intent category.
[0124] In some embodiments, generating a regular expression corresponding to the keyword combination based on the matching corpus includes:
[0125] Using the matching corpus as the corpus to be segmented, and using keywords as segmentation points, segmenting the corpus in the corpus to be segmented into multiple segments to obtain segmented corpora for each segment;
[0126] For each of the segmented corpora, determining whether there is an empty segmented corpus in the segmented corpus;
[0127] If there is an empty segmented corpus, a wildcard character is returned;
[0128] If there is no empty segmented corpus, then calculating the pattern weight of the segmented corpus set, wherein the pattern weight is determined according to the length of a single segmented corpus and the number of segmented corpora in the segmented corpus set;
[0129] Comparing the mode weight with a set mode threshold;
[0130] If the pattern weight is greater than or equal to the pattern threshold, a wildcard is returned;
[0131] If the pattern weight is less than the pattern threshold, determining whether there is a common character string in the segmented corpus;
[0132] If there is no common string, a wildcard character is returned;
[0133] If there is a common string, extract the common string in the segmented corpus as a keyword;
[0134] The segmented corpus is used as the corpus to be segmented, and is returned for further segmentation until no common character string exists in each segmented corpus;
[0135] Generate a regular expression corresponding to the segment of the segmented corpus;
[0136] The regular expressions corresponding to the respective segments are combined with the keywords in the keyword combination to obtain the regular expressions corresponding to the keyword combination.
[0137] For example:
[0138] (1) Exhaust the permutations and combinations of the keyword "where is the order" to obtain a keyword combination set;
[0139] The keyword combination set includes keyword combination 1 "order, where is it" and keyword combination 2 "where is it, order".
[0140] For each keyword combination in the keyword combination set, steps (2) to (11) are executed.
[0141] (2) According to the order of keyword arrangement, find the corpus containing the keyword combination from the filtered corpus to obtain the matching corpus;
[0142] For example, for keyword combination 1 "order, where is it", according to the order of keywords, find the corpus containing keyword combination 1 "order, where is it" from the filtered corpus to obtain the matching corpus;
[0143] Matching corpus: Where is my order, where is my order delivered, where is my order.
[0144] (3) Using the matching corpus as the corpus to be segmented, and using the keywords as the segmentation points, the corpus in the corpus to be segmented is segmented into multiple segments to obtain the segmented corpus of each segment;
[0145] For example, the segmented corpus of the first paragraph: {my, mine, my that}; the segmented corpus of the second paragraph: {, send,}; the segmented corpus of the third paragraph: {,,}.
[0146] For each segmented corpus, perform steps (4) to (10).
[0147] (4) Determine whether there is an empty segmented corpus in the segmented corpus set; if there is an empty segmented corpus, execute step (5); if there is no empty segmented corpus, execute step (6);
[0148] (5) Return wildcards (e.g., .*?);
[0149] (6) calculating a pattern weight of the segmented corpus, wherein the pattern weight is determined based on the length of a single segmented corpus and the number of segmented corpora in the segmented corpus;
[0150] In the embodiment of the present invention, the mode weight can be calculated according to the following formula (1):
[0151]
[0152] Where L(k) is the length of the k+1th segmented corpus in the segmented corpus set, count(A,L(k)) is the number of segmented corpora in the segmented corpus set that have the same length as the k+1th segmented corpus, Len(A) is the number of segmented corpora in the segmented corpus set, and A is the set consisting of the lengths of each segmented corpus in the segmented corpus set, A = {L(0), L(1), ..., L(k), ..., L(n)}.
[0153] For example, for the first segment of the corpus {mine, mine, mine}, L(0)=2, L(1)=2, L(2)=4, count(A,L(0))=2, count(A,L(1))=2, count(A,L(2))=1, Len(A)=3, substituting into the above formula (1), the pattern weight is 0.39.
[0154] (7) Compare the mode weight with a set mode threshold (e.g., 0.8); if the mode weight is greater than or equal to the mode threshold, execute step (5); if the mode weight is less than the mode threshold, execute step (8);
[0155] (8) Determine whether there is a common string in the segmented corpus; if there is no common string, execute step (5); if there is a common string, execute step (9);
[0156] (9) extracting common character strings from the segmented corpus as keywords;
[0157] The segmented corpus is used as the corpus to be segmented, and the process returns to step (3) for further segmentation until there is no more common character string in the segmented corpus.
[0158] (10) generating a regular expression corresponding to the segment of the segmented corpus;
[0159] For example, the segmented corpus of the first paragraph {my, my, my that}, there is no empty segmented corpus in the segmented corpus, calculate the pattern weight of the segmented corpus, the pattern weight is 0.39, which is less than the pattern threshold 0.8, extract the common string "my" in the segmented corpus of the first paragraph {my, my, my that}, use the common string "my" as the keyword, and use the segmented corpus of the first paragraph {my, my, my that} as the corpus to be segmented, return to step (3) and segment again until there is no common string in the segmented corpus, and generate the regular expression corresponding to the segment where the segmented corpus is located as "(.*?)my(.*?)".
[0160] The segmented corpus of the second section is {,send,}. There is an empty segmented corpus in the segmented corpus, and the wildcard ".*?" is returned. Therefore, the regular expression corresponding to the segment where the segmented corpus is located is "(.*?)".
[0161] Similarly, the regular expression corresponding to the segment of the segmented corpus {,,} in the third paragraph is also "(.*?)".
[0162] (11) combining the regular expressions corresponding to each segment with the keywords in the keyword combination to obtain a regular expression corresponding to the keyword combination;
[0163] For example, the regular expression corresponding to keyword combination 1 "where is the order" is "(.*?)where is my (.*?) order (.*?) (.*?)"
[0164] Similarly, by repeating steps (2) to (11), we can obtain the regular expression corresponding to keyword combination 2 "where is it, order" as "(.*?)where is it (.*?)my (.*?)order (.*?)".
[0165] (12) The regular expressions corresponding to all keyword combinations in the keyword combination set are combined by logical OR to obtain the regular expression corresponding to the intent category.
[0166] For example, the regular expression corresponding to keyword combination 1 "order, where is it" is "(.*?)my(.*?)order(.*?)where(.*?)", and the regular expression corresponding to keyword combination 2 "where is it, order" is "(.*?)where(.*?)my(.*?)order(.*?)" are combined through logical OR to obtain the regular expression corresponding to the intent category "logistics tracking" as "((.*?)my(.*?)order(.*?)where(.*?))|((.*?)where(.*?)my(.*?)order(.*?))".
[0167] Based on the same inventive concept, Figure 2 As shown, an embodiment of the present invention further provides a device for starting an intelligent answering system, which includes: an information acquisition module 11, a corpus processing module 12, a similar corpus generation module 13 and a regular expression generation module 14.
[0168] The information acquisition module 11 is configured to acquire, for each intent category predefined in the intelligent answering system, standard question information of the intent category and keywords in the standard question information;
[0169] The corpus processing module 12 is configured to use a word segmentation algorithm to segment the standard question information according to parts of speech, and perform synonym replacement on a word-by-word basis to obtain a replaced corpus set;
[0170] A similar corpus generation module 13 is configured to generate similar corpus corresponding to the intent category based on the replaced corpus set;
[0171] The regular expression generation module 14 is configured to generate a regular expression corresponding to the intention category based on the replaced corpus and the keywords in the standard question information.
[0172] In some embodiments, the corpus processing module 12 is configured to:
[0173] Synonym replacement is performed on word units, and a cross combination of Cartesian products is performed to obtain the replaced corpus.
[0174] In some embodiments, the similar corpus generation module 13 is configured to:
[0175] generating an alternative corpus based on the replaced corpus;
[0176] For each candidate corpus in the candidate corpus set, calling an existing similarity matching model to perform similarity matching between the candidate corpus and the standard question information;
[0177] If the similarity between the two is higher than a set similarity threshold, the candidate corpus is used as the similar corpus corresponding to the intention category and stored in the first preset database.
[0178] In some embodiments, the similar corpus generation module 13 is configured to:
[0179] Using the replaced corpus as an alternative corpus;
[0180] The corpus in the replaced corpus is reorganized into new corpus by adjusting the order of part-of-speech combinations, and added to the candidate corpus.
[0181] In some embodiments, the regular expression generation module 14 is configured to:
[0182] generating an alternative corpus based on the replaced corpus and keywords in the standard question information;
[0183] Calling an existing similarity matching model to perform similarity matching between each candidate corpus in the candidate corpus set and the standard question information, screening corpuses with similarities higher than a set similarity threshold, and obtaining a screened corpus set;
[0184] A regular expression corresponding to the intent category is generated based on the filtered corpus and stored in a second preset database.
[0185] In some embodiments, the regular expression generation module 14 is configured to:
[0186] Using the keywords in the standard question information to filter the corpus in the replaced corpus, to obtain a filtered corpus containing the keywords as a candidate corpus;
[0187] The corpus in the filtered corpus is reorganized into new corpus by adjusting the order of part-of-speech combinations, and is added to the candidate corpus.
[0188] In some embodiments, the regular expression generation module 14 is configured to:
[0189] Exhaustively enumerate the permutations and combinations of the keywords to obtain a keyword combination set;
[0190] For each keyword combination in the keyword combination set, obtaining a corpus containing the keyword combination from the filtered corpus set according to the keyword arrangement order in the keyword combination to obtain a matching corpus set;
[0191] Generating a regular expression corresponding to the keyword combination based on the matching corpus;
[0192] The regular expressions corresponding to all keyword combinations in the keyword combination set are combined in a logical OR manner to obtain a regular expression corresponding to the intent category.
[0193] In some embodiments, the regular expression generation module 14 is configured to:
[0194] Using the matching corpus as the corpus to be segmented, and using keywords as segmentation points, segmenting the corpus in the corpus to be segmented into multiple segments to obtain segmented corpora for each segment;
[0195] For each of the segmented corpora, determining whether there is an empty segmented corpus in the segmented corpus;
[0196] In response to the absence of an empty segmented corpus in the segmented corpus set, calculating a pattern weight of the segmented corpus set, wherein the pattern weight is determined according to the length of a single segmented corpus and the number of segmented corpora in the segmented corpus set;
[0197] Comparing the mode weight with a set mode threshold;
[0198] In response to the pattern weight being less than the pattern threshold, determining whether there is a common character string in the segmented corpus;
[0199] In response to the presence of a common character string in the segmented corpus, extracting the common character string in the segmented corpus as a keyword;
[0200] The segmented corpus is used as the corpus to be segmented, and is returned for further segmentation until no more common character strings exist in the segmented corpus;
[0201] Generate a regular expression corresponding to the segment of the segmented corpus;
[0202] The regular expressions corresponding to the respective segments are combined with the keywords in the keyword combination to obtain the regular expressions corresponding to the keyword combination.
[0203] It should be noted that, in other embodiments, the functions of the information acquisition module 11, the corpus processing module 12 and the similar corpus generation module 13 can be integrated into one module to generate similar corpus corresponding to the intent category, and the functions of the information acquisition module 11, the corpus processing module 12 and the regular expression generation module 14 can be integrated into another module to generate a regular expression corresponding to the intent category.
[0204] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0205] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to the partial description of the method embodiments. The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present invention. A person of ordinary skill in the art can understand and implement the present invention without inventive work.
[0206] Based on the same inventive concept, an embodiment of the present invention further provides a storage medium storing a computer program, which, when executed by a processor, implements the steps of the method for starting the intelligent response system in any possible implementation manner described above.
[0207] Alternatively, the storage medium may be a non-transitory computer-readable storage medium, for example, the non-transitory computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
[0208] Based on the same inventive concept, an embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the method for starting the intelligent response system in any possible implementation manner described above.
[0209] Based on the same inventive concept, see Figure 3 The embodiment of the present invention also provides an intelligent response system, including: a natural language understanding system 21, a dialogue management system 22 and a startup module 23.
[0210] A startup module 23 is configured to, when the intelligent answering system is cold-started, automatically generate a regular expression and similar corpus corresponding to each predefined intent category in the intelligent answering system using the startup method of the intelligent answering system in any of the above embodiments;
[0211] The natural language understanding system 21 is configured to identify the intent category corresponding to the user question based on the regular expression and / or similar corpus generated by the startup module 23;
[0212] The dialogue management system 22 is configured to determine and push the response content based on the intent category identified by the natural language understanding system 21.
[0213] Based on the same inventive concept, see Figure 4 The embodiment of the present invention further provides an intelligent response method, which is applied to an intelligent response system and includes the following steps:
[0214] S201. When the intelligent answering system is cold started, the method for starting the intelligent answering system in any of the above embodiments is used to generate a regular expression and similar corpus corresponding to each predefined intent category in the intelligent answering system.
[0215] S202: Identify the intent category corresponding to the user question based on the generated regular expression and / or similar corpus;
[0216] S203: Based on the identified intent category, determine the response content and push it.
[0217] Embodiments of the subject matter and functional operations described in this specification may be implemented in the following: digital electronic circuits, tangibly embodied computer software or firmware, computer hardware including the structures disclosed in this specification and their structural equivalents, or a combination of one or more of them. Embodiments of the subject matter described in this specification may be implemented as one or more computer programs, i.e., one or more modules of computer program instructions encoded on a tangible, non-transitory program carrier to be executed by a data processing device or to control the operation of the data processing device. Alternatively or additionally, the program instructions may be encoded on an artificially generated propagation signal, such as a machine-generated electrical, optical, or electromagnetic signal, which is generated to encode information and transmit it to a suitable receiver device for execution by the data processing device. The computer storage medium may be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or a combination of one or more of them.
[0218] The processes and logic flows described in this specification can be performed by one or more programmable computers executing one or more computer programs to perform the corresponding functions by operating on input data and generating output. The processes and logic flows can also be performed by, and apparatus can be implemented as, special purpose logic circuitry, such as an FPGA (field programmable gate array) or an ASIC (application-specific integrated circuit).
[0219] Computers suitable for executing computer programs include, for example, general-purpose and / or special-purpose microprocessors, or any other type of central processing unit. Typically, the central processing unit will receive instructions and data from a read-only memory and / or random access memory. The basic components of a computer include a central processing unit for implementing or executing instructions and one or more memory devices for storing instructions and data. Typically, a computer will also include one or more mass storage devices for storing data, such as magnetic disks, magneto-optical disks, or optical disks, or the computer will be operably coupled to such mass storage devices to receive data from them or to transmit data to them, or both. However, a computer does not necessarily have such devices. In addition, a computer can be embedded in another device, such as a mobile phone, a personal digital assistant (PDA), a mobile audio or video player, a game console, a global positioning system (GPS) receiver, or a portable storage device such as a universal serial bus (USB) flash drive, to name a few.
[0220] Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media, and storage devices, including, for example, semiconductor memory devices (e.g., EPROM, EEPROM, and flash memory devices), magnetic disks (e.g., internal hard disks or removable disks), magneto-optical disks, and CD-ROM and DVD-ROM disks. The processor and memory can be supplemented by, or incorporated in, special purpose logic circuitry.
[0221] Although this specification includes many specific implementation details, these should not be interpreted as limiting the scope of any invention or the scope of protection claimed, but are mainly used to describe the features of specific embodiments of specific inventions. Certain features described in multiple embodiments within this specification may also be implemented in combination in a single embodiment. On the other hand, the various features described in a single embodiment may also be implemented separately in multiple embodiments or in any suitable sub-combination. In addition, although features may work in certain combinations as described above and even initially claimed as such, one or more features from the claimed combination may be removed from the combination in some cases, and the claimed combination may point to a sub-combination or a variation of the sub-combination.
[0222] Similarly, although operations are depicted in a particular order in the accompanying drawings, this should not be understood as requiring that these operations be performed in the particular order shown or performed sequentially, or that all illustrated operations be performed to achieve the desired results. In some cases, multitasking and parallel processing may be advantageous. In addition, the separation of various system modules and components in the above-described embodiments should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product, or packaged into multiple software products.
[0223] Thus, specific embodiments of the subject matter have been described. Other embodiments are within the scope of the following claims. In some cases, the actions recited in the claims can be performed in a different order and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the particular order shown or sequential sequence to achieve the desired results. In some implementations, multitasking and parallel processing may be advantageous.
[0224] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.
[0225] The foregoing description is intended only to provide specific embodiments of the present invention, which will enable those skilled in the art to understand and implement the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not intended to be limited to the embodiments shown herein, but is intended to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A method for starting an intelligent response system, characterized in that: The method comprises: For each intent category predefined in the smart answering system, perform the following operations: Obtaining standard question information of the intent category and keywords in the standard question information; Using a word segmentation algorithm, the standard question information is segmented according to parts of speech, and synonym replacement is performed on the word as a unit to obtain a replaced corpus; Generate similar corpus corresponding to the intent category based on the replaced corpus, and generate a regular expression corresponding to the intent category based on the replaced corpus and keywords in the standard question information.
2. The method according to claim 1, characterized in that The synonym replacement is performed on a word-by-word basis to obtain a replaced corpus, including: Synonym replacement is performed on word units, and a cross combination of Cartesian products is performed to obtain the replaced corpus.
3. The method according to claim 1, characterized in that Generating similar corpus corresponding to the intent category based on the replaced corpus set includes: generating an alternative corpus based on the replaced corpus; For each candidate corpus in the candidate corpus set, calling an existing similarity matching model to perform similarity matching between the candidate corpus and the standard question information; If the similarity between the two is higher than a set similarity threshold, the candidate corpus is used as the similar corpus corresponding to the intention category and stored in the first preset database.
4. The method according to claim 3, characterized in that Generating an alternative corpus based on the replaced corpus includes: Using the replaced corpus as an alternative corpus; The corpus in the replaced corpus is reorganized into new corpus by adjusting the order of part-of-speech combinations, and added to the candidate corpus.
5. The method according to claim 1, wherein Generating a regular expression corresponding to the intent category based on the replaced corpus and the keywords in the standard question information includes: generating an alternative corpus based on the replaced corpus and keywords in the standard question information; Calling an existing similarity matching model to perform similarity matching between each candidate corpus in the candidate corpus set and the standard question information, screening corpuses with similarities higher than a set similarity threshold, and obtaining a screened corpus set; A regular expression corresponding to the intent category is generated based on the filtered corpus and stored in a second preset database.
6. The method according to claim 5, characterized in that The generating of the candidate corpus based on the replaced corpus and the keywords in the standard question information includes: Using the keywords in the standard question information to filter the corpus in the replaced corpus, to obtain a filtered corpus containing the keywords as a candidate corpus; The corpus in the filtered corpus is reorganized into new corpus by adjusting the order of part-of-speech combinations, and is added to the candidate corpus.
7. The method according to claim 5, characterized in that Generating a regular expression corresponding to the intent category based on the filtered corpus includes: Exhaustively enumerate the permutations and combinations of the keywords to obtain a keyword combination set; For each keyword combination in the keyword combination set, obtaining a corpus containing the keyword combination from the filtered corpus set according to the keyword arrangement order in the keyword combination to obtain a matching corpus set; Generating a regular expression corresponding to the keyword combination based on the matching corpus; The regular expressions corresponding to all keyword combinations in the keyword combination set are combined in a logical OR manner to obtain a regular expression corresponding to the intent category.
8. The method according to claim 7, characterized in that Generating a regular expression corresponding to the keyword combination based on the matching corpus includes: Using the matching corpus as the corpus to be segmented, and using keywords as segmentation points, segmenting the corpus in the corpus to be segmented into multiple segments to obtain segmented corpora for each segment; For each of the segmented corpora, determining whether there is an empty segmented corpus in the segmented corpus; In response to the absence of an empty segmented corpus in the segmented corpus set, calculating a pattern weight of the segmented corpus set, wherein the pattern weight is determined according to the length of a single segmented corpus and the number of segmented corpora in the segmented corpus set; Comparing the mode weight with a set mode threshold; In response to the pattern weight being less than the pattern threshold, determining whether there is a common character string in the segmented corpus; In response to the existence of a common character string in the segmented corpus, extracting the common character string in the segmented corpus as a keyword; The segmented corpus is used as the corpus to be segmented, and is returned for further segmentation until no more common character strings exist in the segmented corpus; Generate a regular expression corresponding to the segment of the segmented corpus; The regular expressions corresponding to the respective segments are combined with the keywords in the keyword combination to obtain the regular expressions corresponding to the keyword combination.
9. A device for starting an intelligent response system, characterized in that: The device comprises: An information acquisition module is configured to acquire, for each intent category predefined in the intelligent answering system, standard question information of the intent category and keywords in the standard question information; A corpus processing module is configured to use a word segmentation algorithm to segment the standard question information according to parts of speech, and perform synonym replacement on a word-by-word basis to obtain a replaced corpus set; A similar corpus generation module is configured to generate similar corpus corresponding to the intent category based on the replaced corpus set; The regular expression generation module is configured to generate a regular expression corresponding to the intention category based on the replaced corpus and the keywords in the standard question information.
10. A storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
11. An intelligent response system comprising: The natural language understanding system and the dialogue management system are characterized in that the intelligent response system further includes: a startup module configured to, when the intelligent answering system is cold started, use the startup method of the intelligent answering system according to any one of claims 1 to 8 to generate a regular expression and similar corpus corresponding to each predefined intent category in the intelligent answering system; The natural language understanding system is configured to identify the intent category corresponding to the user question based on the regular expression and / or similar corpus generated by the startup module; The dialogue management system is configured to determine and push the response content based on the intent category identified by the natural language understanding system.
12. An intelligent answering method, characterized in that: The intelligent response method is applied to an intelligent response system, and the intelligent response method includes: When the intelligent answering system is cold started, the method for starting the intelligent answering system according to any one of claims 1 to 8 is used to generate a regular expression and similar corpus corresponding to each predefined intent category in the intelligent answering system; Based on the generated regular expression and / or similar corpus, identifying the intent category corresponding to the user question; Based on the identified intent category, the response content is determined and pushed.
Citation Information
Patent Citations
High-accuracy semantic comprehension identification method based on word slot sequence model
CN112149429A