CN114548314A - Text matching method and device, storage medium and electronic equipment - Google Patents

Text matching method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN114548314A
CN114548314A CN202210199238.6A CN202210199238A CN114548314A CN 114548314 A CN114548314 A CN 114548314A CN 202210199238 A CN202210199238 A CN 202210199238A CN 114548314 A CN114548314 A CN 114548314A
Authority
CN
China
Prior art keywords
vector
text
information
question
candidate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210199238.6A
Other languages
Chinese (zh)
Inventor
马勇强
杨杰
罗晓华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Netease Zaigu Technology Co Ltd
Original Assignee
Hangzhou Netease Zaigu Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Netease Zaigu Technology Co Ltd filed Critical Hangzhou Netease Zaigu Technology Co Ltd
Priority to CN202210199238.6A priority Critical patent/CN114548314A/en
Publication of CN114548314A publication Critical patent/CN114548314A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/25Fusion techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/044Recurrent networks, e.g. Hopfield networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N5/00Computing arrangements using knowledge-based models
    • G06N5/02Knowledge representation; Symbolic representation
    • G06N5/022Knowledge engineering; Knowledge acquisition

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Computing Systems (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Molecular Biology (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The disclosure relates to the technical field of computers, and discloses a text matching method and device, a storage medium and an electronic device. The method comprises the following steps: performing feature cross processing on an input text of a user and a candidate problem text corresponding to the input text to obtain a problem cross vector; performing feature cross processing on the input text and the answer text of the candidate question text to obtain an answer cross vector; performing feature vector conversion on user interaction information to obtain first vector representation, and performing feature vector conversion on problem structured information of the candidate problem text to obtain second vector representation; and 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 vectors. The text matching method and the text matching device can improve the accuracy of text matching.

Description

Text matching method and device, storage medium and electronic equipment
Technical Field
Embodiments of the present disclosure relate to the field of computer technologies, and in particular, to a text matching method, a text matching apparatus, a computer-readable storage medium, and an electronic device.
Background
This section is intended to provide a background or context to the embodiments of the disclosure recited in the claims and the description herein is not admitted to be prior art by inclusion in this section.
The text matching technology is a technology for realizing text matching in the form of text similarity and text correlation calculation, and is widely applied to the fields of intelligent question answering, knowledge retrieval, search engines, language learning application, information flow recommendation and the like. In the related technology, a text input by a user and a candidate question text are analyzed, matched and sequenced on a text level, so that an answer text corresponding to a matching result is displayed.
Disclosure of Invention
In this context, embodiments of the present disclosure are intended to provide a text matching method, a text matching apparatus, a computer-readable storage medium, and an electronic device.
According to a first aspect of the disclosed embodiments, there is provided a text matching method, including: performing feature cross processing on an input text of a user and a candidate problem text corresponding to the input text to obtain a problem cross vector; performing feature cross processing on the input text and the answer text of the candidate question text to obtain an answer cross vector; performing feature vector conversion on the user interaction information of the user to obtain a first vector representation, and performing feature vector conversion on the problem structured information of the candidate problem text to obtain a second vector representation; and 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 vectors.
According to a second aspect of the embodiments of the present disclosure, there is provided a text matching apparatus including: the first feature cross processing module is used for performing feature cross processing on an input text of a user and a candidate problem text corresponding to the input text to obtain a problem cross vector; the second feature cross processing module is used for performing 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 used for performing characteristic vector conversion on the user interaction information of the user to obtain a first vector representation, and performing characteristic vector conversion on the problem structured information of the candidate problem text to obtain a second vector representation; and the text matching module is used for performing fusion processing on the question cross vector, the answer cross vector, the first vector representation and the second vector representation which correspond 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 vectors.
According to a third aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements any one of the text matching methods described above.
According to a fourth aspect of the disclosed embodiments, there is provided an electronic device comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform any of the text matching methods described above via execution of the executable instructions.
According to the text matching method, the text matching device, the computer readable storage medium and the electronic device in the embodiments of the present disclosure, on one hand, feature intersection is performed on an input text and a candidate question text, and also feature intersection is performed on the input text and an answer text, so that in a text matching process, feature relevance among the input text, the candidate question text and the answer text is fully utilized, and the expression accuracy of a matching result on a text level is improved; on the other hand, a template pattern of text matching is broken through, user interaction information and problem structural information of candidate problem texts are introduced in the text matching process, various interaction behaviors generated before and in the matching process of a user are considered, meanwhile, an organization structure of problems is introduced, the matching degree of a matching result in the current matching environment is improved, and richer text matching is further realized; on the other hand, the problem cross vector and the answer cross vector of the text level are integrated with the first vector representation and the second vector representation of the current matching environment level, the utilization of various effective matching information in text matching is expanded, the accuracy of text matching is improved, and the user experience of related products using the text matching method of the embodiment of the disclosure is further improved.
Drawings
The above and other objects, features and advantages of exemplary embodiments of the present disclosure will become readily apparent from the following detailed description read in conjunction with the accompanying drawings. Several embodiments of the present disclosure are illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings and in which:
FIG. 1 shows a flow diagram of a text matching method according to an embodiment of the present disclosure;
FIG. 2 illustrates a schematic diagram of the organization of questions in a knowledge base of questions and answers in accordance with an embodiment of the present disclosure;
FIG. 3 illustrates a flow diagram of feature intersection processing of an input text vector with a candidate question vector according to an embodiment of the present disclosure;
FIG. 4 illustrates a flow diagram for obtaining a first vector representation and a second vector representation according to an embodiment of the disclosure;
FIG. 5 illustrates a schematic diagram of a tag category tree structure in accordance with an embodiment of the present disclosure;
FIG. 6 shows a flow diagram for obtaining a second sub-vector according to an embodiment of the present disclosure;
FIG. 7 illustrates a schematic diagram of a text matching model in accordance with an embodiment of the present disclosure;
FIG. 8 shows a schematic diagram of another text matching model in accordance with an embodiment of the present disclosure;
FIG. 9 illustrates a schematic diagram of yet another text matching model, according to an embodiment of the present disclosure;
FIG. 10 shows a schematic diagram of a text matching apparatus according to an embodiment of the present disclosure;
FIG. 11 shows a schematic diagram of a storage medium according to an embodiment of the present disclosure;
FIG. 12 shows a schematic diagram of an electronic device according to an embodiment of the disclosure.
Detailed Description
The principles and spirit of the present disclosure will be described with reference to a number of exemplary embodiments. It is understood that these embodiments are given solely for the purpose of enabling those skilled in the art to better understand and to practice the present disclosure, and are not intended to limit the scope of the present disclosure in any way. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
As will be appreciated by one skilled in the art, embodiments of the present disclosure may be embodied as a system, apparatus, device, method, or computer program product. Accordingly, the present disclosure may be embodied in the form of: entirely hardware, entirely software (including firmware, resident software, micro-code, etc.), or a combination of hardware and software.
According to an embodiment of the present disclosure, a text matching method, a text matching device, a computer-readable storage medium, and an electronic apparatus are provided.
In this document, any number of elements in the drawings is by way of example and not by way of limitation, and any nomenclature is used solely for differentiation and not by way of limitation.
The principles and spirit of the present disclosure are explained in detail below with reference to several representative embodiments of the present disclosure.
Summary of The Invention
In the existing text matching method, generally, an input text of a user and a candidate question text are analyzed, coded and matched at a text level, and an answer text corresponding to a matching result is displayed. However, in the matching process, only a single matching result between the input text and the candidate text is considered at a text level, so that the accuracy of the matching result is influenced, the accuracy of the displayed answer text is further influenced, the situation of 'question answering' occurs, and the user experience of related products is easily influenced.
Aiming at improving the accuracy of the text matching method, the text similarity matching algorithm is usually optimized, but is still limited to the stereotype mode of text matching, and the essence of text matching is still the matching of the input text and the candidate problem text at the text level. In the embodiment of the disclosure, a template pattern of text matching is broken through, in the process of text matching, user interaction information and problem structural information of a candidate problem text are introduced, various interaction behaviors generated before and in the process of text matching by a user are considered, meanwhile, an organization structure of a problem is introduced, the matching degree of a matching result in the current matching environment is improved, richer text matching is further realized, the matching result is finally determined through a comprehensive text level and the current matching environment level, utilization of various effective matching information in text matching is expanded, the accuracy of text matching is improved, and further, the user experience of related products of the text matching method applying the embodiment of the disclosure is improved.
Having described the general principles of the invention, various non-limiting embodiments of the invention are described in detail below.
Exemplary application scenarios
It should be noted that the following application scenarios are merely illustrated to facilitate understanding of the spirit and principles of the present invention, and the embodiments of the present disclosure are not limited in this respect. Rather, embodiments of the present disclosure may be applied to any scenario where applicable.
The text matching method of the embodiment of the disclosure can be applied to various application scenarios related to text matching.
In one application scenario, an intelligent customer service application may be involved. Generally, in this application scenario, a question is posed by a client and an answer is made by a robot. The robot may determine a matching result of the input text from a plurality of candidate question texts and output the matching result according to the feature correlations between the input text and the candidate question texts and between the input text and the answer text, and by integrating the user interaction information, the question structured information, and the like by using the text matching method of the embodiment of the present disclosure.
In another application scenario, a knowledge learning application may be involved. Generally, in this application scenario, during the learning process, the user can input the text of the problem in the knowledge learning application and output the correct answer of the input text of the problem by the knowledge learning application. In this application scenario, the text matching method according to the embodiment of the present disclosure may be utilized to perform feature cross processing on an input problem text and a candidate problem text in a problem library, perform feature cross processing on the input problem text and an answer text, perform feature vector conversion on user interaction information and problem structural information of a user in a learning process, finally fuse the obtained vectors, determine a matching result of the input problem text from the candidate problem text based on the fusion result, and display the answer text corresponding to the candidate problem text for the user to learn and use.
Exemplary method
In conjunction with the above application scenarios, a text matching method according to an exemplary embodiment of the present disclosure is described below with reference to fig. 1.
In this context, it is to be understood that the terms referred to include at least the following:
question-answer knowledge base: the structured knowledge storage system stores predefined question texts which can be asked by a user, each question text comprises a standard dialect text and a plurality of similar question texts, and the standard dialect text and the similar question texts have the same and unique corresponding answer texts. As shown in fig. 2, the question text "why the express delivery is not going to home" includes the standard technical text "why the express delivery is not going to home", the similar question text "the courier directly puts things in the express cabinet and does not go to home", "the courier lets me go to the pickup point" and "the express delivery is not going to home and is all put in the express delivery point", and the unique corresponding answer text "the going-to-home policy of different express deliveries is different according to the situation of the cell where you are located". Of course, the number of similar question texts is not limited to that in this example.
Text recall: and a process of acquiring a certain number of candidate question texts from the question-answer knowledge base according to the input texts of the user so as to narrow the text matching range and facilitate the subsequent text matching process.
The flow of the text matching method according to the exemplary embodiment of the present disclosure as illustrated in fig. 1 may include steps S110 to S140:
step S110, the input text of the user and the candidate question text corresponding to the input text are subjected to feature cross processing to obtain a question cross vector.
In an exemplary embodiment of the present disclosure, the candidate question text is obtained by text recall of a knowledge base of question and answer from the input text. The recalled candidate question text may include standard conversational text of the question text in the question-and-answer knowledge base, may also include similar question text of the question text, and may also include standard conversational text of the question text and similar question text. And performing feature cross processing on the input text and the candidate problem text, and performing cross feature learning and cross feature extraction on the input text and the candidate problem text through a feature cross extraction model to obtain a problem cross vector. Feature cross-extraction models include, but are not limited to, attention models, self-attention models, Fusion matrices (Fusion Matrix), and the like.
Through feature cross processing between the input text and the candidate problem text, the feature relevance of the input text and the candidate problem text is calculated based on the input text and the candidate problem text to obtain a problem cross vector, and further through introducing the feature relevance of the input text and the candidate problem text in the subsequent text matching process, the matching accuracy of the text level is improved.
In step S120, the input text and the answer text of the candidate question text are subjected to feature intersection processing to obtain an answer intersection vector.
In an exemplary embodiment of the present disclosure, cross feature learning and cross feature extraction may also be performed on the input text and the answer text through a feature cross extraction model, so as to extract an answer cross vector according to the degree of feature association in the input text and the answer text, and further improve the matching accuracy at a text level by introducing the feature association between the input text and the answer text in a subsequent text matching process.
In step S130, feature vector conversion is performed on the user interaction information of the user to obtain a first vector representation, and feature vector conversion is performed on the question structured information of the candidate question text to obtain a second vector representation.
In an exemplary embodiment of the present disclosure, the user interaction information is related interaction information generated before a user performs a text matching operation and during a text matching process. For example, in an intelligent customer service application scenario, the user interaction information may include channel and entry information of the user entering the intelligent customer service system, and various interaction behaviors generated before the user enters the intelligent customer service system or in the process of customer service consultation performed by the intelligent customer service system, such as article acquisition, work order application, consulted customer service times, browsing records, and the like. The channel and entrance information refers to a mode of entering the intelligent customer service system by a user, for example, the user enters by clicking a link shared by other users, or enters by triggering an entrance control provided by an article acquisition interface, or the type of an operating system used by the user when logging in, such as android or IOS. In the knowledge learning application scenario, the user interaction information may include knowledge learning behaviors of the user before and after text matching, such as learned knowledge points, collected knowledge points, knowledge retrieval times, and the like. All the information related to various types of interaction behavior generated before the user performs the current text matching operation or during the current text matching process belong to the user interaction information described in the exemplary embodiment of the present disclosure, which is not listed here.
In an exemplary embodiment of the disclosure, the question structured information includes information about interaction behavior of candidate question texts and an organization structure of the question. The problem structured information of the user interaction information and the candidate problem text comprises discrete information and continuous information.
The first continuous information in the user interaction information is statistical information of historical interaction behaviors of the user in a first preset time. For example, the number of times the user has performed text matching operations (e.g., number of times of consulting customer service) within a preset time period, the number of times the user has acquired related items within a preset time period, the number of times the user browses related information within a preset time period, and the like. The first discrete information in the user interaction information is non-statistical interaction information of the user before the text matching operation and in the text matching process, such as the operating system type of a terminal corresponding to the user, the channel and entry information of the user entering the text matching operation, and the like.
The second continuous information in the problem structured information is statistical information of historical interaction behaviors of the candidate problem text in a second preset time, for example, the solution rate, the exposure rate and the like of the candidate problem text in a preset time period; the second discrete information in the question structured information is the organization structure of the candidate question texts, for example, the question structured information is the question organization information of the candidate question texts determined based on the label category tree structure corresponding to the question knowledge base, for example, the question organization information corresponding to the candidate question text "why the candidate question text is not going to be visited quickly" may include keywords such as "logistics", "forward transportation", etc., and the candidate question texts may be quickly located in the question and answer knowledge base based on the question structured information.
In the exemplary embodiment of the disclosure, the problem structural information of the user interaction information and the candidate problem text is supported to be introduced in the text matching process, a first vector representation corresponding to the user interaction information and a second vector representation corresponding to the problem structural information are firstly determined, and the content of the user interaction information or the problem structural information is represented in a vector manner, so that vector fusion can be performed subsequently.
In step S140, a question cross vector, an answer cross vector, a first vector representation, and a second vector representation corresponding to the same candidate question text are subjected to a fusion process to obtain a target vector for each candidate question text, and a matching result of the input text is determined from the candidate question texts based on the target vectors.
By the exemplary embodiment of the present disclosure, the candidate question text and the input text are subjected to feature intersection processing to obtain a question intersection vector, the answer text of the candidate question text and the input text are subjected to feature intersection processing to obtain an answer intersection vector, the question structural information of the candidate question text is subjected to feature vector conversion to obtain a second vector representation, and the first vector representation is determined according to a user corresponding to the input text and is the same for each candidate question text. Thus, for the same candidate question text, a corresponding question cross vector, answer cross vector, first vector representation and second vector representation may be included.
In some possible embodiments, the merging of the question cross vector, the answer cross vector, the first vector representation and the second vector representation corresponding to the same candidate question text may be: and transversely 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.
For example, if the question cross vector x is ═ a, b, c ], the answer cross vector y is ═ e, f, g, the first vector is represented as m ═ h, i, j, the second vector is represented as n ═ k, l, o, then the question cross vector x, the answer cross vector y, the first vector is represented as m, and the second vector is represented as n, the problem cross vector x, the answer cross vector y, the first vector is represented as m, and the second vector is represented as n, and the obtained stitching vector is w ═ a, b, c, e, f, g, h, i, j, k, l, o. It should be noted that the transverse splices mentioned herein are similar to the above, and the transverse splices will not be described in detail.
By the aid of the method and the device, the problem cross vectors and the answer cross vectors in the text level are integrated with the first vector representation and the second vector representation in the current matching environment level, utilization of effective matching information in text matching is expanded, and accuracy of determining the matching result of the input text from the candidate problem text based on the target vector is improved.
In an exemplary embodiment of the present disclosure, an implementation of a method for performing feature intersection processing on a vector is also provided. Through feature intersection processing between the input text vector and the candidate question vector, obtaining a question intersection vector may include steps S310 and S320 as follows:
step S310, the input text and the candidate question text are respectively input to a pre-trained language characterization model to obtain an input text vector and a candidate question vector.
Obtaining an input text vector by inputting an input text into a pre-trained language representation model; and inputting the candidate question texts into the pre-trained language representation model to obtain candidate question vectors, namely, sentence representations of full text semantics of the fusion input texts and sentence representations of full text semantics of the fusion candidate question texts can be obtained through the pre-trained language representation model.
Step S320, performing feature intersection processing on the input text vector and the candidate problem vector to obtain a problem intersection vector.
The input text and the candidate problem text can be respectively coded through the pre-trained language characterization model to generate a fixed-length digital vector or vector sequence, namely the input text vector and the candidate problem vector. The pre-trained language characterization models include, but are not limited to, Word Embedding (Word Embedding), Bert models, and the like. The Bert model is a Transformer-based language model and is used for realizing a multi-layer bidirectional Transformer encoder, and the Bert model aims to obtain the representation of texts containing rich semantic information by utilizing large-scale unmarked linguistic data. The input of the Bert model is each character/word in the text, and the output is vector representation of each character/word in the text after full-text semantic information is fused.
The input text and the candidate problem text are respectively input into a pre-trained language representation model and are respectively converted into vector representation, the obtained input text vector is fused with full-text semantic information of the input text, and the obtained candidate problem vector is fused with full-text semantic information of the candidate problem text.
And after the input text vector and the candidate problem vector are obtained, performing feature cross processing on the input text vector and the candidate problem vector to obtain a problem cross vector. In an exemplary embodiment of the present disclosure, cross feature learning and cross feature extraction may be performed on the input text vector and the candidate question vector through a feature cross extraction model to extract a question cross vector according to a degree of association of features in the input text vector and the candidate question vector.
By the exemplary embodiment of the disclosure, the input text vector fused with the full-text semantic information of the input text and the candidate problem vector fused with the full-text semantic information of the candidate problem text are subjected to feature cross processing, so that in the text matching process, the feature relevance between the input text and the candidate problem text is fully utilized, and the expression accuracy of the subsequent matching result on the text level is further improved.
It should be noted that, in the exemplary embodiment of the present disclosure, the answer cross vector may 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 to 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 a specific processing procedure, refer to the procedure of determining the problem cross vector from step S310 to step S320, which is not described herein again.
By the exemplary embodiment of the disclosure, the input text vector fusing the full-text semantic information of the input text and the answer text vector fusing the full-text semantic information of the answer text are subjected to feature cross processing, so that in the text matching process, the expression accuracy of the matching result on the text level is further improved by using the feature relevance of the input text and the candidate question text and the feature relevance of the input text and the answer text, and the accuracy of subsequent text matching is further improved.
In an exemplary embodiment of the present disclosure, an implementation of feature vector conversion of information is also provided. Performing feature vector conversion on user interaction information of a user to obtain a first vector representation, and performing feature vector conversion on question structural information of a candidate question text to obtain a second vector representation, which may include steps S410 to S440:
step S410, determining a category identification of the discrete information, and determining a first sub-vector of the discrete information according to the random initialization vector corresponding to the category identification.
The user interaction information and the problem structured information both comprise discrete information, the discrete information is provided with a uniquely determined category identifier and a random initialization vector, the random initialization vector is used as a characteristic vector of the discrete information, the random initialization vector corresponding to the discrete information can be inquired through the category identifier, and then a first sub-vector of the discrete information, namely vector expression of the discrete information, is determined according to the random initialization vector.
Step S420, standardizing the continuous information, and forming a second sub-vector according to the standardized continuous information.
The user interaction information and the problem structured information both comprise continuous information, the continuous information is statistical information of interaction behaviors of users or problems, the continuous information of different information sources has different expression spaces and/or expression modes, the continuous information with a standard expression mode is obtained by standardizing the continuous information, and then a second sub-vector, namely vector expression of the continuous information, can be formed based on the continuous information after the standardized treatment.
Step S430, perform fusion processing on the first user sub-vector and the second user sub-vector to obtain a first vector representation.
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. The second sub-vector includes a second user sub-vector corresponding to the first continuous information and a second problem sub-vector corresponding to the second continuous information, that is, the first user sub-vector may be determined according to the random initialization vector corresponding to the category identifier of the first discrete information, the first problem sub-vector may be determined according to the random initialization vector corresponding to the category identifier of the second discrete information, the second user sub-vector may be formed according to the first continuous information after the normalization processing, and the second problem sub-vector may be formed according to the second continuous information after the normalization processing.
And fusing the first user sub-vector and the second user sub-vector corresponding to the user interaction behavior, so that the first vector represents the feature simultaneously containing the discrete information and the continuous information in the user interaction information. The first vector represents the interaction information of the user before the text matching operation or in the matching process is fully fused, the question-answering habit, the preference and the equipment use information of the user can be reflected, and the current matching environment is captured from the perspective of the user.
Step S440, the first question sub-vector and the second question sub-vector are fused to obtain a second vector representation.
And fusing the first question sub-vector and the second question sub-vector corresponding to the question structured information, so that the second vector represents the characteristic simultaneously containing the discrete information and the continuous information in the question structured information. The second vector represents the statistical information of the occurrence interactive behaviors of the text of the candidate question and the combined structure information of the question which are fully fused, and captures the current matching environment from the perspective of the candidate question.
As described above, each discrete information has a uniquely corresponding category identifier, and according to the exemplary embodiment of the present disclosure, a method for constructing a tag category tree structure is also provided. A label category tree structure may be pre-constructed to determine category identifiers corresponding to the discrete information based on the label category tree structure.
As shown in fig. 5, a schematic diagram of a label category tree structure according to an exemplary embodiment of the present disclosure is shown, the label category tree structure includes label nodes (e.g., label node A, B, C, D, E, F, G) corresponding to question label information, the nodes forming the label category tree structure according to each label node, where label node a is a root node, label node B, C, D, E, F, G is a leaf node, and leaf node E, F, G is not followed by a leaf node connected thereto, label node E, F, G is a leaf node, and leaf node E, F, G may correspond to different questions to be matched, such as leaf node F corresponds to "why a courier is not going to the door", "not received, but shown received", and leaf node G corresponds to "trouble providing return address". The question label information is a question keyword extracted according to a question text in a question and answer knowledge base, such as 'logistics', 'commodity quality', 'delivery', 'return transportation', and the like.
With continued reference to fig. 5, each tag node in the tag category tree structure has a category identifier (e.g., ID:1, ID:2, etc.), which facilitates finding the tag node in the huge tag category tree structure, and each tag node has a corresponding random initialization vector, that is, each category identifier has a corresponding random initialization vector.
In some possible embodiments, a word vector may be randomly initialized for problem tag information (e.g., "logistics") corresponding to each tag node, and a vector dimension may be set according to an actual matching requirement, for example, 100 dimensions, 200 dimensions, or 300 dimensions, which is not particularly limited by this disclosure.
In some possible embodiments, a random initialization vector corresponding to a tag node (category identifier) may be obtained using a bilst (Bi-directional Long Short-Term Memory network): using the forward LSTM of the BiLSTM to randomly initialize the problem label information (such as logistics) corresponding to the label node to obtain a forward eigenvector, simultaneously using the backward LSTM of the BiLSTM to randomly initialize the problem label information to obtain a backward eigenvector, and finally transversely splicing the forward eigenvector and the backward eigenvector to obtain the random initialization vector corresponding to the label node.
For example, if the problem tag information corresponding to the tag node is "logistics", the "logistics" is randomly initialized using the forward LSTM, so as to obtain a forward eigenvector w1 ═ m1, m2, m3, and at the same time, the "logistics" is randomly initialized using the backward LSTM, so as to obtain a backward eigenvector w2 ═ n1, n2, n3, and then w1 and w2 are transversely spliced, so as to obtain a random initialization vector w3 of the "logistics" [ m1, m2, m3, n1, n2, n3 ].
It should be noted that, in the above example, only according to a case where "logistics" is included in a certain question text, if the question label information "logistics" is included in a plurality of question texts at the same time, the random initialization vector corresponding to each question text of "logistics" can be obtained by the above method, and the random initialization vector corresponding to the question label information "logistics" can be a horizontal concatenation result corresponding to each random initialization vector including the question text of "logistics". If the random initialization vector for "logistics too slow", "logistics" is w3, and the random initialization vector for "logistics display returned" is w4, then the random initialization vector for the problem label information "logistics" is the lateral concatenation of w3 and w 4. Of course, in the actual operation process, the number of the question texts corresponding to the same question label information is not limited to a few, and may be more, but all the question texts can be obtained by the above method.
According to the embodiment, the BilSTM is used for acquiring the random initialization vector of the label node, the forward and backward time sequence directions are used for acquiring the past and future information of the question text of the question label information in the question and answer knowledge base, the semantic features of the random initialization vector are enriched, and the random initialization vector is enabled to be more consistent with the feature expression of the question text in the whole question and answer knowledge base.
Based on the above constructed tag category tree structure, in step S410, a target tag node corresponding to the first discrete information may also be searched based on the tag category tree structure, and a category identifier of the target tag node corresponding to the first discrete information is determined as the first category identifier. As shown in fig. 5, if the first discrete information includes "logistics", it is determined that the category identifier corresponding to "logistics" is ID:1 and the category identifier corresponding to "delivery promotion" is ID:4 by looking up the tag category tree structure, then the first category identifier includes ID:1 and ID: 4.
In an exemplary embodiment of the present disclosure, the second discrete information in the question structured information 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. As shown in fig. 5, if the candidate question text is "why the express is not going to home", based on the label category tree structure, the target label nodes passing through from the root node of the category tree structure to the leaf node of the candidate question text "why the express is not going to home" are sequentially acquired as "logistics" and "forward transportation", and then category identifiers ID:1 and ID:5 of the target label nodes "logistics" and "forward transportation" are determined as the second category identifier.
As described above, since the category tree structure is generated according to the problem label information, the category identifiers of the first discrete information and the second discrete information obtained by searching the category tree structure can respectively extract the information related to the problem text and the organization structure of the problem text in the user interaction information and the problem structured information, and further introduce the organization structure of the problem in the subsequent text matching process, thereby improving the matching degree of the matching result in the current matching environment, and further realizing richer text matching.
In an exemplary embodiment of the present disclosure, after the category identifier of the discrete information is obtained, the random initialization vectors corresponding to the plurality of category identifiers may be subjected to a splicing process to obtain a first sub-vector of the discrete information. For example, if the first type object identifiers corresponding to the first discrete information include ID:1 and ID:4, the random initialization vectors corresponding to the two first type object identifiers are transversely spliced.
In an exemplary embodiment of the present disclosure, it is further supported that a continuous information group of different information sources is subjected to a normalization process, and then a second sub-vector is determined according to the continuous information group after the normalization process. Step S420 may include steps S610 to S630 as follows:
in step S610, a plurality of consecutive information sets corresponding to different information sources are formed according to the information sources of the consecutive information.
The successive information of different information sources have different expression spaces and/or expression modes, and are therefore grouped according to the information sources of the successive information. Taking the second continuous information of the problem structured information as an example, if the information 1 and the information 2 in the second continuous information are from the same information source, and the information 3, the information 4 and the information 5 are from the same information source, the continuous information sets corresponding to different information sources are formed as [1,2], [3,4,5], wherein the numbers 1 to 5 are statistical information of some historical interaction behavior of the candidate problem text within a preset time.
Step S620, standardizing each of the continuous information sets via a preset parameter matrix.
In an exemplary embodiment of the present disclosure, each consecutive information group may be multiplied by a preset parameter matrix to convert each consecutive information group into a vector having the same length. For example, if the consecutive information sets in the above example are multiplied by 10-dimensional parameter matrices, respectively, each consecutive information set is converted into a 10-dimensional vector.
It should be noted that, according to the algorithm of multiplying the row vector by the matrix, the dimension (number of columns) of the row vector needs to be the same as the number of rows of the matrix, and in some possible embodiments, if the dimension of the row vector corresponding to the consecutive information sets is different from that of the parameter matrix, zero padding may be performed after the row vector elements corresponding to the consecutive information sets. In practice, the dimension of the row vector corresponding to each successive information set can be coordinated to determine the parameter matrix, and the successive information sets corresponding to different information sources can have the same vector expression through the parameter matrix. By standardizing the continuous information groups of different information sources, the continuous information of each information source can be uniformly processed.
Step S630, the normalized continuous information groups are fused to obtain a second subvector.
In an exemplary embodiment of the present disclosure, the normalized continuous information groups may be transversely spliced to obtain a second sub-vector. For example, the normalized set of consecutive information includes: [1,2], [3,4,5], and [7,2,5], then the second subvector is [1,2,3,4,5,7,2,5 ]. According to the method and the device for matching the candidate problem texts, statistical information of various historical interactive behaviors of the candidate problem texts in different channels is fused, and the possibility that the candidate problem texts are subjected to text matching operation in the text matching process is reflected from the perspective of various historical interactive behaviors of the candidate problem texts.
In an exemplary embodiment of the present disclosure, an implementation of determining a matching result of determining an input text based on a target vector is also provided. Determining a matching result of the input text from the candidate question texts based on the target vector may be: firstly, mapping a target vector into a numerical value according to a preset mapping rule, wherein the numerical value is used as a matching score value of a candidate problem text and an input text; and then determining a matching result of the input text from the candidate question texts according to the matching score value.
Alternatively, a Sigmoid function may be used to map the target vector to a value in [0,1] as the matching score of the candidate question text and the input text. Optionally, the target vector is input into a Softmax classifier, and the target vector is mapped to a probability value as a matching score value of the candidate question text and the input text. Of course, other preset mapping rules may also be used to map the target vector into a numerical value as the matching score value of the candidate question text and the input text, and the present disclosure includes but is not limited to the preset mapping rules mentioned above.
In some possible embodiments, target candidate texts with matching scores larger than the first score threshold value can be screened from the candidate question texts as matching results of the input texts. For example, the first score threshold is 0.6, and the matching scores corresponding to the candidate question texts are 0.95, 0.9, 0.8, 0.7, 0.65, and 0.5, respectively, so that the candidate question texts except for the candidate question text corresponding to 0.5 are all determined as target candidate texts and are used as the matching result of the input text.
Optionally, the target candidate question text may be fed back to the terminal corresponding to the user for display in response to a text input operation of the user. Furthermore, answer texts corresponding to the selected target candidate question texts can be displayed in response to the selection operation of the user on the target candidate question texts. Optionally, the target candidate question text and the corresponding answer text may be fed back to the terminal corresponding to the user for display in response to a text input operation of the user, that is, when the target candidate question text is displayed, the answer text corresponding to the target candidate question text is displayed at the same time. Optionally, the target candidate question text may also be fed back to the terminal corresponding to the user for display in response to a text input operation of the user, and the answer text corresponding to the target candidate question text with the score larger than the second score threshold value may also be fed back to the terminal corresponding to the user for display. Continuing with the above example, if the second score threshold is 0.85, when presenting the target candidate question text, only the answer text of the target candidate question text corresponding to the matching score values 0.95 and 0.9 is presented.
In some possible embodiments, target candidate texts with matching scores smaller than the first score threshold value may be further selected from the candidate question texts as matching results of the input texts. It should be noted that, specifically, whether the match score is greater than the first score threshold or smaller than the first score threshold is selected, depending on the training mode and the training result of the text matching model, the training of the corresponding text matching model may be performed according to the actual matching requirement.
The target vector is simultaneously fused with the question cross vector and the answer cross vector of the text level and the first vector representation and the second vector representation of the current matching environment level, so that various types of effective information in the text matching process are fully extracted, the utilization of the effective matching information in the text matching is expanded, the accuracy of the text matching is improved, the corresponding answer text is timely and accurately displayed according to the finally determined matching result, and the user experience of related products using the text matching method of the embodiment of the disclosure is improved.
Exemplary text matching model
Fig. 7 is a schematic diagram illustrating a text matching model according to an exemplary embodiment of the present disclosure, and as shown in fig. 7, the text matching model includes a feature intersection processing layer 710, a feature vector conversion layer 720, a vector fusion layer 730, and a text matching layer 740.
The feature cross processing layer 710 is configured to perform feature cross processing on an input text of a user and a candidate question text corresponding to the input text to obtain a question cross vector; and performing feature cross processing on the input text and the answer text of the candidate question text to obtain an answer cross vector.
The feature vector conversion layer 720 is configured to perform feature vector conversion on user interaction information of a user to obtain a first vector representation, and perform feature vector conversion on problem structured information of a candidate problem text to obtain a second vector representation.
The vector fusion layer 730 is configured to perform 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.
Text matching layer 740 is used to determine matching results for the input text from candidate question texts based on the target vector.
Through the exemplary embodiment of the present disclosure, the feature intersection processing layer 710 performs feature intersection on both the input text and the candidate question text and the input text and the answer text, and extracts feature association between the input text and the candidate question text and feature association between the input text and the answer text; based on the feature vector conversion layer 720, the user interaction information is converted into a first vector representation, the question structured information is converted into a second vector representation, and the vector fusion layer 730 not only introduces the feature relevance among texts and improves the expression accuracy on the text level by performing fusion processing on the obtained question cross vector, answer cross vector, first vector representation and second vector representation, but also introduces various interaction behaviors and organization structures of questions generated before text matching by the user and in the text matching process, improves the matching degree of the matching result in the current matching environment, and further improves the matching result of the input text determined by the subsequent text matching layer 740. Through the functions realized by each layer of the model, the utilization of various effective matching information in text matching is expanded, and the matching accuracy of the text matching model is improved. In an exemplary embodiment of the present disclosure, as shown in fig. 8, on the basis of the exemplary embodiment shown in fig. 7, the text matching model may further include a sentence vector characterization layer 750 for converting the input text, the candidate question text and the answer text into sentence characterizations, i.e., an input text vector, a candidate question vector and an answer text vector, respectively.
In an exemplary embodiment of the present disclosure, as shown in fig. 9, on the basis of the exemplary embodiment shown in fig. 7, the feature vector conversion layer 720 may further include a first vector conversion layer 760 and a second vector conversion layer 770, where the first vector conversion layer 760 is configured to convert first discrete information in the user interaction information into a first user sub-vector, convert first continuous information in the user interaction information into a second user sub-vector, and perform a fusion process on the first user sub-vector and the second user sub-vector to obtain a first vector representation; the second vector conversion layer 670 is configured to convert second discrete information in the problem structured information into a first problem sub-vector, convert second continuous information in the problem resulting information into a second problem sub-vector, and perform fusion processing on the first problem sub-vector and the second problem sub-vector to obtain a second vector representation.
It should be noted that other specific details of each layer in the text matching model according to the exemplary embodiment of the present disclosure have been described in detail in the above embodiment of the method, and are not described herein again.
Exemplary devices
Having described the text matching method of the exemplary embodiment of the present disclosure, next, a text matching apparatus of the exemplary embodiment of the present disclosure will be explained with reference to fig. 10.
It should be noted that other specific details of each functional module of the text matching apparatus according to the embodiments of the present disclosure have been described in detail in the embodiments of the text matching method, and are not described herein again.
Fig. 10 shows a text matching apparatus 1000 according to an exemplary embodiment of the present disclosure, including:
a first feature cross processing module 1010, configured to perform feature cross processing on an input text of a user and a candidate question text corresponding to the input text to obtain a question cross vector;
a second feature cross processing module 1020, 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 1030 is configured to perform feature vector conversion on user interaction information of a user to obtain a first vector representation, and perform feature vector conversion on problem structured information of a candidate problem text to obtain a second vector representation;
the text matching module 1040 is configured to perform 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 determine a matching result of the input text from the candidate question texts based on the target vectors.
In an alternative embodiment, the first feature intersection processing module 1010 may include:
the first text characterization unit is used for inputting the input text and the candidate problem text into a pre-trained language characterization model to obtain an input text vector and a candidate problem vector; and the first feature cross processing unit is used for performing feature cross processing on the input text vector and the candidate problem vector to obtain a problem cross vector.
In an alternative embodiment, the second feature intersection processing module 1020 may include: the second text representation unit is used for inputting the answer text into the pre-trained language representation model to obtain an answer text vector; and the second feature cross processing unit is used for performing feature cross processing on the input text vector and the answer text vector to obtain the answer cross vector.
In an optional implementation manner, the user interaction information and the question structural 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 structural information is statistical information of historical interaction behaviors of the candidate question text within a second preset time;
the vector conversion module 1030 may include:
the first vector determining unit is used for determining a category identification of the discrete information and determining a first sub-vector of the discrete information according to a random initialization vector corresponding to the category identification, wherein the first sub-vector comprises 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;
the second vector determining unit is used for carrying out standardization processing on the continuous information and forming a second sub-vector according to the continuous information after the standardization processing, wherein the second sub-vector comprises a second user sub-vector corresponding to the first continuous information and a second problem sub-vector corresponding to the second continuous information;
the first fusion subunit is used for carrying out fusion processing on the first user sub-vector and the second user sub-vector to obtain a first vector representation;
and the second fusion sub-unit is used for carrying out fusion processing on the first question sub-vector and the second question sub-vector to obtain a second vector representation.
In an alternative embodiment, the first vector determination unit is configured to: and splicing the random initialization vectors corresponding to the category identifications to obtain a first sub-vector of the discrete information.
In an alternative embodiment, the second vector determination unit includes: an information grouping unit for forming a plurality of continuous information groups corresponding to different information sources according to the information sources of the continuous information; the information processing unit is used for carrying out standardization processing on each continuous information group through a preset parameter matrix; and the information group fusion unit is used for carrying out fusion processing on the continuous information groups after the standardization processing to obtain a second sub-vector.
In an optional implementation manner, the text matching apparatus further includes:
and the tag category tree structure generation module is used for acquiring the problem tag information and generating a tag category tree structure according to the problem tag information, each tag node in the tag category tree structure is provided with a category identifier and a corresponding random initialization vector, and leaf nodes of the tag category tree structure correspond to different problem texts to be matched.
In an alternative embodiment, the first vector determination unit comprises: and the first identifier determining unit is used for searching a target label node corresponding to the first discrete information in the user interaction information based on the label category tree structure, and determining the category identifier of the target label node corresponding to the first discrete information as the first category identifier.
In an optional implementation manner, 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 first vector determination unit further includes: and the second identification determining unit is used for sequentially acquiring the category identification of the passing target label node from the root node of the category tree structure to the leaf node where the candidate problem text is located based on the label category tree structure, and determining the category identification of the passing target label node as the second category identification.
In an alternative embodiment, the text matching module may include:
the target vector determining unit is used for splicing the question cross vector, the answer cross vector, the first vector representation and the second vector representation which correspond to the same candidate question text to obtain a target vector of each candidate question text; the score value determining unit is used for mapping the target vector into a numerical value according to a preset mapping rule, and the numerical value is used as a matching score value of the candidate problem text and the input text; and the matching result determining unit is used for determining the matching result of the input text from the candidate question texts according to the matching score value.
It should be noted that although in the above detailed description several modules or units of the text matching means are mentioned, this division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Exemplary storage Medium
The storage medium of the exemplary embodiment of the present disclosure is explained below.
In this exemplary embodiment, referring to fig. 11, a program product 1100 for implementing the above-described method according to an exemplary embodiment of the present disclosure is described, such as may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a device, such as a personal computer. However, the program product of the present disclosure is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product 1100 may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RE, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user computing device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a local area network (FAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
Exemplary electronic device
An electronic device of an exemplary embodiment of the present disclosure is explained with reference to fig. 12.
The electronic device 1200 shown in fig. 12 is only an example and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 12, the electronic device 1200 is embodied 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 memory unit 1220, a bus 1230 connecting the various system components including the memory unit 1220 and the processing unit 1210, and a display unit 1240.
Where the memory unit stores program code, the program code may be executed by the processing unit 1210 such that the processing unit 1210 performs the steps according to various exemplary embodiments of the present disclosure described in the above-mentioned "exemplary methods" section of this specification. For example, processing unit 1210 may perform method steps or the like as shown in fig. 1.
The storage unit 1220 may include volatile storage units such as a random access memory unit (RAM)1221 and/or a cache memory unit 1222, and may further include a read only memory unit (ROM) 1223.
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: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 1230 may include a data bus, an address bus, and a control bus.
The electronic device 1200 may also communicate with one or more external devices 1300 (e.g., keyboard, pointing device, bluetooth device, etc.) via an input/output (I/O) interface 1250. The electronic device 1200 further comprises a display unit 1240 connected to the input/output (I/O) interface 1250 for displaying. Also, the electronic device 1200 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet) via the network adapter 1260. As shown, the network adapter 1260 communicates with the other modules of the electronic device 1200 via the bus 1230. It should be appreciated that although not shown, other hardware and/or software modules may be used in conjunction with the 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, among others.
It should be noted that although in the above detailed description several modules or sub-modules of the apparatus are mentioned, such division is merely exemplary and not mandatory. Indeed, the features and functionality of two or more of the units/modules described above may be embodied in one unit/module, in accordance with embodiments of the present disclosure. Conversely, the features and functions of one unit/module described above may be further divided into embodiments by a plurality of units/modules.
Further, while the operations of the disclosed methods are depicted in the drawings in a particular order, this does not require or imply that these operations must be performed in this particular order, or that all of the illustrated operations must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions.
While the spirit and principles of the present disclosure have been described with reference to several particular embodiments, it is to be understood that the present disclosure is not limited to the particular embodiments disclosed, nor is the division of aspects, which is for convenience only as the features in such aspects may not be combined to benefit. The disclosure is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.

Claims (10)

1. A text matching method, comprising:
performing feature cross processing on an input text of a user and a candidate problem text corresponding to the input text to obtain a problem cross vector;
performing feature cross processing on the input text and the answer text of the candidate question text to obtain an answer cross vector;
performing feature vector conversion on the user interaction information of the user to obtain a first vector representation, and performing feature vector conversion on the problem structured information of the candidate problem text to obtain a second vector representation;
and 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 vectors.
2. The method according to claim 1, wherein the performing feature intersection processing on the input text of the user and the candidate question text corresponding to the input text to obtain a question intersection vector comprises:
respectively inputting the input text and the candidate problem text into a pre-trained language characterization model to obtain an input text vector and a candidate problem vector;
and performing feature cross processing on the input text vector and the candidate problem vector to obtain the problem cross vector.
3. The method of claim 2, wherein the performing feature intersection processing on the input text and answer text of the candidate question text to obtain an answer intersection vector comprises:
inputting the answer text into the pre-trained language representation model to obtain an answer text vector;
and performing feature cross processing on the input text vector and the answer text vector to obtain the answer cross vector.
4. The method according to claim 1, wherein the question structural information of the question text and the user interaction information both include discrete information and continuous information, a first continuous information in the user interaction information is a statistical information of historical interaction behavior of the user within a first preset time, and a second continuous information in the question structural information is a statistical information of historical interaction behavior of the question text occurring within a second preset time;
the performing feature vector conversion on the user interaction information of the user to obtain a first vector representation, and performing feature vector conversion on the question structured information of the candidate question text to obtain a second vector representation includes:
determining a category identification of the discrete information, and determining a first sub-vector of the discrete information according to a random initialization vector corresponding to the category identification, wherein the first sub-vector comprises a first user sub-vector corresponding to first discrete information in the user interaction information and a first problem sub-vector corresponding to second discrete information in the problem structured information;
normalizing the continuous information, and forming a second sub-vector according to the normalized continuous information, wherein the second sub-vector comprises a second user sub-vector corresponding to the first continuous information and a second problem 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 fusing the first problem sub-vector and the second problem sub-vector to obtain the second vector representation.
5. The method of claim 4, wherein normalizing the continuous information and forming a second sub-vector according to the normalized continuous information comprises:
forming a plurality of continuous information groups corresponding to different information sources according to the information sources of the continuous information;
carrying out standardization processing on each continuous information group through a preset parameter matrix;
and performing fusion processing on the normalized continuous information groups to obtain the second subvector.
6. The method according to claim 4 or 5, wherein before the performing feature intersection processing on the input text of the user and the candidate question text corresponding to the input text to obtain a question intersection vector, the method further comprises:
problem label information is obtained, a label category tree structure is generated according to the problem label information, each label node in the label category tree structure is provided with a category identification and a corresponding random initialization vector, and leaf nodes of the label category tree structure correspond to different problem texts to be matched.
7. The method of claim 6, wherein determining the first category identification of the first discrete information in the user interaction information comprises:
searching a target label node corresponding to the first discrete information based on the label category tree structure;
and determining the category identification of the target label node corresponding to the first discrete information as the first category identification.
8. The method according to 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;
determining a second category identification of the second discrete information, comprising:
based on the label category tree structure, sequentially acquiring category identifications of passing target label nodes from a root node of the category tree structure to a leaf node where the candidate problem text is located;
and determining the category identification of the passed target label node as the second category identification.
9. A text matching apparatus, comprising:
the first feature cross processing module is used for performing feature cross processing on an input text of a user and a candidate problem text corresponding to the input text to obtain a problem cross vector;
the second feature cross processing module is used for performing 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 used for performing characteristic vector conversion on the user interaction information of the user to obtain a first vector representation, and performing characteristic vector conversion on the problem structured information of the candidate problem text to obtain a second vector representation;
and the text matching module is used for performing fusion processing on the question cross vector, the answer cross vector, the first vector representation and the second vector representation which correspond 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 vectors.
10. A storage medium having stored thereon a computer program which, when executed by a processor, implements a text matching method according to any one of claims 1 to 8.
CN202210199238.6A 2022-03-02 2022-03-02 Text matching method and device, storage medium and electronic equipment Pending CN114548314A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210199238.6A CN114548314A (en) 2022-03-02 2022-03-02 Text matching method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210199238.6A CN114548314A (en) 2022-03-02 2022-03-02 Text matching method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN114548314A true CN114548314A (en) 2022-05-27

Family

ID=81662378

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210199238.6A Pending CN114548314A (en) 2022-03-02 2022-03-02 Text matching method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN114548314A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116383491A (en) * 2023-03-21 2023-07-04 北京百度网讯科技有限公司 Information recommendation method, apparatus, device, storage medium, and program product
CN116383491B (en) * 2023-03-21 2024-05-24 北京百度网讯科技有限公司 Information recommendation method, apparatus, device, storage medium, and program product

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116383491A (en) * 2023-03-21 2023-07-04 北京百度网讯科技有限公司 Information recommendation method, apparatus, device, storage medium, and program product
CN116383491B (en) * 2023-03-21 2024-05-24 北京百度网讯科技有限公司 Information recommendation method, apparatus, device, storage medium, and program product

Similar Documents

Publication Publication Date Title
Li et al. Api-bank: A benchmark for tool-augmented llms
CN110704576B (en) Text-based entity relationship extraction method and device
CN109376222B (en) Question-answer matching degree calculation method, question-answer automatic matching method and device
CN112131350B (en) Text label determining method, device, terminal and readable storage medium
CN108932342A (en) A kind of method of semantic matches, the learning method of model and server
CN111914568A (en) Method, device and equipment for generating text modifying sentence and readable storage medium
US11651015B2 (en) Method and apparatus for presenting information
Grenander et al. Deep discourse analysis for generating personalized feedback in intelligent tutor systems
CN113705191A (en) Method, device and equipment for generating sample statement and storage medium
CN112632258A (en) Text data processing method and device, computer equipment and storage medium
CN113656561A (en) Entity word recognition method, apparatus, device, storage medium and program product
CN116541493A (en) Interactive response method, device, equipment and storage medium based on intention recognition
CN112100377A (en) Text classification method and device, computer equipment and storage medium
EP4364044A1 (en) Automated troubleshooter
CN115803734A (en) Natural language enrichment using action interpretation
CN112131345A (en) Text quality identification method, device, equipment and storage medium
CN109408175B (en) Real-time interaction method and system in general high-performance deep learning calculation engine
CN112926308B (en) Method, device, equipment, storage medium and program product for matching text
CN117493529A (en) Anthropomorphic dialogue method and device based on natural language model and electronic equipment
CN117077679A (en) Named entity recognition method and device
CN112036189A (en) Method and system for recognizing gold semantic
CN116955591A (en) Recommendation language generation method, related device and medium for content recommendation
CN116662495A (en) Question-answering processing method, and method and device for training question-answering processing model
CN113779202B (en) Named entity recognition method and device, computer equipment and storage medium
CN113468311B (en) Knowledge graph-based complex question and answer method, device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination