Text matching method, device and equipment

By extracting text features and screening sampled texts, a matching degree determination model is constructed, which solves the problems of low accuracy and efficiency of deep neural network models in text matching tasks, and realizes fast and accurate text matching and quantitative description.

CN114254080BActive Publication Date: 2025-09-23INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111582721.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-22
Publication Date
2025-09-23
Estimated Expiration
2041-12-22

AI Technical Summary

Technical Problem

Existing deep neural network models suffer from insufficient accuracy and low efficiency in text matching tasks, especially in the fully supervised learning mode, where the accuracy of the annotation results cannot be guaranteed, causing the model to deviate from actual application requirements and reducing the efficiency of the text matching process.

Method used

By extracting the features of the text to be matched, using the matching determination model to calculate the matching scores between the texts, and screening the sampled texts based on the prediction results, a matching determination model is constructed to reflect the degree of matching between the texts, reducing the amount of sample data and improving the model accuracy.

Benefits of technology

It achieves fast and accurate text matching, improves the accuracy and efficiency of the matching degree determination model, can quantitatively describe the degree of matching between texts, and ensures the effective implementation of related applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114254080B_ABST
    Figure CN114254080B_ABST
Patent Text Reader

Abstract

The embodiments of this specification provide a text matching method, device and equipment that can be applied to the field of artificial intelligence technology. The method includes: obtaining at least two texts to be matched; extracting at least one text feature from each text to be matched; based on the text features corresponding to the at least two texts to be matched, using a matching degree determination model to calculate the matching score between the texts to be matched; the matching degree determination model includes obtaining a sample text for predicting the matching degree, and filtering the sample text based on the prediction result, and then determining a model based on the filtered sample text; determining the matching category between the texts to be matched based on the matching score; the matching category is used to describe the matching degree between texts. The above method ensures the accuracy and efficiency of the process of obtaining the matching degree determination model, and also realizes the quantitative description of the matching degree between texts, accurately realizes the matching between texts, and ensures the effective implementation of related applications.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this specification relate to the field of artificial intelligence technology, and in particular to a text matching method, model training method, device, and equipment. Background Art

[0002] With the development of computer technology, the utilization of text matching is gradually increasing. Text matching is at the bottom layer of many natural language processing tasks, including text reasoning, semantic recognition, and intelligent question answering. It is one of the most basic and core modules required to build many natural language processing applications. Achieving efficient and accurate text matching is of great significance in the field of artificial intelligence.

[0003] To ensure the accuracy of text matching results using deep neural network models, the model size is often increased, requiring more parameters and training with a large amount of sample data. However, in practice, even with fully supervised learning, labeling all sample data cannot guarantee the accuracy of the labeling results. The resulting trained model may deviate from the actual application requirements. Furthermore, using large amounts of data to train the model can reduce the efficiency of the text matching process, resulting in a lack of practical application effectiveness. Achieving fast and accurate text matching is a pressing issue. Summary of the Invention

[0004] The purpose of the embodiments of this specification is to provide a text matching method, apparatus, and device to solve the problem of how to achieve text matching efficiently and accurately.

[0005] In order to solve the above technical problems, an embodiment of this specification proposes a text matching method, including: obtaining at least two texts to be matched; extracting at least one text feature from each of the texts to be matched; based on the text features corresponding to the at least two texts to be matched, using a matching degree determination model to calculate the matching score between the texts to be matched; the matching degree determination model includes obtaining a sample text for predicting the matching degree, and filtering the sample text based on the prediction result, and then determining a model based on the filtered sample text; the matching score is used to reflect the matching degree between the texts to be matched.

[0006] The embodiments of this specification also propose a text matching device, including: a text acquisition module to be matched, used to obtain at least two texts to be matched; a text feature extraction module to extract at least one text feature from each of the texts to be matched; a matching score calculation module to calculate the matching score between the texts to be matched based on the text features corresponding to the at least two texts to be matched, using a matching determination model; the matching determination model includes obtaining sample texts for predicting the matching degree, and filtering the sample texts based on the prediction results, and then determining a model based on the filtered sample texts; the matching score is used to reflect the matching degree between the texts to be matched.

[0007] An embodiment of this specification also proposes a text matching device, including a memory and a processor; the memory is used to store computer program instructions; the processor is used to execute the computer program instructions to implement the following steps: obtaining at least two texts to be matched; extracting at least one text feature from each of the texts to be matched; based on the text features corresponding to the at least two texts to be matched, using a matching degree determination model to calculate the matching score between the texts to be matched; the matching degree determination model includes obtaining sample texts for predicting the matching degree, and filtering the sample texts based on the prediction results, and then determining a model based on the filtered sample texts; the matching score is used to reflect the matching degree between the texts to be matched.

[0008] It can be seen from the technical solutions provided by the above embodiments of this specification that, after obtaining the text to be matched, the embodiments of this specification extract text features from the text to be matched and calculate the matching scores between the texts to be matched based on the matching determination model. The matching determination model is a model determined after obtaining the sampled text and screening the sampled text based on the prediction results corresponding to the sample data, which ensures the accuracy of the rules themselves, and ultimately can determine the matching categories between the texts to be matched based on the matching scores, and then quantitatively describe the matching degrees between the texts. The above method screens the sampled text when determining the matching determination model, which not only reduces the data volume of the sampled text, but also improves the accuracy of the matching determination model determined by the sampled text, ensuring the accuracy and efficiency of the process of obtaining the matching determination model, and correspondingly can also achieve a quantitative description of the matching degrees between texts, accurately achieve matching between texts, and ensure the effective implementation of related applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0010] Figure 1 This is a flowchart of a text matching method according to an embodiment of this specification;

[0011] Figure 2 This is a structural diagram of an RE2 model according to an embodiment of this specification;

[0012] Figure 3 This is a flow chart of a model training process according to an embodiment of this specification;

[0013] Figure 4 This is a module diagram of a text matching device according to an embodiment of this specification;

[0014] Figure 5 This is a structural diagram of a text matching device according to an embodiment of this specification. DETAILED DESCRIPTION

[0015] The following will be combined with the drawings in the embodiments of this specification to clearly and completely describe the technical solutions in the embodiments of this specification. Obviously, the embodiments described are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this specification.

[0016] In order to solve the above technical problems, a text matching method is introduced in the embodiment of this specification. The execution subject of the text matching method is a text matching device, which includes but is not limited to a server, an industrial computer, a PC, etc. Figure 1 As shown, the text matching method may include the following specific implementation steps.

[0017] S110: Obtain at least two texts to be matched.

[0018] The text to be matched is the text to be determined to be matched. The format of the text to be matched is not limited, and the text to be matched may include Chinese characters, numbers, foreign languages, special symbols, etc. The length of the text to be matched may not be limited, or may be limited to a fixed length.

[0019] The text to be matched may be, for example, in a semantic recognition task, where it is necessary to determine the corresponding interpretation of the corresponding text, thereby performing text matching to determine the corresponding interpretation. It may also be applied to fields such as text search, and there is no restriction on the application scenario of the text to be matched.

[0020] The specific method of obtaining the text to be matched can be to directly obtain multiple texts transmitted by other devices or users for matching, or after receiving some texts, these texts can be matched with other texts stored in the device itself in sequence. There is no restriction on this and it can be adjusted based on the needs of actual applications.

[0021] S120: Extract at least one text feature from each of the texts to be matched.

[0022] Since the formats and contents of the texts to be matched may not correspond well if they are not processed, in order to better compare the texts to be matched, text features may be extracted from each text to be matched.

[0023] Text features can be used to describe the text to be matched, and because text features have a pre-set format, they are convenient for comparison in subsequent processes.

[0024] In some embodiments, when extracting text features from the text to be matched, the text to be matched may be first converted into a text vector, and then at least one text feature is extracted based on the text vector. Figure 2 The corresponding RE2 text matching model is shown in the structural diagram. The embedding layer first converts the text to be matched into a corresponding vector, and then uses the encoding layer to extract text features. The specific conversion vector and the method for extracting text features from the vector can be set based on the actual application needs and are not limited to this.

[0025] S130: Based on the text features corresponding to the at least two texts to be matched, a matching score between the texts to be matched is calculated using a matching determination model; the matching determination model includes obtaining sample texts for predicting the matching degree, and filtering the sample texts based on the prediction results corresponding to the sample texts, and then determining a model based on the filtered sample texts; the matching score is used to reflect the matching degree between the texts to be matched.

[0026] After the text features are acquired, the matching scores between the to-be-matched texts may be calculated using a matching determination model in combination with the text features.

[0027] The matching degree determination model may be a model predetermined before text matching is performed to analyze the matching degree between texts. Specifically, the matching degree between texts may be determined by first obtaining sample texts, then filtering the sample texts based on the prediction results corresponding to the sample texts, and then using the filtered sample texts to determine the regularity between the matching degrees between the description texts.

[0028] Since the sampled text is screened based on the prediction results when determining the matching degree determination model, the accuracy of the sampled text after screening is guaranteed. The reduction in the data volume of the sampled text also speeds up the determination process of the matching degree determination model, thereby ensuring the rapid and accurate realization of the text.

[0029] To better describe the matching determination model, the following describes it as corresponding to a neural network deep learning model. It should be noted that in actual applications, the matching determination model can also be expressed in other forms and is not limited to the above example. For example, it can also be expressed as a summary of actual situations, which is not a limitation.

[0030] In this embodiment, the matching degree determination model can be obtained in the following manner: obtaining a first text set; a first sample text in the first text set corresponds to a pre-annotation result; using an initial prediction model to predict a predicted annotation result corresponding to the first sample text; screening candidate annotation results from the predicted annotation results; using a pre-constructed matching degree determination model to predict an experimental annotation result corresponding to the first sample text; training the matching degree determination model based on the experimental annotation result, the candidate annotation result and the pre-annotation result.

[0031] The first text set may include pre-set first sample texts for training the model. Each of the first sample texts corresponds to a pre-annotated result. The pre-annotated result may be result data pre-annotated by a user. In this embodiment, the pre-annotated result may be the degree of matching between texts included in the first sample texts.

[0032] After obtaining the first text set, an initial prediction model can be used to predict the predicted annotation results corresponding to the first sampled text. The initial prediction model can be a pre-trained model for predicting the degree of text matching, which has a high degree of accuracy. Accordingly, to perform this step, the initial prediction model can be trained using a second text set before making specific predictions. The data volume of the second text set can be greater than that of the first text set.

[0033] Specifically, a second text set may be obtained first; the second text set includes annotated sample texts and unannotated sample texts; and the annotated sample texts correspond to annotation results.

[0034] Based on the application characteristics of the embodiments of this specification, the accuracy of the initial prediction model can be greater than that of the matching determination model. Accordingly, the model parameters and corresponding sample data of the initial prediction model can also be greater than those of the matching determination model. Because the initial prediction model is deployed in the offline stage and has strong versatility in all stages of application, it can be pre-trained using a large number of samples for long-term learning to improve the model's accuracy.

[0035] In practical applications, as text matching involves more and more types and fields, the types and fields of sample data involved in the training process are also increasing, leading to a continuous increase in the number of training samples. Labeling each of these training samples one by one obviously consumes a lot of time and effort, so it is possible to label only a portion of the text in the second text set.

[0036] Accordingly, the second text set obtained after annotation includes annotated sample text and unannotated sample text. The annotated sample text is the annotated text, and the annotated sample text corresponds to an annotation result. The annotation result can be set based on the type of sample text. For example, when the sample text is in the form of a question, the annotation result can be the answer to the question. In actual applications, the annotation result can be set as needed, and is not limited to the above example.

[0037] The specific labeling process can be manual labeling of each sample data, or a pre-trained corresponding labeling model can be used to label the sample data. In actual applications, other methods can be used to label sample data as needed, which will not be described here.

[0038] Preferably, in order to further reduce the workload of annotation, the number of the annotated sample texts can be less than the number of the unannotated sample texts. The specific ratio of the annotated sample texts can be adjusted according to the needs of actual application, which will not be repeated here.

[0039] After obtaining the second text set, the annotated sampled text in the second text set can be used to train an initial prediction model. The initial prediction model can be used to predict the annotation results of the data. Because the annotated sampled text used for training has corresponding annotation results, the annotated sampled text and the corresponding annotation results can be combined to achieve supervised learning of the initial prediction model.

[0040] In some embodiments, the initial prediction model can be a model constructed based on the RE2 text matching model. The RE2 text matching model is a fast and powerful neural network method for matching general text. The specific model structure and parameters can be set based on actual application conditions and will not be further described here.

[0041] like Figure 2 The figure shows a schematic diagram of the structure of a RE2 text matching model in an embodiment of this specification, wherein the two text sequences are processed exactly the same before the prediction layer, except that all parameters before the prediction layer are shared. Since the model structure on the right is exactly the same as that on the left, Figure 2 The structural diagram on the right is omitted in the figure. In the RE2 model, the input text sequence is first vectorized through the embedding layer, and then processed by N basic modules (dashed boxes) with consecutive independent parameters. Each basic module includes the following components: First, the encoding layer is used to extract the contextual features of the text. The sequence processed by the encoding layer is spliced ​​together with the sequence before processing and sent to the alignment layer to learn the interactive relationship features between the two input text sequences and "align" the information. Then, the input and output of the alignment layer are directly spliced ​​together and sent to the fusion layer for processing. The output of the fusion layer is the output of the basic building module of the RE2 model mentioned above. At this time, the output sequence is spliced ​​together again with the output of the embedding layer as the input of the next basic building module. This cycle is repeated N times. Finally, the two text sequences learned are sent to the pooling layer to obtain a fixed-length vector, which is then matched through the prediction layer and a matching score is given. The cross entropy loss is usually selected as the optimization function.

[0042] Preferably, since the initial prediction model can be trained offline, the training time does not affect the efficiency of the online application process, thereby maximizing the prediction accuracy of the initial prediction model. Specifically, for example, as many parameters as possible can be set for the initial prediction model, as well as the number of loop iterations during the training process. In actual applications, other methods can also be used to ensure the model's fit and high accuracy.

[0043] After the initial prediction model is trained, since the initial prediction model can be used to predict the annotation results of the data, the initial prediction model can be used to predict the first sample text respectively to obtain the predicted annotation results corresponding to the first sample text.

[0044] It should be noted that even if the sampled text has been pre-annotated, there may be differences between the predicted annotation results and the original annotation results, and this difference may be due to inaccuracies in either. Based on the degree of difference between the two, the corresponding loss function can be used to optimize the training results in the subsequent execution process.

[0045] After obtaining the predicted annotation results, candidate annotation results can also be screened. Since the purpose of training the matching degree determination model in the embodiments of this specification is to achieve text matching, by comparing the similarities between the annotation results, some texts with relatively close similarities can be pre-screened, thereby enabling better text matching in the subsequent implementation process.

[0046] In some embodiments, the screening process may include calculating similarity scores for each candidate annotation result and each pre-annotation result, and then screening a predetermined number of target candidate annotation results corresponding to each pre-annotation result based on the similarity scores. After obtaining similarity scores for each pre-annotation result and each candidate annotation result through the above steps, the corresponding calculations are performed based on these similarity scores.

[0047] The actual screening process is not limited to the number of selected results. For example, a similarity threshold can be set to select predicted annotation results that exceed the similarity threshold as candidate annotation results. The specific method for selecting candidate annotation results can be adjusted according to actual needs and is not limited to this.

[0048] The matching degree determination model can be a pre-built model, specifically applied in the online phase to adapt to text matching in different scenarios. Accordingly, the number of model parameters in the matching degree determination model can be smaller than that of the initial prediction model. The matching degree determination model can be used for data matching, specifically, when the data is text data, the matching degree determination model can be used for text matching.

[0049] Correspondingly, during the training process, the pre-built matching degree determination model can also be used to predict the experimental annotation results corresponding to the first sampled text, that is, there are currently three types of annotation results corresponding to the first sampled text, namely, pre-annotation results, candidate annotation results and experimental annotation results.

[0050] After obtaining the above-mentioned annotation results, the matching degree determination model can be trained.

[0051] Since the candidate annotation results are the filtered annotation results, and the pre-annotation results, candidate annotation results, and experimental annotation results are prediction results for the same sampled text, the matching degree determination model can be trained based on the similarity of these data. Since the initial prediction model can already predict the annotation results relatively accurately, it not only reduces the workload of data annotation, but also reduces the time and computing resources consumed by training the matching degree determination model. Preferably, the matching degree determination model can have fewer parameters to maximize the efficiency of model training and ensure the high efficiency of the text matching process.

[0052] In some embodiments, the matching degree determination model may also be a model constructed based on the RE2 model. For an introduction to the structure of the RE2 model, please refer to the above description and will not be repeated here.

[0053] In some embodiments, a loss function can be constructed based on the experimental annotation results, the candidate annotation results, and the pre-annotation results to train the matching determination model. The loss function is used to determine an optimization strategy for the matching determination model based on the differences between the experimental annotation results and the candidate annotation results and the pre-annotation results. A loss function is constructed based on the annotated sample text and the unannotated sample text corresponding to the target candidate annotation result, and the matching determination model is then optimized based on the loss function.

[0054] Specifically, a loss function can be used to first calculate the difference between the experimental annotation result and the candidate annotation result, and then the loss function can be used to calculate the difference between the experimental annotation result and the pre-annotation result. Because the loss function can be used to evaluate the difference between different results, it has a certain degree of accuracy when the pre-annotation result and the candidate annotation result are the results of the user annotation and the initial prediction model respectively. Accordingly, the model can be optimized and corrected based on the difference between the first result and the second result.

[0055] After obtaining the first result difference and the second result difference, the prediction loss value can be calculated by combining the first result difference and the second result difference. Specifically, the first result difference and the second result difference can be directly added together, or corresponding weight values ​​can be set for the two to achieve the calculation of cross entropy loss.

[0056] When the predicted loss value is not greater than the loss threshold, it means that the difference between the result calculated using the matching determination model and the predicted result is small, and the pre-built matching determination model can be determined as the matching determination model used to calculate the matching score.

[0057] If the predicted loss value is greater than the loss threshold, the steps of adjusting the model parameters of the pre-built matching determination model, calculating the first result difference, calculating the second result difference, and calculating the predicted loss value may be repeated to continuously optimize the matching determination model until the predicted loss value is no greater than the loss threshold, such that the model meets the optimization requirement, or the number of repetitions reaches the repetition threshold. After the above repetitions are completed, the currently adjusted matching determination model is determined as the final matching determination model for calculating the matching score.

[0058] In some embodiments, the loss function also includes hyperparameters; the hyperparameters are used to adjust the degree of optimization of the prediction results and the labeling results with respect to the model parameters.

[0059] Combining the above analysis and introduction, in a specific example, the loss function can be Where θ S The matching degree determines the parameters to be optimized in the model, and α is a hyperparameter that adjusts the loss ratio. is the loss of the candidate annotation result to the annotation result, is the loss of candidate annotation results to predicted annotation results.

[0060] Through the above loss function, the training results of the matching determination model can be optimized while evaluating the prediction error of the initial prediction model, ensuring the accuracy of model training. It can also achieve learning and training for the matching determination model on a smaller scale, thereby improving learning efficiency.

[0061] Since the trained matching determination model can achieve data matching, after inputting text features into the matching determination model, the corresponding matching score can be obtained, and then the matching type between texts can be determined according to the size of the matching score.

[0062] The matching score is used to quantitatively describe the degree of matching between texts. After calculating the matching score between the texts to be matched, the matching score can be compared with the corresponding evaluation criteria in the subsequent process to determine the final matching result.

[0063] In some embodiments, when there are three or more texts to be matched, they can be matched separately in pairs. After determining the matching scores corresponding to two texts to be matched, other texts to be matched can be used for matching, and the matching process can be repeated until all texts are matched. In actual applications, it may be necessary to determine a specific matching method, which will not be described in detail here.

[0064] After obtaining the matching scores, since the size of the matching scores can reflect the degree of matching between texts, whether different to-be-matched texts match each other can be determined by calculating the matching scores.

[0065] In some embodiments, in order to better determine the degree of matching between the texts to be matched, matching categories can also be pre-set. The matching category can be a pre-set category for describing the degree of matching, thereby distinguishing the degree of matching of texts of different categories, for example, it can include matching categories such as complete match, basic match, partial match and non-match. During the application process, multiple matching categories can be pre-set, and the matching score intervals corresponding to each matching category can be pre-divided. After the matching score is calculated, the matching category between the texts to be matched can be directly determined according to the matching score interval corresponding to the matching score, thereby ensuring the accuracy of the matching category division. The specific number and type of the matching categories can be set based on the needs of the actual application, which will not be repeated here.

[0066] After obtaining the matching categories, different to-be-matched texts can be classified according to the corresponding matching categories to achieve effective use of the to-be-matched texts.

[0067] Based on the above embodiment, a scenario example is used for illustration. Figure 3 As shown in the figure, the T-Re2 model and the S-Re2 model can be pre-built. Based on the commonly used deep learning text matching model architecture, RE2, combined with knowledge distillation technology, the top-k predictions of the T model on unlabeled data are selected as additional information and added to the S model training. This can achieve the goal of reducing model parameters, simplifying the model structure, and improving the inference and prediction speed while still maintaining the high accuracy of the S model (compared to the T model).

[0068] In the offline implementation, we first trained the RE2 text matching model on a labeled dataset. The resulting model is called the T-Re2 model. During T-Re2 model training, we typically set as many parameters as possible to ensure good model fit and high matching accuracy.

[0069] Next, in the online stage, the RE2 text matching model is still used. For each question q in the labeled data sample pair, it is first sent to the T-Re2 model trained in the offline stage for prediction. The top K candidate answer texts r1, r2, ..rK with the highest similarity scores are selected from the answer text set of unlabeled data as the supplementary information of the standard answer a of q, and are integrated into the loss function for training. The loss function is where θ S is the parameter to be optimized in the S-Re2 model, LT is the loss of the prediction of question q in the current data sample to the manually labeled standard answer, L S The loss of the T-Re2 model prediction value of the current question q on the top-K selected texts compared with the S-Re2 model prediction value is usually selected as the negative log-likelihood loss, and α is a hyperparameter that adjusts the ratio between the two losses. From this loss function, it can be easily seen that the S-Re2 model uses the T-Re2 model as a teacher and uses the information it has learned as high-level features to supplement its own model training process by making predictions on unlabeled data (that is, αL in the loss function). S Items), thereby achieving accuracy close to that of the T-Re2 model. On the other hand, by treating the learning results of the T-Re2 model as higher-level features, it can be assumed that the information contained in the data has been purified, thus enabling learning and training on a smaller scale in the S model without sacrificing accuracy.

[0070] Based on the introduction of the above embodiments and scenario examples, it can be seen that after obtaining the text to be matched, the above method extracts text features from the text to be matched and calculates the matching score between the texts to be matched based on the matching determination model. The matching determination model is a rule determined after obtaining the sampled text and screening the sampled text based on the prediction results corresponding to the sampled text, which ensures the accuracy of the rule itself, and ultimately determines the matching category between the texts to be matched based on the matching score, and then quantitatively describes the matching degree between the texts. The above method screens the sampled text when determining the matching determination model, which not only reduces the amount of sampled text, but also improves the accuracy of the matching determination model determined based on the sampled text, ensuring the accuracy and efficiency of the process of obtaining the matching determination model, and accordingly can also achieve a quantitative description of the matching degree between texts, accurately achieve matching between texts, and ensure the effective implementation of related applications.

[0071] based on Figure 1 The corresponding text matching method introduces a text matching device according to an embodiment of this specification. The text matching device is set in the text matching device. Figure 4 As shown, the text matching device includes the following modules.

[0072] The to-be-matched text acquisition module 410 is configured to acquire at least two to-be-matched texts.

[0073] The text feature extraction module 420 is configured to extract at least one text feature from each of the texts to be matched.

[0074] The matching score calculation module 430 is used to calculate the matching score between the texts to be matched based on the text features corresponding to the at least two texts to be matched, using a matching determination model; the matching determination model includes obtaining sample texts for predicting the matching degree, and filtering the sample texts based on the prediction results, and then determining a model based on the filtered sample texts; the matching score is used to reflect the matching degree between the texts to be matched.

[0075] based on Figure 1 Corresponding to the text matching method, this specification embodiment provides a text matching device. Figure 5 As shown, the text matching device may include a memory and a processor.

[0076] In this embodiment, the memory may be implemented in any suitable manner. For example, the memory may be a read-only memory, a mechanical hard disk, a solid-state drive, or a USB flash drive. The memory may be used to store computer program instructions.

[0077] In this embodiment, the processor can be implemented in any appropriate manner. For example, the processor can take the form of a microprocessor or a processor and a computer-readable medium storing computer-readable program code (such as software or firmware) executable by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller, etc. The processor can execute the computer program instructions to implement the following steps: obtaining at least two texts to be matched; extracting at least one text feature from each of the texts to be matched; calculating the matching score between the texts to be matched using a matching determination model based on the text features corresponding to the at least two texts to be matched; the matching determination model includes obtaining sample texts for predicting the matching degree, filtering the sample texts based on the prediction results, and then determining a model based on the filtered sample texts; the matching score is used to reflect the matching degree between the texts to be matched.

[0078] It should be noted that the above-mentioned text matching methods, devices and equipment can be applied to the field of artificial intelligence technology, and can also be applied to other technical fields besides the field of artificial intelligence technology, without any limitation.

[0079] In the 1990s, technological improvements could be clearly distinguished as either hardware improvements (for example, improvements to circuit structures like diodes, transistors, and switches) or software improvements (improvements to process flows). However, with the advancement of technology, many process flow improvements today can now be considered direct improvements to hardware circuit structures. Designers almost always create the corresponding hardware circuit structure by programming the improved process flow into the hardware circuit. Therefore, it cannot be said that a process flow improvement cannot be implemented using hardware modules. For example, a programmable logic device (PLD), such as a field programmable gate array (FPGA), is an integrated circuit whose logical function is determined by user programming. Designers can "integrate" a digital system on a PLD through their own programming, without having to hire a chip manufacturer to design and manufacture a dedicated integrated circuit chip. Moreover, nowadays, instead of manually fabricating integrated circuit chips, this programming is mostly done using "logic compiler" software. This is similar to the software compiler used when developing programs. Before compilation, the original code must also be written in a specific programming language, called a hardware description language (HDL). There is not just one HDL, but many, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art will also understand that by simply programming the method flow in one of these hardware description languages ​​and then programming it into an integrated circuit, a hardware circuit that implements the logic method flow can be easily obtained.

[0080] The systems, devices, modules, or units described in the above embodiments may be implemented by computer chips or entities, or by products having certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0081] Through the description of the above embodiments, it can be seen that those skilled in the art can clearly understand that this specification can be implemented by means of software plus the necessary first hardware platform. Based on this understanding, the technical solution of this specification, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in various embodiments or certain parts of the embodiments of this specification.

[0082] The various embodiments in this specification are described in a progressive manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the system embodiments are generally similar to the method embodiments, so the description is relatively simple. For relevant parts, refer to the description of the method embodiments.

[0083] The present disclosure may be used in a variety of first and special computer system environments or configurations, such as personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above.

[0084] This specification may be described in the general context of computer-executable instructions, such as program modules, executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media, including storage devices.

[0085] Although the present specification has been described through embodiments, those skilled in the art will appreciate that there are many modifications and variations to the present specification without departing from the spirit of the present specification. It is intended that the appended claims include these modifications and variations without departing from the spirit of the present specification.

Claims

1. A text matching method, characterized in that: include: Get at least two texts to be matched; Extracting at least one text feature from each of the texts to be matched; Calculating a matching score between the texts to be matched using a matching determination model based on text features corresponding to the at least two texts to be matched; The matching degree determination model includes obtaining sample text for predicting the matching degree, filtering the sample text based on the prediction result corresponding to the sample text, and determining a model based on the filtered sample text; The matching score is used to reflect the matching degree between the texts to be matched; The matching degree determination model is obtained in the following way: Acquire a first text set; a first sample text in the first text set corresponds to a pre-annotated result; Predicting a predicted annotation result corresponding to the first sampled text using the initial prediction model; Filtering candidate annotation results from the predicted annotation results; Predicting an experimental annotation result corresponding to the first sampled text using a pre-built matching degree determination model; The matching degree determination model is trained based on the experimental annotation results, the candidate annotation results, and the pre-annotation results.

2. The method according to claim 1, wherein The extracting at least one text feature from each of the to-be-matched texts includes: Convert the text to be matched into a text vector; At least one text feature is extracted based on the text vector.

3. The method according to claim 2, wherein The number of model parameters of the matching degree determination model is smaller than the number of model parameters of the initial prediction model.

4. The method according to claim 2, wherein The initial prediction model is obtained by: Acquire a second text set; the second text set includes annotated sample texts and unannotated sample texts; The annotated sample text corresponds to an annotation result; the number of texts in the second text set is greater than the data volume of the first sample text and the first text set; The initial prediction model is trained using the second text set.

5. The method according to claim 2, wherein The screening of candidate annotation results from the predicted annotation results includes: Calculate the similarity scores of the candidate annotation results corresponding to each pre-annotation result respectively; A preset number of target candidate annotation results are screened based on the similarity scores.

6. The method according to claim 2, wherein The training of the matching degree determination model based on the experimental annotation results, the candidate annotation results, and the pre-annotation results includes: Constructing a loss function based on the experimental annotation results, the candidate annotation results, and the pre-annotation results; Calculating a first result difference between the experimental annotation result and the candidate annotation result using the loss function; Calculating a second result difference between the experimental annotation result and the pre-annotation result using the loss function; Calculating a predicted loss value by combining the first result difference and the second result difference; In a case where the predicted loss value is not greater than the loss threshold, the pre-built matching degree determination model is determined as the matching degree determination model for calculating the matching degree score.

7. The method according to claim 6, wherein After calculating the predicted loss value by combining the first result difference and the second result difference, the method further includes: If the predicted loss value is greater than the loss threshold, repeatedly performing the steps of adjusting the model parameters of the pre-built matching degree determination model, calculating the first result difference, calculating the second result difference, and calculating the predicted loss value until the predicted loss value is no greater than the loss threshold or the number of repetitions reaches the repetition threshold; The current matching degree determination model is determined to be the matching degree determination model used to calculate the matching degree score.

8. The method according to claim 6, wherein The loss function also includes hyperparameters; the hyperparameters are used to adjust the degree of optimization of the prediction results and labeling results for the model parameters.

9. The method according to claim 1, wherein After calculating the matching scores between the texts to be matched using the matching determination model based on the text features corresponding to the at least two texts to be matched, the method further includes: A matching category corresponding to the matching score is determined; the matching category is used to distinguish text matching degrees of different categories.

10. A text matching device, characterized in that: include: A to-be-matched text acquisition module, used to acquire at least two to-be-matched texts; A text feature extraction module, configured to extract at least one text feature from each of the texts to be matched; A matching score calculation module, configured to calculate a matching score between the texts to be matched using a matching determination model based on text features corresponding to the at least two texts to be matched; The matching degree determination model includes obtaining sample texts for predicting the matching degree, filtering the sample texts based on the prediction results, and determining a model based on the filtered sample texts; the matching degree score is used to reflect the matching degree between the texts to be matched; The device is further configured to obtain a first text set; a first sample text in the first text set corresponds to a pre-annotated result; use an initial prediction model to predict a predicted annotation result corresponding to the first sample text; screen candidate annotation results from the predicted annotation results; and use a pre-built matching degree determination model to predict an experimental annotation result corresponding to the first sample text; The matching degree determination model is trained based on the experimental annotation results, the candidate annotation results, and the pre-annotation results.

11. A text matching device comprising a memory and a processor; The memory is used to store computer program instructions; The processor is configured to execute the computer program instructions to implement the following steps: obtaining at least two texts to be matched; Extracting at least one text feature from each of the texts to be matched; calculating a matching score between the texts to be matched using a matching determination model based on the text features corresponding to the at least two texts to be matched; The matching degree determination model includes obtaining sample texts for predicting matching degree, screening the sample texts based on the prediction results, and determining a model based on the screened sample texts; the matching degree score is used to reflect the matching degree between the to-be-matched texts; obtaining a first text set; a first sample text in the first text set corresponds to a pre-annotated result; using an initial prediction model to predict a predicted annotation result corresponding to the first sample text; screening candidate annotation results from the predicted annotation results; and using a pre-built matching degree determination model to predict an experimental annotation result corresponding to the first sample text; The matching degree determination model is trained based on the experimental annotation results, the candidate annotation results, and the pre-annotation results.

Citation Information

Patent Citations

  • Training method, device and equipment for determining associated topic and model of text data

    CN109918653A

  • Text data processing method, device and equipment and storage medium

    CN111444326A