A method for matching text, an electronic device, and a computer readable storage medium

By encoding and mapping multiple features of conversation information and customer profiles using feature vectors, and introducing an adversarial feature vector text matching model, the problem of inaccurate conversation information matching was solved, improving the accuracy and relevance of text matching on the operation service platform.

CN115481224BActive Publication Date: 2026-01-02BEIKE TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211033773.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-26
Publication Date
2026-01-02
Estimated Expiration
2042-08-26

AI Technical Summary

Technical Problem

Existing technologies cannot accurately match text in the context of session information matching on operational service platforms to improve the quality of operational services. In particular, in housing sales service platforms, the semantic features of session information are not sufficiently combined with customer behavior features, resulting in inaccurate text matching.

Method used

Multiple neural network models are used to encode and map the feature vectors of conversation information and customer profile information. The features of conversation information, such as temporal semantics, keywords, customer intent and conversation stage, are combined to calculate similarity through a text matching model. Adversarial feature vectors are introduced to improve the robustness of the model. The text with the highest similarity is selected for recommendation.

Benefits of technology

It achieves more accurate text matching in conversational information scenarios, improving the service quality of the operation service platform. In particular, in the housing sales service platform, the accuracy and relevance of the matched text are significantly improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115481224B_ABST
    Figure CN115481224B_ABST
Patent Text Reader

Abstract

The application discloses a method for matching text, an electronic device and a computer readable storage medium. Embodiments of the application acquire conversation information in a conversation process, extract at least one type of feature information in the conversation information; acquire portrait information of a client participating in the conversation; acquire a plurality of candidate texts, for each text, extract feature information of the text; for each text, input the feature information of the text, the at least one type of feature information and the portrait information of the client into a text matching model, perform similarity calculation between the text and the conversation information, and obtain a similarity value of the text and the conversation information; from the plurality of candidate texts, according to an order from high to low of the similarity values corresponding to each text, select a set number of texts as texts matching the conversation information. Therefore, an accurate text matching process for conversation information is realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, in particular to a method for matching text, an electronic device and a computer readable storage medium. BACKGROUND

[0002] Text matching using natural language processing (NLP) technology is a relatively mature technology. In different scenarios, different text matching methods can be used to match text. For example, a short query word (query) is used to search the title of the text, and the text with a matching title is matched to the short query word. This text matching method is relatively simple. When the semantic features of the short query word and the semantic features of the short title are processed in the trained neural network model to determine whether they match, the neural network model used is consistent in processing the semantic features of the two, and the processing results are distributed in a similar space, which is accurate and reliable when calculating the similarity. For another example, a query word is used to search the text to obtain the matched text. The search object of this text matching method is a long text including many words, that is, the similarity between the short query word and the long text is calculated using a trained neural network model to determine whether they match. The neural network model used cannot use the same way to process the semantic features of the two, and the processing results will not be distributed in a similar space, which is complex and cannot obtain accurate results when calculating the similarity. For another example, a query text can also be used to search the searched text to obtain the matched text. This text matching method is relatively complex, and the neural network model used to process the semantic features of the two is also complex. This text matching method is not commonly used.

[0003] With the rapid development of Internet technology, various operation service platforms provide various operation services for customers, such as a platform based on sales goods, which provides sales services for customers by a sales service provider, and the like. In this scenario, based on the operation service platform, the sales service provider needs to use an interactive method such as instant messaging (IM) to have a conversation with the customer, learn the customer's demand, recommend the matched text to the customer, so that the customer can continue to consume the operation service on the platform. It can be seen that the text matched and recommended based on the conversation information of the operation service platform directly affects the quality of the operation service. Therefore, how to use a text matching method to accurately match the text based on the conversation information and make subsequent recommendations to improve the operation service quality of the operation service platform is a problem to be solved. SUMMARY

[0004] Therefore, the application provides a text matching method, an electronic device and a computer readable storage medium.

[0005] The application provides a text matching method, which comprises the following steps:

[0006] Obtaining conversation information in a conversation process, and extracting at least one type of feature information in the conversation information;

[0007] Obtaining portrait information of a customer participating in the conversation;

[0008] Obtaining a plurality of candidate texts, and extracting feature information of each text;

[0009] For each text, the feature information of the text, the at least one type of feature information and the portrait information of the customer are input into a text matching model to calculate the similarity between the text and the conversation information, and a similarity value of the text and the conversation information is obtained.

[0010] From the plurality of candidate texts, a certain number of texts are selected according to the order from high to low of the similarity values corresponding to each text, as the texts matching the conversation information.

[0011] In the above method, the extracting at least one type of feature information in the conversation information comprises:

[0012] Extracting one or more combinations of the time sequence semantic feature information of the conversation information, the keyword information of the conversation information, the customer intention information in the conversation information and the conversation stage information to which the conversation information belongs.

[0013] In the above method, the extracting feature information of each text comprises:

[0014] For each text, the title feature information and the semantic feature information of the text are extracted.

[0015] In the above method, the inputting the feature information of each text, the at least one type of feature information and the portrait information of the customer into the text matching model to calculate the similarity between the text and the conversation information, and obtaining the similarity value of the text and the conversation information comprises:

[0016] The feature information of the text is mapped by using a first neural network in the text matching model to obtain a feature vector of the text, and the feature vector of the text is processed by using a first self-attention mechanism neural network in the text matching model to obtain a key feature vector of the text.

[0017] The at least one type of feature information and the portrait information of the customer are mapped by using a second neural network in the text matching model to obtain a feature vector related to the conversation information, and the feature vector related to the conversation information is processed by using a second self-attention neural network in the text matching model to obtain a key feature vector of the conversation information.

[0018] Based on the feature information of the text, generated feature information of the text is constructed, and a third neural network in the text matching model is used for mapping to obtain a generated feature vector of the text.

[0019] The key feature vector of the conversation information and the generated feature vector of the text are input into a fourth neural network in the text matching model for similarity calculation of the generated feature of the text to obtain an adversarial feature vector of the text.

[0020] After the key feature vector of the text and the adversarial feature vector of the text are input into at least one full connection layer unit in the text matching model for at least one classification processing, and then the vector after classification is converted by using a logistic regression layer unit of the text matching model, the similarity value between the text and the conversation information is calculated.

[0021] In the above method, the first neural network is a distilbert network.

[0022] The second neural network is a bi-directional long short-term memory bi-LSTM network.

[0023] The third neural network is a distilbert network.

[0024] In the above method, the fourth neural network performs similarity calculation of the generated feature of the text based on a set function, and the set function is:

[0025] The product value of the set random variable value and the generated feature vector of the text, and the product value of the remaining value of the random variable value and the key feature vector of the conversation information, and the similarity value between the remaining value of the text generated feature and the key feature vector of the conversation information, and the product value between the set Bernoulli distribution random number meeting the set probability.

[0026] In the method, the text matching model is trained, and a structure of the text matching model comprises:

[0027] The first neural network, the first self-attention mechanism neural network, the second neural network, the second self-attention mechanism neural network, the third neural network, the fourth neural network, at least one full connection layer unit, and a logistic regression layer unit, wherein,

[0028] The feature information of the sample text is obtained, the feature vector of the sample text is obtained after the first neural network is mapped, the key feature vector of the sample text is obtained after the first self-attention mechanism neural network is processed on the feature vector of the sample text;

[0029] At least one type of feature information is obtained from the sample conversation information, and sample portrait information of a client participating in the conversation is obtained, the sample feature vector related to the conversation information is obtained after the second neural network is mapped, and the sample key feature vector of the conversation information is obtained after the second self-attention neural network is processed;

[0030] Based on the feature information of the sample text, the generated feature information of the sample text is constructed, and the generated feature vector of the sample text is obtained after the third neural network is mapped;

[0031] The sample key feature vector of the conversation information and the generated feature vector of the sample text are input into the fourth neural network to calculate the similarity of the generated feature of the text, and the adversarial feature vector of the sample text is obtained;

[0032] After the key feature vector of the sample text and the adversarial feature vector of the sample text are input into the at least one full connection layer unit for at least one classification processing, and the vector after classification is converted by the logistic regression layer unit, the similarity value of the text and the conversation information is calculated;

[0033] Based on the calculated similarity value of the text and the conversation information, the parameters in the text matching model are adjusted, and the text matching model is continuously trained in the above manner until a set similarity threshold is met.

[0034] In another embodiment of the present application, an electronic device is also provided, characterized by comprising:

[0035] A processor;

[0036] A memory storing a program configured to implement the method of matching text according to any one of the above when executed by the processor.

[0037] In another embodiment of the present application, a non-transitory computer readable storage medium storing instructions which, when executed by a processor, cause the processor to perform the method of matching text according to any one of the above embodiments is also provided.

[0038] In another embodiment of the present application, a computer program product including a computer program or instructions which, when executed by a processor, implements the method of matching text according to any one of the above embodiments is also provided.

[0039] As seen above, the embodiments of the present application obtain conversation information in a conversation process, extract at least one type of feature information in the conversation information; obtain portrait information of a client participating in the conversation; obtain a plurality of candidate texts, for each of the texts, extract feature information of the text; for each of the texts, input the feature information of the text, and the at least one type of feature information and the portrait information of the client, into a text matching model, to perform similarity calculation between the text and the conversation information, to obtain a similarity value of the text and the conversation information; from the plurality of candidate texts, according to an order from high to low of the similarity value corresponding to each of the texts, select a set number of the texts as texts matching the conversation information. Therefore, the embodiments of the present application not only depend on the plurality of types of feature information in the conversation information when performing text matching, but also depend on the portrait information of the client participating in the conversation, so as to more clearly express the meaning of the conversation, and provide texts with higher matching degree; when matching the texts, the semantic features and title features of the texts are also matched, so that the matched texts are more consistent with the meaning involved in the conversation. The embodiments of the present application realize an accurate text matching process for the conversation information. BRIEF DESCRIPTION OF DRAWINGS

[0040] Figure 1 A structural schematic diagram of the matching text provided by the present application is provided;

[0041] Figure 2 A flowchart of the method of matching text provided by the embodiments of the present application is provided;

[0042] Figure 3 A structural schematic diagram of the architecture of matching text provided by the embodiments of the present application is provided;

[0043] Figure 4 A structural schematic diagram of the matching text model provided by the embodiments of the present application is provided;

[0044] Figure 5 A text display schematic diagram obtained after the matching text provided by the embodiments of the present application is provided;

[0045] Figure 6 A structural schematic diagram of the device of matching text provided by the embodiments of the present application is provided;

[0046] Figure 7 A schematic diagram of an electronic device provided for another embodiment of the present application. DETAILED DESCRIPTION

[0047] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

[0048] The terms "first", "second", "third", "fourth" and the like in the specification and claims of the present application and the above-described drawings (if any) are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, 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 "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units need not be limited to only those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to such a process, method, product or device.

[0049] The technical solutions of the present application will be described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in some embodiments.

[0050] At present, when matching text, considering simplicity and ease of execution, a short query word is usually used to search the title of the text, and the text with a matching title is matched as the text matched by the short query word. Specifically, as shown in Figure 1 , Figure 1 The structure diagram of the matched text provided at present is shown in the figure. The matching is based on a fully connected neural network model, and the general network structure is a double tower network structure. The matching process of the above scheme is performed by the neural network model trained, and the input layer of the neural network model receives the query word vector and the title vector of the text respectively. After that, the semantic feature vector of the query word is extracted from the query word vector, and the semantic feature vector of the title is extracted from the title vector of the text in the representation layer of the neural network model. After the similarity of the two is matched in the matching layer of the neural network model, the final matching score is obtained. The title of the text with the highest matching score is matched as the title of the text matched successfully, so that the text with the title of the text is matched.

[0051] Of course, Figure 1 The process can also be replaced by a query statement and text matching scheme, or a text and text matching scheme, but the accuracy of the matching will be reduced, and the matching process at the matching layer will become complex.

[0052] Currently, the application scenario of the text matching scheme is to recommend articles, and in the process of providing operation services by operation service providers for customers based on an operation service platform, there is no text matching scheme for conversation information in the question and answer interaction scenario between the customer. Adopting Figure 1 When the process is used for text matching for conversation information, there is a problem of inaccurate final matching text. This is because, in the conversation interaction scenario, the final matching text is not only related to the specific semantic features of the conversation information, but also related to the behavior characteristics of the customer, the customer's own characteristics, and the current content theme information. Simply matching the semantic features of the conversation information with the text will result in inaccurate text matching, and the subsequent recommendation to the customer will also not improve the operation service quality of the operation service platform.

[0053] In the application of specific technical fields, there is currently no scheme to match appropriate text for the conversation scenario of specific technical fields. For example, when the operation service platform is a housing sales service platform, based on the previous conversation content between the customer and the broker, the customer's demand and the broker's answer, how to match the text of the conversation content and push the matched text to the customer is currently not achievable. This is because, in this application scenario, on the one hand, the operation service of the broker is strongly dependent on the conversation content with the customer, which can be converted into a real business commission through the conversation content with the customer, so accurate text pushing is required. On the other hand, other operation service platforms can also match and push based on the behavior characteristics of the customer, but in this application scenario, in order to improve the service quality of the broker, not only the behavior characteristics of the customer need to be considered, but also the service quality of the broker and the semantic features of the conversation content need to be considered to match the recommended text. The entire matching process is relatively complex. On the other hand, in this application scenario, there are text matches that have high similarity but low relevance to the conversation information, i.e., the matched text includes the content described in the conversation information, but the matched text has some conditions or domain mismatches. Therefore, in this application scenario, based on the conversation information, how to match accurate text and push it to the customer has become a problem that needs to be solved.

[0054] In order to solve the above problems, the specific text matching method adopted by the embodiment of the application is as follows: obtaining conversation information in a conversation process, extracting at least one type of feature information in the conversation information; obtaining portrait information of a client participating in the conversation; obtaining a plurality of candidate texts, for each text, extracting feature information of the text; for each text, inputting the feature information of the text, the at least one type of feature information and the portrait information of the client into a text matching model, performing similarity calculation between the text and the conversation information, and obtaining a similarity value of the text and the conversation information; from the plurality of candidate texts, selecting a set number of texts according to the order from high to low of the similarity values corresponding to each text, as texts matched with the conversation information.

[0055] In this way, when performing text matching, the embodiment of the application not only depends on one type of feature information in the conversation information, but also includes multiple types of information such as time sequence semantic features of the conversation information, keyword information of the conversation information, client intention information reflected in the conversation information and conversation stage information to which the conversation information belongs, and also depends on the portrait information of the client participating in the conversation, so that the meaning expressed by the conversation is more clear, and the matched text has a higher matching degree. Furthermore, when matching the text, not only the title features of the text are matched, but also the semantic features of the text are matched, so that the matched text is more consistent with the meaning involved in the conversation. In this way, the embodiment of the application realizes an accurate text matching process for the conversation information.

[0056] In the embodiment of the application, different neural network models are used in the text matching model to respectively perform vector encoding mapping on the multiple types of feature information in the conversation information and the portrait information of the client, and to perform vector encoding mapping on the feature information of the text, so as to ensure the effectiveness of the feature vectors used in the subsequent similarity calculation process.

[0057] Furthermore, in the similarity calculation process of the text matching model, the text is also introduced to calculate the adversarial feature vector, so as to improve the robustness of the text matching model and strengthen the degree of matching the text. In order to introduce the adversarial feature vector of the text into the text matching model, a generative neural network is set in the text matching model to generate the adversarial feature vector of the text. The adversarial feature vector of the text has a high similarity but a poor correlation with the conversation information, and the introduction of the adversarial feature vector of the text into the text matching model for calculation can improve the robustness of the text matching model.

[0058] Therefore, the text matching model provided by the embodiments of the present application adopts the architecture concept based on generation and classification, uses the architecture concept of generation to generate the corresponding adversarial feature vector to enhance the processing of the text matching model, and uses the architecture concept of classification to calculate the similarity value, thereby improving the similarity and relevance of the matched text.

[0059] Figure 2 The method for matching text provided by the embodiments of the present application has the following specific steps:

[0060] Step 201: Obtain conversation information in a conversation process, and extract at least one type of feature information in the conversation information.

[0061] Step 202: Obtain portrait information of a client participating in the conversation.

[0062] Step 203: Obtain a plurality of candidate texts, and for each text, extract feature information of the text.

[0063] Step 204: For each text, input the feature information of the text, the at least one type of feature information, and the portrait information of the client into a text matching model, perform similarity calculation between the text and the conversation information, and obtain a similarity value of the text and the conversation information.

[0064] Step 205: From the plurality of candidate texts, select a set number of texts according to the order from high to low of the similarity values corresponding to the texts, as texts for matching the conversation information.

[0065] In the above process, the set number is set according to needs, which is not limited here.

[0066] In the above process, the set number can be set to 1. In this case, the text with the highest similarity value is determined, and the text with the highest similarity value is taken as the text for matching the conversation information.

[0067] In the above process, the execution order of steps 201, 202, and 203 can be simultaneous, sequential, or reverse, which is not limited here.

[0068] In the above process, the portrait information of the client participating in the conversation can be obtained from the conversation information or from the information of the relevant personnel participating in the conversation, which is not limited here.

[0069] It should be understood that in the embodiments of the present disclosure, the conversation information, the portrait information, and the like are obtained under the condition that the user has pre-authorized.

[0070] In the embodiments of the present application, the session information in the session process contains many types of feature information, such as keywords, customer intent (demand), current session stage (session) information, and these information also determines the type of text that the customer is interested in. Therefore, when matching the text, these information needs to be input into the text matching model for processing. Specifically, the extraction of at least one type of feature information in the session information includes:

[0071] The combination of one or more of the timing semantic feature information of the session information, the keyword information of the session information, the customer intent information in the session information, and the session stage information to which the session information belongs.

[0072] In the embodiments of the present application, only matching the title of the text will make the matching inaccurate. Therefore, when matching, the semantic features of the text also need to be matched. Therefore, for each text, the extraction of the feature information of the text includes: for each text, the title feature information and the semantic feature information of the text are extracted.

[0073] The above method uses the architecture shown in Figure 3 The architecture shown in Figure 3 The architecture shown in the embodiments of the present application provides a matching text architecture diagram. As shown in the figure, the timing semantic features, keyword information, customer intent information, and session stage information in the session information, and the title feature information and semantic feature information in the feature information of the text are input into the text matching model for processing, and the similarity value output is obtained.

[0074] Specifically, when the operation service platform is a housing sales service platform, the keyword information in the session information, the customer intent information in the session information, and the category of the customer intent information are as shown in Table 1.

[0075]

[0076]

[0077] Table 1

[0078] Specifically, when the operation service platform is a housing sales service platform, the portrait information of the customer participating in the session includes customer features, broker features, and session features involved, etc. as shown in Table 2.

[0079]

[0080] Table 2

[0081] Specifically, when the operation service platform is a house sales service platform, the session stage information to which the conversation information belongs is a house purchase stage in which the customer is currently located, and the house purchase stage includes a learning stage, a deep learning stage, an intention stage, a transaction stage, and the like.

[0082] In the embodiment of the present application, the text matching model adopts a generation and classification based architecture concept. The generation architecture concept is used to generate a corresponding adversarial feature vector to enhance the processing of the text matching model, and the classification architecture concept is used to calculate the similarity value. Specifically, for each text, the feature information of the text, and the at least one type of feature information and the portrait information of the customer are input into the text matching model to calculate the similarity between the text and the conversation information, and obtain the similarity value between the text and the conversation information, including:

[0083] The feature information of the text is mapped using a first neural network in the text matching model to obtain a feature vector of the text, and the feature vector of the text is processed using a first self-attention mechanism neural network in the text matching model to obtain a key feature vector of the text.

[0084] The at least one type of feature information and the portrait information of the customer are mapped using a second neural network in the text matching model to obtain a feature vector related to the conversation information, and the feature vector related to the conversation information is processed using a second self-attention neural network in the text matching model to obtain a key feature vector of the conversation information.

[0085] Based on the feature information of the text, generate feature information of the text, and map the generate feature information of the text using a third neural network in the text matching model to obtain a generate feature vector of the text.

[0086] The key feature vector of the conversation information and the generate feature vector of the text are input into a fourth neural network in the text matching model to calculate the similarity of the generate feature of the text, and obtain an adversarial feature vector of the text.

[0087] The key feature vector of the text and the adversarial feature vector of the text are input into at least one layer of fully connected layer unit in the text matching model for at least one classification processing, and then the vector after classification is converted through the logistic regression layer unit of the text matching model, and the similarity value between the text and the conversation information is calculated.

[0088] In one example embodiment, the first neural network is a distilbert network; the second neural network is a bi-directional long short-term memory (bi-LSTM) network; and the third neural network is a distilbert network. However, it should be understood that embodiments of the present disclosure are not limited thereto.

[0089] It can be seen that, for the conversation information of the conversation process, a bi-LSTM network is used to obtain the corresponding feature vector due to the inclusion of multiple types of feature information, which have correlations between them, and for the feature information of the text, a distilbert network is used for processing.

[0090] In the embodiments of the present application, the fourth neural network is a generative neural network for generating an adversarial feature vector, which is used to improve the robustness of the text matching model. In specific implementation, the fourth neural network performs similarity calculation on the generated features of the text based on a set function, which is: the product value of a set random variable value and the generated feature vector of the text, and the product value of the remaining value of the random variable value and the key feature vector of the conversation information, and the sum of the two, the value of the random variable value is: the product value between the remaining value of the set similarity value between the generated features of the text and the key feature vector of the conversation information and the Bernoulli distribution random number set to meet the set probability.

[0091] The formula expression of the function used by the fourth neural network is:

[0092] (1)

[0093] wherein, represents the generated feature vector of the text generated by the distilBert network from the generated feature information of the text; M is the corresponding feature vector obtained by the bi-LSTM network from the conversation information; Y is a parameter, representing the similarity of the two, when y=0, the output is , when y=1, the output is M. In order to add noise, the present application introduces a z, which is a Bernoulli distribution random number meeting the set probability, which is to strengthen the robustness of the text matching model.

[0094] Here, s(D, M) is defined as the similarity value of the text and the conversation information, when s=1, it means that the two are matched, when s=0, it means that the two are not matched, s is the output of the full connection layer unit of the text matching model, taking the value of 0-1, as the final similarity value.

[0095] In the above process, when the vector converted by the logistic regression layer unit of the text matching model after classification is converted, the similarity value of the text and the session information is calculated, the logistic regression layer unit of the text matching model adopts a normalization (softmax) function for vector conversion, and the score obtained is the similarity value. The softmax function adopts an existing formula, which is specifically:

[0096]

[0097] Here, softmax (WX+b) is the expression of softmax, indicating that the probability calculation of wx+b parameters is normalized to obtain a value in the interval [0, 1], which is used as the final score socre. Where WX+b= , specifically . represents the text generation feature information generated by the distilBert network; M is the corresponding feature vector obtained by the bi-LSTM network of the session information; y represents the similarity of the two, z is a Bernoulli distribution random number conforming to a set probability, and D represents the text generation feature information, is a coefficient set for the text generation feature information, which is set according to an empirical value.

[0098] The score represents the correlation between the text and the session information, and the recalled text is recommended according to the high and low of the score.

[0099] In the embodiment of the application, the text matching model is trained, and the objective function of the text matching model is:

[0100] wherein, is a set hyperparameter, in order to make the model more easily distinguish the adversarial feature vector, and is set to a value greater than 1. x and y respectively represent the input of the model, that is, x is the key feature vector of the session information of the at least one type of user feature information and the portrait information of the customer, and y is the feature information of the text. The subscript i of x and y identifies the number value of the key feature vector of the session information and the generation feature vector of the text to be calculated for similarity, and N is the total number value of the key feature vector of the session information and the generation feature vector of the text to be calculated for similarity, is a function for calculating a random variable value, which is calculated based on the key feature vector of the session information when calculating.

[0101] In the embodiment of the application, the structure of the text matching model is as shown in Figure 4 .Figure 4 The structure diagram of the text matching model provided by the embodiment of the present application comprises: a first neural network, a first self-attention mechanism neural network, a second neural network, a second self-attention mechanism neural network, a third neural network, a fourth neural network, at least one layer of a fully connected layer unit, and a logistic regression layer unit, wherein,

[0102] The feature information of the sample text is obtained, and after being mapped by the first neural network, the feature vector of the sample text is obtained. After the feature vector of the sample text is processed by the first self-attention mechanism neural network, the key feature vector of the sample text is obtained. At least one type of feature information is obtained from the sample conversation information, and the sample portrait information of the customer participating in the conversation is obtained. After being mapped by the second neural network, the sample feature vector related to the conversation information is obtained. After being processed by the second self-attention neural network, the sample key feature vector of the conversation information is obtained.

[0103] Based on the feature information of the sample text, the generated feature information of the sample text is constructed, and after being mapped by the third neural network, the generated feature vector of the sample text is obtained.

[0104] The sample key feature vector of the conversation information and the generated feature vector of the sample text are input into the fourth neural network to calculate the similarity of the generated feature of the text, and the adversarial feature vector of the sample text is obtained.

[0105] After the key feature vector of the sample text and the adversarial feature vector of the sample text are input into the at least one layer of the fully connected layer unit for at least one time of classification processing, and then the vector after classification is converted by the logistic regression layer unit, the similarity value of the text and the conversation information is calculated.

[0106] Based on the calculated similarity value of the text and the conversation information, the parameters in the text matching model are adjusted, and the text matching model is continuously trained in the above manner until the set similarity threshold is met.

[0107] Here, the first neural network is a distilbert network, the second neural network is a bi-LSTM network, the third neural network is a distilbert network, and the fourth neural network is realized by setting a function, that is, realized by the above formula (1).

[0108] Here, when constructing the generated feature information of the sample text, the feature information of the sample text can be replaced by using the set rules, that is, the sample text is taken as a positive sample, and the regional information, category information or / and time information in the positive sample is randomly replaced to obtain the generated feature information of the sample text. The generated feature information of the sample text is negative sample feature information. The purpose of using this way is to retain the vector features related to the similarity and destroy the vector features related to the correlation when the model is trained and subsequently applied.

[0109] After the text matching of the trained text matching model, the text with high correlation but low similarity to the conversation information is excluded, and the text with high similarity and same attribute is filtered out and recommended to the customer. Therefore, the accuracy of the matched text is ensured.

[0110] In a specific example, when the operation service platform is a house sales service platform, the text matching method provided by the embodiment is run on the platform, the conversation information is obtained within a set time, and the text is matched and pushed after the matching. For example, the set time is 1 day. As shown in Figure 5 , the text matching method provided by the embodiment is run on the platform, the conversation information is obtained within a set time, and the text is matched and pushed after the matching. For example, the set time is 1 day. As shown in Figure 5 The text display schematic diagram obtained after the text matching provided by the embodiment is shown in the figure. The left side of the figure presents the image of the description text displayed by the broker, and the right side presents the image of the description text recommended to the customer. It can be seen that the image of the description text recommended to the customer is the same as the image of the description text that the broker wants to push to the customer. Through statistics, the image of the description text recommended to the customer with the highest similarity value has a 78% adoption rate, and the image of the description text recommended to the customer with the third highest similarity value has an 86% adoption rate. Therefore, the text matching process using the embodiment improves the accuracy of text matching.

[0111] Figure 6 The device structure schematic diagram of the text matching provided by the embodiment is shown. The device includes an acquisition unit, a matching unit and an output unit, wherein,

[0112] The acquisition unit is configured to acquire the conversation information in the conversation process, extract at least one type of feature information in the conversation information, acquire the portrait information of the customer participating in the conversation, and acquire a plurality of candidate texts, and extract the feature information of each text.

[0113] The matching unit is configured to input the feature information of each text, the at least one type of feature information and the portrait information of the customer into a text matching model, calculate the similarity between the text and the conversation information, and obtain the similarity value between the text and the conversation information.

[0114] The output unit is configured to select a preset number of the texts from the plurality of candidate texts according to the order of the similarity values from high to low, as the texts matching the session information.

[0115] In another embodiment of the present application, an electronic device is provided, which can include a processor, and a memory storing a program configured to implement the method for matching texts as described above when executed by the processor.

[0116] In another embodiment of the present application, a non-transitory computer readable storage medium is provided, which stores instructions that, when executed by a processor, cause the processor to perform the method for matching texts in the foregoing embodiments. Figure 7 An example of an electronic device according to another embodiment of the present application is shown in FIG. 7. As shown in FIG. 7, the electronic device according to another embodiment of the present application can include a processor 701, wherein the processor 701 is configured to perform the steps of the method for matching texts as described above. Figure 7 As can be further seen from FIG. 7, the electronic device according to another embodiment of the present application can also include a non-transitory computer readable storage medium 702, wherein the non-transitory computer readable storage medium 702 stores a computer program that, when executed by the processor 701, performs the steps of the method for matching texts as described above. Figure 7 As can be further seen from FIG. 7, the electronic device according to another embodiment of the present application can also include a non-transitory computer readable storage medium 702, wherein the non-transitory computer readable storage medium 702 stores a computer program that, when executed by the processor 701, performs the steps of the method for matching texts as described above.

[0117] In particular, the non-transitory computer readable storage medium 302 can be a general storage medium such as a mobile disk, a hard disk, a FLASH, a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), or a portable compact disk read-only memory (CD-ROM), etc., and the computer program stored on the non-transitory computer readable storage medium 302, when executed by the processor 301, can cause the processor 601 to perform the steps of the method for matching texts as described above.

[0118] In practice, the non-transitory computer readable storage medium 702 can be included in the device / apparatus / system described in the foregoing embodiments, or can exist separately and not be assembled into the device / apparatus / system. The computer readable storage medium carries one or more programs, which, when executed, can perform the steps of the method for matching texts as described above.

[0119] In another embodiment of the present application, a computer program product is provided, which includes a computer program or instructions that, when executed by a processor, implement the steps of the method for matching texts as described above.

[0120] The computer program product of the first aspect can include a computer readable storage medium. The computer readable storage medium can include instructions. The instructions can include one or both of: instructions for causing a computer to implement a method of the first aspect; and instructions for causing a computer to implement an apparatus of the second aspect. The computer readable storage medium can be tangible. The computer readable storage medium can include one or more of: nonvolatile memory, volatile memory, magnetic storage, optical storage, and so on. The computer readable storage medium can include one or more of: a semiconductor-based or other integrated circuit, a

[0121] Those skilled in the art will understand that the features recited in the various embodiments and / or claims of the present disclosure can be combined and / or interchanged, even if this is not explicitly stated in the present application. In particular, the features recited in the various embodiments and / or claims of the present application can be combined and / or interchanged, without departing from the spirit and teachings of the present application, and all such combinations and / or interchanges are to be considered within the scope of the present disclosure.

[0122] The principles and implementation ways of the present application are described in the specific embodiments. The above description of the embodiments is only to help understand the method of the present application and its core idea, and is not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. made by those skilled in the art according to the ideas, spirits and principles of the present application in the specific implementation ways and application ranges shall be included in the scope of protection of the present application.

Claims

1. A method for matching text, characterized in that, The method includes: Acquire session information during the session and extract at least one type of feature information from the session information; Obtain profile information of customers participating in the conversation; Obtain multiple candidate texts, and extract feature information from each text; For each text, the feature information of the text, the feature information of at least one type, and the profile information of the customer are input into the text matching model to calculate the similarity between the text and the conversation information, and obtain the similarity value between the text and the conversation information. From multiple candidate texts, a set number of texts are selected as the texts that match the conversation information, based on the similarity values ​​of each text from high to low. For each text, the feature information of the text, the feature information of at least one type, and the customer profile information are input into a text matching model to calculate the similarity between the text and the conversation information, thereby obtaining a similarity value between the text and the conversation information, including: The feature information of the text is mapped using the first neural network in the text matching model to obtain the feature vector of the text. The feature vector of the text is then processed using the first self-attention mechanism neural network in the text matching model to obtain the key feature vector of the text. The feature information of at least one type and the customer profile information are mapped using the second neural network in the text matching model to obtain the feature vector related to the conversation information. The feature vector related to the conversation information is then processed using the second self-attention mechanism neural network in the text matching model to obtain the key feature vector of the conversation information. Based on the feature information of the text, the generation feature information of the text is constructed, and after mapping using the third neural network in the text matching model, the generation feature vector of the text is obtained. The key feature vector of the conversation information and the generated feature vector of the text are input into the fourth neural network in the text matching model to calculate the similarity of the generated features of the text, thereby obtaining the adversarial feature vector of the text. The key feature vector and adversarial feature vector of the text are input into at least one fully connected layer unit in the text matching model for at least one classification process. After the classified vectors are transformed by the logistic regression layer unit of the text matching model, the similarity value between the text and the conversation information is calculated.

2. The method for matching text as described in claim 1, characterized in that, The extraction of at least one type of feature information from the session information includes: Extract one or more of the following: temporal semantic features of the conversation information, keyword information of the conversation information, customer intent information in the conversation information, and conversation stage information to which the conversation information belongs.

3. The method for matching text as described in claim 1 or 2, characterized in that, The step of extracting feature information for each text includes: For each text, extract the title feature information and semantic feature information of the text.

4. The method for matching text as described in claim 1, characterized in that, The first neural network is a Distilbert network; The second neural network is a bidirectional long short-term memory (bi-LSTM) network; The third neural network is a Distilbert network.

5. The method for matching text as described in claim 1, characterized in that, The fourth neural network calculates the similarity of the generated features of the text based on a set function, wherein the set function is: The sum of the product of the set random variable value and the generated feature vector of the text, and the product of the residual value of the random variable value and the key feature vector of the session information, wherein the value of the random variable is: the residual value of the similarity value between the generated feature of the text and the key feature vector of the session information, and the product of the set random number conforming to the set probability of the Bernoulli distribution.

6. The method for matching text as described in claim 1, characterized in that, The text matching model is trained, and its structure includes: The network comprises a first neural network, a first self-attention mechanism neural network, a second neural network, a second self-attention mechanism neural network, a third neural network, a fourth neural network, at least one fully connected layer unit, and a logistic regression layer unit, wherein... The feature information of the sample text is obtained, and after mapping through the first neural network, the feature vector of the sample text is obtained. After processing the feature vector of the sample text using the first self-attention mechanism neural network, the key feature vector of the sample text is obtained. At least one type of feature information is obtained from the sample session information, and sample profile information of customers participating in the session is obtained. After mapping through the second neural network, the sample feature vector related to the session information is obtained. After processing by the second self-attention mechanism neural network, the sample key feature vector of the session information is obtained. Based on the feature information of the sample text, the generation feature information of the sample text is constructed, and after mapping using the third neural network, the generation feature vector of the sample text is obtained. The sample key feature vector of the conversation information and the generated feature vector of the sample text are input into the fourth neural network to calculate the similarity of the generated features of the text, thereby obtaining the adversarial feature vector of the sample text. After the key feature vector and adversarial feature vector of the sample text are input into the at least one fully connected layer unit for at least one classification process, and then the classified vector is transformed by the logistic regression layer unit, the similarity value between the text and the conversation information is calculated. The parameters in the text matching model are adjusted based on the calculated similarity value between the text and the conversation information, and then the text matching model is trained again in the above manner until the set similarity threshold is met.

7. An electronic device, characterized in that, include: processor; A memory storing a program configured to implement, when executed by the processor, the method for matching text as described in any one of claims 1 to 6.

8. A non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores instructions, characterized in that, When executed by a processor, the instructions cause the processor to perform the method of matching text as described in any one of claims 1 to 6.

9. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the method for matching text as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Information feedback method and device, terminal and storage medium

    CN113157876A