Text matching methods, devices, storage media and electronic devices
By performing feature cross-processing on the input text and candidate question and answer texts, and combining user interaction information and question structure information, a comprehensive vector representation is generated, which solves the problem of low accuracy in existing text matching methods and improves the accuracy of text matching and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-02
- Publication Date
- 2026-03-10
AI Technical Summary
Existing text matching methods only perform matching at the text level, resulting in low accuracy of matching results, which affects the accuracy of answer text and user experience.
By performing feature cross-processing on the input text and candidate question and answer texts, and combining user interaction information and question structure information, a comprehensive vector representation is generated to determine the matching result.
It improves the accuracy of text matching, enhances the matching results in the current environment, and improves the user experience.
Smart Images

Figure CN114548314B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present disclosure relate to the field of computer technology, and more particularly, to a text matching method, a text matching apparatus, a computer readable storage medium and an electronic device. BACKGROUND
[0002] This section is intended to provide background information to facilitate an understanding of embodiments of the disclosure as set forth in the claims. The description herein does not constitute admission of prior art.
[0003] Text matching technology is a technology that realizes text matching in the form of text similarity and text relevance calculation, and is widely used in intelligent question answering, knowledge retrieval, search engines, language learning applications, information flow recommendation and other fields. In related technologies, the user input text and the candidate question text are parsed, matched and sorted at the text level to display the answer text corresponding to the matching result. SUMMARY
[0004] In this context, embodiments of the present disclosure aim to provide a text matching method, a text matching apparatus, a computer readable storage medium and an electronic device.
[0005] According to a first aspect of embodiments of the present disclosure, a text matching method is provided, comprising: performing feature cross processing on input text of a user and candidate question text corresponding to the input text to obtain a question cross vector; performing feature cross processing on the input text and answer text of the candidate question text to obtain an answer cross vector; performing feature vector conversion on user interaction information of the user to obtain a first vector representation, and performing feature vector conversion on question structured information of the candidate question text to obtain a second vector representation; performing fusion processing on the question cross vector, the answer cross vector, the first vector representation and the second vector representation corresponding to the same candidate question text to obtain a target vector of each candidate question text, and determining a matching result of the input text from the candidate question text based on the target vector.
[0006] According to a second aspect of the embodiments of the present disclosure, a text matching device is provided, comprising: a first feature cross processing module configured to perform feature cross processing on input text of a user and candidate question text corresponding to the input text to obtain a question cross vector; a second feature cross processing module configured to perform feature cross processing on the input text and answer text of the candidate question text to obtain an answer cross vector; a vector conversion module configured to convert user interaction information of the user into a first vector representation and convert question structured information of the candidate question text into a second vector representation; and a text matching module configured to fuse the question cross vector, the answer cross vector, the first vector representation and the second vector representation corresponding to the same candidate question text to obtain a target vector of each candidate question text, and determine a matching result of the input text from the candidate question text based on the target vector.
[0007] According to a third aspect of the embodiments of the present disclosure, a computer readable storage medium is provided, which stores a computer program, and the computer program is executed by a processor to implement any of the above text matching methods.
[0008] According to a fourth aspect of the embodiments of the present disclosure, an electronic device is provided, comprising: a processor; and a memory configured to store executable instructions of the processor; wherein the processor is configured to execute any of the above text matching methods by executing the executable instructions.
[0009] According to the text matching method, the text matching device, the computer readable storage medium and the electronic device of the embodiments of the present disclosure, on the one hand, the input text is cross-processed with the candidate question text and the answer text, so that the feature correlation between the input text, the candidate question text and the answer text is fully utilized in the text matching process, and the expression accuracy of the matching result at the text level is improved; on the other hand, the stereotyped mode of text matching is broken, and the user interaction information and the question structured information of the candidate question text are introduced in the text matching process, not only considering various interaction behaviors generated before and during the text matching of the user, but also introducing the organization structure of the question, improving the matching degree of the matching result in the current matching environment, and further realizing more rich text matching; on the other hand, the question cross vector and the answer cross vector at the text level are combined with the first vector representation and the second vector representation at the current matching environment level, the utilization of various effective matching information in the text matching is expanded, the accuracy of the text matching is improved, and the user experience of the related product using the text matching method of the embodiments of the present disclosure is further improved. BRIEF DESCRIPTION OF DRAWINGS
[0010] The above and other objects, features, and advantages of this disclosure will become readily apparent from the following detailed description of exemplary embodiments, taken in conjunction with the accompanying drawings. Several embodiments of this disclosure are illustrated in the drawings by way of example and not limitation, in which:
[0011] Figure 1 A flowchart of a text matching method according to an embodiment of the present disclosure is shown;
[0012] Figure 2 A schematic diagram illustrating the organization of questions in a question-and-answer knowledge base according to an embodiment of the present disclosure is shown;
[0013] Figure 3 A flowchart illustrating feature cross-processing of an input text vector and a candidate question vector according to an embodiment of the present disclosure is shown;
[0014] Figure 4 A flowchart illustrating the acquisition of a first vector representation and a second vector representation according to an embodiment of the present disclosure is shown;
[0015] Figure 5 A schematic diagram of a tag category tree structure according to an embodiment of the present disclosure is shown;
[0016] Figure 6 A flowchart illustrating the acquisition of the second sub-vector according to an embodiment of the present disclosure is shown;
[0017] Figure 7 A schematic diagram of a text matching model according to an embodiment of the present disclosure is shown;
[0018] Figure 8 A schematic diagram of another text matching model according to an embodiment of the present disclosure is shown;
[0019] Figure 9 A schematic diagram of another text matching model according to an embodiment of the present disclosure is shown;
[0020] Figure 10 A schematic diagram of a text matching apparatus according to an embodiment of the present disclosure is shown;
[0021] Figure 11 A schematic diagram of a storage medium according to an embodiment of the present disclosure is shown;
[0022] Figure 12 A schematic diagram of an electronic device according to an embodiment of the present disclosure is shown. Detailed Implementation
[0023] The principles and spirit of this disclosure will now be described with reference to several exemplary embodiments. It should be understood that these embodiments are given merely to enable those skilled in the art to better understand and implement this disclosure, and are not intended to limit the scope of this disclosure in any way. Rather, these embodiments are provided to make this disclosure more thorough and complete, and to fully convey the scope of this disclosure to those skilled in the art.
[0024] Those skilled in the art will recognize that embodiments of this disclosure can be implemented as a system, apparatus, device, method, or computer program product. Therefore, this disclosure can be specifically implemented in the following forms: entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.
[0025] According to embodiments of this disclosure, a text matching method, a text matching apparatus, a computer-readable storage medium, and an electronic device are provided.
[0026] In this document, any number of elements in the accompanying figures is for illustrative purposes and not for limitation, and any naming is for distinction only and has no limiting meaning.
[0027] The principles and spirit of this disclosure are explained in detail below with reference to several representative embodiments. SUMMARY
[0029] Existing text matching methods typically parse, encode, and match user input text with candidate question text at the text level, then display the corresponding answer text. However, this matching process only considers a single match between the input and candidate texts at the text level, affecting the accuracy of the matching results and consequently the accuracy of the displayed answer text. This can lead to irrelevant answers, negatively impacting the user experience of related products. The embodiments disclosed in this invention fully utilize the feature correlations between the input text, candidate question text, and answer text to improve the accuracy of the matching results at the text level.
[0030] To improve the accuracy of text matching methods, optimizations are typically made to text similarity matching algorithms. However, these optimizations remain confined to the rigid framework of text matching, which essentially involves matching the input text and candidate question texts at the text level. This disclosure breaks through this rigid framework by incorporating user interaction information and the structured information of the candidate question texts during the text matching process. It considers not only various user interactions before and during the matching process but also the organizational structure of the questions, improving the matching degree of the results within the current matching environment. This results in richer text matching and ultimately determines the matching result by integrating the text level and the current matching environment. This expands the utilization of various effective matching information in text matching, improves the accuracy of text matching, and ultimately enhances the user experience of products using the text matching method of this disclosure.
[0031] After introducing the basic principles of the present invention, various non-limiting embodiments of the present invention will be described in detail below.
[0032] Example application scenarios
[0033] It should be noted that the following application scenarios are shown only to facilitate understanding of the spirit and principles of the present invention, and the embodiments of this disclosure are not limited in any way. On the contrary, the embodiments of this disclosure can be applied to any applicable scenario.
[0034] The text matching method of this disclosure can be applied to a variety of application scenarios involving text matching.
[0035] In one application scenario, this could involve intelligent customer service applications. Typically, in this scenario, customers ask questions, and a chatbot answers them. The chatbot can utilize the text matching method of this disclosure to determine the matching result of the input text from multiple candidate question texts based on the feature relevance between the input text and candidate question texts and answer texts, and by integrating user interaction information, question structure information, etc., and then output the result.
[0036] In another application scenario, knowledge learning applications may be involved. Typically, in this scenario, during the learning process, users can input the text of a problem they don't know or have doubts about into the knowledge learning application, which then outputs the correct answer. In this application scenario, the text matching method of this disclosure can be used to perform feature cross-processing between the input problem text and candidate problem texts in the problem bank, and between the input problem text and the answer text. Furthermore, user interaction information and structured question information during the learning process are transformed into feature vectors. Finally, the resulting vectors are fused, and based on the fusion result, the matching result of the input problem text is determined from the candidate problem texts. The corresponding answer text is then displayed for user learning.
[0037] Example method
[0038] The following section, in conjunction with the above application scenarios, provides reference... Figure 1 This describes a text matching method according to an exemplary embodiment of the present disclosure.
[0039] In this article, it is important to understand that the terminology used includes at least the following:
[0040] Question-and-answer knowledge base: A structured knowledge storage system that stores predefined question texts that users might ask. Each question text includes a standard response text and several similar question texts. The standard response text and the similar question texts have the same and unique corresponding answer text. For example... Figure 2 The question text "Why don't couriers deliver to my door?" includes the standard phrase "Why don't couriers deliver to my door?", similar question texts such as "The courier just puts the package in the parcel locker instead of delivering it to my home", "The courier told me to pick it up at the self-pickup point", and "The couriers don't deliver to my home, they all leave it at the parcel locker", and the unique corresponding answer text "Different couriers have different door-to-door delivery strategies depending on the situation in your community". Of course, the number of similar question texts is not limited to the number in this example.
[0041] Text recall: The process of retrieving a certain number of candidate question texts from the above-mentioned question-and-answer knowledge base based on the user's input text, in order to narrow down the text matching range and facilitate subsequent text matching processes.
[0042] like Figure 1 The flow of the text matching method according to the exemplary embodiment of this disclosure may include steps S110 to S140:
[0043] Step S110: Perform feature cross processing on the user's input text and the corresponding candidate question text to obtain the question cross vector.
[0044] In an exemplary embodiment of this disclosure, candidate question texts are obtained by retrieving text from a question-and-answer knowledge base based on the input text. The retrieved candidate question texts may include the standard wording of the question text in the question-and-answer knowledge base, similar question texts, or both. Feature cross-processing is performed on the input text and candidate question texts. This can be achieved through a feature cross-extraction model, which learns and extracts cross-features from the input text and candidate question texts to obtain a question cross-vector. Feature cross-extraction models include, but are not limited to, attention models, self-attention models, and fusion matrices.
[0045] By performing feature cross-processing between the input text and the candidate question text, the feature correlation between the two texts is calculated to obtain the question cross vector. Then, in the subsequent text matching process, the feature correlation between the two texts is introduced to improve the matching accuracy at the text level.
[0046] In step S120, the input text and the answer text of the candidate question text are subjected to feature cross-processing to obtain the answer cross vector.
[0047] Each candidate question text includes a corresponding answer text. In the exemplary embodiments of this disclosure, the input text and the answer text can also be cross-feature learned and extracted by a feature cross-extraction model. Based on the degree of feature correlation between the input text and the answer text, the answer cross vector can be extracted. In the subsequent text matching process, by introducing the feature correlation between the input text and the answer text, the matching accuracy at the text level can be further improved.
[0048] In step S130, the user's user interaction information is transformed into a feature vector to obtain a first vector representation, and the question structure information of the candidate question text is transformed into a feature vector to obtain a second vector representation.
[0049] In the exemplary embodiments of this disclosure, user interaction information refers to relevant interaction information generated before and during a user performs a text matching operation. For example, in an intelligent customer service application scenario, user interaction information may include the channel and entry information for the user to enter the intelligent customer service system, and various interactive behaviors generated before the user enters the intelligent customer service system or during customer service consultations within the intelligent customer service system, such as item acquisition, work order application, number of times customer service has been consulted, browsing history, etc. Channel and entry information refers to the way the user enters the intelligent customer service system, for example, the user enters by clicking a link shared by other users, or the user enters by triggering the entry control provided on the item acquisition interface, or the type of operating system the user uses when logging in, such as Android or iOS, etc. In a knowledge learning application scenario, user interaction information may include the user's knowledge learning behavior before and after performing text matching, such as learned knowledge points, collected knowledge points, number of knowledge searches, etc. All information related to various interactive behaviors generated before or during the current text matching operation by the user belongs to the user interaction information described in the exemplary embodiments of this disclosure, and will not be listed one by one here.
[0050] In an exemplary embodiment of this disclosure, the question structure information includes information related to the interactive behavior of candidate question texts and the organizational structure of the questions. Both the user interaction information and the question structure information of the candidate question texts contain discrete and continuous information.
[0051] The first continuous information in user interaction information consists of statistical information about the user's historical interaction behavior within a first preset time period. For example, the number of times the user has performed text matching operations (such as the number of times they have contacted customer service) within the preset time period, the number of times the user has acquired related items within the preset time period, the number of times they have browsed related information within the preset time period, and so on. The first discrete information in user interaction information consists of non-statistical interaction information of the user before and during the text matching operation, such as the operating system type of the user's terminal, the channel and entry point information for the user to enter the text matching operation, etc.
[0052] The second continuous information in the structured question information is the statistical information of the historical interaction behavior of the candidate question text within a second preset time period, such as the resolution rate and exposure rate of the candidate question text within the preset time period; the second discrete information in the structured question information is the organizational structure of the candidate question text. For example, the structured question information is the question organization information of the candidate question text determined based on the tag category tree structure of the question knowledge base. For example, the question organization information corresponding to the candidate question text "Why does Fast Delivery not provide door-to-door service?" can include keywords such as "logistics" and "forward transportation". Based on the structured question information, the candidate question text can be quickly located in the question-and-answer knowledge base.
[0053] In an exemplary embodiment of this disclosure, it is supported to introduce user interaction information and question structure information of candidate question text during the text matching process. First, the first vector representation corresponding to the user interaction information and the second vector representation corresponding to the question structure information need to be determined to represent the content of the user interaction information or question structure information in a vector manner so as to perform vector fusion in the future.
[0054] In step S140, the question cross vector, answer cross vector, first vector representation and second vector representation corresponding to the same candidate question text are fused to obtain the target vector of each candidate question text, and the matching result of the input text is determined from the candidate question text based on the target vector.
[0055] In the exemplary embodiments of this disclosure, the candidate question text and the input text undergo feature cross-processing to obtain a question cross-vector; the answer text of the candidate question text and the input text undergo feature cross-processing to obtain an answer cross-vector; and the question structure information of the candidate question text undergoes feature vector transformation to obtain a second vector representation. The first vector representation is determined based on the user corresponding to the input text and is the same for all candidate question texts. Therefore, for the same candidate question text, it may include a corresponding question cross-vector, an answer cross-vector, a first vector representation, and a second vector representation.
[0056] In some possible implementations, the fusion of the question cross vector, answer cross vector, first vector representation and second vector representation corresponding to the same candidate question text can be performed by horizontally concatenating the question cross vector, answer cross vector, first vector representation and second vector representation corresponding to the same candidate question text to obtain the target vector of each candidate question text.
[0057] Horizontal concatenation involves joining the first and last vectors together. For example, if the question cross vector is x = [a, b, c], the answer cross vector is y = [e, f, g], the first vector representation is m = [h, i, j], and the second vector representation is n = [k, l, o], then horizontal concatenation of the question cross vector x, the answer cross vector y, the first vector representation m, and the second vector representation n yields the concatenated vector w = [a, b, c, e, f, g, h, i, j, k, l, o]. It should be noted that all horizontal concatenation discussed in this article is similar to this, and will not be described in detail further.
[0058] By combining the question cross vector and answer cross vector at the text level with the first vector representation and the second vector representation at the current matching environment level through the exemplary implementation of this disclosure, the utilization of effective matching information in text matching is expanded, and the accuracy of determining the matching result of the input text from the candidate question text based on the target vector is improved.
[0059] In an exemplary embodiment of this disclosure, an implementation method for performing feature cross processing on vectors is also provided. Obtaining a question cross vector through feature cross processing between the input text vector and the candidate question vector may include the following steps S310 and S320:
[0060] Step S310: Input the input text and candidate question text into the pre-trained language representation model to obtain the input text vector and candidate question vector, respectively.
[0061] By inputting the input text into a pre-trained language representation model, an input text vector is obtained; by inputting the candidate question text into a pre-trained language representation model, a candidate question vector is obtained. In other words, the pre-trained language representation model can obtain sentence representations that integrate the full semantics of the input text and sentence representations that integrate the full semantics of the candidate question text.
[0062] Step S320: Perform feature cross processing on the input text vector and the candidate question vector to obtain the question cross vector.
[0063] In this process, pre-trained language representation models can encode the input text and candidate question text separately, generating fixed-length numeric vectors or vector sequences, i.e., input text vectors and candidate question vectors. Pre-trained language representation models include, but are not limited to, word embeddings and the BERT model. The BERT model is a Transformer-based language model that implements a multi-layered bidirectional Transformer encoder. The goal of the BERT model is to obtain a representation of text containing rich semantic information using large-scale unlabeled corpora. The input of the BERT model is each character / word in the text, and the output is a vector representation of each character / word in the text after incorporating the semantic information of the entire text.
[0064] By inputting the input text and candidate question text into a pre-trained language representation model, and converting them into vector representations, the resulting input text vector incorporates the full-text semantic information of the input text, and the resulting candidate question vector incorporates the full-text semantic information of the candidate question text.
[0065] After obtaining the input text vector and candidate question vectors, feature cross processing is performed on the input text vector and candidate question vectors to obtain the question cross vector. In an exemplary embodiment of this disclosure, a feature cross extraction model can be used to learn and extract cross features from the input text vector and candidate question vectors to extract the question cross vector based on the degree of feature correlation between the input text vector and candidate question vectors.
[0066] Through the exemplary implementation of this disclosure, the input text vector, which integrates the full-text semantic information of the input text, and the candidate question vector, which integrates the full-text semantic information of the candidate question text, are subjected to feature cross-processing. This allows the feature correlation between the input text and the candidate question text to be fully utilized during the text matching process, thereby improving the accuracy of the subsequent matching results at the text level.
[0067] It should be noted that, in the exemplary embodiments of this disclosure, the answer cross vector can also be obtained through feature cross processing between the input text vector and the answer text vector. That is, the answer text is also input into the pre-trained language representation model to obtain the answer text vector, and the input text vector and the answer text vector are subjected to feature cross processing to obtain the answer cross vector. For the specific processing procedure, please refer to the process of determining the question cross vector in steps S310 to S320, which will not be repeated here.
[0068] Through the exemplary implementation of this disclosure, the input text vector, which integrates the full-text semantic information of the input text, and the answer text vector, which integrates the full-text semantic information of the answer text, are subjected to feature cross-processing. This allows the text matching process to utilize not only the feature correlation between the input text and the candidate question text, but also the feature correlation between the input text and the answer text, thereby further improving the accuracy of the matching results at the text level and thus improving the accuracy of subsequent text matching.
[0069] In an exemplary embodiment of this disclosure, a method for transforming information into feature vectors is also provided. The user's interaction information is transformed into a first vector representation, and the structured information of the candidate question text is transformed into a second vector representation. This may include steps S410 to S440:
[0070] Step S410: Determine the class identifier of the discrete information, and determine the first sub-vector of the discrete information based on the random initialization vector corresponding to the class identifier.
[0071] Both user interaction information and structured question information include discrete information. Discrete information has a uniquely determined class identifier and a random initialization vector. The random initialization vector serves as the feature vector of the discrete information. The random initialization vector corresponding to the discrete information can be queried through the class identifier. Then, the first sub-vector of the discrete information, i.e., the vector expression of the discrete information, can be determined based on the random initialization vector.
[0072] Step S420: Standardize the continuous information and form a second sub-vector based on the standardized continuous information.
[0073] Both user interaction information and structured question information include continuous information, which is statistical information about user or question interaction behavior. Continuous information from different sources has different expression spaces and / or expression methods. By standardizing the continuous information, we can obtain continuous information with a standardized expression method. Then, a second sub-vector can be formed based on the standardized continuous information, that is, the vector expression of continuous information.
[0074] Step S430: The first user subvector and the second user subvector are fused to obtain the first vector representation.
[0075] The first sub-vector includes a first user sub-vector corresponding to the first discrete information in the user interaction information and a first question sub-vector corresponding to the second discrete information in the question structure information. The second sub-vector includes a second user sub-vector corresponding to the first continuous information and a second question sub-vector corresponding to the second continuous information. That is, the first user sub-vector can be determined based on the random initialization vector corresponding to the class identification of the first discrete information, the first question sub-vector can be determined based on the random initialization vector corresponding to the class identification of the second discrete information, the second user sub-vector can be formed based on the standardized first continuous information, and the second question sub-vector can be formed based on the standardized second continuous information.
[0076] The first user sub-vector corresponding to user interaction behavior is fused with the second user sub-vector, so that the first vector representation simultaneously contains discrete information and features from continuous information in user interaction. The first vector representation fully integrates the user's interaction information before or during the text matching operation, and can reflect the user's question-and-answer habits, preferences, and device usage information, capturing the current matching environment from the user's perspective.
[0077] Step S440: Merge the first problem subvector and the second problem subvector to obtain the second vector representation.
[0078] The first question sub-vector corresponding to the structured information of the question is fused with the second question sub-vector, so that the second vector represents features that simultaneously contain both discrete and continuous information from the structured information of the question. The second vector fully integrates the statistical information of the interaction behavior of the candidate question text and the combined structural information of the question, capturing the current matching environment from the perspective of the candidate question.
[0079] As described above, each discrete piece of information has a unique corresponding category identifier. According to an exemplary embodiment of this disclosure, a method for constructing a tag category tree structure is also provided. The tag category tree structure can be pre-constructed to determine the category identifier corresponding to the discrete information based on the tag category tree structure.
[0080] like Figure 5The diagram illustrates a tag category tree structure according to an exemplary embodiment of this disclosure. The tag category tree structure includes tag nodes (such as tag nodes A, B, C, D, E, F, and G) corresponding to question tag information. The nodes forming the tag category tree structure are defined by these tag nodes, where tag node A is the root node, and tag nodes B, C, D, E, F, and G are leaf nodes. Leaf nodes E, F, and G are not connected to any other leaf nodes; therefore, they are leaf nodes. Leaf nodes E, F, and G can correspond to different questions to be matched, such as leaf node F corresponding to "Why didn't the courier deliver to my door?" or "I didn't receive it, but it shows as received," and leaf node G corresponding to "Please provide a return address." The question tag information is extracted from question text in a question-and-answer knowledge base, such as "logistics," "product quality," "shipping," and "return shipping."
[0081] See also Figure 5 Each tag node in the tag category tree structure has a category identifier (such as ID:1, ID:2, etc.). The category identifier makes it easy to find tag nodes in the huge tag category tree structure. In addition, each tag node has a corresponding random initialization vector, that is, each category identifier has a corresponding random initialization vector.
[0082] In some possible implementations, word vectors can be randomly initialized for the question tag information (such as "logistics") corresponding to each tag node. The vector dimension can be set according to the actual matching requirements, such as 100-dimensional, 200-dimensional, or 300-dimensional. This disclosure does not make any special limitation in this regard.
[0083] In some possible implementations, BiLSTM (Bi-directional Long Short-Term Memory) can be used to obtain the random initialization vector corresponding to the label node (category identification): the forward LSTM of BiLSTM is used to randomly initialize the problem label information (such as "logistics") corresponding to the label node to obtain the forward feature vector, and the backward LSTM of BiLSTM is used to randomly initialize the problem label information to obtain the backward feature vector. Finally, the forward feature vector and the backward feature vector are concatenated horizontally to obtain the random initialization vector corresponding to the label node.
[0084] For example, if the problem label information corresponding to the label node is "logistics", the forward LSTM is used to randomly initialize "logistics" to obtain the forward feature vector w1 = [m1, m2, m3], and the backward LSTM is used to randomly initialize "logistics" to obtain the backward feature vector w2 = [n1, n2, n3]. Then, w1 and w2 are concatenated horizontally to obtain the random initialization vector w3 = [m1, m2, m3, n1, n2, n3] of "logistics".
[0085] It should be noted that the above example only applies to the case where "logistics" is contained in a single question text. If the question tag "logistics" is contained in multiple question texts, the above method can be used to obtain a random initialization vector for "logistics" for each question text. The random initialization vector for "logistics" can then be the horizontal concatenation of the random initialization vectors for each question text containing "logistics". For example, for "logistics is too slow," the random initialization vector for "logistics" is w3, and for "logistics display returned," the random initialization vector is w4. Therefore, the random initialization vector for the question tag "logistics" is the horizontal concatenation of w3 and w4. Of course, in actual operation, the number of question texts corresponding to the same question tag is not limited to a few; it may be more, but all can be obtained using the above method.
[0086] In this exemplary implementation, BiLSTM is used to obtain the random initialization vector of the tag node. By using two time directions, the past and future information of the question tag information in the question-answering knowledge base is obtained, which enriches the semantic features of the random initialization vector and makes the random initialization vector more consistent with the feature expression of the question text in the entire question-answering knowledge base.
[0087] Based on the constructed tag category tree structure, in step S410, the target tag node corresponding to the first discrete information can be found based on the tag category tree structure, and the category identifier of the target tag node corresponding to the first discrete information can be determined as the first category identifier. For example... Figure 5 If the first discrete information includes "logistics", by searching the tag category tree structure, the category identifier corresponding to "logistics" is determined to be ID:1, and the category identifier corresponding to "shipping urging" is ID:4. Then the first category identifier includes ID:1 and ID:4.
[0088] The second discrete information in the structured information of the question refers to the target tag nodes included in the path from the root node of the category tree structure to the leaf node where the candidate question text is located. In the exemplary embodiments of this disclosure, the second type of target identification of the second discrete information can also be determined based on the tag category tree structure. Figure 5If the candidate question text is "Why doesn't the courier deliver to my door?", based on the tag category tree structure, from the root node of the category tree structure to the leaf node where the candidate question text "Why doesn't the courier deliver to my door?" is located, the target tag nodes along the way are "logistics" and "forward transportation". Then, the target tag nodes "logistics" and "forward transportation" are identified as the second type of target identification ID:1 and ID:5.
[0089] As mentioned above, since the category tree structure is generated based on the question tag information, by searching the category tree structure to obtain the category identifiers of the first and second discrete information, it is possible to extract information related to the question text and the organizational structure of the question text from the user interaction information and the question structure information, respectively. Furthermore, in the subsequent text matching process, the organizational structure of the question is introduced to improve the matching degree of the matching result in the current matching environment, thereby achieving richer text matching.
[0090] In an exemplary embodiment of this disclosure, after obtaining the class identifiers of discrete information, the random initialization vectors corresponding to multiple class identifiers can be concatenated to obtain the first sub-vector of the discrete information. For example, if the first class identifiers corresponding to the first discrete information include ID:1 and ID:4, then the random initialization vectors corresponding to these two first class identifiers are concatenated horizontally.
[0091] In an exemplary embodiment of this disclosure, it is also supported to standardize continuous information groups from different information sources, and then determine the second sub-vector based on the standardized continuous information groups. Step S420 may include the following steps S610 to S630:
[0092] Step S610: Based on the information source of the continuous information, form multiple groups of continuous information corresponding to different information sources.
[0093] Continuous information from different sources has different expression spaces and / or expression methods, therefore, it is grouped according to the information source of the continuous information. Taking the second continuous information of the structured question information as an example, if information 1 and information 2 in the second continuous information come from the same information source, and information 3, information 4 and information 5 come from the same information source, then the continuous information groups corresponding to different information sources are [1,2] and [3,4,5], where the numbers 1-5 are statistical information of the candidate question text having a certain historical interaction behavior within a preset time.
[0094] Step S620: The continuous information groups are standardized using a preset parameter matrix.
[0095] In an exemplary embodiment of this disclosure, each consecutive information group can be multiplied by a preset parameter matrix to convert the consecutive information groups into vectors of the same length. For example, if the consecutive information groups in the above example are multiplied by a 10-dimensional parameter matrix respectively, then each consecutive information group is converted into a 10-dimensional vector.
[0096] It should be noted that, according to the rules of multiplying row vectors and matrices, the dimension (number of columns) of the row vector must be the same as the number of rows of the matrix. In some possible implementations, if the dimension of the row vector corresponding to a consecutive information group is different from that of the parameter matrix, zeros can be added after the elements of the row vector corresponding to the consecutive information group. Of course, in practice, the parameter matrix can be determined by coordinating the dimensions of the row vectors corresponding to each consecutive information group, and then this parameter matrix can be used to ensure that consecutive information groups corresponding to different information sources have the same vector representation. By standardizing consecutive information groups from different information sources, it is possible to uniformly process the consecutive information from each source in the future.
[0097] Step S630: The standardized continuous information groups are fused to obtain the second sub-vector.
[0098] In an exemplary embodiment of this disclosure, the standardized continuous information groups can be horizontally concatenated to obtain a second sub-vector. For example, if the standardized continuous information groups include [1,2], [3,4,5], and [7,2,5], then the second sub-vector is [1,2,3,4,5,7,2,5]. Through the exemplary embodiment of this disclosure, statistical information on various historical interaction behaviors of candidate question texts in different channels is integrated, reflecting the likelihood of text matching operations occurring in the current text matching process from the perspective of various historical interaction behaviors of candidate question texts.
[0099] In an exemplary embodiment of this disclosure, a method for determining the matching result of input text based on a target vector is also provided. Determining the matching result of input text from candidate question text based on a target vector can be achieved by: first, mapping the target vector to a numerical value according to a preset mapping rule, which serves as the matching score between the candidate question text and the input text; then, determining the matching result of the input text from the candidate question text based on the matching score.
[0100] Optionally, the sigmoid function can be used to map the target vector to a value in the range [0,1], which serves as the matching score between the candidate question text and the input text. Optionally, the target vector can be input into a softmax classifier to map it to a probability value, which serves as the matching score between the candidate question text and the input text. Of course, other preset mapping rules can also be used to map the target vector to a value, which serves as the matching score between the candidate question text and the input text. This disclosure includes, but is not limited to, the preset mapping rules mentioned above.
[0101] In some possible implementations, target candidate texts with matching scores greater than a first score threshold can be selected from the candidate question texts and used as the matching results for the input text. For example, if the first score threshold is 0.6, and the matching scores of multiple candidate question texts are 0.95, 0.9, 0.8, 0.7, 0.65, and 0.5 respectively, then all candidate question texts except those corresponding to 0.5 are determined as target candidate texts and used as the matching results for the input text.
[0102] Optionally, in response to the user's text input, the target candidate question text can be displayed on the user's corresponding terminal. Further, in response to the user's selection of the target candidate question text, the answer text corresponding to the selected target candidate question text can be displayed. Optionally, in response to the user's text input, the target candidate question text and its corresponding answer text can be displayed on the user's corresponding terminal, that is, when displaying the target candidate question text, the answer text corresponding to the target candidate question text is displayed simultaneously. Optionally, in response to the user's text input, the target candidate question text can be displayed on the user's corresponding terminal, and the answer text of the target candidate question text with a score greater than the second score threshold can also be displayed on the user's corresponding terminal. Continuing with the example above, if the second score threshold is 0.85, then when displaying the target candidate question text, only the answer texts of the target candidate question texts with matching scores of 0.95 and 0.9 will be displayed.
[0103] In some possible implementations, target candidate texts with matching scores lower than a first score threshold can be selected from the candidate question texts and used as the matching results for the input text. It should be noted that whether to select matching scores greater than or less than the first score threshold depends on the training method and results of the text matching model, and the appropriate text matching model can be trained according to the actual matching requirements.
[0104] Since the target vector simultaneously integrates the question cross vector and answer cross vector at the text level, as well as the first vector representation and the second vector representation at the current matching environment level, it fully extracts various effective information in the text matching process, expands the utilization of effective matching information in text matching, improves the accuracy of text matching, and displays the corresponding answer text in a timely and accurate manner based on the final determined matching result, thereby improving the user experience of related products using the text matching method of this disclosure.
[0105] Example text matching model
[0106] like Figure 7 A schematic diagram of a text matching model according to an exemplary embodiment of this disclosure is shown, such as... Figure 7 As shown, the text matching model includes a feature cross-processing layer 710, a feature vector transformation layer 720, a vector fusion layer 730, and a text matching layer 740.
[0107] The feature cross-processing layer 710 is used to perform feature cross-processing on the user's input text and the corresponding candidate question text to obtain a question cross-vector; and to perform feature cross-processing on the input text and the answer text of the candidate question text to obtain an answer cross-vector.
[0108] The feature vector transformation layer 720 is used to transform the user's user interaction information into a feature vector to obtain a first vector representation, and to transform the question structure information of the candidate question text into a feature vector to obtain a second vector representation.
[0109] The vector fusion layer 730 is used to fuse the question cross vector, answer cross vector, first vector representation and second vector representation corresponding to the same candidate question text to obtain the target vector of each candidate question text.
[0110] The text matching layer 740 is used to determine the matching result of the input text from the candidate question text based on the target vector.
[0111] In an exemplary embodiment of this disclosure, the feature cross-processing layer 710 performs feature cross-processing between the input text and candidate question text, and also between the input text and answer text, extracting the feature correlations between the input text and candidate question text, and between the input text and answer text. Based on the feature vector conversion layer 720, user interaction information is converted into a first vector representation, and question structured information is converted into a second vector representation. The vector fusion layer 730 fuses the obtained question cross-vector, answer cross-vector, first vector representation, and second vector representation, so that the target vector not only incorporates the feature correlations between texts, improving the accuracy of expression at the text level, but also incorporates various interactive behaviors and question organization structures generated before and during text matching, improving the matching degree of the matching result in the current matching environment, thereby improving the matching result of the input text determined by the subsequent text matching layer 740. Through the functions implemented by each layer of the model, the utilization of various effective matching information in text matching is expanded, improving the matching accuracy of the text matching model. In an exemplary embodiment of this disclosure, as... Figure 8 As shown, in Figure 7 Based on the exemplary implementation shown, the text matching model may further include a sentence vector representation layer 750, which is used to convert the input text, candidate question text and answer text into sentence representations, namely, input text vector, candidate question vector and answer text vector, respectively.
[0112] In one exemplary embodiment of this disclosure, such as Figure 9 As shown, in Figure 7 Based on the exemplary implementation shown, the feature vector conversion layer 720 may further include a first vector conversion layer 760 and a second vector conversion layer 770. The first vector conversion layer 760 is used to convert the first discrete information in the user interaction information into a first user sub-vector, convert the first continuous information in the user interaction information into a second user sub-vector, and fuse the first user sub-vector and the second user sub-vector to obtain a first vector representation. The second vector conversion layer 770 is used to convert the second discrete information in the question structured information into a first question sub-vector, convert the second continuous information in the question result information into a second question sub-vector, and fuse the first question sub-vector and the second question sub-vector to obtain a second vector representation.
[0113] It should be noted that other specific details of each layer in the text matching model of the exemplary embodiments of this disclosure have been described in detail in the embodiments of the above methods, and will not be repeated here.
[0114] Example apparatus
[0115] After introducing the text matching method of exemplary embodiments of this disclosure, the following refers to...Figure 10 The text matching apparatus of exemplary embodiments of the present disclosure will be described.
[0116] It should be noted that other specific details of the various functional modules of the text matching device of the present disclosure have been described in detail in the above-described text matching method embodiments, and will not be repeated here.
[0117] Figure 10 A text matching apparatus 1000 according to an exemplary embodiment of the present disclosure is shown, comprising:
[0118] The first feature cross-processing module 1010 is used to perform feature cross-processing on the user's input text and the candidate question text corresponding to the input text to obtain a question cross-vector.
[0119] The second feature cross-processing module 1020 is used to perform feature cross-processing on the input text and the answer text of the candidate question text to obtain the answer cross vector.
[0120] The vector conversion module 1030 is used to convert the user's user interaction information into feature vectors to obtain a first vector representation, and to convert the question structure information of the candidate question text into feature vectors to obtain a second vector representation;
[0121] The text matching module 1040 is used to fuse the question cross vector, answer cross vector, first vector representation and second vector representation corresponding to the same candidate question text to obtain the target vector of each candidate question text, and to determine the matching result of the input text from the candidate question text based on the target vector.
[0122] In one optional implementation, the first feature cross-processing module 1010 may include:
[0123] The first text representation unit is used to input the input text and candidate question text into the pre-trained language representation model to obtain the input text vector and the candidate question vector; the first feature cross processing unit is used to perform feature cross processing on the input text vector and the candidate question vector to obtain the question cross vector.
[0124] In one optional implementation, the second feature cross-processing module 1020 may include: a second text representation unit, used to input the answer text into the pre-trained language representation model to obtain an answer text vector; and a second feature cross-processing unit, used to perform feature cross-processing on the input text vector and the answer text vector to obtain the answer cross vector.
[0125] In one optional implementation, both the user interaction information and the question structure information of the candidate question text contain discrete information and continuous information. The first continuous information in the user interaction information is the statistical information of the user's historical interaction behavior within a first preset time period, and the second continuous information in the question structure information is the statistical information of the historical interaction behavior of the candidate question text within a second preset time period.
[0126] Vector transformation module 1030 may include:
[0127] The first vector determination unit is used to determine the class identifier of discrete information and determine the first sub-vector of the discrete information according to the random initialization vector corresponding to the class identifier. The first sub-vector includes a first user sub-vector corresponding to the first discrete information in the user interaction information and a first question sub-vector corresponding to the second discrete information in the question structured information.
[0128] The second vector determination unit is used to standardize the continuous information and form a second sub-vector based on the standardized continuous information. The second sub-vector includes a second user sub-vector corresponding to the first continuous information and a second question sub-vector corresponding to the second continuous information.
[0129] The first fusion subunit is used to fuse the first user subvector and the second user subvector to obtain the first vector representation;
[0130] The second fusion subunit is used to fuse the first problem subvector and the second problem subvector to obtain the second vector representation.
[0131] In one optional implementation, the first vector determining unit is configured to concatenate multiple random initialization vectors corresponding to the class identifiers to obtain a first sub-vector of the discrete information.
[0132] In one optional implementation, the second vector determination unit includes: an information grouping unit, used to form multiple continuous information groups corresponding to different information sources based on the information sources of the continuous information; an information processing unit, used to standardize each continuous information group through a preset parameter matrix; and an information group fusion unit, used to fuse the standardized continuous information groups to obtain a second sub-vector.
[0133] In one alternative implementation, the text matching device further includes:
[0134] The tag category tree structure generation module is used to obtain question tag information and generate a tag category tree structure based on the question tag information. Each tag node in the tag category tree structure has a category identifier and a corresponding random initialization vector. The leaf nodes of the tag category tree structure correspond to different question texts to be matched.
[0135] In one optional implementation, the first vector determination unit includes: a first identifier determination unit, configured to search for the target tag node corresponding to the first discrete information in the user interaction information based on the tag category tree structure, and determine the class identifier of the target tag node corresponding to the first discrete information as the first class identifier.
[0136] In one optional implementation, the second discrete information in the question structured information of the candidate question text is the target tag nodes included in the path from the root node of the category tree structure to the leaf node where the candidate question text is located; the first vector determination unit further includes: a second identifier determination unit, used to obtain the category identifiers of the target tag nodes passed through from the root node of the category tree structure to the leaf node where the candidate question text is located based on the tag category tree structure, and determine the category identifiers of the target tag nodes passed through as the second category identifier.
[0137] In one alternative implementation, the text matching module may include:
[0138] The target vector determination unit is used to concatenate the question cross vector, answer cross vector, first vector representation and second vector representation corresponding to the same candidate question text to obtain the target vector of each candidate question text; the score determination unit is used to map the target vector to a numerical value according to a preset mapping rule, which is used as the matching score value between the candidate question text and the input text; the matching result determination unit is used to determine the matching result of the input text from the candidate question text based on the matching score value.
[0139] It should be noted that although several modules or units of the text matching device have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0140] Example storage medium
[0141] The storage medium of the exemplary embodiments of this disclosure will now be described.
[0142] In this exemplary embodiment, reference is made to Figure 11As shown, a program product 1100 for implementing the above-described method according to an exemplary embodiment of the present disclosure is described. This product may be a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a device such as a personal computer. However, the program product of the present disclosure is not limited thereto. In this document, a readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.
[0143] The program product 1100 can employ any combination of one or more readable media. The readable media can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0144] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.
[0145] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RE, etc., or any suitable combination thereof.
[0146] Program code for performing the operations of this disclosure can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (FAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0147] Example electronic device
[0148] refer to Figure 12 An electronic device according to an exemplary embodiment of the present disclosure will be described.
[0149] Figure 12 The electronic device 1200 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments disclosed herein.
[0150] like Figure 12 As shown, the electronic device 1200 is presented in the form of a general-purpose computing device. The components of the electronic device 1200 may include, but are not limited to: at least one processing unit 1210, at least one storage unit 1220, a bus 1230 connecting different system components (including storage unit 1220 and processing unit 1210), and a display unit 1240.
[0151] The storage unit stores program code, which can be executed by the processing unit 1210 to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of the present disclosure. For example, the processing unit 1210 can perform actions such as... Figure 1 The methods and steps shown are as follows.
[0152] Storage unit 1220 may include volatile storage units, such as random access memory (RAM) 1221 and / or cache memory 1222, and may further include read-only memory (ROM) 1223.
[0153] Storage unit 1220 may also include a program / utility 1224 having a set (at least one) of program modules 1225, such program modules 1225 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.
[0154] Bus 1230 may include a data bus, an address bus, and a control bus.
[0155] Electronic device 1200 can also communicate with one or more external devices 1300 (e.g., keyboard, pointing device, Bluetooth device, etc.) via input / output (I / O) interface 1250. Electronic device 1200 also includes a display unit 1240 connected to input / output (I / O) interface 1250 for display purposes. Furthermore, electronic device 1200 can communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 1260. As shown, network adapter 1260 communicates with other modules of electronic device 1200 via bus 1230. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 1200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0156] It should be noted that although several modules or sub-modules of the apparatus have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided and embodied by multiple units / modules.
[0157] Furthermore, although the operations of the methods disclosed herein are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all of the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0158] While the spirit and principles of this disclosure have been described with reference to several specific embodiments, it should be understood that this disclosure is not limited to the disclosed specific embodiments, and the division of aspects does not imply that features in these aspects cannot be combined for benefit; such division is merely for convenience of expression. This disclosure is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.
Claims
1. A method of text matching, characterized by, The method comprises the following steps: crossing features of the input text of the user and candidate question texts corresponding to the input text to obtain question cross vectors; crossing features of the input text and answer texts of the candidate question texts to obtain answer cross vectors; performing feature vector conversion on user interaction information of the user to obtain a first vector representation, and performing feature vector conversion on question structured information of the candidate question texts to obtain a second vector representation; wherein the user interaction information is related interaction information generated before and during text matching by the user, and the question structured information includes related information of interaction behaviors of the candidate question texts and an organization structure of the questions; performing fusion processing on the question cross vectors, the answer cross vectors, the first vector representation, and the second vector representation corresponding to the same candidate question text to obtain a target vector of each candidate question text, and determining a matching result of the input text from the candidate question texts based on the target vector; wherein the user interaction information and the question structured information of the candidate question texts both contain discrete information and continuous information, first continuous information in the user interaction information is statistical information of historical interaction behaviors of the user within a first preset time, and second continuous information in the question structured information is statistical information of historical interaction behaviors of the candidate question texts within a second preset time; the feature vector conversion of the user interaction information of the user to obtain the first vector representation, and the feature vector conversion of the question structured information of the candidate question texts to obtain the second vector representation, comprises: determining a class target identifier of the discrete information, and determining a first sub-vector of the discrete information according to a random initialization vector corresponding to the class target identifier, the first sub-vector including a first user sub-vector corresponding to first discrete information in the user interaction information and a first question sub-vector corresponding to second discrete information in the question structured information; performing standardization processing on the continuous information, and forming a second sub-vector according to the continuous information after the standardization processing, the second sub-vector including a second user sub-vector corresponding to the first continuous information and a second question sub-vector corresponding to the second continuous information; performing fusion processing on the first user sub-vector and the second user sub-vector to obtain the first vector representation, and performing fusion processing on the first question sub-vector and the second question sub-vector to obtain the second vector representation.
2. The method of claim 1, wherein, The crossing features of the input text of the user and candidate question texts corresponding to the input text to obtain question cross vectors comprises: inputting the input text and the candidate question text into a pre-trained language representation model respectively to obtain an input text vector and a candidate question vector; crossing features of the input text vector and the candidate question vector to obtain the question cross vectors.
3. The method of claim 2, wherein, The crossing features of the input text and answer texts of the candidate question texts to obtain answer cross vectors comprises: inputting the answer text into the pre-trained language representation model to obtain an answer text vector; crossing features of the input text vector and the answer text vector to obtain the answer cross vector.
4. The method of claim 1, wherein, The determining the class identifier of the discrete information comprises: splicing the random initialization vectors corresponding to the multiple class identifiers to obtain the first sub-vector of the discrete information.
5. The method of claim 1, wherein, The standardizing the continuous information and forming the second sub-vector according to the standardized continuous information comprises: forming multiple continuous information groups corresponding to different information sources according to information sources of the continuous information; standardizing each continuous information group by a preset parameter matrix; fusing the standardized continuous information groups to obtain the second sub-vector.
6. The method according to claim 4 or 5, characterized in that, Before the crossing features of the input text of the user and the candidate question text corresponding to the input text to obtain the question cross vector, the method further comprises: obtaining question label information, generating a label category tree structure according to the question label information, each label node in the label category tree structure having a class identifier and a corresponding random initialization vector, and leaf nodes of the label category tree structure corresponding to different to-be-matched question texts.
7. The method of claim 6, wherein, The determining the first class identifier of the first discrete information in the user interaction information comprises: based on the label category tree structure, finding the target label node corresponding to the first discrete information; determining the class identifier of the target label node corresponding to the first discrete information as the first class identifier.
8. The method of claim 6, wherein, The second discrete information in the question structured information of the candidate question text is a target label node included in a path from a root node of the category tree structure to a leaf node where the candidate question text is located; The determining the second class identifier of the second discrete information comprises: based on the label category tree structure, sequentially obtaining class identifiers of target label nodes passing through from the root node of the category tree structure to the leaf node where the candidate question text is located; determining the class identifiers of the target label nodes passing through as the second class identifier.
9. The method of claim 1, wherein, The fusing the question cross vector, the answer cross vector, the first vector representation and the second vector representation corresponding to the same candidate question text to obtain a target vector of each candidate question text, and determining a matching result of the input text from the candidate question text based on the target vector, comprises: splicing the question cross vector, the answer cross vector, the first vector representation and the second vector representation corresponding to the same candidate question text to obtain a target vector of each candidate question text; mapping the target vector to a numerical value according to a preset mapping rule as a matching score value of the candidate question text and the input text; determining the matching result of the input text from the candidate question text according to the matching score value.
10. A text matching apparatus, characterized by comprising: comprises: The first feature cross processing module is configured to perform feature cross processing on the input text of the user and the candidate question text corresponding to the input text to obtain a question cross vector. The second feature cross processing module is configured to perform feature cross processing on the input text and the answer text of the candidate question text to obtain an answer cross vector. The vector conversion module is configured to convert the user interaction information of the user into a first vector representation and convert the question structured information of the candidate question text into a second vector representation, wherein the user interaction information is related interaction information generated before and during text matching by the user, and the question structured information includes related information of the candidate question text and an organization structure of the question. The text matching module is configured to fuse the question cross vector, the answer cross vector, the first vector representation, and the second vector representation corresponding to the same candidate question text to obtain a target vector of each candidate question text, and determine a matching result of the input text from the candidate question text based on the target vector. The user interaction information and the question structured information of the candidate question text both include discrete information and continuous information, first continuous information in the user interaction information is statistical information of historical interaction behaviors of the user within a first preset time, and second continuous information in the question structured information is statistical information of historical interaction behaviors of the candidate question text within a second preset time. The vector conversion module includes: A first vector determination unit is configured to determine a class target identification of the discrete information, determine a first sub-vector of the discrete information according to a random initialization vector corresponding to the class target identification, and the first sub-vector includes a first user sub-vector corresponding to first discrete information in the user interaction information and a first question sub-vector corresponding to second discrete information in the question structured information. A second vector determination unit is configured to perform standardization processing on the continuous information, and form a second sub-vector according to the continuous information after the standardization processing, and the second sub-vector includes a second user sub-vector corresponding to the first continuous information and a second question sub-vector corresponding to the second continuous information. A first fusion sub-unit is configured to fuse the first user sub-vector and the second user sub-vector to obtain the first vector representation. A second fusion sub-unit is configured to fuse the first question sub-vector and the second question sub-vector to obtain the second vector representation.
11. The apparatus of claim 10, wherein, The first feature cross processing module includes: A first text representation unit is configured to input the input text and the candidate question text into a pre-trained language representation model to obtain an input text vector and a candidate question vector. A first feature cross processing unit is configured to perform feature cross processing on the input text vector and the candidate question vector to obtain the question cross vector. The second feature cross processing module includes: A second text representation unit is configured to input the answer text into the pre-trained language representation model to obtain an answer text vector. A second feature cross processing unit is configured to perform feature cross processing on the input text vector and the answer text vector to obtain the answer cross vector.
12. The apparatus of claim 10, wherein, The first vector determination unit is configured to: concatenate the random initialization vectors corresponding to the plurality of class labels to obtain a first sub-vector of the discrete information.
13. The apparatus of claim 10, wherein, The second vector determination unit includes: An information grouping unit is configured to group the continuous information into a plurality of continuous information groups according to information sources of the continuous information; An information processing unit is configured to perform standardization processing on each of the continuous information groups by using a preset parameter matrix; An information group fusion unit is configured to fuse the continuous information groups after the standardization processing to obtain the second sub-vector.
14. The apparatus of claim 12 or 13, wherein, The apparatus further includes: A label category tree structure generation module is configured to obtain question label information, and generate a label category tree structure according to the question label information, each label node in the label category tree structure has a class label and a corresponding random initialization vector, and leaf nodes of the label category tree structure correspond to different to-be-matched question texts.
15. The apparatus of claim 14, wherein, The first vector determination unit includes: A first identification determination unit is configured to find a target label node corresponding to first discrete information in the user interaction information based on the label category tree structure, and determine a class label of the target label node corresponding to the first discrete information as a first class label of the first discrete information in the user interaction information.
16. The apparatus of claim 14, wherein, Second discrete information in question structured information of the candidate question text is a target label node included in a path from a root node of the category tree structure to a leaf node where the candidate question text is located; The first vector determination unit further includes: A second identification determination unit is configured to sequentially obtain class labels of target label nodes on a path from a root node of the category tree structure to a leaf node where the candidate question text is located based on the label category tree structure, and determine the class labels of the target label nodes on the path as second class labels of the second discrete information.
17. The apparatus of claim 10, wherein, The text matching module includes: A target vector determination unit is configured to concatenate a question cross vector, an answer cross vector, a first vector representation, and a second vector representation corresponding to a same candidate question text to obtain a target vector of each candidate question text; A score value determination unit is configured to map the target vector to a numerical value as a matching score value of the candidate question text and the input text according to a preset mapping rule; A matching result determination unit is configured to determine a matching result of the input text from the candidate question text according to the matching score value. 18.A storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the text matching method according to any one of claims 1 to 9.
19. An electronic device, comprising: including: a processor; and a memory configured to store executable instructions of the processor; wherein the processor is configured to implement the text matching method according to any one of claims 1 to 9 by executing the executable instructions.
Citation Information
Patent Citations
Text matching method and device, electronic equipment and storage medium
CN113420139A
Information pushing method and apparatus based on human-computer interaction, and computer device
WO2021068321A1