Text matching method and device, computer equipment and storage medium

By adopting embedding representations of morphemes and words in quantum heuristic neural networks, combined with quantum hybrid state modeling methods, a finer-grained semantic and grammatical knowledge representation is constructed, which solves the problem of insufficient text matching accuracy and efficiency in the existing technology, and achieves a more efficient text matching effect.

CN120354145APending Publication Date: 2025-07-22BEIJING INST OF TECH +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510418586.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-03
Publication Date
2025-07-22

AI Technical Summary

Technical Problem

The existing quantum heuristic neural networks lack more finer-grained semantic and grammatical knowledge representations in text matching, and cannot effectively capture the complexity of language and simulate real human cognitive processes, resulting in insufficient accuracy and efficiency of text matching.

Method used

Using morphemes-based embedding representation and word-based embedding representation, combined with the quantum mixed state modeling method, a quantum mixed state representation of finer-grained semantic and grammatical knowledge is constructed, and the semantic probability of text in a single direction is obtained through quantum measurement for text matching.

Benefits of technology

Improve the accuracy and efficiency of text matching, effectively capture the complexity of language and simulate real human cognitive processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120354145A_ABST
    Figure CN120354145A_ABST
Patent Text Reader

Abstract

The invention relates to the field of text matching, in particular to a text matching method and device, computer equipment and a storage medium, which are based on morpheme-based embedded representation and word-based embedded representation, and adopt a quantum mixed state modeling method to construct quantum mixed state representation of semantic and grammatical knowledge with finer granularity. According to the method, the language complexity is effectively captured, the real human cognitive process is simulated, quantum measurement is carried out based on constructed quantum mixed state representation, the semantic probability of a text in a single direction is obtained and used for text matching, and the text matching precision and efficiency are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of text matching, and particularly to a text matching method, apparatus, computer device, and storage medium. Background Art

[0002] Text matching is one of the important tasks in natural language understanding, mainly used to measure the similarity between a pair of texts. At the same time, the quantum theory has shown significant advantages in cognition and decision-making. Natural language processing based on the quantum theory has shown outstanding performance in solving the uncertainty in language understanding, and related quantum-inspired neural networks have gradually developed. However, so far, the embedding representation modules in most existing quantum-inspired neural networks are based on word-level embedding representations, lacking more fine-grained semantic and syntactic knowledge representations, and unable to effectively capture the complexity of language and simulate the real human cognitive process. In addition, the inherent ambiguity in language also needs to be further explored and alleviated. Summary of the Invention

[0003] Based on this, the object of the present invention is to provide a text matching method, apparatus, computer device, and storage medium. Based on the embedding representation of morphemes and the embedding representation of words, a quantum hybrid state modeling method is adopted to construct a quantum hybrid state representation of more fine-grained semantic and syntactic knowledge, effectively capture the complexity of language and simulate the real human cognitive process, perform quantum measurement based on the constructed quantum hybrid state representation to obtain the semantic probability of the text in a single direction, and use it for text matching to improve the accuracy and efficiency of text matching.

[0004] In a first aspect, an embodiment of the present application provides a text matching method, including the following steps:

[0005] Obtain a pair of texts to be matched, where the pair of texts includes a first text and a second text, and both the first text and the second text include a plurality of sentences, and each sentence includes a plurality of words;

[0006] Perform embedding processing on a plurality of sentences of the first text and the second text to obtain a plurality of word embeddings of the plurality of sentences of the first text and the second text and a plurality of morpheme embeddings of the plurality of words;

[0007] Adopt a quantum hybrid state modeling method to perform feature modeling according to the plurality of word embeddings of the plurality of sentences of the first text and the second text and the plurality of morpheme embeddings of the plurality of words to obtain a quantum hybrid state representation of the plurality of sentences of the first text and the second text;

[0008] Perform quantum measurement based on the quantum mixed state representations of several sentences of the first text and the second text, and obtain the quantum measurement probability representations of several sentences of the first text and the second text;

[0009] Perform text matching based on the quantum measurement probability representations of several sentences of the first text and the second text, and obtain the text matching result between several sentences of the first text and several sentences of the second text.

[0010] In a second aspect, an embodiment of the present application provides a text matching device, including:

[0011] A data acquisition module, configured to acquire a text pair to be matched, where the text pair includes a first text and a second text, both the first text and the second text include several sentences, and the sentences include several words;

[0012] An embedding processing module, configured to perform embedding processing on several sentences of the first text and the second text, and obtain the complex word embedding representations of several sentences of the first text and the second text and the complex word element embedding representations of several words;

[0013] A feature modeling module, configured to adopt a quantum mixed state modeling method to perform feature modeling based on the complex word embedding representations of several sentences of the first text and the second text and the complex word element embedding representations of several words, and obtain the quantum mixed state representations of several sentences of the first text and the second text;

[0014] A quantum measurement module, configured to perform quantum measurement based on the quantum mixed state representations of several sentences of the first text and the second text, and obtain the quantum measurement probability representations of several sentences of the first text and the second text;

[0015] A text matching module, configured to perform text matching based on the quantum measurement probability representations of several sentences of the first text and the second text, and obtain the text matching result between several sentences of the first text and several sentences of the second text.

[0016] In a third aspect, an embodiment of the present application provides a computer device, including a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the text matching method described in the first aspect are implemented.

[0017] In a fourth aspect, an embodiment of the present application provides a storage medium, where the storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the text matching method described in the first aspect are implemented.

[0018] In an embodiment of the present application, a text matching method, apparatus, device, and storage medium are provided. Based on the embedding representation of morphemes and the embedding representation of words, a quantum hybrid state modeling method is adopted to construct a quantum hybrid state representation of finer-grained semantic and syntactic knowledge, effectively capturing the complexity of language and simulating the real human cognitive process. Quantum measurement is performed based on the constructed quantum hybrid state representation to obtain the semantic probability of the text in a single direction, which is used for text matching to improve the accuracy and efficiency of text matching.

[0019] For better understanding and implementation, the present invention will be described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 Schematic flowchart of the text matching method provided by an embodiment of the present application;

[0021] Figure 2 Schematic diagram of S2 in the flowchart of the text matching method provided by an embodiment of the present application;

[0022] Figure 3 Schematic diagram of S3 in the flowchart of the text matching method provided by an embodiment of the present application;

[0023] Figure 4 Schematic diagram of S3 in the flowchart of the text matching method provided by another embodiment of the present application;

[0024] Figure 5 Schematic diagram of S4 in the flowchart of the text matching method provided by an embodiment of the present application;

[0025] Figure 6 Schematic diagram of S5 in the flowchart of the text matching method provided by an embodiment of the present application;

[0026] Figure 7 Schematic structural diagram of the text matching apparatus provided by an embodiment of the present application;

[0027] Figure 8 Schematic structural diagram of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0028] Here, the exemplary embodiments will be described in detail, and the examples are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of the apparatus and methods consistent with some aspects of the present application as detailed in the appended claims.

[0029] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms "a", "the", and "said" used in this application and the appended claims are also intended to include the plural forms unless the context clearly dictates otherwise. It should also be understood that the term "and / or" used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.

[0030] It should be understood that although the terms first, second, third, etc. may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "when" or "while" or "in response to determining".

[0031] Please refer to Figure 1 , Figure 1 which is a schematic flowchart of a text matching method provided for an embodiment of this application. The method includes the following steps:

[0032] S1: Obtain the text pair to be matched.

[0033] The execution subject of the text matching method is a matching device for the text matching method (hereinafter referred to as the matching device). In an optional embodiment, the matching device may be a computer device, a server, or a server cluster formed by combining multiple computer devices.

[0034] In this embodiment, the matching device obtains the text pair to be matched. Among them, the text pair includes a first text and a second text, and both the first text and the second text include several sentences, and each sentence includes several words. The document data to be tested and a preset text matching model, where the document data to be tested includes the text to be tested and the image to be tested, and the text matching model includes a global feature extraction module, a single-modal feature extraction module, a feature bridging module, a feature interaction module, a feature fusion module, and an emotion recognition module.

[0035] S2: Perform embedding processing on several sentences of the first text and the second text to obtain plural word embeddings of several sentences of the first text and the second text and plural word element embeddings of several words.

[0036] Each word or word element in a sentence can be regarded as a particle representing a pure state in a Hilbert space.

[0037] In this embodiment, the matching device performs embedding processing on several sentences of the first text and the second text to obtain plural word embedding representations of several sentences of the first text and the second text and plural morpheme embedding representations of several words.

[0038] Please refer to Figure 2 , Figure 2 which is a schematic diagram of S2 in the process of the text matching method provided by an embodiment of the present application, including steps S21 to S23, specifically as follows:

[0039] S21: Input the sentence into a preset word embedding model for embedding processing to obtain plural word embedding representations of several sentences of the first text and the second text.

[0040] The word embedding model uses the word2vec word embedding model to convert the vectors of several words in a sentence into corresponding state vectors.

[0041] In this embodiment, the matching device inputs the sentence into a preset word embedding model for embedding processing to obtain plural word embedding representations of several sentences of the first text and the second text. Among them, the plural word embedding representation generally includes two parts: a real part and an imaginary part, and these two parts are composed of an amplitude and a phase through a non-linear semantic combination method. The plural word embedding representation is:

[0042]

[0043] In the formula, |w> is the plural word embedding representation, r j is the amplitude of the word embedding vector of the j-th word in the plural word embedding representation of the sentence, θ j is the phase of the word embedding vector of the j-th word in the plural word embedding representation of the sentence, i represents an imaginary number, and |e j > is the ground state of the word embedding vector of the j-th word in the plural word embedding representation of the sentence.

[0044] S22: Perform morpheme splitting on several words of the sentence, and input several morphemes of the words obtained after splitting into a preset morpheme embedding model for embedding processing to obtain morpheme embeddings of several morphemes of the words.

[0045] The morpheme embedding model uses the one-hot encoding model. In this embodiment, the matching device performs morpheme splitting on several words of the sentence to obtain several morphemes of several words, and inputs several morphemes of the words obtained after splitting into a preset one-hot encoding model for embedding processing to obtain morpheme embeddings of several morphemes of the words.

[0046] S23: Perform a tensor product operation on the morpheme embeddings of several morphemes of the same word to obtain the plural morpheme embedding representations of several words in several sentences of the first text and the second text.

[0047] In this embodiment, the matching device performs a tensor product operation on the morpheme embeddings of several morphemes of the same word to obtain the plural morpheme embedding representations of several words in several sentences of the first text and the second text, as described below:

[0048]

[0049] In the formula, |M> is the plural morpheme embedding representation, m k is the morpheme embedding vector of the k-th morpheme of the word, K is the number of morphemes of the word, is the tensor product symbol.

[0050] S3: Adopt a quantum mixed state modeling method to perform feature modeling according to the plural word embedding representations and plural morpheme embedding representations of several words in several sentences of the first text and the second text, and obtain the quantum mixed state representations of several sentences of the first text and the second text.

[0051] A sentence is often composed of multiple words, which can be analogous to multiple particles in a Hilbert space. The global mixed state of quantum can be used to represent the mixed state of the whole sentence.

[0052] In this embodiment, the matching device adopts a quantum mixed state modeling method to perform feature modeling according to the plural word embedding representations and plural morpheme embedding representations of several words in several sentences of the first text and the second text, and obtain the quantum mixed state representations of several sentences of the first text and the second text.

[0053] The quantum mixed state representation includes a global mixed state representation. The plural morpheme embedding representation includes a real part and an imaginary part, and these two parts are composed of amplitude and phase through a non-linear semantic combination method. Please refer to Figure 3 , Figure 3 is a schematic diagram of S3 in the process of the text matching method provided by an embodiment of the present application, including step S31, specifically as follows:

[0054] S31: Obtain the global mixed state representations of several sentences of the first text and the second text according to the plural word embedding representations of several sentences of the first text and the second text and a preset first feature modeling algorithm.

[0055] The first feature modeling algorithm is:

[0056]

[0057] where ρ W is the global mixed state representation, L is the number of words, is the first weight parameter determined by the fuzzy membership function, where λ n represents the first index, a and c are respectively the first and second trainable parameters in the neural network, |Ф j > is the word embedding vector of the j-th word in the plural word embedding representation of the sentence, <Ф j | is the conjugate transpose of the word embedding vector of the j-th word in the plural word embedding representation of the sentence.

[0058] In this embodiment, the matching device constructs a global mixed state density matrix as the global mixed state representation according to the plural word embedding representations of several sentences of the first text and the second text and a preset first feature modeling algorithm, and obtains the global mixed state representations of several sentences of the first text and the second text.

[0059] The quantum mixed state representation includes a local mixed state representation. Please refer to Figure 4 , Figure 4 which is a schematic diagram of S3 in the process of the text matching method provided in another embodiment of the present application, including steps S32 to S33, specifically as follows:

[0060] S32: Perform a tensor product operation on the plural word embedding representations of several words of the sentence according to a preset sliding window to obtain several tensor product representations of several sentences of the first text and the second text.

[0061] In this embodiment, the matching device performs a tensor product operation on the plural word embedding representations of several words of the sentence according to a preset sliding window to obtain several tensor product representations of several sentences of the first text and the second text, as described below:

[0062]

[0063] where |M gram > is the tensor product representation, M j is the plural word embedding representation of the j-th word of the sentence, L is the number of words in the sentence, is the tensor product symbol.

[0064] S33: Obtain the local mixed state representations of several sentences of the first text and the second text according to the several tensor product representations of the sentence and a preset second feature modeling algorithm.

[0065] The second feature modeling algorithm is:

[0066]

[0067] In the formula, ρ M is the local mixed state representation, m is the index of the tensor product representation, and M is the number of tensor product representations. is the second weight parameter determined by the fuzzy membership function. where λ m represents the second index, and a and c are respectively the third and fourth trainable parameters in the neural network. is the tensor product representation of the m-th word. is of the tensor product representation of the m-th word.

[0068] In this embodiment, the matching device obtains the local mixed state representations of several sentences of the first text and the second text according to several tensor product representations of the sentence and a preset second feature modeling algorithm.

[0069] S4: Perform quantum measurement according to the quantum mixed state representations of several sentences of the first text and the second text to obtain the quantum measurement probability representations of several sentences of the first text and the second text.

[0070] In this embodiment, the matching device performs quantum measurement according to the quantum mixed state representations of several sentences of the first text and the second text to obtain the quantum measurement probability representations of several sentences of the first text and the second text.

[0071] Please refer to Figure 5 , Figure 5 which is a schematic diagram of S4 in the process of the text matching method provided by an embodiment of this application, including steps S41 to S42, specifically as follows:

[0072] S41: Obtain the mixed state fusion representations of several sentences of the first text and the second text according to the global mixed state representation, local mixed state representation of the same sentence, and a preset feature fusion algorithm.

[0073] The feature fusion algorithm is:

[0074]

[0075] In the formula, ρ is the mixed state fusion representation. is the third weight parameter determined by the fuzzy membership function. where λ f represents the third index, and a and c are respectively the fifth and sixth trainable parameters in the neural network. is the mixed state representation. When λ f = 1, λ f = 2,

[0076] In this embodiment, the matching device obtains the hybrid state fusion representations of several sentences of the first text and the second text according to the global hybrid state representation, the local hybrid state representation of the same sentence, and a preset feature fusion algorithm.

[0077] S42: Obtain the quantum measurement probability representations of several sentences of the first text and the second text according to the hybrid state fusion representations of the sentences and a preset quantum measurement probability algorithm.

[0078] The quantum measurement probability algorithm is as follows:

[0079]

[0080] where p is the quantum measurement probability representation, T t is the t-th measurement operator in a preset measurement operator set, is the conjugate transpose of the t-th measurement operator.

[0081] In this embodiment, the matching device obtains the quantum measurement probability representations of several sentences of the first text and the second text according to the hybrid state fusion representations of the sentences and a preset quantum measurement probability algorithm.

[0082] S5: Perform text matching according to the quantum measurement probability representations of several sentences of the first text and the second text, and obtain the text matching result between several sentences of the first text and several sentences of the second text.

[0083] In this embodiment, the matching device performs text matching according to the quantum measurement probability representations of several sentences of the first text and the second text, and obtains the text matching result between several sentences of the first text and several sentences of the second text.

[0084] Based on the morpheme-based embedding representation and the word-based embedding representation, a quantum hybrid state modeling method is adopted to construct a quantum hybrid state representation of finer-grained semantic and syntactic knowledge, effectively capturing the complexity of language and simulating the real human cognitive process. Quantum measurement is performed based on the constructed quantum hybrid state representation to obtain the semantic probability of the text in a single direction for text matching, improving the accuracy and efficiency of text matching.

[0085] Please refer to Figure 6 , Figure 6 , which is a schematic diagram of S5 in the process of the text matching method provided by an embodiment of the present application, including steps S51 to S52, specifically as follows:

[0086] S51: Concatenate the quantum measurement probability representations of several sentences of the first text with the quantum measurement probability representations of several sentences of the second text respectively to obtain a concatenated representation between several sentences of the first text and several sentences of the second text.

[0087] In this embodiment, the matching device concatenates the quantum measurement probability representations of several sentences of the first text with the quantum measurement probability representations of several sentences of the second text respectively to obtain a concatenated representation between several sentences of the first text and several sentences of the second text.

[0088] S52: Obtain text matching probability data according to the concatenated representation between several sentences and a preset text matching probability algorithm; obtain the text matching label corresponding to the text matching probability vector of the largest dimension according to the text matching probability data as the text matching result, and obtain the text matching result between several sentences of the first text and several sentences of the second text.

[0089] In this embodiment, the matching device obtains text matching probability data according to the concatenated representation between several sentences and a preset text matching probability algorithm, where the text matching probability data includes text matching probability vectors of several dimensions, and each dimension is set with a corresponding text matching label, and the text matching probability algorithm is:

[0090]

[0091] In the formula, P is the text matching probability data, k is the k-th element in the concatenated representation, l is all elements in the concatenated representation, and e is the natural logarithm.

[0092] The matching device obtains the text matching label corresponding to the text matching probability vector of the largest dimension according to the text matching probability data as the text matching result, and obtains the text matching result between several sentences of the first text and several sentences of the second text.

[0093] Please refer to Figure 7 , Figure 7 which is a schematic structural diagram of a text matching device provided by an embodiment of the present application. The device can implement all or part of the text matching device through software, hardware, or a combination of both. The device 7 includes:

[0094] A data acquisition module 71, configured to acquire a text pair to be matched, where the text pair includes a first text and a second text, and both the first text and the second text include several sentences, and each sentence includes several words;

[0095] An embedding processing module 72, configured to perform embedding processing on several sentences of the first text and the second text, so as to obtain plural word embedding representations of several sentences of the first text and the second text, and plural morpheme embedding representations of several words;

[0096] A feature modeling module 73, configured to perform feature modeling by using a quantum mixed state modeling method according to the plural word embedding representations of several sentences of the first text and the second text, and the plural morpheme embedding representations of several words, so as to obtain quantum mixed state representations of several sentences of the first text and the second text;

[0097] A quantum measurement module 74, configured to perform quantum measurement according to the quantum mixed state representations of several sentences of the first text and the second text, so as to obtain quantum measurement probability representations of several sentences of the first text and the second text;

[0098] A text matching module 75, configured to perform text matching according to the quantum measurement probability representations of several sentences of the first text and the second text, so as to obtain a text matching result between several sentences of the first text and several sentences of the second text.

[0099] In an embodiment of the present application, a text pair to be matched is obtained through a data acquisition module, where the text pair includes a first text and a second text, and both the first text and the second text include a plurality of sentences, and each sentence includes a plurality of words; through an embedding processing module, embedding processing is performed on the plurality of sentences of the first text and the second text to obtain a plurality of word embedding representations of the plurality of sentences of the first text and the second text and a plurality of morpheme embedding representations of the plurality of words; through a feature modeling module, using a quantum mixed state modeling method, feature modeling is performed according to the plurality of word embedding representations of the plurality of sentences of the first text and the second text and the plurality of morpheme embedding representations of the plurality of words to obtain a quantum mixed state representation of the plurality of sentences of the first text and the second text; through a quantum measurement module, quantum measurement is performed according to the quantum mixed state representation of the plurality of sentences of the first text and the second text to obtain a quantum measurement probability representation of the plurality of sentences of the first text and the second text; through a text matching module, text matching is performed according to the quantum measurement probability representation of the plurality of sentences of the first text and the second text to obtain a text matching result between the plurality of sentences of the first text and the plurality of sentences of the second text. Based on the morpheme-based embedding representation and the word-based embedding representation, using the quantum mixed state modeling method, a quantum mixed state representation of finer-grained semantic and syntactic knowledge is constructed, effectively capturing the complexity of language and simulating the real human cognitive process. Based on the constructed quantum mixed state representation, quantum measurement is performed to obtain the semantic probability of the text in a single direction for text matching, improving the accuracy and efficiency of text matching.

[0100] Please refer to Figure 8 , Figure 8 which is a schematic structural diagram of a computer device provided by an embodiment of the present application. The computer device 8 includes: a processor 81, a memory 82, and a computer program 83 stored on the memory 82 and executable on the processor 81; the computer device can store multiple instructions, and the instructions are suitable for being loaded and executed by the processor 81 to perform the method steps of the above Figures 1 to 6 shown embodiment. The specific execution process can be referred to Figures 1 to 6 the specific description of the shown embodiment, and details are not described herein.

[0101] Among them, the processor 81 may include one or more processing cores. The processor 81 utilizes various interfaces and circuits to connect various parts within the server, and by running or executing instructions, programs, code sets, or instruction sets stored in the memory 82, as well as calling the data in the memory 82, it executes various functions of the text matching device 7 and processes data. Optionally, the processor 81 may be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), or programmable logic array (PLA). The processor 81 may integrate one or a combination of several of the central processing unit 81 (CPU), graphics processing unit 81 (GPU), and modem, etc. Among them, the CPU mainly processes the operating system, user interface, application programs, etc.; the GPU is responsible for the rendering and drawing of the content to be displayed on the touch display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 81 and may be implemented separately by a single chip.

[0102] Among them, the memory 82 may include random access memory 82 (RAM), and may also include read-only memory 82 (Read-Only Memory). Optionally, the memory 82 includes a non-transitory computer-readable storage medium. The memory 82 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 82 may include a program storage area and a data storage area. Among them, the program storage area may store instructions for implementing the operating system, instructions for at least one function (such as touch instructions, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store the data involved in the above-mentioned various method embodiments. Optionally, the memory 82 may also be at least one storage device located far from the aforementioned processor 81.

[0103] The embodiment of the present application also provides a storage medium, which can store multiple instructions, and the instructions are suitable for being loaded and executed by a processor to perform the method steps of the above Figures 1 to 6 shown embodiments. The specific execution process can refer to Figures 1 to 6 the specific description of the shown embodiments, and will not be elaborated here.

[0104] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above-mentioned division of each functional unit and module is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules according to needs, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiments can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of each functional unit and module are only for the convenience of mutual distinction and do not limit the protection scope of this application. The specific working processes of the units and modules in the above system can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.

[0105] In the above embodiments, the descriptions of the respective embodiments have their own emphases. For the parts not detailed or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0106] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or by a combination of computer software and electronic hardware. Whether these functions are executed in the form of hardware or software depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.

[0107] In the embodiments provided by the present invention, it should be understood that the disclosed device / terminal device and method can be implemented in other ways. For example, the device / terminal device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division, and there can be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces, and the indirect couplings or communication connections of the devices or units can be in electrical, mechanical or other forms.

[0108] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0109] In addition, in each embodiment of the present invention, each functional unit can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.

[0110] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such understanding, to implement all or part of the processes in the above method embodiments of the present invention, it can also be completed by a computer program instructing relevant hardware. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc.

[0111] The present invention is not limited to the above embodiments. If various modifications or deformations of the present invention do not depart from the spirit and scope of the present invention, and if these modifications and deformations belong to the scope of the claims of the present invention and equivalent technical scope, then the present invention also intends to include these modifications and deformations.

Claims

1. A text matching method, characterized in that, Including the following steps: Obtain text pairs to be matched, where the text pairs include a first text and a second text, both the first text and the second text include several sentences, and each sentence includes several words; Perform embedding processing on several sentences of the first text and the second text to obtain plural word embedding representations of several sentences of the first text and the second text and plural morpheme embedding representations of several words; Adopt a quantum mixed state modeling method to perform feature modeling according to the plural word embedding representations of several sentences of the first text and the second text and the plural morpheme embedding representations of several words, and obtain quantum mixed state representations of several sentences of the first text and the second text; Perform quantum measurement according to the quantum mixed state representations of several sentences of the first text and the second text to obtain quantum measurement probability representations of several sentences of the first text and the second text; Perform text matching according to the quantum measurement probability representations of several sentences of the first text and the second text to obtain text matching results between several sentences of the first text and several sentences of the second text.

2. The text matching method according to claim 1, characterized in that The step of performing embedding processing on several sentences of the first text and the second text to obtain plural word embedding representations and plural morpheme embedding representations of several sentences of the first text and the second text includes the steps of: Input the sentences into a preset word embedding model for embedding processing to obtain plural word embedding representations of several sentences of the first text and the second text; Perform morpheme splitting on several words of the sentence, input several morphemes of the words obtained after splitting into a preset morpheme embedding model for embedding processing to obtain morpheme embeddings of several morphemes of the words; perform a tensor product operation on the morpheme embeddings of several morphemes of the same word to obtain plural morpheme embedding representations of several words of several sentences of the first text and the second text.

3. The text matching method according to claim 1 or 2, characterized in that: The quantum mixed state representation includes a global mixed state representation; The step of performing feature modeling according to the plural word embedding representations of several sentences of the first text and the second text and the plural morpheme embedding representations of several words to obtain quantum mixed state representations of several sentences of the first text and the second text includes the steps of: Obtain the global mixed state representations of several sentences of the first text and the second text according to the plural word embedding representations of several sentences of the first text and the second text and a preset first feature modeling algorithm, where the first feature modeling algorithm is: where ρ W is the global mixed state representation, L is the number of words, is the first weight parameter determined by the fuzzy membership function, where λ n represents the first index, a and c are the first and second trainable parameters in the neural network, |Ф j > is the word embedding vector of the j-th word in the plural word embedding representation of the sentence, <Ф j | is the conjugate transpose of the word embedding vector of the j-th word in the plural word embedding representation of the sentence.

4. The text matching method according to claim 3, wherein: The quantum mixed state representation includes a local mixed state representation; The step of performing feature modeling according to the plural word embedding representations of several sentences of the first text and the second text and the plural morpheme embedding representations of several words to obtain quantum mixed state representations of several sentences of the first text and the second text includes the steps of: Perform a tensor product operation on the plural morpheme embedding representations of several words of the sentence according to a preset sliding window to obtain several tensor product representations of several sentences of the first text and the second text; Based on the tensor product representations of the sentences and a preset second feature modeling algorithm, obtain the local mixed state representations of the sentences of the first text and the second text, where the second feature modeling algorithm is as follows: where ρ M is the local mixed state representation, m is the index of the tensor product representation, M is the number of tensor product representations, is the second weight parameter determined by the fuzzy membership function, where λ m represents the second index, a and c are respectively the third and fourth trainable parameters in the neural network, is the tensor product representation of the m-th word, of the tensor product representation of the m-th word.

5. The text matching method according to claim 4, characterized in that Performing quantum measurement on the quantum mixed state representations of the sentences of the first text and the second text to obtain the quantum measurement probability representations of the sentences of the first text and the second text, including the steps of: Based on the global mixed state representation, local mixed state representation of the same sentence, and a preset feature fusion algorithm, obtain the mixed state fusion representations of the sentences of the first text and the second text, where the feature fusion algorithm is as follows: where ρ is the representation of the fusion of the mixed state, is the third weight parameter determined by the fuzzy membership function, where λ f represents the third index, a and c are the fifth and sixth trainable parameters in the neural network respectively, and ρ λf is the representation of the mixed state, and when λ f = 1, λ f = 2, Based on the mixed state fusion representation of the sentence and a preset quantum measurement probability algorithm, obtain the quantum measurement probability representations of the sentences of the first text and the second text, where the quantum measurement probability algorithm is as follows: where p represents the quantum measurement probability, and T t is the t-th measurement operator in the preset measurement operator set, is the conjugate transpose of the t-th measurement operator.

6. The text matching method according to claim 5, wherein Performing text matching on the quantum measurement probability representations of the sentences of the first text and the second text to obtain the text matching result between the sentences of the first text and the sentences of the second text, including the steps of: Concatenating the quantum measurement probability representations of the sentences of the first text with the quantum measurement probability representations of the sentences of the second text respectively to obtain the concatenated representation between the sentences of the first text and the sentences of the second text; Based on the concatenated representation between the sentences and a preset text matching probability algorithm, obtain the text matching probability data; based on the text matching probability data, obtain the text matching label corresponding to the text matching probability vector with the largest dimension as the text matching result, to obtain the text matching result between the sentences of the first text and the sentences of the second text, where the text matching probability algorithm is as follows: In the formula, P is the text matching probability data, k is the k-th element in the concatenated representation, l is all elements in the concatenated representation, and e is the natural logarithm.

7. A text matching device, characterized in that, Including: A data acquisition module, configured to acquire a text pair to be matched, where the text pair includes a first text and a second text, both the first text and the second text include a plurality of sentences, and each sentence includes a plurality of words; An embedding processing module, configured to perform embedding processing on the sentences of the first text and the second text to obtain the complex word embedding representations of the sentences of the first text and the second text and the complex word element embedding representations of the plurality of words; A feature modeling module, configured to adopt a quantum mixed state modeling method to perform feature modeling based on the complex word embedding representations of the sentences of the first text and the second text and the complex word element embedding representations of the plurality of words to obtain the quantum mixed state representations of the sentences of the first text and the second text; A quantum measurement module, configured to perform quantum measurement based on the quantum mixed state representations of the sentences of the first text and the second text to obtain the quantum measurement probability representations of the sentences of the first text and the second text; A text matching module, configured to perform text matching according to the quantum measurement probability representations of several sentences of the first text and the second text, so as to obtain a text matching result between several sentences of the first text and several sentences of the second text.

8. A computer device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the text matching method according to any one of claims 1 to 6 are implemented.

9. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the text matching method according to any one of claims 1 to 6 are implemented.