A method for generating a text matching model, a computing device, and a storage medium

By constructing PariWise training samples and training a text matching model, the problem of insufficient accuracy in existing text matching schemes is solved, and efficient identification and information acquisition of semantic similarity are achieved in specific domains.

CN116521825BActive Publication Date: 2026-02-03CHEZHI HULIAN BEIJING SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310418103.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-18
Publication Date
2026-02-03
Estimated Expiration
2043-04-18

AI Technical Summary

Technical Problem

Existing text matching schemes struggle to handle non-factual questions and answers, often resulting in inaccurate information retrieval due to issues such as users' colloquial expressions, insufficient coverage of frequent question and answer sets, and failure to consider semantic similarity and contextual information.

Method used

By obtaining query data and resource data from query logs, PariWise training samples are constructed. A text matching model is trained using language processing and similarity calculation components. Positive and negative samples are filtered out by combining query logs and search engines, and network parameters are adjusted to improve matching accuracy.

Benefits of technology

It effectively improves the accuracy of text matching, can identify semantic similarity in specific domains, and meets the performance and effectiveness requirements of online systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116521825B_ABST
    Figure CN116521825B_ABST
Patent Text Reader

Abstract

The application discloses a method for generating a text matching model, a computing device and a storage medium. The method comprises the following steps: obtaining query data and corresponding first resource data from a query log, generating a first data set, and the query data and the first resource data both contain attribute information of a resource; obtaining a predetermined number of second resource data based on the query data, and generating a second data set by using the query data and the second resource data; selecting second query data, third resource data and fourth resource data from the second data set by associating the first data set and the second data set; inputting the second query data, the third resource data and the fourth resource data as training samples into an initial text matching model for training, and adjusting network parameters of the text matching model according to output first prediction results and second prediction results until the training is completed, so that a trained text matching model is obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, computing device and storage medium for generating text matching models. Background Technology

[0002] Text matching has always been a fundamental and important area of ​​Natural Language Processing (NLP), generally studying the relationship between two pieces of text. Text similarity calculation, natural language inference, question answering systems, and information retrieval can all be seen as applications of text matching for different data and scenarios. For example, information retrieval can be reduced to matching search terms with document resources, question answering systems can be reduced to matching questions with candidate answers, and dialogue systems can be reduced to matching the previous dialogue with the response.

[0003] Taking non-factual question answering as an example, it is generally done by constructing a question-and-answer database generated by a FAQ (Frequently Asked Questions) system, and then building an inverted index based on this database for text matching. The FAQ system mainly includes: a frequent question-and-answer pair dataset (usually generated from open-source encyclopedias in a specific domain, or user-generated questions and answers on related systems), a retrieval and recall module (used to retrieve similar questions), and a similarity ranking module (used to determine the highest similarity question and whether the confidence level is sufficient). Plaintext question-and-answer retrieval using an inverted index is currently the main approach. The user query is segmented, and relevant results are retrieved from the inverted index for each segmented term. The intersection of the retrieved results for each term is then used to obtain the final result. Afterwards, traditional matching methods such as TF-IDF and BM25, primarily based on the bag-of-words model, are used to map the two texts to the same space and calculate similarity to measure the degree of text similarity.

[0004] The main shortcomings of this solution are as follows: First, user queries tend to be colloquial and varied in expression, such as asking how much a price is or how it is sold. These queries generally differ from the textual descriptions of answers in the frequent question-and-answer set, making it difficult to accurately obtain information through literal matching alone. Second, due to the limitations of the frequent question-and-answer set's content, there is a significant deficiency in the effective coverage of similar answers. Third, it does not consider the semantic similarity between different sentences or the contextual information within sentences, and therefore cannot solve problems related to synonymy, polysemy, and word order structure.

[0005] Therefore, a new text matching scheme is needed that can be applied to text matching in specific domains (such as question-answering systems). Summary of the Invention

[0006] This application provides a method, computing device, and storage medium for generating text matching models, in an attempt to solve or at least alleviate at least one of the problems mentioned above.

[0007] According to one aspect of this application, a method for generating a text matching model is provided, comprising: obtaining query data and corresponding first resource data from a query log to generate a first data set, wherein both the query data and the first resource data contain attribute information of resources; obtaining a predetermined number of second resource data based on the query data, and generating a second data set using the query data and the second resource data; selecting second query data, third resource data, and fourth resource data from the second data set by associating the first data set and the second data set, wherein the attribute information of the resources contained in the second query data is consistent with the attribute information of the resources contained in the third resource data, and the attribute information of the resources contained in the second query data is inconsistent with the attribute information of the resources contained in the fourth resource data; using the second query data, the third resource data, and the fourth resource data as training samples, inputting them into an initial text matching model for training, and adjusting the network parameters of the text matching model according to the output first prediction result and second prediction result until training is completed, thereby obtaining a trained text matching model.

[0008] Optionally, in the method according to this application, the text matching model includes at least a coupled language processing component and a similarity calculation component.

[0009] Optionally, in the method according to this application, the first prediction result is a probability value characterizing whether the attribute information of the resources contained in the second query data and the third resource data and the fourth resource data are consistent; the second prediction result is a score characterizing the similarity between the second query data and the third resource data and the fourth resource data; and adjusting the network parameters of the text matching model according to the output first prediction result and second prediction result includes: adjusting the network parameters of the language processing component according to the first prediction result, and adjusting the network parameters of the similarity calculation component according to the second prediction result.

[0010] Optionally, in the method according to this application, the language processing component includes a backbone convolutional network and a transform network, wherein the backbone convolutional network includes three identical backbone network blocks, adapted to receive and process the second query data, the third resource data, and the fourth resource data respectively, and output their respective semantic vectors; the transform network includes two identical transform network blocks, adapted to process the semantic vectors, and output a first semantic vector and a second semantic vector respectively; the similarity calculation component includes two identical similarity calculation blocks, adapted to process the first semantic vector and the second semantic vector respectively, to output a first probability value and a first score, a second probability value, and a second score respectively.

[0011] Optionally, in the method according to this application, the text matching model further includes a pooling component coupled between the language processing component and the similarity calculation component. The pooling component includes two identical pooling blocks adapted to reduce the dimensionality of the first semantic vector and the second semantic vector, respectively, to obtain a dimensionality-reduced first semantic vector and a dimensionality-reduced second semantic vector, and output them to the similarity calculation component.

[0012] Optionally, in the method according to this application, obtaining a predetermined number of second resource data based on the query data includes: for each query data in the first data set, obtaining resource data corresponding to the query data through a search engine, wherein the obtained resource data has a location attribute; and selecting a predetermined number of resource data as second resource data according to the location attribute of the resource data.

[0013] Optionally, in the method according to this application, selecting second query data, third resource data, and fourth resource data from the second data set by associating the first data set and the second data set includes: identifying the attribute information of resources contained in the query data and second resource data in the second data set by associating the first data set and the second data set respectively; selecting second resource data corresponding to each query data that is consistent with the attribute information of each query data from the second data table as the second query data and the third resource data; and selecting second resource data corresponding to each second query data that is inconsistent with the attribute information of each second query data from the second data table as the fourth resource data.

[0014] Optionally, in the method according to this application, the attribute information includes manufacturer, brand, vehicle series, and model.

[0015] According to another aspect of this application, a computing device is provided, comprising: one or more processor memories; and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors, and the one or more programs include instructions for performing any of the methods described above.

[0016] According to another aspect of this application, a computer-readable storage medium is provided for storing one or more programs, the one or more programs including instructions that, when executed by a computing device, cause the computing device to perform any of the methods described above.

[0017] In summary, according to the scheme of this application, a dataset of query data and resource data is obtained by combining query logs and a search engine, serving as the basis for generating training samples. Because it is based on a search engine, it can continuously adapt to newly emerging vocabulary and effectively reduce the annotation cost of massive samples. Then, based on attribute information, positive and negative samples are selected from the dataset. Thus, a training sample consists of three parts: Query, Title+, and Title-. This allows the trained text matching model to identify semantic similarity while ensuring consistency of attribute information between sentence pairs, effectively improving the accuracy of text matching.

[0018] Furthermore, when training the text matching model, different prediction tasks can be set to adjust the network parameters of the corresponding modules, which can effectively address the issue of combining effectiveness and performance.

[0019] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0020] To achieve the foregoing and related objectives, certain illustrative aspects are described herein in conjunction with the following description and accompanying drawings. These aspects indicate various ways in which the principles claimed herein may be practiced, and all aspects and their equivalents are intended to fall within the scope of the claimed subject matter. The foregoing and other objectives, features, and advantages of this application will become more apparent from the following detailed description, taken in conjunction with the accompanying drawings. Throughout this application, the same reference numerals generally refer to the same parts or elements.

[0021] Figure 1 A schematic diagram of a computing device 100 according to some embodiments of this application is shown;

[0022] Figure 2 A flowchart illustrating a method 200 for generating a text matching model according to some embodiments of this application is shown;

[0023] Figure 3 A schematic diagram of a text matching model 300 according to some embodiments of this application is shown. Detailed Implementation

[0024] Exemplary embodiments of the present application will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this application will be thorough and complete, and will fully convey the scope of the present application to those skilled in the art.

[0025] In actual searches, queries tend to favor user-side language, such as "How much does a BMW cost?" or "How do I buy a BMW?", while titles tend to favor author-side language, such as "BMW price" or "BMW quote". Semantically, both queries and titles express the price of BMW, which this technology clearly cannot handle. Furthermore, the same word can have different meanings in different contexts. For example, "discover" can be both a verb and a description of a luxury large SUV under the Land Rover brand. On the other hand, there's the issue of word order. Using the same words in sentences with different word orders can express different, even contradictory, meanings. For example, "The BMW X3 has a higher cost-performance ratio than the Audi A4L" and "The Audi A4L has a higher cost-performance ratio than the BMW X3" express completely opposite meanings. Finally, two texts may not satisfy the condition of simultaneous co-occurrence, leading to a mismatch, even if they have high semantic similarity. For example, "What are the various instrument symbols on a car?" and "A complete list of car instrument symbols," or "Solve the problem of loud car door closing sound" and "Is there a way to solve the problem of loud car door closing sound?"

[0026] Current Word2Vec models, commonly used to represent sentence vectors for queries and titles, do not adequately consider sentence order information, and their output text vectors are fixed, failing to adapt to word vector representations in different contexts. For example, the word "apple" can refer to either an Apple mobile phone or an apple fruit, depending on the context. The Word2Vec model uses synonym vectors to represent different contextual information, which is clearly unsuitable for this situation. Furthermore, for specific domains, different subsets of the same category may have similar sentence patterns; for example, "Hongqi H9" and "Hongqi H5" refer to different car models, but the Word2Vec model cannot semantically distinguish between these two words.

[0027] To consider more comprehensive contextual information, current research has progressed from Word2Vec models to CNNs and then to RNNs. CNNs use convolutional layers to obtain local contextual information and pooling layers to obtain global contextual information, but they cannot take into account the relationships between words with long positional intervals, resulting in limited effectiveness. RNNs mainly use LSTM network structures to solve the problem of long text dependencies, but LSTMs do not perfectly solve the problem of long-term dependencies at the sentence order level, and the cost of constructing samples is high. Therefore, they cannot meet the search requirements in practical applications.

[0028] For the reasons stated above, this application provides a scheme for training a text matching model. For query data and resource data in a specific domain, PariWise training samples are constructed by analyzing the attribute information of the resources contained therein. Then, a text matching model is trained based on the constructed training samples. In some embodiments, the specific domain is a vehicle-related domain, such as a vertical search domain about vehicles, and the attribute information includes manufacturer, brand, model series, and vehicle type.

[0029] The text matching model generated by this application can solve the problem of information retrieval for users on long-tail queries. Because user behavior is sparse on long-tail queries, it is particularly important to obtain similarity samples that can effectively distinguish between "How is the Hongqi H9?" and "How is the Hongqi H5?", or "How is the BMW 3 Series?" and "How is the BMW 5 Series?". Furthermore, in the vertical search field related to vehicles, applying this text matching model can meet both the performance and effectiveness requirements of online systems.

[0030] The method 100 for training and generating a text matching model according to this application can be implemented in a computing device. Figure 1 A structural block diagram of a computing device 100 according to an embodiment of this application is shown.

[0031] like Figure 1 As shown, in the basic configuration 102, the computing device 100 typically includes a system memory 106 and one or more processors 104. A memory bus 108 can be used for communication between the processors 104 and the system memory 106.

[0032] Depending on the desired configuration, processor 104 can be any type of processor, including but not limited to: microprocessors (μP), microcontrollers (μC), digital information processors (DSPs), or any combination thereof. Processor 104 may include one or more levels of cache such as L1 cache 110 and L2 cache 112, processor core 114, and registers 116. Example processor core 114 may include an arithmetic logic unit (ALU), a floating-point unit (FPU), a digital signal processing (DSP) core, or any combination thereof. Example memory controller 118 may be used with processor 104, or in some implementations, memory controller 118 may be an internal part of processor 104.

[0033] Depending on the desired configuration, system memory 106 can be any type of memory, including but not limited to volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.), or any combination thereof. Physical memory in a computing device typically refers to volatile RAM, and data on a disk needs to be loaded into physical memory before it can be read by processor 104. System memory 106 may include operating system 120, one or more applications 122, and program data 124. In some embodiments, application 122 may be arranged to execute instructions on the operating system using program data 124 by one or more processors 104. Operating system 120 may be, for example, Linux, Windows, etc., and includes program instructions for handling basic system services and performing hardware-dependent tasks. Application 122 includes program instructions for implementing various user-desired functions, and application 122 may be, for example, a browser, instant messaging software, software development tools (such as integrated development environments IDEs, compilers, etc.), but is not limited to these.

[0034] When computing device 100 starts up, processor 104 reads and executes program instructions from memory 106 of operating system 120. Application 122 runs on operating system 120, utilizing interfaces provided by operating system 120 and underlying hardware to implement various user-expected functions. When user starts application 122, application 122 is loaded into memory 106, and processor 104 reads and executes program instructions from memory 106 of application 122.

[0035] The computing device 100 also includes a storage device 132, which includes a removable storage device 136 (e.g., CD, DVD, USB flash drive, portable hard drive, etc.) and a non-removable storage device 138 (e.g., hard disk drive, HDD, etc.). Both the removable storage device 136 and the non-removable storage device 138 are connected to the storage interface bus 134.

[0036] The computing device 100 may also include a storage interface bus 134. The storage interface bus 134 enables communication from storage devices 132 (e.g., removable storage 136 and non-removable storage 138) to the basic configuration 102 via a bus / interface controller 130. At least a portion of the operating system 120, application 122, and program data 124 may be stored on the removable storage 136 and / or the non-removable storage 138, and loaded into system memory 106 via the storage interface bus 134 when the computing device 100 is powered on or when application 122 is to be executed, and executed by one or more processors 104.

[0037] The computing device 100 may also include an interface bus 140 that facilitates communication from various interface devices (e.g., output devices 142, peripheral interfaces 144, and communication devices 146) to the basic configuration 102 via a bus / interface controller 130. Example output devices 142 include a graphics processing unit 148 and an audio processing unit 150. They may be configured to facilitate communication with various external devices such as displays or speakers via one or more A / V ports 152. Example peripheral interfaces 144 may include a serial interface controller 154 and a parallel interface controller 156, which may be configured to facilitate communication with external devices such as input devices (e.g., keyboards, mice, pens, voice input devices, touch input devices) or other peripherals (e.g., printers, scanners, etc.) via one or more I / O ports 158. Example communication devices 146 may include a network controller 160, which may be arranged to facilitate communication with one or more other computing devices 162 via a network communication link through one or more communication ports 164.

[0038] A network communication link can be an example of a communication medium. A communication medium can typically be embodied in a modulated data signal, such as a carrier wave or other transmission mechanism, and can include any information delivery medium. A “modulated data signal” can be a signal whose data set, or its modifications, can be encoded as information within the signal. As a non-limiting example, a communication medium can include wired media such as wired networks or leased lines, and various wireless media including sound, radio frequency (RF), microwave, infrared (IR), or other wireless media. The term “computer-readable medium” as used herein can include both storage media and communication media.

[0039] The computing device 100 can be implemented as a personal computer, including desktop and laptop computer configurations. Of course, the computing device 100 can also be implemented as part of a small-sized portable (or mobile) electronic device, such as a cellular phone, digital camera, personal digital assistant (PDA), personal media player device, wireless network browsing device, personal head-mounted device, application-specific device, or a hybrid device that may include any of the above functions. It can even be implemented as a server, such as a file server, database server, application server, and web server. The embodiments of this application do not impose any limitations on this.

[0040] In an embodiment according to this application, computing device 100 is configured to execute method 200 for generating a text matching model according to this application. Application 122, arranged on an operating system, includes multiple program instructions for executing one or more of the above methods, which can instruct processor 104 to execute method 200 of this application.

[0041] The following example of a vertical search domain related to vehicles will be used to illustrate the execution process of method 200. Figure 2 A flowchart illustrating a method 200 for generating a text matching model according to some embodiments of this application is shown. Figure 2 As shown, method 200 begins at 210.

[0042] In step 210, query data and corresponding first resource data are obtained from the query log to generate the first data set.

[0043] In some embodiments, user-exposed click information is obtained from vehicle-related user query logs, which includes user-searched query data (i.e., query information) and corresponding first resource data (i.e., the title information returned by the query). The query data contains vehicle attribute information, and similarly, the returned first resource data also contains vehicle attribute information. According to some implementations, the attribute information includes: manufacturer, brand, vehicle series, and model.

[0044] The query data and the corresponding first resource data are associated and stored in a data table as the first data set.

[0045] In step 220, based on the query data, a predetermined number of second resource data are obtained, and a second data set is generated using the query data and the second resource data.

[0046] According to some embodiments of this application, for each query data in the first data set, resource data corresponding to each query data is obtained through a search engine. The obtained resource data has a location attribute. The location attribute of the resource data indicates the relevance of the resource data to the query data. If the location attribute of each resource data is represented sequentially by numbers "1", "2", "3", etc., then the smaller the number (i.e., the earlier the sorting position), the more relevant the resource data is to the query data.

[0047] Furthermore, a predetermined number of resource data points are selected as the second resource data based on the location attributes of the resource data. In some embodiments, the first 5 resource data points corresponding to each query data are selected as the second resource data.

[0048] Then, the query data and the corresponding second resource data are associated and stored in a data table as the second data set.

[0049] In step 230, by associating the first data set and the second data set, second query data, third resource data, and fourth resource data are selected from the second data set. According to the embodiments of this application, the attribute information of the resources contained in the second query data is consistent with the attribute information of the resources contained in the third resource data, and the attribute information of the resources contained in the second query data is inconsistent with the attribute information of the resources contained in the fourth resource data.

[0050] By associating the first and second data sets, the attribute information of the resources contained in the query data and the second resource data in the second data set is identified respectively. From the second data table, the second resource data corresponding to each query data with attribute information consistent with it is selected as the second query data and the third resource data, and the associated second query data and third resource data are recorded as positive samples. Then, the second resource data corresponding to each second query data with attribute information inconsistent with it is selected as the fourth resource data, and this part of the associated second query data and fourth resource data is recorded as negative samples. In other words, for each second query data Query, there is a third resource data Title+ with consistent attribute information and a fourth resource data Title- with inconsistent attribute information, and both Title+ and Title- come from the second resource data.

[0051] It should be noted that the attribute information includes manufacturer, brand, vehicle series, and model. According to the implementation method of this application, consistent attribute information means that the manufacturer indicated in the query data is consistent with the manufacturer indicated in the resource data, the brand is consistent, the vehicle series is consistent, and the model is consistent; if any one of the manufacturer, brand, vehicle series, or model is inconsistent, it is considered that the attribute information is inconsistent.

[0052] Furthermore, in other embodiments of this application, the attribute information in the second data set can be randomly replaced to generate new query data and new resource data, thereby obtaining new positive and negative samples. For example, the attribute information in the third resource data can be randomly replaced, such as randomly replacing car series A with car series B, to obtain a new negative sample.

[0053] In step 240, the second query data (Query), the third resource data (Title+), and the fourth resource data (Title-) are used as training samples and input into the initial text matching model for training. The network parameters of the text matching model are adjusted according to the first and second prediction results output until the training is completed, resulting in a trained text matching model.

[0054] According to an embodiment of this application, the text matching model includes at least a coupled language processing component and a similarity calculation component.

[0055] The language processing component processes the input text data to generate semantic vectors for each. The input text data includes Query, Title+, and Title-, which generate a first semantic vector f1 and a second semantic vector f2, respectively. Here, f1 represents the semantic vector of the positive sample {Query, Title+}, and f2 represents the semantic vector of the negative sample {Query, Title-}.

[0056] The similarity calculation component is implemented using the Softmax function. In an embodiment according to this application, the similarity calculation component includes two prediction tasks: first, predicting whether the attribute information of two texts contained in the input semantic vector f1(f2) is consistent; and second, predicting whether the two texts contained in the input semantic vector f1(f2) are similar. Thus, the first prediction result includes: a probability value representing whether the attribute information of the resources contained in Query and Title+ is consistent (denoted as the first probability value), and a probability value representing whether the attribute information of the resources contained in Query and Title- is consistent (denoted as the second probability value). The second prediction result includes a score representing the similarity between Query and Title+ (denoted as the first score) and a score representing the similarity between Query and Title- (denoted as the second score).

[0057] Figure 3 A schematic diagram illustrating the structure of a text matching model 300 according to some embodiments of this application is shown as an example. Figure 3 As shown, the text matching model 300 includes at least a language processing component 310 and a similarity calculation component 320.

[0058] The language processing component 310 includes a coupled backbone convolutional network 312 and a transform network 314. The backbone convolutional network 312 further comprises three identical backbone network blocks (B). These three backbone network blocks (B) respectively receive second query data (Query), third resource data (Title+), and fourth resource data (Title-), and process them respectively, outputting semantic vectors for Query, Title+, and Title-. According to one embodiment of this application, the input representation method of the backbone network block (B) is the same as that of the BERT model, including token embedding, position embedding, and segment embedding. Segment embedding can also serve as an identifier for the training method (one-way, two-way, sequence-to-sequence), which this application does not impose excessive restrictions on. It should be noted that the three backbone network blocks (B) not only have the same network structure but also share network parameters.

[0059] Furthermore, the input text is segmented by adding [CLS] and [SEP] symbols to achieve the desired effect. Figure 3 Taking the middle backbone network block (B) as an example, the input text is represented as: [CLS]Query[SEP]Title+[SEP] (or [CLS]Query[SEP]Title-[SEP]). After processing by network block (B), the output corresponding to [CLS] is taken as the semantic representation of the text (i.e., the semantic vector of the Query). Similarly, the left backbone network block (B) takes [CLS]Title+[SEP]Query[SEP] as input and outputs the semantic vector of Title+; the right backbone network block (B) takes [CLS]Title-[SEP]Query[SEP] as input and outputs the semantic vector of Title-.

[0060] The transform network 314 includes two identical transform network blocks (T) adapted to process semantic vectors, correspondingly outputting a first semantic vector f1 and a second semantic vector f2. In some embodiments, the semantic vectors of Query and Title+ are input into one transform network block (T), which outputs f1 as the semantic vector of the positive sample sentence pair {Query, Title+}; the semantic vectors of Query and Title- are input into another transform network block (T), which outputs f2 as the semantic vector of the negative sample sentence pair {Query, Title-}.

[0061] It should be noted that the two transform network blocks (T) not only have the same network structure, but also share network parameters. In some embodiments, the transform network block (T) adopts the Transformer layer in the UniLM model, but it is not limited to this.

[0062] Correspondingly, the similarity calculation component 320 also includes two identical similarity calculation blocks (S), one of which processes the first semantic vector f1 and the second semantic vector f2 to output a first probability value and a first score, and the other similarity calculation block (S) processes the second semantic vector f2 to output a second probability value and a second score.

[0063] As mentioned earlier, the similarity calculation component 320 has two tasks. First, it uses the Softmax function to predict whether the attribute information of {Query, Title+} and {Query, Title-} are consistent. For example, if they are consistent, the output probability value is 1; if they are inconsistent, the output probability value is 0. Second, it uses the Softmax function to predict the similarity of {Query, Title+} and {Query, Title-}. The higher the score, the more similar the two are.

[0064] According to further embodiments of this application, the text matching model 300 also includes a pooling component 330 coupled between the language processing component 310 and the similarity calculation component 320.

[0065] Correspondingly, the pooling component 330 also includes two identical pooling blocks (P), one of which reduces the dimensionality of the first semantic vector f1, and the other pooling block (P) reduces the dimensionality of the second semantic vector f2, thereby obtaining the first semantic vector and the second semantic vector with reduced dimensionality, and outputting them to the similarity calculation component 320.

[0066] In some embodiments, the pooling block (P) may employ max pooling, using the dimensionality-reduced semantic vector as the basis for semantic similarity measurement.

[0067] It should be noted that the above description of the text matching model 300 is only an example. Those skilled in the art can also use other existing functions to replace some modules in the text matching model 300 of this application based on the description of this application, so as to achieve the technical effects described in this application, all of which are within the protection scope of this application.

[0068] According to some embodiments of this application, during the training process, the Softmax cross-entropy loss function is used to adjust the network parameters of the language processing component based on the first prediction result and the network parameters of the similarity calculation component based on the second prediction result until the preset conditions are met (e.g., the value of the loss function converges or the number of iterations reaches a predetermined value, but not limited to these), and the training ends. At this time, the corresponding text matching model is the finally trained text matching model.

[0069] According to method 200 of this application, a dataset of query data and resource data is obtained by combining query logs and a search engine, serving as the basis for generating training samples. Because it is based on a search engine, it can continuously adapt to newly emerging vocabulary and effectively reduce the annotation cost of massive samples. Then, based on attribute information, positive and negative samples are selected from the dataset. Thus, a training sample consists of three parts: Query, Title+, and Title-. This allows the trained text matching model to identify semantic similarity while ensuring consistency of attribute information between sentence pairs, effectively improving the accuracy of text matching.

[0070] Furthermore, when training the text matching model, different prediction tasks can be set to adjust the network parameters of the corresponding modules, which can effectively address the issue of combining effectiveness and performance.

[0071] The text matching model generated by Method 200 can be applied in scenarios such as information retrieval and question-answering systems. While ensuring consistency in attribute information between the query statement and the returned result statement, it intelligently identifies semantic similarity, thereby improving the user's search experience. For example, this solution can effectively distinguish between questions like "How is the Hongqi H9?" and "How is the Hongqi H5?", or "How is the BMW 3 Series?" and "How is the BMW 5 Series?", matching the closest answer for the user.

[0072] The various techniques described herein can be implemented in combination with hardware or software, or a combination thereof. Thus, the methods and apparatus of this application, or certain aspects or portions thereof, can take the form of program code (i.e., instructions) embedded in a tangible medium, such as a removable hard disk, USB flash drive, floppy disk, CD-ROM, or any other machine-readable storage medium, wherein when the program is loaded into and executed by a machine such as a computer, the machine becomes an apparatus for practicing this application.

[0073] When the program code is executed on a programmable computer, the computing device generally includes a processor, a processor-readable storage medium (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device. The memory is configured to store the program code; the processor is configured to execute the text matching model generation scheme of this application according to the instructions in the program code stored in the memory.

[0074] By way of example, and not limitation, readable media include readable storage media and communication media. Readable storage media stores information such as computer-readable instructions, data structures, program modules, or other data. Communication media generally embodies computer-readable instructions, data structures, program modules, or other data in the form of modulated data signals such as carrier waves or other transmission mechanisms, and includes any information delivery medium. Any combination of the above is also included within the scope of readable media.

[0075] In the specification provided herein, the algorithms and displays are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used with the examples of this application. Based on the above description, the required structure for constructing such a system is obvious. Furthermore, this application is not directed to any particular programming language. It should be understood that the content of this application described herein can be implemented using various programming languages, and the above description of specific languages ​​is for the purpose of disclosing preferred embodiments of this application.

[0076] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of this application may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.

[0077] Similarly, it should be understood that, for the purpose of simplification and aiding understanding of one or more aspects of the application, various features of the application are sometimes grouped together in a single embodiment, figure, or description thereof in the above description of exemplary embodiments of the application. However, this approach should not be construed as reflecting an intention that the claimed application requires more features than are expressly recited in each claim. Therefore, the claims following the detailed description are hereby expressly incorporated into that detailed description, wherein each claim itself is a separate embodiment of the application.

[0078] Those skilled in the art will understand that modules, units, or components of the devices disclosed in the examples herein can be arranged in the devices described in this embodiment, or alternatively, can be located in one or more devices different from the devices in this example. The modules in the foregoing examples can be combined into a single module or, in addition, can be divided into multiple sub-modules.

[0079] Those skilled in the art will understand that modules in the device of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiments can be combined into a single module, unit, or component, and further, they can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or device so disclosed. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.

[0080] Furthermore, those skilled in the art will understand that although some embodiments described herein include certain features but not others included in other embodiments, combinations of features from different embodiments are intended to be within the scope of this application and form different embodiments. For example, in the following claims, any of the claimed embodiments can be used in any combination.

[0081] Furthermore, some of the embodiments described herein are methods or combinations of method elements that can be implemented by a processor of a computer system or by other means of performing the functions. Therefore, a processor having the necessary instructions for implementing the method or method elements forms means for implementing the method or method elements. Furthermore, the elements described herein in the apparatus embodiments are examples of means for implementing the functions performed by the elements for the purposes of this disclosure.

[0082] As used herein, unless otherwise specified, the use of ordinal numbers such as “first,” “second,” “third,” etc., to describe ordinary objects merely indicates different instances of similar objects and is not intended to imply that the objects being described must have a given order in time, space, sequence, or any other manner. Furthermore, the quantifier “multiple” means “two” and / or “more than two.”

[0083] Although this application has been described with reference to a limited number of embodiments, those skilled in the art will understand from the foregoing description that other embodiments are conceivable within the scope of this application described herein. Furthermore, it should be noted that the language used in this specification has been chosen primarily for readability and edibility purposes, and not for interpreting or limiting the subject matter of this application. Therefore, many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the appended claims. The disclosure of this application is illustrative and not restrictive, and the scope of this application is defined by the appended claims.

Claims

1. A method for generating a text matching model, comprising: Query data and corresponding first resource data are obtained from the query log to generate a first data set, wherein both the query data and the first resource data contain attribute information of the resource. Based on the query data, a predetermined number of second resource data are obtained, and a second data set is generated using the query data and the second resource data; By associating the first data set and the second data set, second query data, third resource data, and fourth resource data are selected from the second data set, wherein the attribute information of the resources contained in the second query data is consistent with the attribute information of the resources contained in the third resource data, and the attribute information of the resources contained in the second query data is inconsistent with the attribute information of the resources contained in the fourth resource data. The second query data, the third resource data, and the fourth resource data are used as training samples and input into the initial text matching model for training. The network parameters of the text matching model are adjusted according to the first and second prediction results output until the training is completed, and a trained text matching model is obtained. The step of obtaining a predetermined number of second resource data based on the query data includes: For each query data in the first data set, the resource data corresponding to the query data is obtained through a search engine, and the obtained resource data has a location attribute; A predetermined number of resource data points are selected as the second resource data based on the location attributes of the resource data. The step of selecting the second query data, the third resource data, and the fourth resource data from the second data set by associating the first data set and the second data set includes: By associating the first data set and the second data set, the attribute information of the resources contained in the query data and the second resource data in the second data set is identified respectively; Select second resource data that is consistent with the attribute information of each of the query data from the second data set, and use it as the second query data and the third resource data; Select the second resource data that is inconsistent with the attribute information of each second query data from the second data set, and use it as the fourth resource data.

2. The method as described in claim 1, wherein, The text matching model includes at least a coupled language processing component and a similarity calculation component.

3. The method as described in claim 2, wherein, The first prediction result is a probability value characterizing whether the attribute information of the resources contained in the second query data is consistent with that of the third resource data and the fourth resource data. The second prediction result is a score characterizing the similarity between the second query data and the third resource data and the fourth resource data. The step of adjusting the network parameters of the text matching model based on the output of the first and second prediction results includes: The network parameters of the language processing component are adjusted based on the first prediction result, and the network parameters of the similarity calculation component are adjusted based on the second prediction result.

4. The method as described in claim 2 or 3, wherein, The language processing component includes a backbone convolutional network and a transform network. The backbone convolutional network includes three identical backbone network blocks, which are adapted to receive and process the second query data, the third resource data, and the fourth resource data respectively, and output their respective semantic vectors. The transform network includes two identical transform network blocks, which are adapted to process the semantic vectors and output a first semantic vector and a second semantic vector respectively. The similarity calculation component includes two identical similarity calculation blocks, which are adapted to process the first semantic vector and the second semantic vector respectively, so as to output a first probability value and a first score, a second probability value and a second score respectively.

5. The method of claim 4, wherein, The text matching model further includes a pooling component coupled between the language processing component and the similarity calculation component. The pooling component includes two identical pooling blocks, which are adapted to reduce the dimensionality of the first semantic vector and the second semantic vector, respectively, to obtain a dimensionality-reduced first semantic vector and a dimensionality-reduced second semantic vector, and output them to the similarity calculation component.

6. The method of claim 1, wherein, The attribute information includes manufacturer, brand, vehicle series, and model.

7. A computing device, comprising: One or more processors; Memory; One or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including instructions for performing the method as described in any one of claims 1-6.

8. A computer-readable storage medium storing one or more programs, said one or more programs including instructions that, when executed by a computing device, cause the computing device to perform the method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Underlay recall method and device for query result

    CN106021374A

  • Text matching model training method and device, equipment and storage medium

    CN113569011A