Information retrieval method and device, electronic equipment and storage medium
Through dynamic attenuation memory model and weighted search technology, the problem of memory loss in information retrieval is solved, more efficient and accurate information retrieval is achieved, and context connection effect and recall rate are improved.
Patent Information
- Application Number
- CN202510562233.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2025-08-12
AI Technical Summary
Existing information relies on a single search source and static memory mechanism, resulting in limited search breadth and depth, and insufficient timeliness and accuracy.
The dynamic attenuation memory model is used to determine the historical information corresponding to the query input information, and weighted search and results are fused according to the weight values of different query types to obtain the target search results.
It improves the context connection effect, improves the recall and accuracy of searches, reduces response delays, and enhances the efficiency of search results.
Smart Images

Figure CN120470186A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the fields of artificial intelligence and large model technology, and in particular to an information retrieval method, device, electronic device and storage medium. Background Art
[0002] Existing information retrieval often relies on a single search source, a limitation that significantly restricts the breadth and depth of retrieval. Furthermore, static memory mechanisms are often employed. Once information is entered, it is difficult to reflect the latest knowledge changes unless it is manually updated. This significantly compromises the timeliness and accuracy of information. Summary of the Invention
[0003] The purpose of this application is to solve one of the technical problems in the related art at least to a certain extent.
[0004] To this end, the first purpose of this application is to propose an information retrieval method to achieve efficient and accurate information retrieval.
[0005] The second objective of this application is to provide an information retrieval device.
[0006] The third objective of this application is to provide an electronic device.
[0007] The fourth object of this application is to provide a computer-readable storage medium.
[0008] A fifth object of this application is to provide a computer program product.
[0009] To achieve the above-mentioned purpose, the first embodiment of the present application proposes an information retrieval method, comprising: receiving query input information from a client;
[0010] Determining first historical information corresponding to the query input information through a dynamic decay memory model;
[0011] Determining respective weight values of different query types corresponding to the query input information;
[0012] Performing a weighted search based on the query input information, the first historical information, and the weight value to obtain candidate search results corresponding to the query type;
[0013] The candidate search results are fused to obtain a target search result, and the target search result is fed back to the client.
[0014] To achieve the above-mentioned purpose, a second embodiment of the present application proposes an information retrieval device, comprising: a receiving module, configured to receive query input information from a client;
[0015] A first determining module, configured to determine first historical information corresponding to the query input information through a dynamic decay memory model;
[0016] A second determination module is used to determine the weight values of different query types corresponding to the query input information;
[0017] a retrieval module, configured to perform a weighted search based on the query input information, the first historical information, and the weight value to obtain candidate search results corresponding to the query type;
[0018] The fusion module is used to fuse the candidate retrieval results to obtain a target retrieval result, and feed back the target retrieval result to the client.
[0019] To achieve the above-mentioned purpose, the third aspect embodiment of the present application proposes an electronic device, comprising: a processor; and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the processor can execute the information retrieval method described in the first aspect embodiment above.
[0020] To achieve the above-mentioned purpose, the fourth embodiment of the present application proposes a computer-readable storage medium having a computer program stored thereon, wherein the computer instructions are used to enable the computer to execute the information retrieval method described in the above-mentioned first embodiment.
[0021] To achieve the above-mentioned purpose, the fifth embodiment of the present application proposes a computer program product, including a computer program, which implements the information retrieval method described in the above-mentioned first embodiment when executed by a processor.
[0022] The information retrieval method, device, electronic device and storage medium provided by the present application receive query input information sent by the client, and use a dynamic decay memory model to determine the first historical information corresponding to the query input information, and determine the weight values corresponding to different query types, so that a weighted search can be performed based on the query input information, the first historical information and the weight value to obtain multiple candidate search results, and the candidate search results are fused to obtain the target search result, and fed back to the client. Therefore, using a dynamic decay memory model to determine historical information and using historical information for retrieval can solve the problem of memory loss and improve the context connection effect. By performing retrieval of multiple query types, the recall rate of the retrieval can be improved, and the response delay can be reduced, further improving the accuracy and efficiency of the retrieval results.
[0023] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0025] Figure 1 A flowchart of an information retrieval method provided in an embodiment of the present application;
[0026] Figure 2 A flowchart of another information retrieval method provided in an embodiment of the present application;
[0027] Figure 3 A flowchart of another information retrieval method provided in an embodiment of the present application;
[0028] Figure 4 Provided for the embodiment of this application is a schematic diagram of a weighted search process;
[0029] Figure 5 An interactive diagram based on a weighted search process provided in an embodiment of the present application;
[0030] Figure 6 A schematic diagram of the information retrieval process provided in an embodiment of the present application;
[0031] Figure 7 A schematic diagram of the structure of an information retrieval device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0032] The following describes in detail embodiments of the present application, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0033] The information retrieval method and apparatus according to the embodiments of the present application will be described below with reference to the accompanying drawings.
[0034] Figure 1 is a flow chart of an information retrieval method provided according to an embodiment of the present application, such as Figure 1 As shown, the information retrieval method of the embodiment of the present application includes but is not limited to the following steps:
[0035] S101, receiving query input information from the client.
[0036] It should be noted that the execution subject of the information retrieval method provided in the embodiments of the present application is an electronic device, which may be a terminal device. Optionally, the terminal device may be a mobile electronic device or a non-mobile electronic device. For example, the mobile electronic device may be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc., and the non-mobile electronic device may be a personal computer (PC), a television, etc. The embodiments of the present application do not specifically limit this.
[0037] In some embodiments, the query input information refers to the information input by the user on the client. The user inputs the information to be queried on the client, and the client sends the information input by the user as the query input information to the server.
[0038] For example, if a user inputs "introduce the history of the development of artificial intelligence" in the client, the client will send "introduce the history of the development of artificial intelligence" as query input information to the server, so that the server can receive the query input information of the client.
[0039] Optionally, the user may input information on the client through text, voice or other forms, and the client then sends the query input information to the server.
[0040] S102: Determine first historical information corresponding to the query input information through a dynamic decay memory model.
[0041] In some embodiments, in order to improve the accuracy of information retrieval and avoid the separation between the currently input query input information and the historical information, the first historical information corresponding to the query input information can be obtained to retrieve the query input information in combination with the first historical information.
[0042] In some embodiments, the first historical information corresponding to the query input information can be determined using a dynamic decay memory model. The dynamic decay memory model is a model that combines time factors and memory decay characteristics, taking into account the impact of time factors on memory. The model can reflect the process of memory changes over time, including memory enhancement, retention, and decay. "Decay" in the model refers to the weakening of memory strength. This decay may be affected by a variety of factors, such as the passage of time, the number of repetitions, the intensity of the stimulus, etc.
[0043] In some embodiments, the dynamic decay memory model may obtain all historical information associated with the client and determine a weight value corresponding to the first historical information, so as to determine the first historical information from the historical information according to the weight value.
[0044] In some embodiments, the first historical information includes conversation-level memory, domain-level memory, and user-level memory, namely, historical conversation information, historical knowledge graphs, and historical user profiles. For example, the historical information may include 10 rounds of conversation information from the input.
[0045] In some embodiments, a decay weight of the memory may be calculated according to time, and the weight may be used as a weight value corresponding to the first historical information, so as to determine the first historical information according to the weight value.
[0046] S103: Determine the weight values of different query types corresponding to the query input information.
[0047] In some embodiments, historical weight values corresponding to historical query input information may be obtained, and the historical weight values may be averaged to obtain respective weight values of different query types corresponding to the query input information.
[0048] In some embodiments, user configuration information may also be received, and weight values of different query types corresponding to the query input information may be determined based on weight configuration information carried in the configuration information.
[0049] In some embodiments, query types include semantic queries, relational queries, and temporal queries.
[0050] In some embodiments, for each round of query input information, the weight values of different query types corresponding thereto are also different.
[0051] For example, taking semantic query as an example, its historical weight values are 0.6, 0.3, and 0.6 respectively. By averaging the historical weight values, it can be determined that the weight value of the semantic query corresponding to the query input information of this round is 0.5.
[0052] S104: Perform weighted search based on the query input information, the first historical information, and the weight value to obtain candidate search results corresponding to the query type.
[0053] In some embodiments, the query time corresponding to different query types can be determined according to the weight value, and according to the query time corresponding to each query type, a search is performed based on the query input information and the first historical information to obtain candidate search results corresponding to the query type.
[0054] In some embodiments, a search prompt word may be generated based on the query input information and the first historical information, so that the query input information is searched based on the search prompt word to obtain contextually coherent and accurate candidate search results.
[0055] S105: Fusing the candidate search results to obtain a target search result, and feeding back the target search result to the client.
[0056] In some embodiments, weight values corresponding to candidate search results can be determined. That is, the weight values of different query types can be used as the weight values of their corresponding candidate searches. For example, if the weight value of a semantic query is 0.6, the weight value of a relational query is 0.3, and the weight value of a time-sensitive query is 0.1, then the weight value of the candidate search result corresponding to the semantic query is determined to be 0.6, the weight value of the candidate search result corresponding to the relational query is 0.3, and the weight value of the candidate search result corresponding to the time-sensitive query is 0.1.
[0057] Furthermore, the candidate retrieval results may be fused according to their corresponding weight values to obtain the target retrieval result.
[0058] In some embodiments, a cross-modal attention fusion algorithm can be used to fuse the candidate search results to obtain a target search result. The target search result can be obtained by linearly transforming the candidate search results to obtain a vector representation corresponding to the candidate search results, and then fusing the vector representation with the cross-modal attention fusion algorithm.
[0059] Alternatively, the process of the cross-modal attention fusion algorithm can be expressed as:
[0060]
[0061] Among them, Q, K, V are the vector representations corresponding to the candidate retrieval results, d k is the dimension of K, Used to scale the attention score to prevent it from being too large or too small.
[0062] Among them, Q and K are used to calculate the attention score, and V is used to provide the final information representation.
[0063] In some embodiments, before feeding back the target retrieval result to the client, the target retrieval result may be verified, and the target retrieval result may be fed back to the client after passing the verification.
[0064] In some embodiments, the target search results may be subjected to logic verification, fact verification, security verification, and format verification.
[0065] In the information retrieval method provided in the embodiment of the present application, by receiving the query input information sent by the client, and using the dynamic decay memory model to determine the first historical information corresponding to the query input information, and determining the weight values corresponding to different query types, a weighted search can be performed based on the query input information, the first historical information and the weight value to obtain multiple candidate search results, and the candidate search results are fused to obtain the target search result, and fed back to the client. Thus, using the dynamic decay memory model to determine the historical information and using the historical information for retrieval can solve the problem of memory loss and improve the context connection effect. By performing retrieval of multiple query types, the recall rate of the retrieval can be improved, and the response delay can be reduced, further improving the accuracy and efficiency of the retrieval results.
[0066] Figure 2 is a flow chart of an information retrieval method provided according to an embodiment of the present application, such as Figure 2 As shown, the information retrieval method of the embodiment of the present application includes but is not limited to the following steps:
[0067] S201: Receive query input information from the client.
[0068] In the embodiment of the present application, the implementation method of step S201 can be implemented by any method in the various embodiments of the present application, which is not limited here and will not be repeated.
[0069] S202: Determine the time difference between the query input information and the previous round of query input information.
[0070] In some embodiments, by determining the time information corresponding to the previous round of query input information and obtaining the time information corresponding to the query input information, and calculating the difference between the two time information, the time difference between the query input information and the previous round of query input information can be determined.
[0071] S203: Obtain a preset initial weight value of the first historical information, and determine a target weight value of the first historical information based on the time difference and the initial weight value through a dynamic attenuation memory model.
[0072] It is understandable that as the time difference increases, the target weight value will decay exponentially, indicating that the importance of earlier memories in subsequent processing will gradually decrease.
[0073] In some embodiments, by determining a preset initial weight value and a time difference of the first historical information, a target weight value of the first historical information can be determined through a dynamic decay memory model.
[0074] Optionally, the dynamic decay memory model can obtain an exponential decay curve and determine the weight values corresponding to different time differences based on the curve, so that the target weight value of the first historical information can be determined based on the time difference between the query input information and the previous round of query input information.
[0075] S204: Determine first historical information corresponding to the query input information based on the target weight value.
[0076] In some embodiments, a historical information set associated with a client may be obtained, the historical information set including at least the first historical information. Optionally, when the client sends query input information for retrieval, the query input information carries the client's identification information, and the retrieval results corresponding to the query input information also carry the client's identification information. The historical information set associated with the client may then be determined based on the client's identification information.
[0077] In some embodiments, the target weight value may represent the importance of the historical information, and the historical conversation information, the historical knowledge graph, and the historical user portrait may be determined from the historical information set as the first historical information based on the target weight value.
[0078] In some embodiments, the first historical information may be determined from the historical information set based on the target weight value or based on the time information of the historical information in the historical information set in combination with the target weight value.
[0079] In some embodiments, by determining the first moment of query input information and determining the second moment of each historical information in the historical information set, the difference between the first moment and the second moment is further determined, and then the first historical information can be determined from the historical information set based on the target weight value and the difference between the first moment and the second moment.
[0080] That is, in response to the target weight value being less than the weight threshold, a set number of historical conversation information, historical knowledge graphs, and historical user portraits whose difference is less than the difference threshold are obtained from the historical information set as the first historical information.
[0081] For example, five rounds of historical dialogues whose differences with the query input information are less than a difference threshold may be selected as the historical dialogue information.
[0082] S205: Determine the weight values of different query types corresponding to the query input information.
[0083] In the embodiment of the present application, the implementation method of step S205 can be implemented by any method in the various embodiments of the present application, which is not limited here and will not be repeated.
[0084] S206: Perform weighted search based on the query input information, the first historical information, and the weight value to obtain candidate search results corresponding to the query type.
[0085] In the embodiment of the present application, the implementation method of step S206 can be implemented by using any method in the various embodiments of the present application, which is not limited here and will not be repeated.
[0086] S207: Fusing the candidate search results to obtain a target search result, and feeding back the target search result to the client.
[0087] In the embodiment of the present application, the implementation method of step S207 can be implemented by any method in the various embodiments of the present application, which is not limited here and will not be repeated.
[0088] In the information retrieval method provided in the embodiments of the present application, a dynamic decay memory model is used to determine a target weight value for the first historical information based on an initial weight value according to the time difference between the query input information and the previous round of query input information. Thus, the first historical information can be determined based on the target weight value. Thus, using the dynamic decay memory model to determine historical information and using this historical information for retrieval can resolve the problem of memory loss, improve the effect of contextual cohesion, further enhance the accuracy of information retrieval, and improve the precision of retrieval results.
[0089] Figure 3 is a flow chart of an information retrieval method provided according to an embodiment of the present application, such as Figure 3 As shown, the information retrieval method of the embodiment of the present application includes but is not limited to the following steps:
[0090] S301: Receive query input information from the client.
[0091] In the embodiment of the present application, the implementation method of step S301 can be implemented by any method in the various embodiments of the present application, which is not limited here and will not be repeated.
[0092] S302: Determine first historical information corresponding to the query input information through a dynamic decay memory model.
[0093] In the embodiment of the present application, the implementation method of step S302 can be implemented by any method in the various embodiments of the present application, which is not limited here and will not be repeated.
[0094] S303: Determine the weight values of different query types corresponding to the query input information.
[0095] In some embodiments, the weight values of different query types corresponding to the query input information may be determined based on historical weight values corresponding to different query types. The weight values of different query types corresponding to the query input information may also be determined based on weight configuration information.
[0096] In some embodiments, by obtaining historical query input information sent by the client and determining the historical weight values of different query types corresponding to the historical query input information, the weight values of different query types corresponding to the query input information can be determined based on the historical weight values. Optionally, the historical weight values can be averaged to obtain the weight values of different query types corresponding to the query input information.
[0097] In some embodiments, weight configuration information of the client may be received, and based on the weight configuration information, weight values of different query types corresponding to the query input information may be determined.
[0098] S304: Optimize the query input information based on the first historical information to obtain target query information.
[0099] In some embodiments, the target query information can be obtained by adding the historical conversation information, historical knowledge graph, and historical user portrait in the first historical information to the query input information, so that the target query information includes the first historical information.
[0100] S305: Determine a search method corresponding to each query type, and determine a search duration of the search method based on the weight value.
[0101] In some embodiments, the query types include semantic queries, relational queries, and time-sensitive queries. In response to the query type being a semantic query, the retrieval method corresponding to the query type is determined to be vector retrieval; in response to the query type being a relational query, the retrieval method corresponding to the query type is determined to be graph retrieval; in response to the query type being a time-sensitive query, the retrieval method corresponding to the query type is determined to be streaming retrieval.
[0102] Furthermore, the query type weight value can be used as the weight value of the corresponding search method, so that the search duration corresponding to the search method can be determined based on the weight value. Optionally, the correspondence between different weight values and different search durations can be pre-set, and after the weight value is determined, the search duration of the search method can be determined by querying the correspondence.
[0103] S306 , for each query type, searching the target query information according to the search method corresponding to the query type within the search duration, obtaining candidate search results corresponding to the query type, and determining weight values corresponding to the candidate search results.
[0104] In some embodiments, for each query type, within the search duration corresponding to each query type, the target query information is searched according to the search method corresponding to the query type, and a candidate search result corresponding to the query type can be obtained.
[0105] For example, for semantic queries, the corresponding retrieval method is vector retrieval, and the target query information can be vector-searched within 100ms to obtain candidate retrieval results corresponding to the semantic query.
[0106] In some embodiments, the weight value corresponding to the query type can be used as the weight value corresponding to the candidate search result. For example, if the weight value of the semantic query is 0.6, the weight value of the relational query is 0.3, and the weight value of the time-sensitive query is 0.1, then the weight value of the candidate search result corresponding to the semantic query is determined to be 0.6, the weight value of the candidate search result corresponding to the relational query is 0.3, and the weight value of the candidate search result corresponding to the time-sensitive query is 0.1.
[0107] In some embodiments, in order to improve the efficiency of retrieval, the retrieval process can also be optimized according to the actual retrieval time, by obtaining the actual retrieval time of the vector retrieval and determining the time difference between the retrieval time of the vector retrieval and the actual retrieval time, in response to the time difference exceeding the set time threshold, the timeout degradation mechanism is triggered, and the timeout degradation mechanism is used to use the cached data generated during the retrieval as the candidate retrieval result.
[0108] S307: Fusing the candidate search results to obtain a target search result, and feeding back the target search result to the client.
[0109] In some embodiments, the candidate search results may be fused based on their weights. Optionally, the candidate search results may be sorted based on their corresponding weights. Based on the sorting results, candidate search results to be fused are determined from the candidate search results, and the candidate search results to be fused are fused to obtain a target search result. The higher the candidate search result in the sorting results, the greater its corresponding weight.
[0110] In some embodiments, based on the sorting results, candidate retrieval results of a set data volume can be obtained from the candidate retrieval results as candidate retrieval results to be fused. Based on the sorting results, the candidate retrieval result with the largest weight value can be determined, and the candidate retrieval results to be fused of the first set data volume can be determined from the candidate retrieval results; based on the sorting results, the candidate retrieval results with a weight value less than the maximum weight value and greater than the minimum weight value can be determined, and the candidate retrieval results to be fused of the second set data volume can be determined from the candidate retrieval results; based on the sorting results, the candidate retrieval result with the smallest weight value can be determined, and the candidate retrieval results to be fused of the third set data volume can be determined from the candidate retrieval results. Wherein, the first set data volume is greater than the second set data volume and greater than the third set data volume.
[0111] Furthermore, after obtaining the target retrieval result, the target retrieval result may be subjected to multi-dimensional verification, and after passing the verification, the verified target retrieval result may be fed back to the client.
[0112] In some embodiments, the target retrieval results can be subjected to logic verification, fact verification, security verification and format verification to achieve multi-dimensional verification, and after the target retrieval results pass logic verification, fact verification, security verification and format verification, the target retrieval results are fed back to the client.
[0113] In the information retrieval method provided in the embodiments of this application, a weighted search is performed based on multiple query types to obtain corresponding candidate search results, and the candidate search results are then fused to obtain the target search results and fed back to the client, thereby improving the accuracy of the search. By performing searches based on multiple query types, the recall rate of the search can be improved and the response delay can be reduced. Information fusion can further improve the accuracy and efficiency of the search results.
[0114] Figure 4 The figure shows a schematic diagram of the weighted retrieval process. By obtaining query input information and determining the query type corresponding to the query input information, a search is performed according to the search method corresponding to each query type to obtain candidate retrieval results, and the target retrieval result is obtained by fusing the candidate retrieval results.
[0115] Figure 5 Shown is an interaction diagram of the weighted retrieval process. Figure 5 It includes a search engine, a vector library, a knowledge graph, and a data stream. Users enter query information through the client, and the search engine performs concurrent searches using multiple search methods based on the query type of the query input information. Figure 5In the example, concurrent search 1 performs a vector search in the vector library, obtains result A, and returns it to the search engine. Concurrent search 2 performs a graph search in the knowledge graph, obtains result B, and returns it to the search engine. Concurrent search 3 performs a streaming search in the data stream, obtains result C, and returns it to the search engine. The search engine sends results A, B, and C to the fusion module for fusion, resulting in the corresponding target search result.
[0116] Figure 6 The figure shows a flow chart of information retrieval. The query input information from the client is obtained and parsed using a semantic parser. The dynamic attenuation memory model then determines the first historical information based on the parsing results. Furthermore, the hybrid retrieval engine performs a weighted retrieval of the parsed results corresponding to the query input information and the first historical information to obtain multiple candidate retrieval results. These candidate retrieval results are then input into a knowledge amalgamator for fusion to obtain the target retrieval result. Furthermore, the verification center verifies the target retrieval result and, upon successful verification, provides feedback to the client.
[0117] Corresponding to the information retrieval methods proposed in the above-mentioned embodiments, an embodiment of the present application also proposes an information retrieval device. Since the information retrieval device proposed in the embodiment of the present application corresponds to the information retrieval methods proposed in the above-mentioned embodiments, the implementation method of the above-mentioned information retrieval method is also applicable to the information retrieval device proposed in the embodiment of the present application, and will not be described in detail in the following embodiments.
[0118] In order to implement the above embodiment, the present application also proposes an information retrieval device.
[0119] Figure 7 A schematic diagram of the structure of an information retrieval device provided in an embodiment of the present application.
[0120] like Figure 7 As shown, the information retrieval device 700 includes:
[0121] Receiving module 701, for receiving query input information from the client;
[0122] A first determining module 702 is configured to determine first historical information corresponding to the query input information using a dynamic decay memory model;
[0123] The second determination module 703 is used to determine the weight values of different query types corresponding to the query input information;
[0124] A retrieval module 704 is configured to perform a weighted search based on the query input information, the first historical information, and the weight value to obtain candidate search results corresponding to the query type;
[0125] The fusion module 705 is used to fuse the candidate search results to obtain the target search results and feed back the target search results to the client.
[0126] In a possible implementation of the embodiment of the present application, the first determining module 702 is further configured to:
[0127] Determine the time difference between the query input information and the previous round of query input information;
[0128] Obtaining a preset initial weight value of the first historical information, and determining a target weight value of the first historical information based on the time difference and the initial weight value through a dynamic attenuation memory model;
[0129] Based on the target weight value, first historical information corresponding to the query input information is determined.
[0130] In a possible implementation of the embodiment of the present application, the first determining module 702 is further configured to:
[0131] Obtaining a historical information set associated with the client, where the historical information set includes at least first historical information;
[0132] According to the target weight value, historical conversation information, historical knowledge graph and historical user portrait are determined from the historical information set as the first historical information.
[0133] In a possible implementation of the embodiment of the present application, the first determining module 702 is further configured to:
[0134] Determine a first moment of query input information, and determine a second moment of each historical information in the historical information set;
[0135] determining a difference between a first moment and a second moment;
[0136] In response to the target weight value being less than the weight threshold, a set number of historical conversation information, historical knowledge graphs, and historical user portraits whose difference is less than the difference threshold are obtained from the historical information set as the first historical information.
[0137] In a possible implementation of the embodiment of the present application, the second determining module 703 is further configured to:
[0138] Obtain historical query input information sent by the client, and determine the historical weight values of different query types corresponding to the historical query input information;
[0139] Based on the historical weight values, determine the weight values of different query types corresponding to the query input information; or,
[0140] Receive weight configuration information from the client, and based on the weight configuration information, determine the respective weight values of different query types corresponding to the query input information.
[0141] In a possible implementation of the embodiment of the present application, the retrieval module 704 is further configured to:
[0142] Optimizing the query input information based on the first historical information to obtain target query information;
[0143] Determine the search method corresponding to each query type, and determine the search time of the search method based on the weight value;
[0144] For each query type, the target query information is retrieved according to the retrieval method corresponding to the query type within the retrieval time, candidate retrieval results corresponding to the query type are obtained, and weight values corresponding to the candidate retrieval results are determined.
[0145] In a possible implementation of the embodiment of the present application, the fusion module 705 is further configured to:
[0146] Sort the candidate search results based on the weight values corresponding to the candidate search results;
[0147] According to the ranking result, the candidate retrieval results to be fused are determined from the candidate retrieval results, and the candidate retrieval results to be fused are fused to obtain the target retrieval result.
[0148] In a possible implementation of the embodiment of the present application, the retrieval module 704 is further configured to:
[0149] In response to the query type being a semantic query, determining that the retrieval method corresponding to the query type is a vector retrieval; or,
[0150] In response to the query type being a relational query, determining that the search method corresponding to the query type is graph search; or,
[0151] In response to the query type being a time-sensitive query, it is determined that the retrieval mode corresponding to the query type is a streaming retrieval.
[0152] In a possible implementation of the embodiment of the present application, the retrieval module 704 is further configured to:
[0153] Obtaining the actual search duration of the vector search, and determining the difference between the search duration of the vector search and the actual search duration;
[0154] In response to the duration difference exceeding the set duration threshold, a timeout degradation mechanism is triggered, and the timeout degradation mechanism is used to use the cached data generated during the retrieval as a candidate retrieval result.
[0155] In a possible implementation of the embodiment of the present application, the fusion module 705 is further configured to:
[0156] The target retrieval results are multi-dimensionally verified, and after the verification is passed, the verified target retrieval results are fed back to the client.
[0157] In the information retrieval device provided in the embodiment of the present application, by receiving the query input information sent by the client, and using the dynamic decay memory model to determine the first historical information corresponding to the query input information, and determining the weight values corresponding to different query types, a weighted search can be performed based on the query input information, the first historical information and the weight value to obtain multiple candidate search results, and the candidate search results are fused to obtain the target search result, and fed back to the client. Thus, using the dynamic decay memory model to determine the historical information and using the historical information for retrieval can solve the problem of memory loss and improve the context connection effect. By performing retrieval of multiple query types, the recall rate of the retrieval can be improved, and the response delay can be reduced, further improving the accuracy and efficiency of the retrieval results.
[0158] It should be noted that the above explanations of the information retrieval method embodiment are also applicable to the information retrieval device of this embodiment, and will not be repeated here.
[0159] In order to implement the above embodiments, the present application also proposes an electronic device, comprising: a processor, and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the method provided by the above embodiments.
[0160] In order to implement the above embodiments, the present application also proposes a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the methods provided by the above embodiments.
[0161] In order to implement the above embodiments, the present application also proposes a computer program product, including a computer program, which implements the methods provided by the above embodiments when executed by a processor.
[0162] The collection, storage, use, processing, transmission, provision and application of user personal information involved in this application are in compliance with relevant laws and regulations and do not violate public order and good morals.
[0163] It is important to note that personal information collected from users should be used for legitimate and reasonable purposes and should not be shared or sold beyond these legitimate uses. Furthermore, such collection / sharing should be conducted only after receiving the user's informed consent, including but not limited to notifying the user to read the user agreement / user notice and sign an agreement / authorization that includes the relevant user information before using the feature. Furthermore, any necessary steps must be taken to safeguard and secure access to such personal information and ensure that others with access to personal information comply with its privacy policy and procedures.
[0164] This application contemplates providing implementation options for users to selectively block the use or access of personal information data. Specifically, this application contemplates providing hardware and / or software to prevent or block access to such personal information data. Risks can be minimized by limiting data collection and deleting data once it is no longer needed. Furthermore, where applicable, such personal information can be de-identified to protect user privacy.
[0165] In the descriptions of the foregoing embodiments, the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" mean that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are mutually inconsistent.
[0166] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features being referred to. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of such features. Throughout the description of this application, "plurality" means at least two, for example, two, three, etc., unless otherwise specifically defined.
[0167] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may be performed out of the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present application belong.
[0168] The logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing the logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (e.g., a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device). For purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection with one or more wires (electronic devices), a portable computer disk cartridge (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and programmable read-only memory (EPROM or flash memory), fiber optic devices, and a portable compact disc read-only memory (CDROM). Furthermore, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing it in another suitable manner if necessary, and then storing it in a computer memory.
[0169] It should be understood that various parts of the present application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used to implement: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0170] Those skilled in the art will understand that all or part of the steps in the method of the above embodiment can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiment.
[0171] In addition, the functional units in the various embodiments of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into a module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0172] The storage medium mentioned above may be a read-only memory, a magnetic disk, or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application. Persons skilled in the art may make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present application.
Claims
1. An information retrieval method, characterized in that: The method comprises: Receive query input information from the client; Determining first historical information corresponding to the query input information through a dynamic decay memory model; Determining respective weight values of different query types corresponding to the query input information; Performing a weighted search based on the query input information, the first historical information, and the weight value to obtain candidate search results corresponding to the query type; The candidate search results are fused to obtain a target search result, and the target search result is fed back to the client.
2. The method according to claim 1, characterized in that The determining, by using a dynamic attenuation memory model, first historical information corresponding to the query input information includes: Determining a time difference between the query input information and the previous round of query input information; Obtaining an initial weight value preset for the first historical information, and determining a target weight value for the first historical information based on the time difference and the initial weight value using the dynamic attenuation memory model; Based on the target weight value, first historical information corresponding to the query input information is determined.
3. The method according to claim 2, characterized in that The determining, based on the target weight value, first historical information corresponding to the query input information includes: Acquire a historical information set associated with the client, where the historical information set at least includes the first historical information; According to the target weight value, historical conversation information, historical knowledge graph and historical user portrait are determined from the historical information set as the first historical information.
4. The method according to claim 3, characterized in that The determining, based on the target weight value, historical conversation information, historical knowledge graph, and historical user portrait from the historical information set as the first historical information includes: Determining a first time of the query input information, and determining a second time of each historical information in the historical information set; determining a difference between the first moment and the second moment; In response to the target weight value being less than the weight threshold, a set number of the historical conversation information, historical knowledge graphs, and historical user portraits whose difference is less than the difference threshold are obtained from the historical information set as the first historical information.
5. The method according to claim 1, wherein Determining the weight values of different query types corresponding to the query input information includes: Obtaining historical query input information sent by the client, and determining historical weight values of different query types corresponding to the historical query input information; Determine the weight values of different query types corresponding to the query input information based on the historical weight values; or Receive weight configuration information from the client, and determine weight values of different query types corresponding to the query input information based on the weight configuration information.
6. The method according to claim 1, characterized in that The performing weighted search based on the query input information, the first historical information, and the weight value to obtain candidate search results corresponding to the query type includes: Optimizing the query input information based on the first historical information to obtain target query information; Determine a search method corresponding to each query type, and determine a search duration of the search method based on the weight value; For each query type, the target query information is searched according to the search method corresponding to the query type within the search duration to obtain the candidate search results corresponding to the query type, and the weight values corresponding to the candidate search results are determined.
7. The method according to claim 5, characterized in that The step of fusing the candidate search results to obtain a target search result includes: sorting the candidate search results based on the weight values corresponding to the candidate search results; According to the ranking result, candidate retrieval results to be fused are determined from the candidate retrieval results, and the candidate retrieval results to be fused are fused to obtain the target retrieval result.
8. The method according to claim 6, characterized in that The query types include semantic query, relation query and time-sensitive query, and determining the retrieval method corresponding to each query type includes: In response to the query type being the semantic query, determining that the retrieval method corresponding to the query type is vector retrieval; or, In response to the query type being the relationship query, determining that the search method corresponding to the query type is graph search; or, In response to the query type being a time-sensitive query, it is determined that a retrieval method corresponding to the query type is a streaming retrieval.
9. The method according to claim 8, characterized in that The method further comprises: Obtaining an actual search duration of the vector search, and determining a time difference between the search duration of the vector search and the actual search duration; In response to the duration difference exceeding a set duration threshold, a timeout degradation mechanism is triggered, and the timeout degradation mechanism is used to use the cached data generated during the retrieval as the candidate retrieval result.
10. The method according to claim 1, characterized in that Feedback of the target search result to the client includes: The target search result is multi-dimensionally verified, and after the verification is passed, the verified target search result is fed back to the client.
11. An information retrieval device, characterized in that: The device comprises: Receiving module, used to receive query input information from the client; A first determining module, configured to determine first historical information corresponding to the query input information through a dynamic decay memory model; A second determination module is used to determine the weight values of different query types corresponding to the query input information; a retrieval module, configured to perform a weighted search based on the query input information, the first historical information, and the weight value to obtain candidate search results corresponding to the query type; The fusion module is used to fuse the candidate retrieval results to obtain a target retrieval result, and feed back the target retrieval result to the client.
12. An electronic device, characterized in that: include: a processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 10 when executed by a processor.
14. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 10 when being executed by a processor.