Information retrieval method and device, electronic equipment and computer readable storage medium

By obtaining and utilizing the fuzzy difference characteristics of the query text, determining the target index set, and recalling and sorting text in the set, the problem of difficulty in capturing the multi-dimensional semantic characteristics of text in the prior art is solved, and more accurate and efficient information retrieval is achieved.

CN119760123APending Publication Date: 2025-04-04CHINA TELECOM CORP LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411658681.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-19
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

When existing information retrieval methods process long text or text with complex sentence structures, it is difficult to fully capture the multi-dimensional and multi-level semantic characteristics of the text, resulting in low retrieval accuracy and efficiency.

Method used

By obtaining the fuzzy difference characteristics of the query text, and determining the target index set to be retrieved based on these features, text recall and sorting is performed in the target index set, and the sorted target search results are output. Specific steps include feature extraction, search tree construction, text recall and sorting model application.

Benefits of technology

The importance of fuzzy differential features in retrieval is enhanced, and the use of tree structure storage search indexes narrows the search scope and improves the accuracy and efficiency of search results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119760123A_ABST
    Figure CN119760123A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an information retrieval method and device, electronic equipment and a computer readable storage medium, and relates to the technical field of information retrieval, the information retrieval method comprises the following steps: after an intelligent question-answering system obtains a retrieval instruction for performing query by adopting a query text, determining fuzzy difference characteristics of the query text, the method comprises the following steps: acquiring fuzzy difference characteristics of a to-be-retrieved target index set, determining the to-be-retrieved target index set based on the fuzzy difference characteristics, then performing text recall in the target index set to obtain candidate retrieval results, sorting the candidate retrieval results to obtain sorted target retrieval results, and outputting the target retrieval results. According to the embodiment of the invention, the retrieval result is more accurate, and the retrieval efficiency is higher.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of information retrieval, and in particular to an information retrieval method, an information retrieval device, an electronic device and a computer-readable storage medium. Background Art

[0002] Large Language Models (LLMs) have been applied in many fields, but they still face the "hallucination" problem. RAG (Retrieval-Augmented Generation) has become a major technology to alleviate this problem. It retrieves relevant information from external knowledge bases and inputs it as prompts to LLMs to enhance the model's ability to handle knowledge-intensive tasks. Among them, retrieval technology can be roughly divided into two categories: sparse retrieval and dense retrieval.

[0003] In sparse retrieval, documents (Doc) and queries (Query) are usually represented in the form of a bag-of-words model, that is, each word is regarded as an independent feature, and the relevance of the query and Doc is mainly evaluated by matching the shared vocabulary between them. Although this method is simple, intuitive, easy to understand and implement, it ignores the semantic relationship between words, resulting in inaccurate recall results and the problem of semantic mismatch.

[0004] In dense retrieval, the query and the document are mapped to a fixed-dimensional vector space so that they can be represented by a single vector of fixed length. The generation process of these single vectors takes into account certain semantic information, which solves the semantic mismatch problem to a certain extent. However, this method of mapping texts of different lengths and complexities into a single dense vector may cause loss of semantic information, especially when dealing with long texts or texts with complex sentence structures. A single vector may not be able to fully capture the multi-dimensional and multi-level semantic characteristics of the text.

[0005] Therefore, a retrieval method based on the pre-trained model BERT (Bidirectional Encoder Representation from Transformers, a deep learning pre-trained model) was proposed. Compared with the dense retrieval method that maps the query and Doc to a single vector, some methods also calculate the similarity between each query word embedding and each Doc word embedding at the word level, that is, the fine-grained matching at the word level is also considered when learning the overall vector representation of the query and Doc.

[0006] However, although the model incorporates contextual information in the process of encoding text, it does not consider the situation of phrases. This limitation may cause some key semantic features to be ignored when evaluating the relevance between Query and Doc, resulting in low retrieval accuracy and low retrieval efficiency. Summary of the invention

[0007] In view of the above problems, embodiments of the present invention are proposed to provide an information retrieval method, an information retrieval device, an electronic device and a computer-readable storage medium that overcome the above problems or at least partially solve the above problems.

[0008] The embodiment of the present invention discloses an information retrieval method, the method comprising:

[0009] Obtaining a search instruction for performing a search using a query text;

[0010] Determining fuzzy difference features of the query text, and determining a target index set to be retrieved based on the fuzzy difference features;

[0011] Performing text recall in the target index set to obtain candidate retrieval results;

[0012] Sorting the candidate search results to obtain sorted target search results;

[0013] The target search result is outputted.

[0014] In one or more embodiments, determining the fuzzy difference features of the query text, and determining the target index set to be retrieved based on the fuzzy difference features, includes:

[0015] Performing feature extraction on the query text by using the trained feature extraction model to obtain fuzzy difference features in the query text;

[0016] The target index set to be searched is determined by using the constructed search tree and the fuzzy difference feature.

[0017] In one or more embodiments, performing text recall in the target index set to obtain candidate retrieval results includes:

[0018] Using the target index set to perform text recall in a preset vector database to obtain recalled question-answer pairs;

[0019] The top N question-answer pairs among the recalled question-answer pairs are used as candidate retrieval results.

[0020] In one or more embodiments, the step of sorting the candidate search results to obtain sorted target search results includes:

[0021] The candidate search results are sorted by using the text fragments associated with the candidate search results and the query text through a sorting model to obtain sorted target search results.

[0022] In one or more embodiments, before obtaining a retrieval instruction for querying using a query text, the method further includes:

[0023] When a set of search objects is obtained, a set of phrases having fuzzy difference characteristics between the search objects is determined;

[0024] The phrase set is used to train the original feature extraction model with the preset feature extraction model to obtain a trained feature extraction model, and the fuzzy difference feature is used to construct a retrieval tree;

[0025] The search tree is used to construct an index of the search object set in a preset vector database, and the text of the search object set is vectorized and stored in the vector database.

[0026] In one or more embodiments, determining the phrases having fuzzy difference characteristics between the search object sets includes:

[0027] Based on the self-attention mechanism, the similarities between the various search objects in the search object set are analyzed to obtain a phrase set with fuzzy difference features in the search object set.

[0028] In one or more embodiments, the step of constructing an index of the search object set in a preset vector database using the search tree, and vectorizing the text of the search object set and storing it in the vector database, includes:

[0029] Obtaining text corresponding to each search object in the search object set to obtain a text set;

[0030] Using the search tree to construct an index of each search object in the vector database to obtain an index set;

[0031] Performing coarse-grained text slicing on each text in the text set to obtain a text segment set corresponding to each search object;

[0032] Vectorize each text segment set to obtain a text segment vector set corresponding to each search object;

[0033] Through feature summarization, a set of text fragments is used to construct a set of question-answer pairs corresponding to each search object, and each set of question-answer pairs is vectorized to obtain a set of question-answer pair vectors;

[0034] The text segment vector set and the question-answer pair vector set are stored in the vector database according to the index set.

[0035] Accordingly, an embodiment of the present invention discloses an information retrieval device, the device comprising:

[0036] An acquisition module, used to acquire a search instruction for querying using a query text;

[0037] A first determination module, configured to determine fuzzy difference features of the query text, and determine a target index set to be retrieved based on the fuzzy difference features;

[0038] A recall module, used to recall text in the target index set to obtain candidate retrieval results;

[0039] A sorting module, used to sort the candidate search results to obtain sorted target search results;

[0040] An output module is used to output the target search result.

[0041] In one or more embodiments, the first determining module is specifically configured to:

[0042] Performing feature extraction on the query text by using the trained feature extraction model to obtain fuzzy difference features in the query text;

[0043] The target index set to be searched is determined by using the constructed search tree and the fuzzy difference feature.

[0044] In one or more embodiments, the recall module is specifically used to:

[0045] Using the target index set to perform text recall in a preset vector database to obtain recalled question-answer pairs;

[0046] The top N question-answer pairs among the recalled question-answer pairs are used as candidate retrieval results.

[0047] In one or more embodiments, the sorting module is specifically used to:

[0048] The candidate search results are sorted by using the text fragments associated with the candidate search results and the query text through a sorting model to obtain sorted target search results.

[0049] In one or more embodiments, further comprising:

[0050] A second determination module is used for determining a phrase set having fuzzy difference characteristics between the search objects when a search object set is obtained before obtaining the search instruction for searching using the query text;

[0051] A training module, used to train the original feature extraction model using the phrase set to obtain a trained feature extraction model;

[0052] A first construction module is used to construct a retrieval tree using the fuzzy difference feature;

[0053] The second construction module is used to construct an index of the search object set in a preset vector database using the search tree, and to vectorize the text of the search object set and store it in the vector database.

[0054] In one or more embodiments, the second determining module is specifically configured to:

[0055] Based on the self-attention mechanism, the similarities between the various search objects in the search object set are analyzed to obtain a phrase set with fuzzy difference features in the search object set.

[0056] In one or more embodiments, the second building block is specifically used to:

[0057] Obtaining text corresponding to each search object in the search object set to obtain a text set;

[0058] Using the search tree to construct an index of each search object in the vector database to obtain an index set;

[0059] Performing coarse-grained text slicing on each text in the text set to obtain a text segment set corresponding to each search object;

[0060] Vectorize each text segment set to obtain a text segment vector set corresponding to each search object;

[0061] Through feature summarization, a set of text fragments is used to construct a set of question-answer pairs corresponding to each search object, and each set of question-answer pairs is vectorized to obtain a set of question-answer pair vectors;

[0062] The text segment vector set and the question-answer pair vector set are stored in the vector database according to the index set.

[0063] Accordingly, an embodiment of the present invention discloses an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the various steps of the above-mentioned information retrieval method embodiment when executed by the processor.

[0064] Accordingly, an embodiment of the present invention discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, each step of the above-mentioned information retrieval method embodiment is implemented.

[0065] The embodiments of the present invention include the following advantages:

[0066] After obtaining the search instruction using the query text for query, the intelligent question answering system determines the fuzzy difference features of the query text, and determines the target index set to be searched based on the fuzzy difference features, then performs text recall in the target index set to obtain candidate search results, sorts the candidate search results, obtains the sorted target search results, and outputs the target search results. In this way, when searching the query text, the fuzzy difference features between phrases are taken into account, which can enhance the importance of the fuzzy difference features during the search. At the same time, using a tree structure to store the search index can narrow the search scope, and the search results output by the common search method are more accurate and the search efficiency is higher.

[0067] At the same time, the question-answer pairs and related text fragments can be recalled by calculating the correlation between the query and the question, and then the reranker model is used to re-rank the query, question-answer pairs and related text fragments according to the correlation to obtain the final retrieval results, thereby reducing the complexity of the retrieval and improving the recall efficiency. At the same time, the reranking can effectively ensure that all key information in the query is retrieved, thereby improving the retrieval effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] Figure 1 is a flow chart of the steps of Embodiment 1 of an information retrieval method of the present invention;

[0069] Figure 2 is a flow chart of the steps of Embodiment 2 of an information retrieval method of the present invention;

[0070] Figure 3 It is a schematic diagram of the structure of the search tree of the present invention;

[0071] Figure 4 It is a structural block diagram of an information retrieval device embodiment of the present invention. DETAILED DESCRIPTION

[0072] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0073] One of the core concepts of the embodiment of the present invention is that when searching the query text, the fuzzy difference features between phrases are taken into account, which can enhance the importance of the fuzzy difference features during the search. At the same time, the use of a tree structure to store the search index can narrow the search scope, and the search results output by the common search method are more accurate and the search efficiency is higher. At the same time, the question-answer pair and the associated text fragments can be recalled by calculating the correlation between the Query and the Question, and then the reranker model is used to re-rank the Query, the question-answer pair and the associated text fragments to obtain the final search results, thereby reducing the complexity of the search and improving the recall efficiency. At the same time, the re-ranking can effectively ensure that all key information in the Query is retrieved, thereby improving the search effect.

[0074] Reference Figure 1 , showing a step flow chart of embodiment 1 of an information retrieval method of the present invention.

[0075] At present, due to the frequent updates of business and product knowledge in the telecommunications field, the LLM (Large Language Model) combined with the RAG (Retrieval-Augmented Generation) model is preferred in the construction of intelligent question-answering systems to ensure the timeliness of the knowledge generated answers. However, there are many types of sales products in the telecommunications field, and various sales products will be updated and iterated in different versions according to the needs of different user groups and different periods. The names of sales products are composed of many proprietary words and fixed expression patterns. It is often the case that the names of the same type of sales products are only one letter different, and the descriptions of the various attributes of these similar sales products in the knowledge base will only have slight differences in individual functions or rights. When the difference in text features is small and the similarity is extremely high, the accuracy of RAG retrieval results becomes a key factor in ensuring the quality of LLM-generated answers.

[0076] At present, text retrieval methods usually pay more attention to the association information between contexts when processing semantics, thus ignoring the fuzzy feature differences between phrases. Although the model incorporates context information in the process of encoding text, it does not consider modeling phrases. This limitation may cause some key semantic feature information to be ignored when evaluating the correlation between Query and Doc. For example, when evaluating the similarity between the texts containing the two phrases "DIY video ringtone Zhuoyue package" and "DIY video ringtone excellent package", the model ignores the fuzzy difference feature information of the words "Zhuoyue package" and "Excellent package" due to the interference of context information; when evaluating the similarity between the texts containing the two phrases "5G 299 yuan standard fusion package" and "5G 399 yuan standard fusion package", it is difficult for the model to identify the fuzzy difference feature information of the numbers "299 yuan" and "399 yuan". These fuzzy feature differences will affect the accuracy of the final retrieval.

[0077] To solve the above problems, the applicant creatively proposes an embodiment of the present invention, which may specifically include the following steps:

[0078] Step 101, obtaining a search instruction for searching using a query text.

[0079] Specifically, the intelligent question-answering system can be provided with a visual interface for interacting with the user, and the user can log in to the intelligent question-answering system through the visual interface. A search input box can be provided in the visual interface, and the user can enter the question to be searched in the search input box after successfully logging in. When the user clicks the button to trigger the search, the intelligent question-answering system can obtain the search instruction and the query text (i.e., the question entered by the user).

[0080] It should be noted that, in actual applications, the intelligent question-answering system may also obtain search instructions and query texts in other ways. The specific acquisition method may be set according to actual needs, and the embodiment of the present invention does not limit this.

[0081] Step 102: determine the fuzzy difference features of the query text, and determine the target index set to be retrieved based on the fuzzy difference features.

[0082] After obtaining the query text, the intelligent question-answering system can extract the existing fuzzy difference features from the query text. The greater the similarity between the texts, the smaller the fuzzy difference features. For example, the fuzzy difference features between "Zhuoyue bag" and "Excellent bag" mentioned above, and the fuzzy difference features between "299 yuan" and "399 yuan". On the contrary, the smaller the similarity between the texts, the larger the fuzzy difference features, or even no fuzzy difference features.

[0083] After extracting the fuzzy difference features, the set of indexes to be detected corresponding to the query text can be determined (for ease of description, referred to as the "target index set"), so that the text can be recalled based on the target index set to obtain retrieval results.

[0084] In the embodiment of the present invention, determining the fuzzy difference features of the query text and determining the target index set to be retrieved based on the fuzzy difference features includes:

[0085] Performing feature extraction on the query text by using the trained feature extraction model to obtain fuzzy difference features in the query text;

[0086] The target index set to be searched is determined by using the constructed search tree and the fuzzy difference feature.

[0087] Specifically, after obtaining the fuzzy difference features, the trained feature extraction model (FeatureModel) can be used to extract the fuzzy difference features (PuzzyFeatures) in the query text (Query), and then the target index set to be detected is obtained by constructing a retrieval tree (FeatureTrie) based on FuzzyFeatures. i}.

[0088] Step 103: perform text recall in the target index set to obtain candidate retrieval results.

[0089] Since each index has a corresponding text, after obtaining the target index set, the text can be recalled based on the target index set to obtain the recalled text (referred to as "candidate retrieval result").

[0090] In the embodiment of the present invention, the step of performing text recall in the target index set to obtain candidate search results includes:

[0091] Using the target index set to perform text recall in a preset vector database to obtain recalled question-answer pairs;

[0092] The top N question-answer pairs among the recalled question-answer pairs are used as candidate retrieval results.

[0093] Specifically, the preset vector database stores multiple question and answer pairs, so a multi-granularity fusion retrieval method can be used to retrieve the target index set TargetIndexex={IndexOi i} Recall the question-answer pairs that are relevant to the query text (Query) in the vector database, and take the top N question-answer pairs as candidate retrieval results; N is a positive integer.

[0094] The relevance between the query text and the question-answer pair can be evaluated by calculating the cosine similarity between the query text and the vector of the question in the question-answer pair (i.e., Query and Question), which can be calculated using the following formula:

[0095]

[0096] It should be noted that in addition to the above-mentioned method, the relevance between the query text and the question-answer pair can also be evaluated in other ways. In practical applications, the specific evaluation method can be set according to actual needs, and the embodiments of the present invention are not limited to this.

[0097] Furthermore, in addition to using the top N question-answer pairs as candidate retrieval results, all question-answer pairs can also be used as candidate retrieval results. In actual applications, the specific number of candidate retrieval results can be set according to actual needs, and the embodiments of the present invention do not limit this.

[0098] Step 104: sort the candidate search results to obtain sorted target search results.

[0099] Since some of the recalled candidate search results with less relevance to the query text are ranked higher, while those with greater relevance are ranked lower, the candidate searches can be reordered to obtain sorted search results (referred to as "target search results"). In this way, it can be ensured that the higher the ranking of the search results, the greater the relevance to the query text.

[0100] In the embodiment of the present invention, the step of sorting the candidate search results to obtain sorted target search results includes:

[0101] The candidate search results are sorted by using the text fragments associated with the candidate search results and the query text through a sorting model to obtain sorted target search results.

[0102] Specifically, when ranking the candidate search results, the text fragments associated with the recalled candidate search results and the query text (Query) can be reranked through the Reranker model to obtain the ranked target search results.

[0103] It should be noted that the target search result can be a question-answer pair, a text fragment associated with the question-answer pair, or a question-answer pair and a corresponding text fragment. In actual applications, the specific content of the target search result can be set according to actual needs, and the embodiments of the present invention do not limit this.

[0104] Furthermore, in addition to using the Reranker model, other methods can also be used to sort the candidate search results. In practical applications, the specific sorting method can be set according to actual needs, and the embodiments of the present invention do not limit this.

[0105] Furthermore, after obtaining the re-ranked search results, the top K search results can also be used as target search results, where K≤N. In practical applications, the specific number of target search results can be set according to actual needs, and the embodiment of the present invention does not limit this.

[0106] Step 105: output the target search result.

[0107] After obtaining the target search results, the target search results can be output, for example, displayed in a visual interface, and users can browse the target search results.

[0108] In the embodiment of the present invention, after obtaining the search instruction using the query text for query, the intelligent question answering system determines the fuzzy difference features of the query text, and determines the target index set to be searched based on the fuzzy difference features, then performs text recall in the target index set to obtain candidate search results, sorts the candidate search results, obtains the sorted target search results, and outputs the target search results. In this way, when searching the query text, the fuzzy difference features between phrases are taken into account, which can enhance the importance of the fuzzy difference features during the search. At the same time, using a tree structure to store the search index can narrow the search scope, and the search results output by the common search method are more accurate and more efficient.

[0109] At the same time, the question-answer pairs and related text fragments can be recalled by calculating the correlation between the query and the question, and then the reranker model is used to re-rank the query, question-answer pairs and related text fragments according to the correlation to obtain the final retrieval results, thereby reducing the complexity of the retrieval and improving the recall efficiency. At the same time, the reranking can effectively ensure that all key information in the query is retrieved, thereby improving the retrieval effect.

[0110] Reference Figure 2 , shows a flow chart of the steps of Embodiment 2 of an information retrieval method of the present invention, which may specifically include the following steps:

[0111] Step 201: When a set of search objects is obtained, a set of phrases having fuzzy difference characteristics between the search objects is determined.

[0112] When deploying the intelligent question answering system, the administrator can enter the retrieval object set Objects = {O1, O2, ..., O n}, (n∈N), N is a positive integer. The intelligent question answering system can mine the search object set and determine the set of phrases with fuzzy difference characteristics between the search objects in the search object set.

[0113] In the embodiment of the present invention, the step of determining the phrases having fuzzy difference characteristics between the search object sets includes:

[0114] Based on the self-attention mechanism, the similarities between the various search objects in the search object set are analyzed to obtain a phrase set with fuzzy difference features in the search object set.

[0115] Specifically, the analysis of i , (i=1,2,…,n), and obtain the phrase set Phrases={P1,P2,…,P m},(m∈N),O i The similarity between them can be evaluated based on the score matrix obtained by inner product calculation based on the Self-Attention architecture. The specific formula can be as follows:

[0116]

[0117] Q = Concat(O i ,O i′ )W Q

[0118] K = Concat(O i ,O i′ )W K

[0119] Among them, W Q and W K They are the weight matrices for calculating the Q and K matrices in Self-Attention, and d k is the dimension of matrix K, O i′ ∈Objects-O i , K T is the transpose of K.

[0120] It should be noted that O iIn addition to the above-mentioned method, the similarity between them can also be evaluated in other ways. In practical applications, the specific evaluation method can be set according to actual needs, and the embodiment of the present invention does not limit this.

[0121] Step 202, using the phrase set to train the original feature extraction model with a preset feature extraction model to obtain a trained feature extraction model, and using the fuzzy difference feature to construct a retrieval tree.

[0122] After obtaining the phrase set, the phrase set can be used to train a fuzzy difference feature extraction model FeatureModel based on an untrained original Transformer architecture, and a retrieval tree FeatureTrie can be constructed based on the fuzzy difference features in the phrase set.

[0123] Step 203: construct an index of the search object set in a preset vector database using the search tree, and vectorize the text of the search object set and store it in the vector database.

[0124] After obtaining the trained feature extraction model and retrieval tree, an index of the retrieval object set in the vector database can be constructed based on the retrieval tree, wherein each retrieval object in the retrieval object set has a corresponding index; and the text corresponding to each retrieval object is vectorized and stored in the vector database.

[0125] In an embodiment of the present invention, the step of constructing an index of the search object set in a preset vector database using the search tree, and vectorizing the text of the search object set and storing it in the vector database, includes:

[0126] Obtaining text corresponding to each search object in the search object set to obtain a text set;

[0127] Using the search tree to construct an index of each search object in the vector database to obtain an index set;

[0128] Performing coarse-grained text slicing on each text in the text set to obtain a text segment set corresponding to each search object;

[0129] Vectorize each text segment set to obtain a text segment vector set corresponding to each search object;

[0130] Through feature summarization, a set of text fragments is used to construct a set of question-answer pairs corresponding to each search object, and each set of question-answer pairs is vectorized to obtain a set of question-answer pair vectors;

[0131] The text segment vector set and the question-answer pair vector set are stored in the vector database according to the index set.

[0132] Specifically, the intelligent question answering system can obtain the text corresponding to each search object in the search object set, thereby obtaining the text set (z∈N), N is a positive integer. It should be noted that the text set can be obtained automatically, for example, from a database, or passively, for example, through manual input. In practical applications, the specific method of obtaining the text set can be set according to actual needs, and the embodiment of the present invention does not limit this.

[0133] Then construct each retrieval object O according to the retrieval tree i Index IndexO in the vector database i , thus obtaining the index set ObjectIndexes = {IndexO1, IndexO2, ..., IndexO n}.

[0134] For each text in the text collection (j=1,2,…,z) to perform coarse-grained text slicing to obtain a set of text segments corresponding to each search object, and then vectorize each set of text segments to obtain a set of text segment vectors corresponding to each search object (k∈N), and according to IndexO i The text segment vector collection is stored in a vector database.

[0135] Among them, the coarse-grained text slicing method can be segmented according to the logical structure of the original document, such as sentences, paragraphs, and chapters. (l=1,2,…,k) is the vectorized representation of the token sequence of a text fragment. In computer science and natural language processing, a token usually refers to the basic unit of text data after word segmentation, which can be a word, phrase or character, etc. These tokens are the basis for further processing (such as analysis, indexing, and searching). (k∈N), N is a positive integer, and Trans is a vectorized encoder based on the Transformer architecture.

[0136] For each search object Fine-grained question-answer pairs can be constructed through feature summarization to obtain a question-answer pair set corresponding to each retrieval object, and then each question-answer pair set is vectorized to obtain a question-answer pair vector set, and then the vector set is obtained according to IndexO. i The question-answer pair vector set is stored in a vector database.

[0137] Step 204: Obtain a search instruction for searching using the query text.

[0138] Step 205: determine the fuzzy difference features of the query text, and determine the target index set to be retrieved based on the fuzzy difference features.

[0139] Step 206: perform text recall in the target index set to obtain candidate retrieval results.

[0140] Step 207: sort the candidate search results to obtain sorted target search results.

[0141] Step 208: output the target search result.

[0142] Among them, steps 204 to 208 are substantially the same as steps 101 to 105, and will not be described here in order to avoid repetition.

[0143] In the embodiment of the present invention, phrases with fuzzy difference features between search objects are mined, and a search tree is constructed based on these phrase features. In this way, when searching for a query text, the fuzzy difference feature phrases in the query text can be obtained through a feature extraction model, and then these phrases are quickly searched in the search tree to obtain the target index to be searched. Through this method, the importance of fuzzy difference features during retrieval can be enhanced. At the same time, using a tree structure to store the search index can narrow the search scope and improve the search efficiency.

[0144] Furthermore, after the documents of the search object are coarsely sliced, the features of each text segment are summarized to construct a more fine-grained question-answer pair as the associated field of the text segment, and the text segment and the question-answer pair are vectorized and stored in the database respectively. In this way, when searching the query text, the question-answer pair and the associated text segment can be recalled by calculating the correlation between the query and the question, and then the reranker model is used to re-rank the query, the question-answer pair and the associated text segment to obtain the final search result, thereby reducing the complexity of the search and improving the recall efficiency. At the same time, the re-ranking can effectively ensure that all the key information in the query is retrieved, improving the search effect.

[0145] For ease of understanding, the complete process of the embodiment of the present invention is described below using specific examples.

[0146] Assume that O1=campus integration 79 yuan (2022 Spring), O2=campus integration 79 yuan (2022 Jiaotong University), O3=campus integration 79 yuan (2022 Chongqing University), O4=campus integration 79 yuan (2022 Chongqing University co-stream), O5=campus integration 79 yuan (Jiaotong University co-stream), O6=campus integration 79 yuan (Yongchuan), O7=campus integration 89 yuan (Yongchuan).

[0147] The intelligent question answering system obtains a retrieval object set Objects = {O1, O2, O3, O4, O5, O6, O7}.

[0148] Analysis i The similarity between them is used to obtain the phrase set with fuzzy difference features Phrases = {campus integration 79 yuan, campus integration 89 yuan, 2022 spring, 2022 Jiaotong University, 2022 major, 2022 major co-flow, Jiaotong University. Since the similarity between "Yongchuan" and other phrases is small, it does not belong to the phrase set.

[0149] Among them, O i The similarity between them is evaluated according to the score matrix obtained by inner product calculation based on the Self-Attention architecture according to the formula in step 201, and O is obtained. i The similarity score matrix between is shown in Table 1:

[0150]

[0151] Table 1

[0152] Phrases is used to train the fuzzy difference feature extraction model FeatureModel based on the Transformer architecture, and the retrieval tree FeatureTrie is constructed based on the fuzzy difference features between Phrases. The structure of the retrieval tree is as follows: Figure 3 shown.

[0153] Get O i Docs i ={Business introduction, business rates, processing channels, sales product information}.

[0154] Construct O according to FeatureTrie i Index IndexO in the vector database i .

[0155] For example, O1 = "Campus Integration 79 yuan (Spring 2022)" IndexO i =“Package-Campus-Fusion-79 Yuan-Spring 2022”.

[0156] Will (j=1,2,3,4) Perform coarse-grained document slicing and vectorization to obtain a set of text segment vectors (k∈N), N is a positive integer, and according to IndexO i Stored in a vector database.

[0157] For example, for O1 = "Campus Integration 79 yuan (2022 Spring)" The original document is sliced ​​according to the original module internal knowledge point structure of the document to obtain the text fragments shown in Table 2:

[0158]

[0159]

[0160] Table 2

[0161] After vectorizing the above text fragment, we get A vector collection of text snippets:

[0162]

[0163] The text fragment vector set is stored in the vector database index IndexOi = "Package-Campus-Fusion-79 Yuan-2022 Spring".

[0164] For O i Every Fine-grained QA pairs are constructed through feature summarization, and the QA pairs are vectorized as The associated fields are stored in the vector database Index0 i middle.

[0165] For example, O1 = "Campus Integration 79 yuan (Spring 2022)" The QA pairs constructed by text fragment 1 and text fragment 2 based on fine-grained knowledge points through feature induction and summary are as follows

[0166] As shown in Table 3:

[0167]

[0168]

[0169] Table 3

[0170] After the above QA pairs are vectorized, they are used as the associated fields of text segment 1 and text segment 2 respectively and stored in the vector database Index0. i = "Package-Campus-Fusion-79 yuan-2022 Spring".

[0171] When the intelligent question-answering system obtains the query text Query = "Will the suspension of the 79-yuan campus fusion main card processed in the spring of 2022 affect the secondary card?" input by the user, FeatureModel is used to extract the fuzzy difference features FuzzyFeatures = {campus, fusion, 79 yuan, 2022 spring, main card, suspension, secondary card} in Query.

[0172] According to FuzzyFeatures, through FeatureTrie, obtain the target index set to be retrieved TargetIndexes = {"Package-Campus-Fusion-79 yuan", "Package-Campus-Fusion-

[0173] 79 yuan-2022 Spring","Package-Campus-Fusion-79 yuan-2022 Spring-Jiaotong University"}.

[0174] Assuming that the recall N is 5, then the top-5 QA pairs ranked by recall relevance in the vector database according to TargetIndexes are shown in Table 4:

[0175]

[0176]

[0177] Table 4

[0178] The relevance ranking of the query and question pairs is evaluated by calculating the cosine similarity between the query and question vectors according to the formula in step 103.

[0179] Score Cos As shown below:

[0180] Top-1Score Cos =0.8026

[0181] Top-2Score Cos =0.7863

[0182] Top-3Score Cos =0.7458

[0183] Top-4Score Cos =0.7259

[0184] Top-5Score Cos =0.6376

[0185] The text fragments associated with the recalled Top-5 QA pairs and the query are reranked through the Reranker model. The reranking evaluation scores are shown below and the reranking results are shown in Table 5:

[0186]

[0187]

[0188] Table 5

[0189] Assuming that the K of the target retrieval result is 2, then the output is the Top-2 ranked text fragment set TopKDocs, as shown in Table 6:

[0190]

[0191] Table 6

[0192] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0193] Reference Figure 4 , shows a structural block diagram of an information retrieval device embodiment of the present invention, which may specifically include the following modules:

[0194] The acquisition module 401 is used to acquire a search instruction for querying using a query text;

[0195] A first determination module 402 is used to determine the fuzzy difference features of the query text, and determine a target index set to be retrieved based on the fuzzy difference features;

[0196] A recall module 403, used to recall text in the target index set to obtain candidate search results;

[0197] A sorting module 404 is used to sort the candidate search results to obtain sorted target search results;

[0198] The output module 405 is used to output the target search result.

[0199] In the embodiment of the present invention, the first determining module is specifically configured to:

[0200] Performing feature extraction on the query text by using the trained feature extraction model to obtain fuzzy difference features in the query text;

[0201] The target index set to be searched is determined by using the constructed search tree and the fuzzy difference feature.

[0202] In the embodiment of the present invention, the recall module is specifically used for:

[0203] Using the target index set to perform text recall in a preset vector database to obtain recalled question-answer pairs;

[0204] The top N question-answer pairs among the recalled question-answer pairs are used as candidate retrieval results.

[0205] In the embodiment of the present invention, the sorting module is specifically used to:

[0206] The candidate search results are sorted by using the text fragments associated with the candidate search results and the query text through a sorting model to obtain sorted target search results.

[0207] In an embodiment of the present invention, it also includes:

[0208] A second determination module is used for determining a phrase set having fuzzy difference characteristics between the search objects when a search object set is obtained before obtaining the search instruction for searching using the query text;

[0209] A training module, used to train the original feature extraction model using the phrase set to obtain a trained feature extraction model;

[0210] A first construction module is used to construct a retrieval tree using the fuzzy difference feature;

[0211] The second construction module is used to construct an index of the search object set in a preset vector database using the search tree, and to vectorize the text of the search object set and store it in the vector database.

[0212] In the embodiment of the present invention, the second determining module is specifically configured to:

[0213] Based on the self-attention mechanism, the similarities between the various search objects in the search object set are analyzed to obtain a phrase set with fuzzy difference features in the search object set.

[0214] In the embodiment of the present invention, the second building module is specifically used to:

[0215] Obtaining text corresponding to each search object in the search object set to obtain a text set;

[0216] Using the search tree to construct an index of each search object in the vector database to obtain an index set;

[0217] Performing coarse-grained text slicing on each text in the text set to obtain a text segment set corresponding to each search object;

[0218] Vectorize each text segment set to obtain a text segment vector set corresponding to each search object;

[0219] Through feature summarization, a set of text fragments is used to construct a set of question-answer pairs corresponding to each search object, and each set of question-answer pairs is vectorized to obtain a set of question-answer pair vectors;

[0220] The text segment vector set and the question-answer pair vector set are stored in the vector database according to the index set.

[0221] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0222] An embodiment of the present invention further provides an electronic device, including:

[0223] It includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned information retrieval method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0224] An embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned information retrieval method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0225] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0226] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0227] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0228] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0229] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0230] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0231] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0232] The above is a detailed introduction to an information retrieval method and an information retrieval device provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. An information retrieval method, characterized in that: The method comprises: Obtaining a search instruction for performing a search using a query text; Determining fuzzy difference features of the query text, and determining a target index set to be retrieved based on the fuzzy difference features; Performing text recall in the target index set to obtain candidate retrieval results; Sorting the candidate search results to obtain sorted target search results; The target search result is outputted.

2. The information retrieval method according to claim 1, characterized in that: The step of determining the fuzzy difference features of the query text and determining the target index set to be retrieved based on the fuzzy difference features includes: Performing feature extraction on the query text by using the trained feature extraction model to obtain fuzzy difference features in the query text; The target index set to be searched is determined by using the constructed search tree and the fuzzy difference feature.

3. The information retrieval method according to claim 1, characterized in that: The text recall in the target index set to obtain candidate retrieval results includes: Using the target index set to perform text recall in a preset vector database to obtain recalled question-answer pairs; The top N question-answer pairs among the recalled question-answer pairs are used as candidate retrieval results.

4. The information retrieval method according to claim 1, characterized in that: The step of sorting the candidate search results to obtain sorted target search results includes: The candidate search results are sorted by using the text fragments associated with the candidate search results and the query text through a sorting model to obtain sorted target search results.

5. The information retrieval method according to claim 1, characterized in that: Before obtaining the retrieval instruction for querying using the query text, the method further includes: When a set of search objects is obtained, a set of phrases having fuzzy difference characteristics between the search objects is determined; The phrase set is used to train the original feature extraction model with the preset feature extraction model to obtain a trained feature extraction model, and the fuzzy difference feature is used to construct a retrieval tree; The search tree is used to construct an index of the search object set in a preset vector database, and the text of the search object set is vectorized and stored in the vector database.

6. The information retrieval method according to claim 5, characterized in that: The phrases of determining whether there are fuzzy difference characteristics between the search object sets include: Based on the self-attention mechanism, the similarities between the various search objects in the search object set are analyzed to obtain a phrase set with fuzzy difference features in the search object set.

7. The information retrieval method according to claim 5, characterized in that: The step of using the search tree to construct an index of the search object set in a preset vector database, and vectorizing the text of the search object set and storing it in the vector database, includes: Obtaining text corresponding to each search object in the search object set to obtain a text set; Using the search tree to construct an index of each search object in the vector database to obtain an index set; Performing coarse-grained text slicing on each text in the text set to obtain a text segment set corresponding to each search object; Vectorize each text segment set to obtain a text segment vector set corresponding to each search object; Through feature summarization, a set of text fragments is used to construct a set of question-answer pairs corresponding to each search object, and each set of question-answer pairs is vectorized to obtain a set of question-answer pair vectors; The text segment vector set and the question-answer pair vector set are stored in the vector database according to the index set.

8. An information retrieval device, characterized in that: The device comprises: An acquisition module, used to acquire a search instruction for querying using a query text; A first determination module, configured to determine fuzzy difference features of the query text, and determine a target index set to be retrieved based on the fuzzy difference features; A recall module, used to recall text in the target index set to obtain candidate retrieval results; A sorting module, used to sort the candidate search results to obtain sorted target search results; An output module is used to output the target search result.

9. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of the information retrieval method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the information retrieval method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Business object matching method and related equipment

    CN122045398A