List matching method and device, electronic equipment and storage medium
Through the combination of serial number matching, text matching and natural language understanding, combined with clarification and re-questioning, the problem of inaccurate matching results when users enter idioms or spoken language in intelligent interaction is solved, and more accurate and rich list matching is achieved, improving User experience.
Patent Information
- Application Number
- CN202410982216.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2024-11-12
AI Technical Summary
In intelligent interactive scenarios, when users enter idioms or spoken language, the existing technology cannot return accurate list answers, resulting in inaccurate matching results.
By obtaining the user's text and list content, serial number matching and text matching are performed. If the results are empty, natural language understanding is performed. Otherwise, the user will be prompted to perform secondary selection through clarification and reverse questioning to determine the target matching result.
Improve the accuracy of list matching and the richness of matching results, and improve user friendliness and user experience.
Smart Images

Figure CN118939772A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of information matching, and in particular to a list matching method and device, an electronic device, and a storage medium. Background Art
[0002] Currently, in intelligent interaction scenarios, when users are in multiple rounds of processing, when a list answer is returned and has an associated answer, the answer is relatively simple through simple serial number matching. However, when the user enters some idioms or colloquialisms, an accurate answer cannot be returned.
[0003] In summary, the technical problems existing in the relevant technologies need to be improved. Summary of the invention
[0004] The main purpose of the embodiments of the present application is to propose a list matching method and device, an electronic device and a storage medium, aiming to achieve flexible list matching and improve the accuracy of list matching and the richness of matching results.
[0005] To achieve the above object, an embodiment of the present application provides a list matching method in one aspect, the method comprising the following steps:
[0006] Get user text and list content;
[0007] Performing serial number matching on the user text and the list content to obtain a serial number matching result;
[0008] Performing text matching on the user text and the list content to obtain a text matching result;
[0009] If both the sequence number matching result and the text matching result are empty, natural language understanding is performed to obtain a target matching result;
[0010] If both the serial number matching result and the text matching result are not empty and the serial number matching result is different from the text matching result, prompting the user to make a second selection through a clarifying rhetorical question to obtain a target matching result;
[0011] If one of the sequence number matching result and the text matching result is not empty, the matching result that is not empty is determined as the target matching result.
[0012] In some embodiments, the method further comprises:
[0013] The user text and the list content are preprocessed, and the preprocessing includes word segmentation, sentence segmentation, stop word removal, and keyword extraction operations.
[0014] In some embodiments, performing serial number matching on the user text and the list content to obtain a serial number matching result includes:
[0015] The user text and the list content are matched by sequence number using a regular expression to obtain a sequence number matching result.
[0016] In some embodiments, performing serial number matching on the user text and the list content to obtain a serial number matching result includes:
[0017] The user text and the list content are matched by serial number through an intention recognition model to obtain a serial number matching result.
[0018] In some embodiments, performing serial number matching on the user text and the list content to obtain a serial number matching result includes:
[0019] The user text and the list content are matched by serial number through a preset mapping dictionary to obtain a serial number matching result.
[0020] In some embodiments, the list content includes list options, and performing text matching on the user text and the list content to obtain a text matching result includes:
[0021] Calculate the number of common words and the number of duplicate words between the user text and the list options;
[0022] Calculate the number of common characters between the user text and the list options and the number of duplicate characters;
[0023] Calculate a relevance score based on the number of common words, the number of deduplicated words, the number of common characters, and the number of deduplicated characters;
[0024] If the relevance score exceeds a preset relevance threshold, the list option is determined as a text matching result.
[0025] In some embodiments, the list content includes list options, and performing text matching on the user text and the list content to obtain a text matching result includes:
[0026] Get user history text;
[0027] Using embedding technology, convert the user text into a first vector, convert the user history text into a second vector, and convert the list options into a list vector;
[0028] Taking a weighted average of the first vector and the second vector to obtain a third vector;
[0029] Calculating a first similarity score based on the third vector and the list vector;
[0030] Extracting the first top 3 keywords from the user text and the user history text, and extracting the second top 3 keywords from the list options;
[0031] Using embedding technology to convert the first top 3 keywords into a first keyword vector, and convert the second top 3 keywords into a second keyword vector;
[0032] Calculating a second similarity score based on the first keyword vector and the second keyword vector;
[0033] Taking a weighted average of the first similarity score and the second similarity score to obtain an average similarity score;
[0034] If the average similarity score exceeds a preset similarity threshold, an answer is obtained from a knowledge base according to the list options, and the answer is determined as a text matching result.
[0035] To achieve the above object, another aspect of an embodiment of the present application provides a list matching device, the device comprising:
[0036] Acquisition module, used to obtain user text and list content;
[0037] A serial number matching module, used for performing serial number matching on the user text and the list content to obtain a serial number matching result;
[0038] A text matching module, used for performing text matching between the user text and the list content to obtain a text matching result;
[0039] A result understanding module, used for performing natural language understanding to obtain a target matching result if both the sequence number matching result and the text matching result are empty;
[0040] A secondary selection module, for prompting the user to make a secondary selection through a clarifying rhetorical question to obtain a target matching result if both the serial number matching result and the text matching result are not empty and the serial number matching result is different from the text matching result;
[0041] The target determination module is used to determine the matching result that is not empty as the target matching result if one of the sequence number matching result and the text matching result is not empty.
[0042] To achieve the above-mentioned purpose, another aspect of an embodiment of the present application provides an electronic device, the electronic device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the above-mentioned method when executing the computer program.
[0043] To achieve the above objective, another aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described above is implemented.
[0044] The embodiments of the present application include at least the following beneficial effects: The present application provides a list matching method and device, an electronic device and a storage medium, which obtains user text and list content; performs serial number matching on the user text and the list content to obtain a serial number matching result; performs text matching on the user text and the list content to obtain a text matching result, thereby achieving flexible list matching; if both the serial number matching result and the text matching result are empty, natural language understanding is performed to obtain a target matching result; if both the serial number matching result and the text matching result are not empty and the serial number matching result is different from the text matching result, the user is prompted to make a second selection through clarifying rhetoric to obtain a target matching result, thereby achieving flexible list matching, improving the accuracy of list matching and the richness of matching results, and enhancing user friendliness and user experience; if one of the serial number matching result and the text matching result is not empty, the non-empty matching result is determined as the target matching result. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 is a flowchart of a list matching method provided in an embodiment of the present application;
[0046] Figure 2 yes Figure 1 A flow chart of step S103 in FIG.
[0047] Figure 3 yes Figure 1 Another flow chart of step S103 in ;
[0048] Figure 4 It is a flow chart of intelligent customer service interaction provided by an embodiment of the present application;
[0049] Figure 5 It is a flowchart of the list matching method provided in the embodiment of the present application applied to page element matching in intelligent customer service interaction;
[0050] Figure 6 is a text matching schematic diagram provided in an embodiment of the present application;
[0051] Figure 7 It is a schematic diagram of serial number matching provided in an embodiment of the present application;
[0052] Figure 8 It is a schematic diagram of the model structure provided in the embodiment of the present application;
[0053] Fig. 9 is a flowchart of the miss strategy execution provided by an embodiment of the present application;
[0054] Fig.10 is a schematic diagram of the structure of a list matching device provided in an embodiment of the present application;
[0055] Fig.11 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application. They are only examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the attached claims.
[0057] It is understood that the terms "first", "second", etc. used in this application can be used to describe various concepts in this article, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. For example, without departing from the scope of the embodiment of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein can be interpreted as "at the time of" or "when" or "in response to determination".
[0058] The terms "at least one", "multiple", "each", "any", etc. used in this application, at least one includes one, two or more, multiple includes two or more, each refers to each of the corresponding multiple, and any refers to any one of the multiple.
[0059] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0060] Before describing the embodiments of the present application in detail, some nouns and terms involved in the embodiments of the present application are first described. The nouns and terms involved in the embodiments of the present application are subject to the following explanations.
[0061] 1) Natural Language Understanding (NLU), a branch of Natural Language Processing (NLP), involves computer programs understanding, interpreting, and generating the intent and meaning of human language. The goal of NLU is to enable computers to understand the meaning, context, and sentiment of human language so that they can respond in a way that humans can understand.
[0062] Currently, in intelligent interaction scenarios, when users are in multiple rounds of processing, when a list answer is returned and has an associated answer, the answer is relatively simple through simple serial number matching. However, when the user enters some idioms or colloquialisms, an accurate answer cannot be returned.
[0063] In summary, the technical problems existing in the relevant technologies need to be improved.
[0064] In view of this, a list matching method, apparatus, device and medium are provided in an embodiment of the present application. The scheme obtains user text and list content; performs serial number matching on the user text and the list content to obtain a serial number matching result; performs text matching on the user text and the list content to obtain a text matching result, thereby achieving flexible list matching; if both the serial number matching result and the text matching result are empty, natural language understanding is performed to obtain a target matching result; if both the serial number matching result and the text matching result are not empty and the serial number matching result is different from the text matching result, the user is prompted to make a second selection through clarifying rhetoric to obtain a target matching result, thereby achieving flexible list matching, improving the accuracy of list matching and the richness of matching results, and enhancing user friendliness and user experience; if one of the serial number matching result and the text matching result is not empty, the non-empty matching result is determined as the target matching result.
[0065] The list matching method provided in the embodiment of the present application relates to the field of information matching technology. The list matching method provided in the embodiment of the present application can be applied to a terminal, can also be applied to a server, and can also be software running in a terminal or a server. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and a car terminal, etc., but is not limited to this; the server side can be configured as an independent physical server, or it can be configured as a server cluster or distributed system composed of multiple physical servers, and can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server can also be a node server in a blockchain network; the software can be an application that implements the list matching method, etc., but is not limited to the above forms.
[0066] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0067] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.
[0068] Figure 1 is an optional flowchart of the list matching method provided in the embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S106.
[0069] Step S101, obtaining user text and list content;
[0070] Specifically, the user text includes the text of the user's current conversation, and the list content includes the summary answer sent by the customer service.
[0071] In some embodiments, the user first inputs a question into the intelligent customer service system, which returns a list summary answer (ie, list content), and then obtains the text input again by the user (ie, user text).
[0072] Furthermore, the user text and list content are preprocessed, and the preprocessing includes word segmentation, sentence segmentation, stop word removal, and keyword extraction operations.
[0073] In this embodiment, user text and list content are obtained and preprocessed to prepare for subsequent sequence number matching and text matching.
[0074] Step S102, performing serial number matching on the user text and the list content to obtain a serial number matching result;
[0075] Specifically, the serial number matching includes at least one of regular expression-based matching, model-based matching and rule-based matching. The rule includes a preset mapping dictionary.
[0076] Optionally, a regular expression is used to perform sequence number matching on the user text and the list content to obtain a first sequence number matching result.
[0077] Optionally, the user text and the list content are matched by serial number through the intent recognition model to obtain a second serial number matching result.
[0078] Optionally, a preset mapping dictionary is used to perform sequence number matching on the user text and the list content to obtain a third sequence number matching result.
[0079] It should be noted that if only one of the first sequence number matching result, the second sequence number matching result and the third sequence number matching result is not empty, then the result is determined as the sequence number matching result; if the first sequence number matching result, the second sequence number matching result and the third sequence number matching result are all empty, then the sequence number matching result is empty.
[0080] Furthermore, when at least two of the first serial number matching result, the second serial number matching result and the third serial number matching result are not empty, the result calibration is performed. If the results are the same, the result is determined as the serial number matching result. If the results are different, the result is clarified again to obtain the serial number matching result.
[0081] It can be understood that if the serial number matching includes only one of regular expression-based matching, model-based matching and rule-based matching, the matching result is directly determined as the serial number matching result.
[0082] In this embodiment, serial number matching is performed on the user text and the list content to obtain a serial number matching result, which is conducive to quickly locating the list elements that the user is interested in and improving the efficiency and accuracy of responding to users.
[0083] Step S103, performing text matching on the user text and the list content to obtain a text matching result;
[0084] Specifically, the text matching includes at least one of rule-based matching and vector-based matching, the list content includes list options, and the rule includes a relevance score calculation formula. The relevance score calculation formula is as follows:
[0085] Score = number of identical words / number of all words after deduplication*50%+number of identical characters / number of all characters after deduplication*50%
[0086] Among them, Score is the relevance score, the number of identical words is the number of common words, the number of all words after deduplication is the number of deduplicated words, the number of identical characters is the number of common characters, and the number of all characters after deduplication is the number of deduplicated characters.
[0087] The present application does not specifically limit the preset relevance threshold and the preset similarity threshold, and they can be flexibly selected in combination with actual matching needs. For example, the preset relevance threshold and the preset similarity threshold can be determined by relevant personnel or automatically determined by the system.
[0088] It should be noted that the sequence number matching and text matching can be executed in parallel or one after the other.
[0089] It can be understood that the list content includes at least one list option.
[0090] Optionally, the number of common words and the number of duplicate words between the user text and each list option are calculated; the number of common characters and the number of duplicate characters between the user text and the list options are calculated; a relevance score is calculated based on the number of common words, the number of duplicate words, the number of common characters and the number of duplicate characters; if the relevance score exceeds a preset relevance threshold, the list option is determined as the first text matching result.
[0091] Optionally, obtain user history text; use embedding technology to convert the user text into a first vector, convert the user history text into a second vector, and convert all list options into list vectors; perform weighted average of the first vector and the second vector to obtain a third vector; calculate a first similarity score based on the third vector and the list vector; extract the first top3 keywords from the user text and the user history text, and extract the second top3 keywords from the list options; use embedding technology to convert the first top3 keywords into a first keyword vector, and convert the second top3 keywords into a second keyword vector; calculate a second similarity score based on the first keyword vector and the second keyword vector; perform weighted average of the first similarity score and the second similarity score to obtain an average similarity score; if the average similarity score exceeds a preset similarity threshold, obtain an answer from the knowledge base based on the list options, and determine the answer as the second text matching result.
[0092] It should be noted that if only one of the first text matching result and the second text matching result is not empty, the result is determined as the text matching result; if the first text matching result and the second text matching result are the same, the text matching result is empty.
[0093] Furthermore, when both the first text matching result and the second text matching result are not empty, the result calibration is performed. If the results are the same, the result is determined as the text matching result. If the results are different, the result is clarified for a second time to obtain the text matching result.
[0094] It is understandable that if the serial number matching includes only one of regular expression-based matching, model-based matching and rule-based matching, the matching result is directly determined as a text matching result.
[0095] In this embodiment, text matching is performed on user text and list content to obtain text matching results, thereby improving the ability to understand user intent and achieving more accurate list matching, which is conducive to improving the intelligence of list matching and improving user experience and enhancing user satisfaction.
[0096] Step S104: if both the sequence number matching result and the text matching result are empty, natural language understanding is performed to obtain the target matching result;
[0097] Specifically, the target matching result includes the hit list elements (ie, list options).
[0098] Optionally, the user text and the list content are recalled and matched through the vector library to obtain a matching score. If the matching score is greater than a preset score threshold, the corresponding answer is directly extracted from the knowledge base to obtain a target matching result. For example, the preset score threshold may be 0.9.
[0099] In some embodiments, natural language understanding is performed on user text and list content, and corresponding answers are extracted from the knowledge base to obtain target matching results.
[0100] In this embodiment, if both the serial number matching result and the text matching result are empty, natural language understanding is performed to obtain the target matching result, thereby solving the situation where text matching and serial number matching cannot provide satisfactory results, improving the robustness and adaptability of list matching, and improving the intelligence level of list matching.
[0101] Step S105, if both the serial number matching result and the text matching result are not empty and the serial number matching result is different from the text matching result, prompting the user to make a second selection through a clarifying rhetorical question to obtain a target matching result;
[0102] In some embodiments, natural language generation (NLG) technology is used to generate questions based on the generated serial number matching results and text matching results, and the user is prompted to make a secondary selection through the questions to obtain the target matching results, and the answers corresponding to the target matching results are extracted from the knowledge base and returned to the user.
[0103] It is understandable that if the user does not make a choice for three consecutive rounds and obtains a target matching result, the current session round state is directly exited.
[0104] In this embodiment, if both the serial number matching result and the text matching result are not empty and the serial number matching result is different from the text matching result, the user is prompted to make a second selection through a clarifying rhetorical question to obtain the target matching result, thereby achieving flexible list matching, improving the accuracy of list matching and the richness of matching results, and helping to improve user satisfaction. Among them, the clarifying rhetorical question is used to guide the user to further clarify his previous choice. For example, the clarifying rhetorical question can be used in the form of "Are you considering function A or function B?" or "Do you want to choose function A or function B?"
[0105] Step S106: If one of the sequence number matching result and the text matching result is not empty, the matching result that is not empty is determined as the target matching result.
[0106] It can be understood that if the text matching result is not empty, the text matching result is determined as the target matching result; if the sequence number matching result is not empty, the sequence number matching result is determined as the target matching result.
[0107] Furthermore, the answer corresponding to the target matching result is extracted from the knowledge base and returned to the user.
[0108] In this embodiment, if one of the sequence number matching result and the text matching result is not empty, the matching result that is not empty is determined as the target matching result, thereby improving the response speed and performance.
[0109] It can be understood that step S104, step S105 and step S106 are parallel steps, and one of step S104, step S105 and step S106 should be selected to be executed when applied.
[0110] Steps S101 to S106 shown in the embodiment of the present application are performed by obtaining user text and list content; performing serial number matching on the user text and list content to obtain a serial number matching result; performing text matching on the user text and list content to obtain a text matching result, thereby achieving flexible list matching; if both the serial number matching result and the text matching result are empty, performing natural language understanding to obtain a target matching result; if both the serial number matching result and the text matching result are not empty and the serial number matching result is different from the text matching result, prompting the user to make a secondary selection through clarifying rhetoric to obtain a target matching result, thereby achieving flexible list matching, improving the accuracy of list matching and the richness of matching results, and enhancing user friendliness and user experience; if one of the serial number matching result and the text matching result is not empty, the non-empty matching result is determined as the target matching result.
[0111] See also Figure 2In some embodiments, step S103 may include but is not limited to steps S201 to S204:
[0112] Step S201, calculating the number of common words and the number of duplicate words between the user text and the list options.
[0113] In step S201 of some embodiments, the words in the user text and the list options are segmented, and each word in the user text is compared to see whether it appears in the list options, and the number of common words is counted.
[0114] Optionally, all words in the user text and list options are combined into a set, and duplicate items are automatically removed from the set. The size of the set can be calculated to obtain the number of de-duplicated words.
[0115] Step S202, calculating the number of common characters and the number of duplicate characters between the user text and the list options.
[0116] In step S202 of some embodiments, each word in the user text and the list options is split into single characters, and the number of single characters that appear in both the user text and the list options is counted to obtain the number of common characters.
[0117] Optionally, after merging the user text and the list options, repeated single characters are removed to obtain the number of remaining different characters (ie, the number of deduplicated characters).
[0118] Step S203, calculating a relevance score according to the number of common words, the number of de-duplicate words, the number of common characters and the number of de-duplicate characters.
[0119] In step S203 of some embodiments, the relevance score is calculated according to the number of common words, the number of deduplicated words, the number of common characters and the number of deduplicated characters by using a relevance score calculation formula. The relevance score calculation formula is as follows:
[0120] Score = number of identical words / number of all words after deduplication*50%+number of identical characters / number of all characters after deduplication*50%
[0121] Among them, Score is the relevance score, the number of identical words is the number of common words, the number of all words after deduplication is the number of deduplicated words, the number of identical characters is the number of common characters, and the number of all characters after deduplication is the number of deduplicated characters.
[0122] Step S204: if the relevance score exceeds a preset relevance threshold, the list option is determined as a text matching result.
[0123] Exemplarily, the preset relevance threshold is 0.8. If the relevance score is greater than 0.8, the list option is determined as a text matching result.
[0124] See also Figure 3 In some embodiments, step S103 may include but is not limited to steps S301 to S309:
[0125] Step S301, obtaining user history text.
[0126] Specifically, the user history text includes the user's last round of text, and the user's last round of text is related to the list data (ie, the list content).
[0127] Step S302: using embedding technology to convert user text into a first vector, convert user history text into a second vector, and convert list options into a list vector.
[0128] Optionally, a pre-trained word embedding model (such as Word2Vec, G loVe, BERT) is used to convert user text, user history text and list options into a first vector, a second vector and a list vector respectively.
[0129] In this embodiment, embedding technology is used to convert user text into a first vector, user history text into a second vector, and list options into a list vector, which can quantify the semantic information of the text and make subsequent similarity calculations more accurate and effective.
[0130] Step S303: perform weighted averaging of the first vector and the second vector to obtain a third vector.
[0131] In some embodiments, the first vector and the second vector are weighted averaged according to preset vector weights to obtain a comprehensive third vector.
[0132] Step S304: Calculate a first similarity score according to the third vector and the list vector.
[0133] Optionally, a first similarity score between the third vector and the list vector is calculated using cosine similarity.
[0134] Step S305: extract the first top 3 keywords from the user text and the user history text, and extract the second top 3 keywords from the list options.
[0135] Optionally, a text processing technology (such as TF-IDF, TextRank) is used to extract the first top 3 keywords from the user text and the user history text, and the second top 3 keywords are extracted from the list options.
[0136] Step S306: Use embedding technology to convert the first top 3 keywords into a first keyword vector, and convert the second top 3 keywords into a second keyword vector.
[0137] In some embodiments, a pre-trained word embedding model (such as Word2Vec, GloVe, BERT) is used to convert the first top3 keywords into a first keyword vector, and the second top3 keywords are converted into a second keyword vector.
[0138] Step S307: Calculate a second similarity score according to the first keyword vector and the second keyword vector.
[0139] Optionally, a similarity measurement method is used to calculate a second similarity score between the first keyword vector and the second keyword vector.
[0140] Step S308: perform weighted averaging of the first similarity score and the second similarity score to obtain an average similarity score.
[0141] Optionally, the first similarity score and the second similarity score are weighted averaged according to a preset similarity weight.
[0142] Step S309: if the average similarity score exceeds a preset similarity threshold, an answer is obtained from the knowledge base according to the list options, and the answer is determined as a text matching result.
[0143] For example, the preset similarity threshold is 0.98, if the average similarity score is greater than 0.98, it is considered extremely relevant, the knowledge base id corresponding to the list number is returned, the answer is extracted according to the knowledge base id, and the answer is determined as a text matching result and returned to the user. The list option includes the list number.
[0144] In some embodiments, the list matching method can be applied to intelligent customer service interaction. The intelligent customer service interaction flow chart is as follows: Figure 4 As shown, Figure 4 The method may include but is not limited to the following steps.
[0145] Step 1: The user inputs text data through the front end and transmits it to the back end central control module.
[0146] Step 2: Perform preprocessing such as semantic coherence, semantic error correction, and word segmentation through the text preprocessing module.
[0147] Step 3: Identify the user's specific intent, slot, and other information through the NLU module.
[0148] Step 4: Extract the corresponding answer from the knowledge base based on the results of NLU recognition.
[0149] Step 5: Package the text answers, such as cards, converting to TTS, etc.
[0150] Figure 5is a flowchart of applying the list matching method provided in an embodiment of the present application to page element matching in intelligent customer service interaction. Figure 5 The method may include but is not limited to the following steps.
[0151] Step 1: The user inputs a query and performs text preprocessing on the query.
[0152] The query (i.e. user text) is preprocessed. The preprocessing includes word segmentation, sentence segmentation, stop word removal, and keyword extraction.
[0153] Step 2, determine whether there is a conversation list, if so, execute step 3, otherwise execute step 6.
[0154] Among them, it is determined whether there is a previous round of dialogue. If so, the answer of the previous round is cached in redis and step 3 is executed, otherwise step 6 is executed.
[0155] Step 3: Identify page elements.
[0156] Furthermore, the sequence number matching scheme and the text matching scheme are executed concurrently.
[0157] Step 4: Perform content identification.
[0158] Specifically, content identification is text matching.
[0159] For example, the text matching diagram is as follows: Figure 6 As shown. Among them, text matching includes the following two methods:
[0160] 1. Rule-based matching logic:
[0161] a) First determine whether the list answer (i.e., the list content) contains the user text. If so, the relationship is hit; otherwise, proceed to step b).
[0162] b) Perform word segmentation and character segmentation on the original query and list content respectively.
[0163] c) Calculate the relevance between the original query and each list. The calculation formula is as follows:
[0164] 1) Calculate the number of common words between the query and the list, as well as the number of all words (excluding duplicates);
[0165] 2) Calculate the number of common characters between query and list and the number of all characters (excluding duplicates);
[0166] 3) Score = number of identical words / number of all words after deduplication*50% + number of identical characters / number of all characters after deduplication*50%
[0167] 4) Get the relevance score between the query and the list.
[0168] d) If the correlation is greater than 0.8, it is considered a match.
[0169] 2. Vector matching logic based on improved weights:
[0170] a) Due to the large gap between the query and the list, it is difficult for the vector dimension to have a similar distance. For example, if the user query is: I want to check the 159 package, the list is: the 159 package includes 20 GB of nationwide traffic and 100 minutes of nationwide call charges.
[0171] b) As it is difficult to obtain the adaptation result through vector representation, the matching logic proposed in this paper is as follows:
[0172] 1) Combine the user's previous query (i.e. the user's historical text) + this query (because the previous query will be relevant to the list data).
[0173] 2) Calculate the similarity between the embedding result obtained from the previous query and the embedding result obtained from the current query and the embedding result obtained from the list item.
[0174] 3) At the same time, extract the top 3 keywords from the previous query + the current query, and calculate the similarity by taking the weighted average of the keyword embedding and the weighted embedding result of the top 3 keywords extracted from the list items (because questions and answers may have similar keywords, such as packages).
[0175] 4) Finally, the scores calculated in the above two steps are weighted and averaged.
[0176] c) If the final result is greater than 0.98, it is considered to be extremely relevant, and the knowledge base ID corresponding to the list number is returned.
[0177] d) Extract the answer based on the knowledge base ID and return it to the user.
[0178] Step 5: Determine the serial number.
[0179] Specifically, sequence number identification is sequence number matching.
[0180] For example, the sequence number matching diagram is as follows: Figure 7 As shown. Among them, the sequence number matching includes the following three methods:
[0181] 1. Perform serial number matching based on regular expressions to identify pure numeric problems, such as 1, 2, 3, etc. The matching rule is: (-)+|(\\d).
[0182] 2. Model-based recognition method:
[0183] a) The defined intent types are as follows:
[0184] i.g_select (select the number), used to determine whether the user selects a list element. If yes, the slot is identified to determine the number.
[0185] ii.g_confi rm (confirmation), used to confirm the user's clarification questions. For example, if the user enters "the first and the second" in the current round, the clarification question will be asked to the user to make a choice;
[0186] iii.g_next (next page), used for page turning instructions in super long lists;
[0187] iv.g_previous (previous page), used to return to the previous page;
[0188] v.g_exit (exit), user exit command;
[0189] vi.g_none (neither) is used for normal NLU understanding, indicating that the user does not want to perform multiple rounds or list recognition.
[0190] b) Slot recognition, if g_se l ect is hit, then the numbers in the text are recognized and the final combination is returned as g_se lect#number.
[0191] c) Considering the performance issue, the model is trained using text-cnn.
[0192] For example, the model structure diagram is as follows: Figure 8 As shown, the model is a convolutional neural network, red represents the convolution layer, and yellow represents the pooling layer.
[0193] 3. Identification method based on rules (i.e. preset mapping dictionary):
[0194] a) Data standardization: convert each entry in the original data list into a unified format, such as converting them all into digital form. For example, "the first" and "the first item" can both be converted into the number 1.
[0195] b) Create a mapping dictionary that maps natural language expressions (such as: first) to corresponding numeric indices.
[0196] c) Parsing user input:
[0197] i. First, determine the number. If the user input is a number, it will be directly used as an index for search.
[0198] ii. If it is a non-numeric string and its length is less than 5, the word list is searched directly and a match is returned.
[0199] iii. Otherwise, perform word segmentation and recognition on the user text, remove useless stop words from the segmentation results, and customize the stop word list.
[0200] i v. If the number of words after filtering is greater than 1, it means that the semantics is complex and no match is performed.
[0201] v. If the number of words is 1, the result is compared with the user-defined vocabulary again, and if a match is found, it is returned.
[0202] It is understandable that if the user has more than two methods that have results, the results need to be calibrated. If the results are the same, they will be returned. If they are different, they will be clarified again. If only one method has a result, it will be returned directly; if there is no result, other matching strategies will be relied on.
[0203] Step 6: NLU result understanding.
[0204] Among them, normal NLU result understanding is performed.
[0205] Step 7: Extract the answer.
[0206] Directly extract the answer from the knowledge base based on the hit answer and return it.
[0207] Step 8: Process the answer and return it to the user.
[0208] In some embodiments, when the list matching method is applied to page element matching, it also includes a miss situation. The miss strategy execution flow chart is as follows: Fig. 9 As shown, Fig. 9 The method may include but is not limited to the following steps.
[0209] Step 1: Perform multiple rounds of element matching to determine whether there is a hit. If there is a hit, execute step 5; otherwise, execute step 2.
[0210] Step 2: If there is no hit, perform knowledge point matching based on the vector library.
[0211] Among them, the missed element is equivalent to the sequence number matching result and the text matching result being empty.
[0212] Step 3: If the knowledge point matching fails, the user is prompted to select from the existing elements.
[0213] Step 4: If the knowledge point is matched successfully, the knowledge base id corresponding to the list number is returned, and the answer is extracted based on the knowledge base id and returned to the user.
[0214] Step 5: If the answer is correct, multiple rounds of answers are returned.
[0215] See also Fig. 9 The embodiment of the present application further provides a list matching device, which can implement the above-mentioned list matching method, and the device includes:
[0216] Acquisition module 1001, used to acquire user text and list content;
[0217] The serial number matching module 1002 is used to perform serial number matching on the user text and the list content to obtain a serial number matching result;
[0218] The text matching module 1003 is used to perform text matching on the user text and the list content to obtain a text matching result;
[0219] The result understanding module 1004 is used to perform natural language understanding to obtain a target matching result if both the sequence number matching result and the text matching result are empty;
[0220] A secondary selection module 1005 is used to prompt the user to make a secondary selection through a clarifying rhetorical question to obtain a target matching result if both the serial number matching result and the text matching result are not empty and the serial number matching result is different from the text matching result;
[0221] The target determination module 1006 is used to determine the matching result that is not empty as the target matching result if one of the sequence number matching result and the text matching result is not empty.
[0222] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0223] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above list matching method when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.
[0224] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0225] See also Fig.11 , Fig.11 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0226] The processor 1101 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0227] The memory 1102 may be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1102 may store an operating system and other application programs. When the technical solution provided in the embodiments of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1102, and the processor 1101 calls and executes the list matching method of the embodiments of this application;
[0228] Input / output interface 1103, used to implement information input and output;
[0229] The communication interface 1104 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WI FI, Bluetooth, etc.);
[0230] A bus 1105 that transmits information between various components of the device (e.g., the processor 1101, the memory 1102, the input / output interface 1103, and the communication interface 1104);
[0231] The processor 1101 , the memory 1102 , the input / output interface 1103 and the communication interface 1104 are connected to each other in communication within the device via the bus 1105 .
[0232] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned list matching method is implemented.
[0233] It can be understood that the contents of the above method embodiments are all applicable to the present storage medium embodiments, the functions specifically implemented by the present storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0234] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0235] The list matching method, list matching device, electronic device and storage medium provided in the embodiments of the present application obtain user text and list content; perform serial number matching on the user text and the list content to obtain a serial number matching result; perform text matching on the user text and the list content to obtain a text matching result, thereby achieving flexible list matching; if both the serial number matching result and the text matching result are empty, perform natural language understanding to obtain a target matching result; if both the serial number matching result and the text matching result are not empty and the serial number matching result is different from the text matching result, prompt the user to make a second selection through clarifying rhetoric to obtain a target matching result, thereby achieving flexible list matching, improving the accuracy of list matching and the richness of matching results, and enhancing user friendliness and user experience; if one of the serial number matching result and the text matching result is not empty, the non-empty matching result is determined as the target matching result.
[0236] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0237] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0238] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0239] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0240] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0241] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0242] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0243] The units described above 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 on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0244] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0245] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0246] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A list matching method, characterized in that: The method comprises the following steps: Get user text and list content; Performing serial number matching on the user text and the list content to obtain a serial number matching result; Performing text matching on the user text and the list content to obtain a text matching result; If both the sequence number matching result and the text matching result are empty, natural language understanding is performed to obtain a target matching result; If both the serial number matching result and the text matching result are not empty and the serial number matching result is different from the text matching result, prompting the user to make a second selection through a clarifying rhetorical question to obtain a target matching result; If one of the sequence number matching result and the text matching result is not empty, the matching result that is not empty is determined as the target matching result.
2. The method according to claim 1, characterized in that The method further comprises: The user text and the list content are preprocessed, and the preprocessing includes word segmentation, sentence segmentation, stop word removal, and keyword extraction operations.
3. The method according to claim 1, characterized in that: The performing sequence number matching on the user text and the list content to obtain a sequence number matching result includes: The user text and the list content are matched by sequence number using a regular expression to obtain a sequence number matching result.
4. The method according to claim 1, characterized in that The performing sequence number matching on the user text and the list content to obtain a sequence number matching result includes: The user text and the list content are matched by serial number through an intention recognition model to obtain a serial number matching result.
5. The method according to claim 1, characterized in that The performing sequence number matching on the user text and the list content to obtain a sequence number matching result includes: The user text and the list content are matched by serial number through a preset mapping dictionary to obtain a serial number matching result.
6. The method according to claim 1, characterized in that The list content includes list options, and the text matching between the user text and the list content is performed to obtain a text matching result, including: Calculate the number of common words and the number of duplicate words between the user text and the list options; Calculate the number of common characters between the user text and the list options and the number of duplicate characters; Calculate a relevance score based on the number of common words, the number of deduplicated words, the number of common characters, and the number of deduplicated characters; If the relevance score exceeds a preset relevance threshold, the list option is determined as a text matching result.
7. The method according to claim 1, characterized in that The list content includes list options, and the text matching between the user text and the list content is performed to obtain a text matching result, including: Get user history text; Using embedding technology, convert the user text into a first vector, convert the user history text into a second vector, and convert the list options into a list vector; Taking a weighted average of the first vector and the second vector to obtain a third vector; Calculating a first similarity score based on the third vector and the list vector; Extracting the first top 3 keywords from the user text and the user history text, and extracting the second top 3 keywords from the list options; Using embedding technology to convert the first top 3 keywords into a first keyword vector, and convert the second top 3 keywords into a second keyword vector; Calculating a second similarity score based on the first keyword vector and the second keyword vector; Taking a weighted average of the first similarity score and the second similarity score to obtain an average similarity score; If the average similarity score exceeds a preset similarity threshold, an answer is obtained from a knowledge base according to the list options, and the answer is determined as a text matching result.
8. A list matching device, characterized in that: The device comprises: Acquisition module, used to obtain user text and list content; A serial number matching module, used for performing serial number matching on the user text and the list content to obtain a serial number matching result; A text matching module, used for performing text matching between the user text and the list content to obtain a text matching result; A result understanding module, used for performing natural language understanding to obtain a target matching result if both the sequence number matching result and the text matching result are empty; A secondary selection module, for prompting the user to make a secondary selection through a clarifying rhetorical question to obtain a target matching result if both the serial number matching result and the text matching result are not empty and the serial number matching result is different from the text matching result; The target determination module is used to determine the matching result that is not empty as the target matching result if one of the sequence number matching result and the text matching result is not empty.
9. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
