A conversational information retrieval method based on reply awareness

By using historical queries and replies as expansion words in conversational information retrieval, combined with the SimSCE model and BM25 algorithm, the problem of low traditional retrieval efficiency and irrelevant results is solved, and a more efficient and accurate information retrieval experience is achieved.

CN118673125BActive Publication Date: 2024-10-22HANGZHOU DIANZI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411157060.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2024-10-22
Estimated Expiration
2044-08-22

AI Technical Summary

Technical Problem

Traditional keyword search is difficult to understand the user's true intention, resulting in irrelevant results. Conversational retrieval is inefficient when dealing with historical queries and contextual relevance, and large models match all documents, which reduces retrieval efficiency.

Method used

Adopt a conversational information retrieval method based on reply awareness, use historical queries and replies as a knowledge base for expanded words, perform comparative learning through the SimSCE model to improve the quality and efficiency of semantic expression, and combine the BM25 algorithm and hyperspace semantic method to filter and sort relevant document.

Benefits of technology

Significantly improves the accuracy and efficiency of retrieval, reduces noise, provides smooth and personalized information suggestions, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118673125B_ABST
    Figure CN118673125B_ABST
Patent Text Reader

Abstract

The present invention discloses a conversational information retrieval method based on reply perception, which first encodes the document D using a large language model; for a group of conversational queries, corresponding feedback sets are obtained for the queries based on the use of the BM25 algorithm. Secondly, based on the feedback set, the large language model is used for encoding, and the extended words are obtained through the hyperspace semantic method. Then the query is encoded and concatenated with the extended words into a new query, and its semantic similarity with the document after encoding is calculated, and the semantic similarity is sorted from large to small, and the loss is calculated for training. Finally, the trained model is used to retrieve the test set query to obtain the sorted result of the retrieval. The present invention improves the continuity of the upper and lower query replies, and adds replies as candidates for extended words to reduce noise, bringing smooth and personalized information and suggestions to users.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of information retrieval, and in particular relates to a conversational information retrieval method based on reply perception. Background Art

[0002] With the development of the Internet and the explosion of information, it is difficult for users to quickly find the precise information they need when faced with a massive amount of information. Traditional keyword searches often fail to accurately understand the user's true intentions, resulting in a large number of irrelevant results. Conversational search interacts with users through natural language, tracks the conversation status, and gradually understands the user's query intent through multiple rounds of search, providing more accurate and relevant search results.

[0003] There are many methods for implementing query rewriting in conversational retrieval, which are mainly divided into two categories: query expansion and query rewriting. Query expansion improves the relevance and coverage of the search scope by adding or replacing keywords in the user's original query. The mainstream methods include expanding the query and adding extension items based on synonyms, document content, and knowledge base. Query rewriting is used to modify, replace or reorganize the user's original query terms to solve the problem that the query is too short, vague or inaccurate. The difference between the two is whether the query used for the final retrieval is a sentence. The present invention only involves a query expansion method to implement the above process, and selects a query expansion technology based on document content.

[0004] For query expansion methods, how to find accurate expansion words becomes the primary task. Existing methods calculate the proximity of all candidate expansion words to all current documents as options for screening expansion words. In order to better screen suitable expansion words, various methods and their improved methods have gradually emerged. The use of sliding windows and kernel functions to calculate proximity has been well developed in recent years. Recently, due to the emergence of large models, pre-trained language models (GPT-3, BERT, etc.) are used to achieve zero samples. Few-sample training means that information retrieval only requires a small amount of training data. Currently, new pre-trained language models are emerging in an endless stream, and increasingly high-performance large models can bring better service experience and retrieval efficiency to retrieval.

[0005] However, not all documents need to be matched with extended terms. If all documents are matched with the query terms using a large model, the efficiency of retrieval will inevitably be reduced and the retrieval time will be prolonged. How to screen out documents that are highly relevant to the current query terms has become a top priority. Moreover, conversational retrieval is different from traditional single-round retrieval in that it has a strong contextual relevance and the representational feature of historical queries. If the impact of historical queries on the current query is not considered, it will inevitably cause a deviation in understanding. During use, users often use the pronoun it them to refer to the nouns and phrases that appear in the previous text, but repeated retrieval of the previous text will cause performance waste, repeated work, and a sharp drop in retrieval efficiency. Summary of the invention

[0006] In view of the above problems, the present invention provides a conversational information retrieval method based on reply perception, which uses historical query replies and historical query documents as the knowledge base of the current query expansion terms to achieve more precise retrieval and further connect the context query statements. The SimSCE model used in this paper can significantly improve the quality and efficiency of semantic expression, train sentence embedding through comparative learning, and has wide applicability in natural language processing tasks, improving retrieval effects.

[0007] The following is a technical solution of the present invention, which is a conversational query expansion and information retrieval method based on reply perception, comprising the following steps:

[0008] S1: Encode document D using a large language model to obtain E D * .

[0009] S2: For a set of conversational queries Q 1:k , k>1, for the query Q in round k k 、Previous QueryQ k-1 , based on the BM25 algorithm, the corresponding feedback sets are obtained respectively.

[0010] For a set of conversational queries Q 1:k , k>1, for the query Q in round k k , use the BM25 algorithm to calculate the score Score(q k , D), take the first n documents in S1 corresponding to the encoded document D * Input into the sentence vector representation SimSCE based on contrastive learning, calculate the semantic similarity, and obtain the document with the highest ranking |R1| as the feedback set R1, where |R1| represents the number of documents taken after re-ranking by SimSCE; find the previous query Q of the query k-1 , and obtain its feedback set R2 by the same operation as above.

[0011] S3: Based on the feedback set, the large language model is used for encoding and the extended words are obtained through the hyperspace semantic method.

[0012] S4: Will Q k Encode to get Q k * and the extension items to form a new query Q′ k , and use SimSCE to calculate E D * and Q′ k Semantic similarity is calculated and the semantic similarity is sorted from large to small to obtain the sorted results of the retrieval, and the loss is calculated for training.

[0013] S5: Use the trained model to search the test set query and obtain the search ranking results. SimSCE will also output a unified response for the comprehensive document.

[0014] The reply-aware conversational query expansion and information retrieval method provided by the present invention improves the continuity of the upper and lower query replies by adding the expansion words in the historical replies and historical query feedback sets, and adds replies as expansion word candidates to reduce noise, thereby providing users with smooth, personalized information and suggestions. SimSCE is used to replace the traditional large language model, and adversarial learning is used to embed sentences, maximize the similarity between similar sentences, minimize the similarity between non-similar sentences, generate sentence embeddings with more semantic distinction, and have simple and efficient training, strong generalization ability, generate higher-quality sentences, and realize a retrieval service with better user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 It is a schematic diagram of the process of the present invention. DETAILED DESCRIPTION

[0016] The present invention provides a conversational information retrieval method based on reply perception, such as Figure 1 The technical solution of the present invention is further described in detail below through examples.

[0017] S1: Encode document D using an existing document model such as RoBERTa to obtain D * , the specific steps are as follows:

[0018] The RoBERTa model is trained on a larger dataset based on the BERT model to improve the generalization ability of the model. In addition, it uses dynamic masks. Unlike the static masks of BERT, the dynamic masks of RoBERTa allow different mask patterns to be seen in each training, thus achieving better generalization. By better tuning the model parameters, the model performance is better and more robust. The following is the specific process of RoBERTa encoding:

[0019] Use the tokenizer in the transformer to split document D into words or word tokens, separated by special tags, as the input of the model:

[0020]

[0021] [CLS] is the beginning of a sentence, and [SEP] is the sentence separator. Here, a document is considered a sentence. is the vector representation of the i-th document, Represents the nth word or term in a document.

[0022] Will Input into the core multi-layer Transformer encoder of RoBERTa. Assuming that after L layers of encoders, the final representation is:

[0023]

[0024] Among them, H L is the output of the L-th layer encoder, is the hidden representation of the [CLS] output in the L-th layer encoder, and the other h representations have the same meaning. As the global semantic representation of the entire sentence, the position representation Here H L That is output D * .

[0025] S2: For a set of conversational queries Q 1:k , for the query Q in round k k , use BM25 to calculate the query term and each document D i Score(Q k ,D i ), the 1000 documents with the highest ranking are input into SimSCE, and the document with the highest ranking |R1| is obtained as the feedback set. Find the previous historical query (if any) Q k-1 , the same steps as above are used to obtain its feedback set |R2| and its feedback sentence R k-1 The specific steps are as follows:

[0026] Q mentioned in S2 k Calculated using BM25:

[0027]

[0028] Where f(q ik ,D i ) is qik In document D i The frequency words appearing in |D i | is document D i , avgdl is the average length of documents in the corpus, k1 and b are adjustment parameters, and IDF is the query word q ki The inverse document frequency of

[0029]

[0030] Where N is the total number of documents, n(qk i ) represents the word qk i The number of documents.

[0031] Get Score(Q k ,D i ), then take the first 1000 documents and the corresponding encoded documents D in S1 * Input into SimSCE, and then calculate Q' k The semantic similarity between the document and sim(Q′ k ,d i ), here cosine similarity is used for calculation, and the calculation formula is as follows:

[0032]

[0033] in represents the vector dot product, is the query Q′ k The encoded vector representation is: It is a document i The encoded vector representation is: and Represents the length of the vector respectively. Finally, take the first |R1| documents as the feedback set and take Q k-1 Query to obtain its feedback set |R2| and its feedback sentence R k-1 .

[0034] S3: Corresponding code R1 in feedback set R1 * , for query Q k The query word q in 1:m , for the mth query word q m , using the hyperspace semantic method, supplemented by a dynamic window, the weighted word vector r1 is calculated. Similarly, the corresponding code R2 for the feedback set R2 * , and obtain the weighted word vector r2. Use SimSCE to k-1 Encode to get R k-1 * , get the word vector r3. The specific steps are as follows:

[0035] The Hyperspace Semantic Method (HAL) is used to add a dynamic window to calculate the frequency of the extended word. k The query word q in 1:m , find its position in each document, calculate the frequency of nearby words to select the candidate word options.

[0036] Assuming the window size is W and using the dynamic window function f(d), the calculation formula is as follows:

[0037] f(d))=W-d+1

[0038] The query word is at position i, the context word is at position j, and the word r i and r j The distance is d=|ij|.

[0039] Update the hyperspace semantic weight W according to the dynamic window function hal , for each expansion term r ij , the calculation formula is as follows:

[0040]

[0041] Where p(r i ,d,q i ) represents the candidate extension r i With the query word q i The number of co-occurring words at distance d.

[0042] In addition to calculating the hyperspace semantic weight, the words with higher word frequency in each document are also candidates for expansion items. Here, the document item weight is calculated. BM25 is used to calculate the corresponding weight size. Suppose the importance of candidate expansion words based on the BM25 model is W doc (r), the calculation formula is as follows:

[0043]

[0044] The difference between the similarity calculation of document query and the use of extended word r i Calculate the importance. Use the same formula to get the document importance weights of the extended words r1, r2, and r3 respectively.

[0045] Combine the two weights into a candidate word weight W(r), and the calculation formula is as follows:

[0046] W1(r1)=λ1·W hal (r1)+(1-λ1)·W doc (r1)

[0047] W2(r2)=λ2·W hal(r2)+(1-λ2)·W doc (r2)

[0048] W3(r3)=λ3·W hal (r3)+(1-λ3)·W doc (r3)

[0049] Among them, λ1, λ2, λ3 are parameters that balance the hyperspace semantic weight and document weight in the expansion words of each category. W1, W2, W3 represent the weights of expansion words with three different calculation weights, corresponding to the current query document expansion words, historical query document expansion words and historical reply expansion words, respectively. Take the expansion word weight W i (r ij ) Select the expansion words r1, r2, r3 in descending order.

[0050] S4: Each query in a set of session retrievals is processed by S2 and S3. k Encode to get Q k * Combined with the expanded words r1, r2, r3 obtained from S3, a new query Q′ is formed k , and use SimSCE with Q′ k Calculate semantic similarity and sort the documents from largest to smallest similarity. The specific steps are as follows:

[0051] Get the extended words r1, r2, r3 from S3, and update the query to the new query Q′. The calculation formula is as follows:

[0052]

[0053] where Q′ k Q is the new query after the expansion. k * It's Q k The word vector after encoding, α, β, γ are balance factors, α is mainly used to balance the original query term and all expansion terms, β is mainly used to balance the current query term feedback document expansion terms and historical expansion terms, γ is mainly used to balance the historical query document expansion terms and historical reply expansion terms. N1, N2 are the total number of feedback documents for each feedback expansion term, and N3 is a document reply balance parameter, which simulates the number of reply feedback documents.

[0054] Then use SimSCE to calculate Q′ k The semantic similarity between the document and sim(Q′ k ,d i ), here cosine similarity is used for calculation, and the calculation formula is as follows:

[0055]

[0056] in represents the vector dot product, is the query Q′ k The encoded vector representation is: It is a document i The encoded vector representation is: and Respectively represent the length of the vector.

[0057] According to sim(Q′ k ,d i ) Sort each document and obtain the sorting result.

[0058] S5: Train the process of S4 and calculate the model loss. The specific steps are as follows:

[0059] The sorting results obtained by S4 are used for training. The training set constructed by S4 is used for training. The SimSCE model used here uses the contrast loss function to train the model. We use the contrast loss based on cosine similarity. The calculation formula is as follows:

[0060]

[0061] where h i and is the two embedded vectors after encoding, where It means h i Similar sentences are called positive examples, while semantically dissimilar sentences are called negative examples. sim(u,v) represents the similarity between two vectors, which is calculated using the dot product u·v. T is the temperature parameter, which is used to adjust the smoothness of the contrast loss. [k≠i] is an indicator function, which is 1 when k≠i and 0 otherwise.

[0062] After back propagation optimizes the model parameters, the sorting results are closer to the correct results.

[0063] S6: Use the model trained in S5 to search the test set query and get the ranking result. The specific steps are as follows:

[0064] Use the trained model to perform conversational search. Now there is a set of queries Q 1:k , use RoBERTa to encode it, and the result after encoding is recorded as Then get the offline encoded document D *First, BM25 is used to calculate the top 1000 documents with the highest scores without encoding, and then SimSCE is used to calculate the corresponding feedback documents. The corresponding extensions r1, r2, and r3 are selected using the weights formed by the combination of hyperspace semantic weights and document weights. The extensions and the original query are concatenated into a new extension and then input into SimSCE, and finally the document ranking results and retrieval responses that the user is satisfied with are obtained.

[0065] In summary, according to the expansion item selection method described in the present invention, that is, the range of candidate expansion items is generated, which is composed of three parts: the current query feedback set, the historical query feedback set, and the historical replies. The continuity of the context query replies is improved, and replies are added as expansion word candidates to reduce noise, bringing smooth, personalized information and suggestions to users.

[0066] According to the method for using the large language model described in the present invention, SimSCE is used to replace the traditional large language model, and adversarial learning is used to perform sentence embedding, maximize the similarity between similar sentences, minimize the similarity between non-similar sentences, generate sentence embeddings with more semantic distinction, and train simply and efficiently with strong generalization ability, thereby achieving a retrieval service with better user experience.

[0067] Table 1 shows the method of the present invention and ZeCo 2 Overall performance comparison on the CAsT-19 dataset. ZeCo 2 (Zero-shot Conversational Contextualization) [1] The model most closely related to this paper's approach is to concatenate all historical information as input and use ColBERT for conversational retrieval. This paper makes improvements based on this, so we choose ZeCo 2 As a comparison model. BM25-raw is the result of using BM25 as the retriever for the original query. ColBERT-raw is the result of using ColBERT for the original query [2] As the result of the retriever. These two are also used as references and compared here. From the comparison results in Table 1, it can be seen that the results on the CAsT-19 dataset show that the method of the present invention can effectively improve the performance of conversational retrieval.

[0068] The dataset used in the experiment is the CAsT-19 (TREC Conversational Assistance Track 2019) dataset, which includes documents and conversational queries. The documents come from MS MARCO passages and TREC CAR paragraphs. There are 80 groups of conversational queries, 30 of which are training sets and 50 are test sets. Each conversation revolves around a conversation topic, and each group of conversations contains 9-10 questions.

[0069] The overall performance comparison uses the commonly used retrieval algorithm evaluation indicators MRR and NDCG@3. Among them, MRR evaluates the ranking position of the correct retrieval results, and NDCG@3 measures the ranking quality of the first three positions of the retrieval results. From the comparison results, it can be seen that the method described in the present invention has significantly improved the results under these two comparison indicators compared with similar methods.

[0070] Table 1 Overall performance evaluation of reply-aware conversational information retrieval methods

[0071]

[0072]

Claims

1. A conversational information retrieval method based on reply perception, characterized in that: The steps include: S1: Encode document D using a large language model to obtain E D * ; S2: For a set of conversational queries Q 1:k , k>1, for the query Q in the kth round k 、Previous QueryQ k-1 , based on the BM25 algorithm, the corresponding feedback sets are obtained respectively. The specific process is as follows: For a set of conversational queries Q 1:k , k>1, for the query Q in the kth round k , use the BM25 algorithm to calculate the score Score(q k , D), take the first n documents and the corresponding encoded documents D* in S1 and input them into the sentence vector representation SimSCE based on contrastive learning, calculate the semantic similarity, and obtain the document with the highest ranking in R1 as the feedback set R1, |R1| represents the number of documents taken after re-ranking by SimSCE; find the previous query Q of the query k-1 , and obtain its feedback set R2 by the same operation as above; S3: Based on the feedback set, the large language model is used for encoding, and the extended words are obtained through the hyperspace semantic method. The specific implementation process is as follows: Use the hyperspace semantic method HAL to increase the dynamic window method to realize the calculation of the frequency of the extended word and take Q k The query word q in 1:m , find its position in each document, calculate the frequency of nearby words to select the candidate words; Assuming the window size is W, using the dynamic window function f(d), the calculation formula is as follows: f(d)=W-d+1 The query word is at position i, the context word is at position j, and the word r i and r j The distance is d = |ij|; Update the hyperspace semantic weight W according to the dynamic window function hal , for each expansion term r ij , the calculation formula is as follows: Where p(r i , d, q i ) represents the candidate extension r i With the query word q i The number of co-occurring words at a distance d; Calculate the document term weights and use BM25 to calculate the corresponding weights. Suppose the importance of candidate expansion terms based on the BM25 model is W doc (r), the calculation formula is as follows: The difference between calculating similarity with document query is that the extended word r is used i Calculate the importance and use the same formula to get the document importance weights of the extended words r1, r2, and r3 respectively; Combine the two weights into a candidate word weight W(r), calculated as follows: W1(r1)=λ1·W hal (r1)+(1-λ1)·W doc (r1) W2(r2)=λ2·W hal (r2)+(1-λ2)·W doc (r2) <h2 style=";text-align:left;direction:ltr">W3(r3) = λ3 W<h2 style=";text-align:left;direction:ltr"> hal <h2 style=";text-align:left;direction:ltr"> (r3)+(1-λ3)·W<h2 style=";text-align:left;direction:ltr"> doc <h2 style=";text-align:left;direction:ltr"> (r3) Where λ1, λ2, λ3 are parameters that balance the hyperspace semantic weight and document weight in the expansion words of each category. W1, W2, W3 represent the weights of expansion words with three different calculation weights, corresponding to the current query document expansion words, historical query document expansion words and historical reply expansion words, respectively. The expansion word weight Wi(r i j) Select the expansion words r1, r2, r3 in descending order; S4: Will Q k Encode to get Q k * and the expanded word to form a new query Q′ k , and calculate E D * and Q′ k Semantic similarity is calculated, and the semantic similarity is sorted from large to small to obtain the sorted results of the retrieval, and the loss is calculated for training, and the test set query is retrieved.

2. The reply-aware conversational information retrieval method according to claim 1, characterized in that: The BM25 algorithm is used to calculate the score Score (q k , D) The specific process is as follows: Query Q k Use BM25 to calculate the score Score(q k , D): Where f(q ik , D i ) is q ik In document D i The frequency words appearing in |D i | is document D i , avgdl is the average length of documents in the corpus, k1 and b are adjustment parameters, and IDF is the query word q ki The inverse document frequency of .

3. The reply-aware conversational information retrieval method according to claim 2, characterized in that: The first n documents in S1 are encoded in the corresponding document D* and input into the sentence vector representation SimSCE based on contrastive learning. The specific process of calculating the semantic similarity is as follows: Get Score(Q k , D i ), take the first n documents in S1 and input the corresponding encoded document D* into SimSCE to calculate Q′ k The semantic similarity between the document and sim(Q′ k , d i ), and use cosine similarity for calculation. The calculation formula is as follows: in represents the vector dot product, is the query Q′ k The encoded vector representation is: It is a document i The encoded vector representation is: and Represent the length of the vector respectively, and finally take the top |R1| documents with the highest semantic similarity as the feedback set.

4. The reply-aware conversational information retrieval method according to claim 3, characterized in that: The specific implementation process of step S4 is as follows: Based on the extended words r1, r2, r3, the query is updated to a new query Q′, and the calculation formula is as follows: where Q′ k Q is the new query after the expansion. k * It's Q k The word vector after encoding, α, β, γ are balance factors, α balances the balance between the original query term and all expansion terms, β balances the balance between the current query term feedback document expansion terms and historical expansion terms, γ balances the balance between the historical query document expansion terms and historical reply expansion terms, N1, N2 are the total number of feedback documents for each feedback extension term, N3 is a document reply balance parameter, which simulates the number of reply feedback documents; Then use SimSCE to calculate Q′ k The semantic similarity between the document and sim(Q′ k , d i ), where cosine similarity is used for calculation, according to sim(Q′ k , d i ) Sort each document and obtain the sorting result.