Text matching method and text matching device

By determining the attributes of the input search terms and selecting an appropriate text matching module, the problem of semantic mismatch and low efficiency of text matching in the existing technology is solved, efficient and accurate text matching is achieved, and the user experience is improved.

CN118568508APending Publication Date: 2024-08-30THE FOURTH PARADIGM BEIJING TECH CO LTD

Patent Information

Application Number
CN202310639437.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-31
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

Existing text matching technology has problems such as semantic mismatch, poor matching effect, and difficulty in engineering deployment, and it is difficult to improve user experience while ensuring efficiency.

Method used

By determining the attributes of the input search terms, selecting appropriate text matching modules (such as text recall matching module, rewriting recall matching module and vector recall matching module), obtaining candidate document information, and determining matching documents based on the sorting results, using the semantic engine module and Deep learning algorithms improve matching accuracy and efficiency.

Benefits of technology

It improves the accuracy and efficiency of text matching, achieves millisecond-level response, reduces the difficulty and cost of engineering deployment, and enhances user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118568508A
    Figure CN118568508A
Patent Text Reader

Abstract

The invention provides a text matching method and a text matching device. The method comprises the steps that the attribute of an input search word is determined, and the attribute comprises at least one of the field and the service type which the input search word aims at; selecting at least one text matching module from a plurality of preset text matching modules based on the determined attribute of the input search word; obtaining candidate document information of a candidate document corresponding to the input search word through the at least one text matching module; sorting the candidate documents based on the candidate document information; and determining a matching document corresponding to the input search word in the candidate documents based on the sorting result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure generally relates to the field of natural language processing, and more specifically, to a text matching method and a text matching device. Background Art

[0002] Text matching refers to the technology of quickly and efficiently obtaining precise semantic and highly relevant target text from a large-scale text candidate pool. The content is recalled for the historical text collection and the query data related to the user's intention, and then the recalled candidate collection is precisely sorted to return the optimal result.

[0003] The current common text matching mainly relies on a simple text matching model combined with a knowledge base in a specific field and an external related knowledge base, or simply improves the text matching model. The text matching implementation path of the existing technology is relatively traditional, with a large reliance on a large field and a very low recall rate. In addition, due to the diversity and colloquialism of query forms, it is easy to miss synonymous expressions only by using traditional hard matching algorithms between words. On the other hand, the operating efficiency of traditional text matching methods is difficult to reach millisecond-level response, and the engineering deployment is difficult and the investment cost is high. In addition, in traditional text matching models, most search terms (queries) and documents (docs) are encountered for the first time by the matching engine. How to make the text model handle this long-tail data well is also a difficult problem.

[0004] Therefore, a text matching technology is needed that can ensure text matching results while taking into account online efficiency, so as to solve the problems of semantic mismatch, poor matching results, and difficult engineering deployment in text matching retrieval in the existing technology, and improve the overall user text matching experience. Summary of the invention

[0005] In order to at least solve the above problems in the prior art, the present application discloses a text matching method and a text matching device.

[0006] According to an embodiment of the present invention, a text matching method is provided, the method comprising: determining the attributes of an input search term, wherein the attributes include at least one of a field and a business type targeted by the input search term; based on the determined attributes of the input search term, selecting at least one text matching module from a plurality of preset text matching modules; obtaining candidate document information of a candidate document corresponding to the input search term through the at least one text matching module; sorting the candidate documents based on the candidate document information; and determining a matching document corresponding to the input search term among the candidate documents based on the sorting result.

[0007] Optionally, the at least one text matching module may include at least one of a text recall matching module, a rewrite recall matching module and a vector recall matching module.

[0008] Optionally, the vector recall matching module may include a vector recall module and a semantic engine module, wherein obtaining candidate document information of a candidate document corresponding to an input search term through the at least one text matching module may include: converting the input search term into a first text vector using a first preset semantic vector model through the vector recall module, searching for a plurality of second text vectors similar to the first text vector in a content vector stored in the semantic engine module through the semantic engine module, and obtaining candidate document information of a candidate document corresponding to the input search term based on the plurality of second text vectors through the vector recall module.

[0009] Optionally, the semantic engine module may include: a semantic vector module, configured to convert the content of the full corpus into corresponding content vectors through a second preset semantic vector model; a semantic index library, configured to store the content of the full corpus and the corresponding content vectors and document indexes; a similarity calculation module, configured to determine the multiple second text vectors by calculating the similarity between the first text vector and the content vectors stored in the semantic index library, and provide the document indexes corresponding to the multiple second text vectors to a vector recall module, wherein the vector recall module can obtain candidate document information of candidate documents corresponding to the input search term based on the document indexes corresponding to the multiple second text vectors.

[0010] Optionally, the content of the full corpus may include at least one of text content, picture content, and audio and video content.

[0011] Optionally, obtaining candidate document information of candidate documents corresponding to the input search term through the at least one text matching module may include: using a preset rewriting model to expand and transform the content of the input search term through the rewriting recall matching module to obtain the rewritten search term and its corresponding document information, and determining the candidate document information of the candidate document corresponding to the input search term based on the corresponding document information.

[0012] Optionally, obtaining candidate document information of candidate documents corresponding to the input search term through the at least one text matching module may include: performing word segmentation and entity extraction on the input search term through the text recall matching module, obtaining documents including corresponding word segmentations according to the inverted index, and determining candidate document information of candidate documents corresponding to the input search term based on the obtained documents.

[0013] Optionally, sorting the candidate documents based on the candidate document information may include: generating a sorting corpus for each candidate document based on the candidate document information; inputting the sorting corpus of each candidate document into a preset sorting model to obtain a score for each candidate document; and sorting the candidate documents based on the score.

[0014] Optionally, sorting the candidate documents based on the score may include: obtaining a weighted score for each candidate document based on the score and a text matching result weight assigned to the at least one text matching module; and sorting the candidate documents according to the weighted score, wherein the text matching result weight may be assigned to the at least one text matching module based on an attribute of an input search term.

[0015] Optionally, the plurality of text matching modules may be trained by using a deep learning algorithm to obtain candidate document information of corresponding candidate texts based on an input search term.

[0016] Optionally, each of the multiple text matching modules can be trained independently of each other, wherein when at least two text matching modules are selected, the at least two text matching modules can independently obtain candidate document information of candidate documents corresponding to the input search term.

[0017] According to another exemplary embodiment of the present invention, a text matching device is provided, and the device may include: a matching module selection unit, configured to determine the attributes of an input search term, and based on the determined attributes of the input search term, select at least one text matching module from a plurality of preset text matching modules, wherein the attributes include at least one of a field and a business type targeted by the input search term; a document matching unit, configured to obtain candidate document information of a candidate document corresponding to the input search term through the at least one text matching module; and a sorting unit, configured to sort the candidate documents based on the candidate document information, and determine a matching document corresponding to the input search term among the candidate documents based on the sorting result.

[0018] Optionally, the at least one text matching module may include at least one of a text recall matching module, a rewrite recall matching module and a vector recall matching module.

[0019] Optionally, the vector recall matching module may include a vector recall module and a semantic engine module, the vector recall module may be configured to convert the input search term into a first text vector through a first preset semantic vector model, and the semantic engine module may be configured to search for multiple second text vectors similar to the first text vector in the content vector stored in the semantic engine module, wherein the vector recall module may also be configured to obtain candidate document information of candidate documents corresponding to the input search term based on the multiple second text vectors.

[0020] Optionally, the semantic engine module may include: a semantic vector module, configured to convert the content of the full corpus into corresponding content vectors through a second preset semantic vector model; a semantic index library, configured to store the content of the full corpus and the corresponding content vectors and document indexes; a similarity calculation module, configured to determine the multiple second text vectors by calculating the similarity between the first text vector and the content vectors stored in the semantic index library, and provide the document indexes corresponding to the multiple second text vectors to a vector recall module, wherein the vector recall module can obtain candidate document information of candidate documents corresponding to the input search term based on the document indexes corresponding to the multiple second text vectors.

[0021] Optionally, the content of the full corpus may include at least one of text content, picture content, and audio and video content.

[0022] Optionally, the rewriting recall matching module may be configured to: use a preset rewriting model to expand and transform the content of the input search term to obtain the rewritten search term and its corresponding document, and determine candidate document information of the candidate document corresponding to the input search term based on the corresponding document.

[0023] Optionally, the text recall matching module may be configured to: perform word segmentation and entity extraction on the input search term, obtain documents including corresponding word segmentations according to the inverted index, and determine candidate document information of the candidate document corresponding to the input search term based on the obtained documents.

[0024] Optionally, the ranking unit may be configured to: generate a ranking corpus for each candidate document based on the candidate document information; input the ranking corpus of each candidate document into a preset ranking model to obtain a score for each candidate document; and rank the candidate documents based on the score.

[0025] Optionally, the sorting unit may be configured to obtain a weighted score for each candidate document based on the score and a text matching result weight assigned to the at least one text matching module, and sort the candidate documents according to the weighted score, wherein the text matching result weight may be assigned to the at least one text matching module based on an attribute of the input search term.

[0026] Optionally, the plurality of text matching modules may be trained by using a deep learning algorithm to obtain candidate document information of corresponding candidate texts based on an input search term.

[0027] Optionally, each of the multiple text matching modules can be trained independently of each other, wherein when at least two text matching modules are selected, the at least two text matching modules can independently obtain candidate document information of candidate documents corresponding to the input search term.

[0028] According to another exemplary embodiment of the present disclosure, a system is provided, including at least one computing device and at least one storage device storing instructions, wherein when the instructions are executed by the at least one computing device, the at least one computing device is prompted to perform the text matching method as described above.

[0029] According to another exemplary embodiment of the present disclosure, a computer-readable storage medium storing instructions is provided, wherein when the instructions are executed by at least one computing device, the at least one computing device is prompted to perform the text matching method as described above.

[0030] According to the text matching method and device of the exemplary embodiment of the present invention, it is possible to configure the use priority of multiple recall modules according to the exemplary embodiment of the present invention and the weight of their recall results for different fields and business types, adjust the matching degree, and thus improve the accuracy of text matching. In addition, the text matching method and device according to the exemplary embodiment of the present invention can also achieve millisecond-level matching results for a million-level corpus by utilizing a semantic engine module, thereby performing text matching in a fast and efficient manner, achieving high-performance matching, reducing the difficulty of engineering deployment, and improving matching efficiency.

[0031] On the other hand, the text matching method and device according to the exemplary embodiment of the present invention use a multi-channel strategy for independent recall, and the multiple recall module channels are independent of each other and are processed in parallel. The results of each channel can be merged to increase the recall rate, and the multiple recall modules are loosely coupled to achieve decoupling, thereby enabling migration and reuse according to different scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] These and / or other aspects and advantages of the present application will become clearer and easier to understand from the following detailed description of the embodiments of the present application in conjunction with the accompanying drawings, in which:

[0033] Figure 1 is a flow chart illustrating a text matching method according to an exemplary embodiment of the present invention;

[0034] Figure 2 is a schematic framework diagram showing a text matching system according to an exemplary embodiment of the present invention;

[0035] FIG. 3A to FIG. 3E Shows the description of the functional interfaces provided by each module of the text matching system;

[0036] Figure 4 is a block diagram showing a text matching apparatus according to an exemplary embodiment of the present invention;

[0037] Figure 5is a block diagram illustrating an electronic device according to an exemplary embodiment of the present disclosure.

[0038] Hereinafter, the present application will be described in detail with reference to the accompanying drawings. Throughout the accompanying drawings, the same or similar elements will be indicated by the same or similar reference numerals. DETAILED DESCRIPTION

[0039] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0040] The following description with reference to the accompanying drawings is provided to assist in a comprehensive understanding of the embodiments of the present disclosure as defined by the claims and their equivalents. Various specific details are included to assist in understanding, but these details are considered to be exemplary only. Therefore, one of ordinary skill in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. In addition, descriptions of well-known functions and structures are omitted for clarity and brevity.

[0041] The terms and words used in the following description and claims are not limited to the bibliographical meanings, but are merely used by the inventor to enable a clear and consistent understanding of the present disclosure. Therefore, it should be clear to those skilled in the art that the following description of various embodiments of the present disclosure is provided for illustrative purposes only and is not intended to limit the purpose of the present disclosure as defined by the claims and their equivalents.

[0042] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar target objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the attached claims.

[0043] Figure 1 is a flowchart illustrating a text matching method according to an exemplary embodiment of the present invention.

[0044] like Figure 1As shown, in step S101, the attributes of the input search term may be determined. In an exemplary embodiment of the present invention, the attributes of the input search term may include, but are not limited to: the field targeted by the input search term (e.g., the medical field, the economic field, etc.) and the business type (e.g., text search, video search, question and answer, etc.). Here, the attributes of the input search term may be determined based on at least one factor or a combination of various factors such as semantic analysis, the application or application type of the received search term, and the context when the search term is input.

[0045] Thereafter, in step S102, at least one text matching module may be selected from a plurality of preset text matching modules based on the determined attributes of the input search term.

[0046] In an exemplary embodiment of the present invention, as an example only, the at least one text matching module may include at least one of a text recall matching module, a rewrite recall matching module, and a vector recall matching module.

[0047] In an exemplary embodiment of the present invention, the input search term can be segmented and entity extracted through the text recall matching module, the document including the corresponding segmented word can be obtained according to the inverted index, and the candidate document information of the candidate document corresponding to the input search term can be determined based on the obtained document. Here, the inverted index is a specific storage form for realizing the "word-document matrix". Through the inverted index, a list of documents containing this word can be quickly obtained according to the word. The specific method is known to those skilled in the art, so it will not be described in detail for the sake of simplicity. In addition, the candidate document information according to the exemplary embodiment of the present invention may include a document title and a document index (for example, a document ID). Through the document title and the document index, the corresponding document (for example, a picture document, a web page document, an audio and video document, etc.) can be easily obtained.

[0048] In an exemplary embodiment of the present invention, the rewriting recall matching module can use a preset rewriting model to expand and transform the content of the input search term to obtain the rewritten search term and its corresponding document, and determine the candidate document information of the candidate document corresponding to the input search term based on the corresponding document.

[0049] In addition, in an exemplary embodiment of the present invention, the vector recall matching module may include a vector recall module and a semantic engine module. The vector recall module may convert the input search term into a first text vector using a first preset semantic vector model, and then the semantic engine module may search for multiple second text vectors similar to the first text vector in the content vector stored in the speech engine module. Afterwards, the vector recall module may obtain candidate document information of the candidate document corresponding to the input search term based on the multiple second text vectors.

[0050] It should be understood that these exemplified text matching modules are merely examples listed for the convenience of explanation, and the present invention is not limited thereto. The usable text matching modules of the present invention may also include more other types of recall modules.

[0051] Continue to refer to Figure 1 In step S103, candidate document information of the candidate document corresponding to the input search term may be obtained through the selected at least one text matching module.

[0052] Then, in step S104, the candidate documents may be sorted based on the candidate document information, and matching documents corresponding to the input search term may be determined from among the candidate documents based on the sorting result. Here, the matching documents corresponding to the input search term may be multiple documents, for example, the top K documents determined from among the candidate documents based on the sorting result, where K is an integer greater than 0.

[0053] The following will be combined Figure 2 Modules such as the text recall matching module, the rewrite recall matching module, and the vector recall matching module are explained in more detail.

[0054] Figure 2 is a schematic framework diagram illustrating a text matching system 200 according to an exemplary embodiment of the present invention.

[0055] Reference Figure 2 The text matching system 200 may be composed of a text recall module 210 , a rewriting recall module 220 , a vector recall module 230 , a semantic engine module 240 and a sorting module 250 .

[0056] The text recall module 210 may correspond to the text recall matching module described above, and may provide a text recall service.

[0057] The rewrite recall module 220 may correspond to the rewrite recall matching module described above, and may provide a rewrite recall service. In an exemplary embodiment of the present invention, the rewrite recall module 220 may use a rewrite model to provide a rewrite recall service, and rewrite and transform and expand the content of the input search term. The rewrite model may be a model generated by training a pre-trained language model (e.g., a BERT model) or other types of language models using error correction corpus, and is used to obtain rewritten words and transformed and expanded words of the input word. Here, the error correction corpus may be a rewrite pair obtained by processing the original corpus through data enhancement, corpus expansion, etc., and the rewrite pair may refer to a pair consisting of a search term and a rewritten word obtained by rewriting the search term.

[0058] It should be understood that, although not explicitly stated in the text recall and rewrite recall services described above, the content recalled through these two recall services includes the corresponding document index and document title. Therefore, the document title and document index (i.e., candidate document information) of the candidate documents corresponding to the search terms can be obtained through these two recall services.

[0059] The vector recall module 230 and the semantic engine module 240 together correspond to the vector recall matching module described above, and can provide vector recall services.

[0060] In an exemplary embodiment of the present invention, the first preset semantic vector model used in the vector recall module 230 can be a model obtained by training a pre-trained language model (e.g., a BERT model) or other types of language models using training corpus (e.g., supervised training), and is used to convert input text corpus (e.g., input search terms) into text vectors.

[0061] In an exemplary embodiment of the present invention, Figure 2 As shown in , the semantic engine module 240 may include a semantic vector module 241 , a semantic index library 242 , and a similarity calculation module 243 .

[0062] The semantic vector module 241 can convert the content of the full corpus in the semantic engine module 240 into a corresponding content vector through a second preset semantic vector model (e.g., a BERT model) or other types of language models. The semantic index library 242 can store the content of the full corpus and the corresponding content vector and document index. In an exemplary embodiment of the present invention, the full corpus may include corpus (e.g., phrases) obtained by processing question-answer pairs and titles corresponding to the full document (i.e., the entire document, not just the document title), and the content of the full corpus may include at least one of text content, picture content, and audio and video content.

[0063] In addition, in an exemplary embodiment of the present invention, the full corpus stored in the semantic index library 242 can be continuously iteratively updated as the semantic engine module 240 continuously mines and obtains updated documents.

[0064] The similarity calculation module 243 can determine a plurality of second text vectors similar to the first text vector in the semantic index library 242 by calculating the similarity between the first text vector generated by the vector recall module 230 and the content vector stored in the semantic index library 242, and provide the document indexes corresponding to the plurality of second text vectors to the vector recall module 230. Thus, the vector recall module 230 can obtain candidate document information of the candidate document corresponding to the input search term based on the documents determined by the document indexes corresponding to the plurality of second text vectors.

[0065] Continue to refer to Figure 2 The sorting module 250 can provide semantic matching services, sort candidate documents based on candidate document information obtained from at least one of the text recall module 210, the rewriting recall module 220, and the vector recall module 230, and determine matching documents corresponding to the input search terms among the candidate documents based on the sorting results.

[0066] Specifically, the ranking module 250 may generate a ranking corpus for each candidate document based on the candidate document information. For example, the ranking module 250 may generate a document title-document pair as the ranking corpus based on the candidate document information.

[0067] Afterwards, the ranking module 250 may input the ranking corpus of each candidate document into a preset ranking model, obtain a score for each candidate document, and rank the candidate documents based on the score.

[0068] In an exemplary embodiment of the present invention, as an example only, the preset sorting model can be a model obtained by training a preset semantic matching model using pair-wise corpus (e.g., search term-document pairs and document title-document pairs, etc.) collated according to preset business rules as training corpus. However, it should be understood that the sorting method described above is only an example, and the sorting module 250 according to the exemplary embodiment of the present invention can also use other sorting methods or sorting models to achieve the above sorting.

[0069] In an exemplary embodiment of the present invention, each module in the text recall system 200 can be trained using a deep learning algorithm to implement its own function (i.e., the model used in each module can be trained using a deep learning algorithm), and can be used in a loosely coupled manner (i.e., the modules are not interdependent). For example, the text recall matching module, the rewrite recall matching module, and the vector recall matching module can be trained using a deep learning algorithm to obtain candidate document information of the corresponding candidate text based on the input search term. By using a deep learning algorithm to model these modules, the problem of semantic drift can be effectively solved.

[0070] In addition, the above-mentioned various text matching modules can be trained independently of each other instead of being trained jointly, and these modules do not have to be used together, but as described above, at least one of the modules can be selected for use according to the field and business type of the search term entered. For example, when a search term is entered for image retrieval, only the vector recall matching module (i.e., the vector recall module 230 and the semantic engine module 240) can be used without using the text recall module 210. As another example, when a search term is entered for text retrieval, at least one of the text recall matching module, the rewrite recall matching module, and the vector recall matching module can be used.

[0071] In addition, when at least two text matching modules are selected, the at least two text matching modules can independently obtain candidate document information of candidate documents corresponding to the input search term. And, the weights of the text matching results of the at least two text matching modules can be further determined based on the attributes of the input search term, and the determined weights can be used when sorting candidate documents based on the text matching results of the text matching modules (i.e., the candidate document information obtained by each text matching module). For example, the sorting module 250 can obtain a weighted score for each candidate document based on the scores for each candidate document obtained using the sorting model and the weights for the text matching results of the at least two text matching modules, and then sort the candidate documents according to the weighted scores.

[0072] In an exemplary embodiment of the present invention, the loose coupling method can be implemented by providing the modules with their own functional interfaces. Figure 3E Give examples of these functional interfaces

[0073] FIG. 3A to FIG. 3E A description of the functional interfaces provided by various modules of the text matching system is shown.

[0074] Figure 3A The following is a description of the text recall function interface. Figure 3A As shown in the figure, the text recall service mainly accesses the server in Docker. The input content of the call is a string type Query (search term), and the call is made through RESTful communication. Title indicates the document title, docid indicates the document index, input_data indicates the search term, result gives the returned candidate document information, and score indicates the score of the corresponding document.

[0075] Figure 3B Shows the description of rewriting the recall function interface. Figure 3B As shown, the rewritten recall service mainly accesses the server in Docker. The input content of the call is a string type Query, and the call is made through restful communication.

[0076] Figure 3C The following is a description of the vector recall function interface. Figure 3C As shown in the figure, the vector recall service mainly accesses the server in Docker. The input content of the call is a string type Query, and the call is made through restful communication.

[0077] Figure 3D The following table shows the description of the semantic engine functional interface. Figure 3DAs shown, the semantic engine service mainly accesses the server in Docker, and the input content of the call is a string type Query, and the call is in the form of restful communication. The first number in each group of numbers in the result (for example, 0.8529911637306213) indicates the similarity between the first text vector received by the semantic engine module from the vector recall module and the determined second text vector, and the second number indicates the document index, that is, docid. In an exemplary embodiment of the present invention, the Milvus vector search engine can be used to implement the semantic engine module.

[0078] Figure 3E The following is a description of the sorting function interface. Figure 3E As shown, the sorting service mainly accesses the server in Docker. The input content of the call is a string type Query, and the call is made through an http request. pred_prob indicates the sorting score of the corresponding document (i.e., the document indicated by docid).

[0079] Since each module performs functions through its own functional interface and is trained independently, they can be called independently to achieve loose coupling and decoupling of these modules, and can also be migrated and reused according to different scenarios, that is, these modules can be used in different scenarios without retraining them. For example, only the text recall module can be called for simple text search, the vector recall text matching module can be called for image search, and so on.

[0080] In addition, the text matching system 200 according to the exemplary embodiment of the present invention described above can be applied to various scenarios. For example, it can be used to search for related web pages or web page links based on the input search terms in the scenario of web page search, or can be used to obtain result answers based on the input questions (i.e., search terms) in the scenario of question and answer, or can be used to search for related pictures / audio based on the input search terms in the scenario of picture / audio search.

[0081] In addition, in the exemplary embodiment of the present invention, although the text matching system 200 is described as being used to retrieve documents corresponding to the input search terms, the present application is not limited thereto, and the text matching system 200 can also be applied to the transformation and error correction of search terms, similarity calculation, knowledge base search matching and other scenarios, and only the output content of each module needs to be adjusted or further processed, or some modules can be selected and their functions can be used, for example, the semantic vector engine module can be directly called to be applied to the vector search scenario. In this way, these modules can be migrated and reused according to different scenarios, and the relevant technical content can be learned from the content described above, and will not be described here for the sake of simplicity.

[0082] Figure 4 is a block diagram illustrating a text matching apparatus 400 according to an exemplary embodiment of the present invention.

[0083] The text matching device 400 according to an exemplary embodiment of the present invention may include a matching module selection unit 410 , a document matching unit 420 , and a sorting unit 430 .

[0084] In an exemplary embodiment of the present invention, the matching module selection unit 410 may determine the attributes of the input search term, and based on the determined attributes of the input search term, select at least one text matching module from a plurality of preset text matching modules, wherein the attributes include at least one of the field and the business type targeted by the input search term. The document matching unit 320 may obtain candidate document information of the candidate document corresponding to the input search term through the at least one text matching module. The sorting unit 330 may sort the candidate documents based on the candidate document information, and determine the matching document corresponding to the input search term among the candidate documents based on the sorting result.

[0085] In an exemplary embodiment of the present invention, the at least one text matching module may include at least one of a text recall matching module, a rewrite recall matching module, and a vector recall matching module.

[0086] In an exemplary embodiment of the present invention, the vector recall matching module may include a vector recall module and a semantic engine module. The vector recall module may convert an input search term into a first text vector through a first preset semantic vector model, the semantic engine module may search for a plurality of second text vectors similar to the first text vector in a content vector stored in the semantic engine module, and the vector recall module may obtain candidate document information of a candidate document corresponding to the input search term based on the plurality of second text vectors.

[0087] In an exemplary embodiment of the present invention, the semantic engine module may include: a semantic vector module, configured to convert the content of the full corpus into corresponding content vectors through a second preset semantic vector model; a semantic index library, configured to store the content of the full corpus and the corresponding content vectors and document indexes; and a similarity calculation module, configured to determine the multiple second text vectors by calculating the similarity between the first text vector and the content vectors stored in the semantic index library, and provide the document indexes corresponding to the multiple second text vectors to a vector recall module, wherein the vector recall module can obtain candidate document information of candidate documents corresponding to the input search term based on the document indexes corresponding to the multiple second text vectors.

[0088] In an exemplary embodiment of the present invention, the content of the full corpus may include at least one of text content, picture content, and audio and video content.

[0089] In an exemplary embodiment of the present invention, the rewrite recall matching module may use a preset rewrite model to expand and transform the content of an input search term to obtain the rewritten search term and its corresponding document, and determine candidate document information of the candidate document corresponding to the input search term based on the corresponding document.

[0090] In an exemplary embodiment of the present invention, the text recall matching module may perform word segmentation and entity extraction on an input search term, obtain documents including corresponding word segments according to an inverted index, and determine candidate document information of a candidate document corresponding to the input search term based on the obtained documents.

[0091] In an exemplary embodiment of the present invention, the sorting unit 330 may generate a sorting corpus for each candidate document based on the candidate document information; input the sorting corpus of each candidate document into a preset sorting model to obtain a score for each candidate document; and sort the candidate documents based on the score.

[0092] In an exemplary embodiment of the present invention, the sorting unit 330 may obtain a weighted score for each candidate document based on the score and a text matching result weight assigned to the at least one text matching module, and sort the candidate documents according to the weighted score, wherein the text matching result weight is assigned to the at least one text matching module based on the attributes of the input search term.

[0093] In an exemplary embodiment of the present invention, a plurality of text matching modules may be trained by using a deep learning algorithm to obtain candidate document information of corresponding candidate texts based on an input search term.

[0094] In an exemplary embodiment of the present invention, each of the multiple text matching modules can be trained independently of each other, and when at least two text matching modules are selected, the at least two text matching modules can independently obtain candidate document information of the candidate documents corresponding to the input search term.

[0095] The above has been combined Figure 1 The specific operations of the various units of the text recall device 400 are described in detail in FIG. 3 , and will not be repeated here.

[0096] Figure 5 is a block diagram illustrating an electronic device 500 according to an exemplary embodiment of the present disclosure.

[0097] According to an embodiment of the present disclosure, an electronic device may be provided. Figure 5It is a block diagram of an electronic device 500 according to an embodiment of the present disclosure, and the electronic device includes at least one memory 501 and at least one processor 502, wherein a set of computer executable instructions is stored in the at least one memory, and when the computer executable instruction set is executed by the at least one processor, the image-text matching method according to the embodiment of the present disclosure is executed.

[0098] As an example, the electronic device 500 may be a PC, a tablet device, a personal digital assistant, a smart phone, or other device capable of executing the above-mentioned instruction set. Here, the electronic device 500 is not necessarily a single electronic device, but may also be any device or circuit collection capable of executing the above-mentioned instructions (or instruction sets) individually or in combination. The electronic device 500 may also be part of an integrated control system or system manager, or may be configured as a portable electronic device interconnected with a local or remote (e.g., via wireless transmission) interface.

[0099] In the electronic device 500, the processor 502 may include a central processing unit (CPU), a graphics processing unit (GPU), a programmable logic device, a dedicated processor system, a microcontroller or a microprocessor. As an example and not limitation, the processor 502 may also include an analog processor, a digital processor, a microprocessor, a multi-core processor, a processor array, a network processor, etc.

[0100] The processor 502 may execute instructions or codes stored in the memory, wherein the memory 401 may also store data. Instructions and data may also be sent and received over a network via a network interface device, wherein the network interface device may employ any known transmission protocol.

[0101] The memory 501 may be integrated with the processor 502, for example, by placing RAM or flash memory within an integrated circuit microprocessor or the like. In addition, the memory 501 may include a separate device, such as an external disk drive, a storage array, or any other storage device that can be used by a database system. The memory 501 and the processor 502 may be operationally coupled, or may communicate with each other, such as through an I / O port, a network connection, etc., so that the processor 502 can read files stored in the memory 501.

[0102] In addition, the electronic device 500 may also include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, a mouse, a touch input device, etc.) All components of the electronic device may be connected to each other via a bus and / or a network.

[0103] According to an embodiment of the present disclosure, a computer-readable storage medium may also be provided, wherein when the instructions in the computer-readable storage medium are executed by at least one processor, the at least one processor is prompted to execute the text matching method of the embodiment of the present disclosure. Examples of computer-readable storage media here include: read-only memory (ROM), random access programmable read-only memory (PROM), electrically erasable programmable read-only memory (EEPROM), random access memory (RAM), dynamic random access memory (DRAM), static random access memory (SRAM), flash memory, non-volatile memory, CD-ROM, CD-R, CD+R, CD-RW, CD+RW, DVD-ROM, DVD-R, DVD+R, DVD-RW, DVD+RW, DVD-RAM, BD-ROM, BD-R, BD-R LTH, BD-RE, Blu-ray or optical disk storage, hard disk drive (HDD), solid state drive (SSD), card storage (such as, multimedia card, secure digital (SD) card or extreme digital (XD) card), magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid state disk and any other device, any other device is configured to store computer programs and any associated data, data files and data structures in a non-transitory manner and provide the computer programs and any associated data, data files and data structures to a processor or computer so that the processor or computer can execute the computer program. The computer program in the above-mentioned computer-readable storage medium can be run in an environment deployed in a computer device such as a client, a host, an agent device, a server, etc. In addition, in one example, the computer program and any associated data, data files and data structures are distributed on a networked computer system, so that the computer program and any associated data, data files and data structures are stored, accessed and executed in a distributed manner by one or more processors or computers.

[0104] According to an embodiment of the present disclosure, a computer program product is provided, including computer instructions, and when the computer instructions are executed by a processor, the text matching method of the embodiment of the present disclosure is implemented.

[0105] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0106] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A text matching method, characterized in that: The method comprises: Determining an attribute of the input search term, wherein the attribute includes at least one of a field and a business type targeted by the input search term; Based on the determined attributes of the input search term, selecting at least one text matching module from a plurality of preset text matching modules; Acquiring candidate document information of candidate documents corresponding to the input search term through the at least one text matching module; sorting the candidate documents based on the candidate document information; A matching document corresponding to the input search term is determined among the candidate documents based on the ranking result.

2. The text matching method according to claim 1, characterized in that: The at least one text matching module includes at least one of a text recall matching module, a rewrite recall matching module, and a vector recall matching module.

3. The text matching method according to claim 2, characterized in that: The vector recall matching module includes a vector recall module and a semantic engine module. Wherein, obtaining candidate document information of candidate documents corresponding to the input search term through the at least one text matching module includes: The vector recall module uses a first preset semantic vector model to convert the input search term into a first text vector, searching, by the semantic engine module, for a plurality of second text vectors similar to the first text vector in the content vectors stored in the semantic engine module, The candidate document information of the candidate documents corresponding to the input search term is obtained based on the plurality of second text vectors through the vector recall module.

4. The text matching method according to claim 3, characterized in that: The semantic engine module includes: A semantic vector module, configured to convert the content of the full corpus into a corresponding content vector through a second preset semantic vector model; The semantic index library is configured to store the content of the full corpus and the corresponding content vectors and document indexes; a similarity calculation module configured to determine the plurality of second text vectors by calculating the similarity between the first text vector and the content vectors stored in the semantic index library, and provide document indexes corresponding to the plurality of second text vectors to the vector recall module, The vector recall module obtains candidate document information of candidate documents corresponding to the input search term based on the document indexes corresponding to the plurality of second text vectors.

5. The text matching method according to claim 4, characterized in that: The content of the full corpus includes at least one of text content, picture content, and audio and video content.

6. The text matching method according to claim 1, characterized in that: Any of the text matching modules is trained by using a deep learning algorithm to obtain candidate document information of corresponding candidate text based on an input search term.

7. The text matching method according to claim 6, characterized in that: Each of the plurality of text matching modules is trained independently of each other, Wherein, when at least two text matching modules are selected, the at least two text matching modules independently obtain candidate document information of candidate documents corresponding to the input search term.

8. A text matching device, characterized in that: The device comprises: a matching module selection unit configured to determine an attribute of the input search term, and select at least one text matching module from a plurality of preset text matching modules based on the determined attribute of the input search term, wherein the attribute includes at least one of a field and a business type targeted by the input search term; a document matching unit configured to obtain candidate document information of a candidate document corresponding to the input search term through the at least one text matching module; The sorting unit is configured to sort the candidate documents based on the candidate document information, and determine the matching document corresponding to the input search term among the candidate documents based on the sorting result.

9. A system comprising at least one computing device and at least one storage device storing instructions, wherein: When the instructions are executed by the at least one computing device, the at least one computing device is prompted to perform the text matching method according to any one of claims 1 to 7.

10. A computer-readable storage medium storing instructions, wherein: When the instructions are executed by at least one computing device, the at least one computing device is prompted to perform the text matching method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Video generation method and device, storage medium and electronic equipment

    CN112015949A

  • Question and answer matching method and device

    CN114757208A

  • Searching method and device based on keywords and semantics, equipment and storage medium

    CN115438166A

  • Multi-scene intelligent question answering method and system based on multi-path recall

    CN115470338A

  • Document retrieval method and system based on deep learning

    CN115495555A

Cited By

  • Document mixed search method, device and equipment

    CN119396988A