Adjustment method, device, electronic device, medium and product of query system
By optimizing query strategies through simulated annealing algorithm and user feedback, the problem of low adaptability of the query system was solved, and query accuracy and user experience were improved.
Patent Information
- Application Number
- CN202510772664.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-11
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2045-06-11
AI Technical Summary
The query system's preset query strategies have low adaptability, resulting in low query accuracy. Users need to manually adjust query data or strategies, which reduces user experience.
The query strategy group is adjusted through the simulated annealing algorithm, and the query system is optimized in combination with user feedback information. The target query strategy group is determined and the initial strategy group is replaced to gradually adapt to user behavior.
It improves the accuracy of the query system, lowers the threshold for user adjustments, and improves user experience.
Smart Images

Figure CN120296036B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to methods, devices, electronic devices, media, and products for adjusting a query system. Background Art
[0002] The query system processes the query data to be queried, obtains documents associated with the query data, inputs the documents into the pre-trained model, and obtains query results corresponding to the query data to realize the query for the query data.
[0003] However, in the related art, the query system performs detection and processing through a preset query strategy, and the preset query strategy has the problem of low adaptability, resulting in the problem of low query accuracy of the query system. Summary of the Invention
[0004] The present application provides a query system adjustment method, device, electronic device, medium and product to at least solve the problem of low query accuracy in related technologies.
[0005] The present application provides a method for adjusting a query system, comprising: receiving a query request sent by a user terminal, the query request including data to be queried; determining an initial query strategy group of an initial query system based on the query request; adjusting the initial query strategy group using a simulated annealing algorithm to obtain multiple query strategy groups to be selected; determining a target query strategy group from the multiple query strategy groups to be selected, generating a query result corresponding to the data to be queried using the target query strategy group, and obtaining multiple user feedback information corresponding to the query result; and adjusting the initial query system based on the multiple user feedback information and the target query strategy group to obtain an adjusted query system.
[0006] The present application also provides an adjustment device for a query system, comprising: a receiving module for receiving a query request sent by a user terminal, the query request including data to be queried; a determining module for determining an initial query strategy group of an initial query system based on the query request; an adjusting module for adjusting the initial query strategy group through a simulated annealing algorithm to obtain a plurality of query strategy groups to be selected; a generating module for determining a target query strategy group from the plurality of query strategy groups to be selected, generating a query result corresponding to the data to be queried through the target query strategy group, and obtaining a plurality of user feedback information corresponding to the query result; and an optimizing module for adjusting the initial query system based on the plurality of user feedback information and the target query strategy group to obtain an adjusted query system.
[0007] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned query system adjustment methods when executing the computer program.
[0008] The present application also provides a non-volatile computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned query system adjustment methods are implemented.
[0009] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned query system adjustment methods when executed by a processor.
[0010] Through this application, the query strategy group in the query system can be adjusted according to user feedback information to make the query strategy group adapt to the user's behavior, thereby gradually optimizing the query system to improve query accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0012] Figure 1 A schematic diagram of an application scenario of a query system adjustment method provided in an embodiment of the present application;
[0013] Figure 2 A flowchart of a method for adjusting a query system provided in an embodiment of the present application;
[0014] Figure 3 A flowchart of a method for adjusting a query system provided in an embodiment of the present application;
[0015] Figure 4 A schematic diagram of a historical policy usage record provided in an embodiment of the present application;
[0016] Figure 5 A schematic diagram of feedback information provided in an embodiment of the present application;
[0017] Figure 6 A schematic diagram of the combination of the multi-arm selection algorithm and the simulated annealing algorithm provided in an embodiment of the present application;
[0018] Figure 7 A schematic diagram of the structure of an adjustment device for a query system provided in an embodiment of the present application;
[0019] Figure 8A schematic diagram of the structure of an adjustment device for a query system provided in an embodiment of the present application;
[0020] Figure 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0021] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0022] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0023] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, processing, transmission, provision, disclosure and application of the relevant data comply with the relevant laws, regulations and standards of the relevant countries and regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0024] In addition, this application involves conducting big data analysis of user information (including but not limited to personal biometrics, identity data, consumption data, asset data, electronic terminal operation data, etc.), and using artificial intelligence technology to make automated decisions, and making technical solutions that have a significant impact on personal rights and interests based on the results of automated decisions. The application provides users with corresponding operation entrances for them to choose to agree or reject the results of automated decisions; if the user chooses to reject, the expert decision-making process will be entered.
[0025] Exemplarily, the query system outputs corresponding query results based on the user's query data. For example, if the query data is a question, the query result is the answer to the question. The query system operates in two steps: searching for documents related to the query data and mapping the relevant documents using a pre-trained model to obtain the query results. The query system executes the query strategy to retrieve documents related to the query data from the document library.
[0026] It can be understood that the higher the relevance of the documents queried by the query system to the data to be queried, the more accurate the query results output by the pre-trained model.
[0027] In related technologies, query systems execute pre-set query strategies, which are incapable of adapting to the query habits of different users. This results in documents found by the query system being less relevant to the data being searched, leading to low accuracy in the query results. Users are required to readjust their search data or query strategies based on the query results, which increases the user experience and reduces the user experience.
[0028] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0029] In conjunction with the specific application environment architecture or specific hardware architecture on which the execution of the query system adjustment method depends, the specific application environment architecture or specific hardware architecture is described here. Figure 1 , Figure 1 This is a schematic diagram of the application of the query system adjustment method. The user sends the query data to the query system. The query system uses the query strategy to query the query data and obtain relevant documents. The query system uses the pre-trained model to map the relevant documents to obtain the query results and sends the query results to the user. The user determines whether to continue query processing based on the query results.
[0030] Figure 2 A flow chart of the method for adjusting the query system provided in the embodiment of the present application is shown as follows: Figure 2 As shown, the embodiment of the present application provides a method for adjusting a query system, and the method is described in detail as follows:
[0031] S201: Receive a query request sent by a user terminal, where the query request includes data to be queried.
[0032] Exemplarily, the query request is used to trigger the query system to perform a query, and the data to be queried is the basis for the query system to perform the query.
[0033] Exemplarily, a user may interact with a user terminal, and the user terminal generates data to be queried based on content input by the user, and initiates a query request to the query system.
[0034] For example, the data to be queried may be a question (e.g., what will the weather be like tomorrow) or an instruction (e.g., generate an argumentative essay), and the query system uses different strategies to perform queries based on different data to be queried.
[0035] S202: Determine an initial query strategy group of the initial query system according to the query request.
[0036] Exemplarily, the initial query system is the current state of the query system, and the initial query policy group is the query policy group currently used by the initial query system.
[0037] Exemplarily, the initial query system uses multiple query strategy groups, each query strategy group is adapted to a different data type, and the initial query strategy group is a query strategy group adapted to the data to be queried sent by the user terminal.
[0038] Exemplarily, the initial query strategy group includes at least one query strategy. Query strategies include, but are not limited to, at least one of the following: vector query, keyword query, or graph query. Each query strategy is suitable for different data types. Combining multiple query strategies to create an initial query strategy group can enable comprehensive multi-dimensional queries to improve query accuracy.
[0039] For example, for an initial query strategy group including multiple query strategies, the multiple query strategies may be mixed in proportion, for example, the vector query strategy accounts for 70% and the keyword query strategy accounts for 30% in the initial query strategy group.
[0040] S203: Adjust the initial query strategy group using a simulated annealing algorithm to obtain multiple query strategy groups to be selected.
[0041] For example, the simulated annealing algorithm (SA) is used to find an approximate global optimal solution in a large-scale search space.
[0042] For example, the initial query strategy group may not be the most suitable query strategy group for the user. A simulated annealing algorithm is used to fine-tune the initial query strategy group to obtain multiple candidate query strategy groups. By evaluating each of the multiple candidate query strategy groups, a query strategy group that is suitable for the user is determined, thereby improving query accuracy.
[0043] For example, the initial query strategy group is adjusted using multiple adjustment methods to obtain multiple candidate query strategy groups, where each candidate query strategy group corresponds to an adjustment method. Using multiple adjustment methods, the initial query strategy group can be adjusted from different dimensions to find a global optimal solution, thereby improving the accuracy of the adjustment.
[0044] S204: Determine a target query strategy group from the multiple query strategy groups to be selected, generate a query result corresponding to the to-be-queried data using the target query strategy group, and obtain multiple user feedback information corresponding to the query result.
[0045] Exemplarily, a target query strategy group is obtained by screening from a plurality of candidate query strategy groups, and the target query strategy group is a query strategy group used to execute a query request. By executing the target query strategy group, it can be determined whether the target query strategy group is suitable for the user.
[0046] For example, user feedback information can be user interaction behaviors on the user terminal, such as the length of time the user stays on the user terminal interface, the controls the user clicks on the user terminal interface (the controls can indicate approval or disapproval of the query results), etc. User feedback information can reflect whether the query results meet the user's expectations, and the query system can be adjusted based on the user feedback information.
[0047] Combined with the scenario example, the query system executes the target query strategy group, queries the document library to obtain relevant documents, inputs the relevant documents into the pre-trained model, and obtains the corresponding query results.
[0048] S205 : Adjust the initial query system according to the multiple user feedback information and the target query strategy group to obtain an adjusted query system.
[0049] For example, if the target query strategy group is more suitable for the user, the initial query strategy group is replaced by the target query strategy group to obtain an adjusted query system. Otherwise, the target query strategy group is deleted.
[0050] Exemplarily, whether the query result meets the user's expectations is determined through multiple user feedback information, and whether the target query strategy group is suitable for the user is indirectly determined based on whether the query result meets the user's expectations, thereby determining whether to retain the target query strategy group.
[0051] Exemplarily, the query system is adjusted to continuously perform iterative adjustments to gradually obtain a query system that is more suitable for the user.
[0052] Based on the scenario examples, adjust the query system to better suit the user. Use the adjusted query system in subsequent query requests. Iterate the above adjustments during use to gradually adapt the query system to the user, thereby improving query accuracy.
[0053] The adjustment method of the query system provided in the embodiment of the present application receives a query request sent by a user end, wherein the query request includes data to be queried; determines an initial query strategy group of the initial query system according to the query request; adjusts the initial query strategy group through a simulated annealing algorithm to obtain multiple query strategy groups to be selected; determines a target query strategy group from the multiple query strategy groups to be selected, generates query results corresponding to the data to be queried through the target query strategy group, and obtains multiple user feedback information corresponding to the query results; adjusts the initial query system according to the multiple user feedback information and the target query strategy group to obtain an adjusted query system. The above scheme adjusts the query strategy group in the query system according to the user feedback information so that the query strategy group adapts to the user's behavior, thereby gradually optimizing the query system to improve the query accuracy.
[0054] Based on any of the above embodiments, Figure 3 , the detailed process of the query system adjustment method is explained.
[0055] Figure 3 This is a flow chart of a method for adjusting a query system provided in an embodiment of the present application. Figure 3 As shown, the method includes:
[0056] S301: Receive a query request sent by a user terminal, where the query request includes data to be queried.
[0057] It should be noted that the execution process of S301 refers to S201 and will not be repeated here.
[0058] S302: Determine an initial query strategy group of the initial query system according to the query request.
[0059] A feasible implementation method is to determine the initial query strategy group by the following method: determining the target data type of the data to be queried; determining the mapping relationship between the data type and the query strategy group; and determining the initial query strategy group based on the target data type and the mapping relationship.
[0060] Exemplarily, the mapping relationship includes query strategy groups corresponding to various data types, and the query strategy group corresponding to the target data type in the mapping relationship is determined as the initial query strategy group.
[0061] Combined with the scenario example, each query strategy group is adapted to the corresponding data type. Querying through the initial query strategy group corresponding to the target data type can improve the accuracy of the query.
[0062] Optionally, the query system maintains a policy pool, which includes multiple query policy groups, and the initial query policy group is determined from the multiple query policy groups.
[0063] In this feasible implementation, the initial query strategy group adapted to the data to be queried can be accurately determined through the mapping relationship, thereby improving the accuracy of the query.
[0064] S303: Adjust the policy parameters and / or policy structure of the initial query policy group using a perturbation function to obtain multiple query policy groups to be selected.
[0065] Exemplarily, the policy parameter adjustment may be adjusting the proportion of each query policy in the initial query policy group.
[0066] In this scenario example, the initial query strategy group consists of 70% vector query strategies and 30% keyword query strategies. Using a perturbation function to perturb the weights of the vector query strategies, the resulting weight of the vector query strategy in one of the candidate query strategy groups is 68%. The corresponding keyword query strategy weight is adaptively adjusted to 32%. Multiple perturbation calculations are performed on each of the initial query strategy groups to generate multiple candidate query strategy groups.
[0067] Exemplarily, the policy structure adjustment may be adding, deleting, or replacing a query policy in the initial query policy group.
[0068] Optionally, you can adjust the strategy structure using the following formula:
[0069]
[0070] in, Indicates the initial query strategy group, Indicates adjusting the strategy structure of the initial query strategy group. Indicates the query strategy group to be selected. Represents the probability of strategy structure adjustment.
[0071] Combined with the scenario example, through probability The control performs random perturbation strategy and determines whether to perform strategy structure adjustment by probability. If yes, the query strategy group obtained by strategy structure adjustment is determined as the candidate query strategy group. If not, strategy structure adjustment is not performed.
[0072] Based on the above implementation methods, compared with deterministic methods, performing policy structure adjustment through random methods can explore the globally optimal query policy group, thereby improving the accuracy of queries.
[0073] S304: Determine a historical strategy usage record, where the historical strategy usage record includes multiple query strategy groups, feedback values corresponding to each query strategy group, and usage frequencies corresponding to each query strategy group.
[0074] For example, the feedback value is determined based on the user's satisfaction with the query result, indicating the degree of fit between the query result and the user. The usage frequency indicates how often the query system uses the query strategy group, indicating the query system's preference for the query strategy group.
[0075] S305: Determine multiple candidate feedback values and multiple candidate usage frequencies corresponding to multiple candidate query strategy groups according to historical strategy usage records.
[0076] Next, combine Figure 4 Describe the historical policy usage records.
[0077] Figure 4 This is a schematic diagram of the historical strategy usage record provided in the embodiment of this application. Figure 4 As shown, the historical policy usage record includes multiple query policy groups, multiple feedback values, and multiple usage frequencies, and the query policy groups, feedback values, and usage frequencies are in a one-to-one relationship. The corresponding multiple candidate feedback values and multiple candidate usage frequencies are determined by comparing the composition of the candidate query policy groups with the historical policy usage record.
[0078] Optionally, the feedback value and usage frequency of the new candidate query strategy group obtained through the adjustment process can be determined by using query strategy groups with similar parameters in historical strategy usage records. For example, if the vector query weight of the new candidate query strategy group is 65%, the feedback value and usage frequency of the candidate query strategy group can be determined by combining the feedback value and usage frequency of query strategy groups with vector query weights between 60% and 70% in historical strategy usage records.
[0079] S306 : performing calculations and processing using a multi-arm selection algorithm based on the multiple candidate feedback values and the multiple candidate usage frequencies to obtain multiple priority information corresponding to the multiple candidate query strategy groups.
[0080] Exemplarily, the priority information is used to determine the priority ranking of candidate query strategies, and the candidate query strategies with higher priority rankings should be used first.
[0081] For example, a higher feedback value for a candidate query strategy group indicates a greater user preference for it, resulting in a higher priority. The less frequently a candidate query strategy group is used, the more likely it is that the query system will use a locally optimal solution as the basis for its query strategy group, thereby omitting more accurate query strategy groups. This prioritizes less frequently used candidate query strategy groups to achieve a global optimal solution, thereby improving query accuracy.
[0082] S307: Determine a target query strategy group from multiple candidate query strategies based on multiple priority information.
[0083] Optionally, the target query strategy group can be determined using the following formula:
[0084]
[0085] in, Indicates the target query strategy group, Indicates one of the query strategy groups to be selected The feedback value of Indicates one of the query strategy groups to be selected Frequency of use, represents multiple candidate query strategy groups, S represents the total number of historical queries of the query system, and α is the coefficient that controls the degree of exploration.
[0086] Exemplarily, the candidate query strategy group with the highest priority is determined as the target query strategy group.
[0087] For example, It is used to give priority to strategies with fewer historical uses to avoid local optimal solutions.
[0088] Based on the above implementation, the target query group can be comprehensively determined from multiple dimensions by combining the candidate feedback values and the candidate usage frequencies, thereby improving the accuracy of the query.
[0089] A feasible implementation method can generate query results by the following method: executing the target query strategy group through the initial query system, performing query processing in the document library to obtain multiple candidate documents corresponding to the data to be queried; inputting the multiple candidate documents into the pre-trained model of the initial query system to obtain query results.
[0090] Exemplarily, the multiple candidate documents are documents related to the query data. Inputting multiple candidate documents into the pre-trained model can provide the pre-trained model with more samples. Multiple samples allow the pre-trained model to compare and self-check the query results, thereby improving query accuracy.
[0091] Optionally, multiple candidate documents are tagged with relevance and fed into a pre-trained model. This allows the pre-trained model to determine the reliability of the candidate documents based on their relevance, thereby improving the accuracy of the query results. Relevance indicates the degree of association between the candidate documents and the query data.
[0092] In this feasible implementation, multiple candidate documents are input into the pre-trained model so that the pre-trained model can compare and self-check the query results, thereby improving the query accuracy.
[0093] S308: Adjust the initial query system according to the multiple user feedback information and the target query strategy group to obtain an adjusted query system.
[0094] A feasible implementation method can obtain multiple user feedback information corresponding to the query results through the following method, including: determining a target duration based on the amount of text in the query results; sending the query results to the user end; and obtaining multiple user feedback information from the user end within the target duration.
[0095] Exemplarily, user feedback information indicates the user's degree of approval of the query results, and the user feedback information includes but is not limited to at least one of the following: the user clicking an approval control or a disapproval control on the user side, the length of time the user stays on any page of the query results on the user side, etc.
[0096] For example, the more text there is in the query results, the longer it takes for the user to read and analyze the query results, and the target duration should be extended accordingly.
[0097] Optionally, the acquired data is normalized to obtain user feedback information in numerical form.
[0098] Next, combine Figure 5 Describe the feedback information.
[0099] Figure 5 This is a schematic diagram of feedback information provided in the embodiment of the present application. Figure 5 As shown, after the query system generates a query result based on the query data sent by the user terminal, it sends the query result to the user terminal and adjusts the query system based on the feedback information of the user terminal on the query result.
[0100] In this feasible implementation, the target duration is determined based on the amount of text, which is consistent with the time required for users to read and analyze the query results, so that user feedback information accurately reflects the user's degree of agreement with the query results, thereby ensuring the accuracy of the query system adjustment.
[0101] A feasible implementation method can be adjusted and processed by the following method to obtain an adjusted query system, including: determining an initial feedback value corresponding to an initial query strategy group from historical strategy usage records; determining multiple weights corresponding to multiple user feedback information; determining a current learning rate; performing weighted calculation processing on multiple user feedback information according to the multiple weights to obtain a weighted calculation result corresponding to a target query strategy group; determining a target feedback value according to the weighted calculation result and the current learning rate, wherein the current learning rate is used to control the convergence speed of the target feedback value; comparing the target feedback value with the initial feedback value; if the target feedback value is greater than the initial feedback value, replacing the initial query strategy group with the target query strategy group to adjust the initial query system to obtain an adjusted query system; if the target feedback value is less than or equal to the initial feedback value, adjusting the initial query system through a simulated annealing algorithm to obtain an adjusted query system.
[0102] For example, if the learning rate is too high, the system will be overly sensitive to new user feedback, which may lead to frequent policy changes and difficulty in convergence. If the learning rate is too low, the system will learn too slowly from the feedback, which will affect the system's optimization efficiency. Dynamically adjusting the learning rate can balance learning speed and convergence speed.
[0103] For example, each user feedback information contributes differently to the user's approval of the query result, and the contribution is reflected by the weight. The weighted calculation process can integrate multiple user feedback information, thereby improving the accuracy of the adjustment.
[0104] Exemplarily, if the target feedback value is greater than the initial feedback value, it means that the target query strategy group is more suitable for the user, and the initial query strategy group is replaced by the target query strategy group.
[0105] Exemplarily, if the target feedback value is less than or equal to the initial feedback value, further judgment is performed to avoid a local optimal solution.
[0106] In this feasible implementation, by replacing the initial query strategy group with a target query strategy group that the user is more in favor of under preset conditions, the query system can be gradually optimized to improve the query accuracy of the query system.
[0107] A feasible implementation method can be to adjust the query system by the following method, including: calculating the acceptance probability value through a simulated annealing algorithm based on the target feedback value and the initial feedback value; if the acceptance probability value is greater than or equal to the probability threshold, replacing the initial query strategy group with the target query strategy group to adjust the initial query system and obtain the adjusted query system.
[0108] Exemplarily, the acceptance probability value is used to evaluate the feasibility of the target feedback value relative to the initial feedback value. If the acceptance probability value is greater than or equal to the probability threshold, it means that the feasibility of the target feedback value is high and the initial feedback value can be replaced by the target feedback value.
[0109] Optionally, the acceptance probability value is calculated using the following formula:
[0110]
[0111] in, represents the acceptance probability value, Indicates the target feedback value, represents the initial feedback value, and T represents the exploration coefficient.
[0112] For example, T decays over time, controlling the convergence rate of the adjustment process. The larger T is, the greater the probability of accepting the target feedback value is, and the adjustment process can explore more query strategy groups. The smaller T is, the smaller the probability of accepting the target feedback value is, and the adjustment process gradually converges.
[0113] Next, combine Figure 6 The combination of multi-arm selection algorithm and simulated annealing algorithm is explained.
[0114] Figure 6 This is a schematic diagram of the combination of the multi-arm selection algorithm and the simulated annealing algorithm provided in the embodiment of this application. Figure 6 As shown, the system receives a query request from a user, processes it using a perturbation function to obtain a target query strategy group, executes the query using the target query strategy group, and obtains feedback from the user. When the target feedback value is less than or equal to the initial feedback value, the simulated annealing algorithm calculates the acceptance probability. Based on the acceptance probability, the multi-arm selection algorithm updates the priority information. The next time a query request is executed, the updated priority information is used to implement iterative updates of the query system.
[0115] In this feasible implementation, when the target feedback value is less than or equal to the initial feedback value, the acceptance probability value is calculated by the simulated annealing algorithm to determine whether to use the target feedback value. Multiple feedback values can be explored to achieve the global optimal solution, thereby improving the accuracy of the query.
[0116] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0117] Figure 7 This is a schematic diagram of the structure of the adjustment device of the query system provided in the embodiment of the present application. Figure 7 As shown, the embodiment of the present application further provides an adjustment device for a query system. The adjustment device 70 for the query system may include: a receiving module 71, a determining module 72, an adjustment module 73, a generating module 74, and an optimizing module 75, wherein:
[0118] The receiving module 71 is configured to receive a query request sent by a user terminal, where the query request includes data to be queried.
[0119] The determination module 72 is configured to determine an initial query strategy group of the initial query system according to the query request.
[0120] The adjustment module 73 is used to adjust the initial query strategy group through a simulated annealing algorithm to obtain multiple query strategy groups to be selected.
[0121] The generating module 74 is configured to determine a target query strategy group from a plurality of candidate query strategy groups, generate a query result corresponding to the to-be-queried data using the target query strategy group, and obtain a plurality of user feedback information corresponding to the query result.
[0122] The optimization module 75 is used to adjust the initial query system according to the multiple user feedback information and the target query strategy group to obtain an adjusted query system.
[0123] Optionally, the receiving module 71 may execute Figure 2 S201 in the embodiment.
[0124] Optionally, the determination module 72 may execute Figure 2 S202 in the embodiment.
[0125] Optionally, the adjustment module 73 may execute Figure 2 S203 in the embodiment.
[0126] Optionally, the generation module 74 may execute Figure 2 S204 in the embodiment.
[0127] Optionally, the optimization module 75 may execute Figure 2 S205 in the embodiment.
[0128] It should be noted that the adjustment device of the query system shown in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0129] In a possible implementation, the adjustment module 73 is specifically configured to adjust the policy parameters and / or policy structure of the initial query policy group using a perturbation function to obtain a plurality of query policy groups to be selected.
[0130] Figure 8 This is a schematic diagram of the structure of an adjustment device for a query system provided in an embodiment of the present application. Figure 7 Based on the embodiment shown, Figure 8 As shown, the query system adjustment device 70 further includes: a screening module 76, an input module 77, an acquisition module 78, a replacement module 79, and a mapping module 710, wherein:
[0131] The screening module 76 is used to:
[0132] Determine a historical strategy usage record, where the historical strategy usage record includes multiple query strategy groups, feedback values corresponding to each query strategy group, and usage frequencies corresponding to each query strategy group;
[0133] Determining, based on historical strategy usage records, multiple candidate feedback values and multiple candidate usage frequencies corresponding to multiple candidate query strategy groups;
[0134] Based on multiple candidate feedback values and multiple candidate usage frequencies, a multi-arm selection algorithm is used to perform calculations and processing to obtain multiple priority information corresponding to multiple candidate query strategy groups;
[0135] A target query strategy group is determined from a plurality of candidate query strategies according to the plurality of priority information.
[0136] Input module 77, used for:
[0137] Execute the target query strategy group through the initial query system, perform query processing in the document library to obtain multiple candidate documents corresponding to the query data;
[0138] Multiple candidate documents are input into the pre-trained model of the initial query system to obtain the query results.
[0139] The acquisition module 78 is used to:
[0140] Determine the target duration based on the amount of text in the query results;
[0141] Send query results to the user end;
[0142] Obtain multiple user feedback information from the user end within the target duration.
[0143] Replacement module 79 for:
[0144] Determine the initial feedback value corresponding to the initial query strategy group from the historical strategy usage records;
[0145] Determine multiple weights corresponding to multiple user feedback information;
[0146] Determine the current learning rate;
[0147] Perform weighted calculation on multiple user feedback information according to multiple weights to obtain weighted calculation results corresponding to the target query strategy group;
[0148] The target feedback value is determined based on the weighted calculation result and the current learning rate. The current learning rate is used to control the convergence speed of the target feedback value.
[0149] Compare the target feedback value and the initial feedback value;
[0150] If the target feedback value is greater than the initial feedback value, the initial query strategy group is replaced by the target query strategy group to adjust the initial query system to obtain an adjusted query system;
[0151] If the target feedback value is less than or equal to the initial feedback value, the initial query system is adjusted by a simulated annealing algorithm to obtain an adjusted query system.
[0152] In a possible implementation, the replacement module 79 is specifically configured to:
[0153] According to the target feedback value and the initial feedback value, the acceptance probability value is calculated by the simulated annealing algorithm;
[0154] If the acceptance probability value is greater than or equal to the probability threshold, the initial query strategy group is replaced by the target query strategy group to adjust the initial query system to obtain an adjusted query system.
[0155] The mapping module 710 is configured to:
[0156] Determine the target data type of the data to be queried;
[0157] Determine the mapping relationship between data types and query strategy groups;
[0158] Determine the initial query strategy group based on the target data type and mapping relationship.
[0159] For the description of the features in the embodiment corresponding to the adjustment device of the query system, reference can be made to the relevant description of the embodiment corresponding to the adjustment method of the query system, which will not be repeated here.
[0160] Figure 9 This is a schematic diagram of the structure of the electronic device provided in this application. Figure 9 As shown, the electronic device 90 provided in this embodiment includes: at least one processor 901 and a memory 902. Optionally, the electronic device 90 further includes a communication component 903. The processor 901, the memory 902 and the communication component 903 are connected via a bus.
[0161] During the specific implementation process, at least one processor 901 executes the computer-executable instructions stored in the memory 902, so that the at least one processor 901 executes the above-mentioned query system adjustment method embodiment.
[0162] The specific implementation process of the processor 901 can be found in the above method embodiment. Its implementation principle and technical effects are similar and will not be repeated here in this embodiment.
[0163] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the application may be directly executed by a hardware processor or by a combination of hardware and software modules within the processor.
[0164] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage.
[0165] A bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. Buses can be categorized as address buses, data buses, and control buses. For ease of illustration, the buses in the drawings of this application are not limited to just one bus or just one type of bus.
[0166] An embodiment of the present application further provides a non-volatile computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above-mentioned query system adjustment method embodiments when running.
[0167] In an exemplary embodiment, the non-volatile computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0168] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of any of the above-mentioned query system adjustment method embodiments are implemented.
[0169] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above-mentioned query system adjustment method embodiments are implemented.
[0170] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0171] The above is a detailed introduction to the adjustment method, device, electronic device, medium and product of a query system provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A method for adjusting a query system, characterized in that: include: receiving a query request sent by a user terminal, wherein the query request includes data to be queried; determining an initial query strategy group of an initial query system according to a target data type of the query request; The initial query strategy group corresponds to the data type; The initial query strategy group includes at least one query strategy; Adjusting policy parameters and / or policy structure of the initial query policy group to obtain multiple query policy groups to be selected, wherein the policy parameter adjustment is to adjust the proportion of each query policy in the initial query policy group, and the policy structure adjustment is to add, delete or replace query policies in the initial query policy group; Determining a target query strategy group from the multiple query strategy groups to be selected, generating a query result corresponding to the to-be-queried data using the target query strategy group, and obtaining a plurality of user feedback information corresponding to the query result; Adjusting the initial query system according to the plurality of user feedback information and the target query strategy group to obtain an adjusted query system; Determining a target query strategy group from the multiple candidate query strategy groups includes: Determining a historical strategy usage record, wherein the historical strategy usage record includes a plurality of query strategy groups, a feedback value corresponding to each query strategy group, and a usage frequency corresponding to each query strategy group; Determining, based on the historical strategy usage records, a plurality of candidate feedback values and a plurality of candidate usage frequencies corresponding to the plurality of candidate query strategy groups; According to the multiple candidate feedback values and the multiple candidate usage frequencies, a multi-arm selection algorithm is used to perform calculation processing to obtain multiple priority information corresponding to the multiple candidate query strategy groups; The target query strategy group is determined from the multiple candidate query strategies according to the multiple priority information.
2. The method for adjusting the query system according to claim 1, characterized in that: Generating a query result corresponding to the to-be-queried data using the target query strategy group includes: Executing the target query strategy group through the initial query system, performing query processing in the document library to obtain multiple candidate documents corresponding to the data to be queried; The multiple candidate documents are input into a pre-trained model of the initial query system to obtain the query result.
3. The method for adjusting the query system according to claim 2, characterized in that: Acquiring multiple user feedback information corresponding to the query result, including: Determine a target duration based on the amount of text in the query result; Sending the query result to the user terminal; The plurality of user feedback information is obtained from the user terminal within the target duration.
4. The method for adjusting the query system according to claim 3, characterized in that: Adjusting the initial query system according to the plurality of user feedback information and the target query strategy group to obtain an adjusted query system, including: Determining an initial feedback value corresponding to the initial query strategy group from historical strategy usage records; Determining multiple weights corresponding to the multiple user feedback information; Determine the current learning rate; Performing weighted calculation processing on the plurality of user feedback information according to the plurality of weights to obtain a weighted calculation result corresponding to the target query strategy group; Determining a target feedback value based on the weighted calculation result and the current learning rate, wherein the current learning rate is used to control a convergence speed of the target feedback value; comparing the target feedback value and the initial feedback value; If the target feedback value is greater than the initial feedback value, replacing the initial query strategy group with the target query strategy group to adjust the initial query system to obtain the adjusted query system; If the target feedback value is less than or equal to the initial feedback value, the initial query system is adjusted using a simulated annealing algorithm to obtain the adjusted query system.
5. The method for adjusting the query system according to claim 4, characterized in that: The initial query system is adjusted by a simulated annealing algorithm to obtain the adjusted query system, including: Calculating an acceptance probability value using the simulated annealing algorithm according to the target feedback value and the initial feedback value; If the acceptance probability value is greater than or equal to the probability threshold, the initial query strategy group is replaced by the target query strategy group to adjust the initial query system to obtain the adjusted query system.
6. The method for adjusting the query system according to claim 1, characterized in that: The method further comprises: Determining the target data type of the data to be queried; Determine the mapping relationship between data types and query strategy groups; The determining of an initial query strategy group of the initial query system according to the target data type of the query request includes: The initial query strategy group is determined according to the target data type and the mapping relationship.
7. An adjustment device for a query system, characterized in that: include: A receiving module, configured to receive a query request sent by a user terminal, wherein the query request includes data to be queried; a determination module, configured to determine an initial query strategy group of an initial query system according to a target data type of the query request; The initial query strategy group corresponds to the data type; The initial query strategy group includes at least one query strategy; an adjustment module, configured to adjust policy parameters and / or policy structure of the initial query policy group to obtain a plurality of query policy groups to be selected, wherein the policy parameter adjustment is to adjust the proportion of each query policy in the initial query policy group, and the policy structure adjustment is to add, delete, or replace query policies in the initial query policy group; a generating module, configured to determine a target query strategy group from the plurality of candidate query strategy groups, generate a query result corresponding to the to-be-queried data using the target query strategy group, and obtain a plurality of user feedback information corresponding to the query result; an optimization module, configured to adjust the initial query system according to the plurality of user feedback information and the target query strategy group to obtain an adjusted query system; The generating module is specifically configured to determine a historical strategy usage record, wherein the historical strategy usage record includes a plurality of query strategy groups, a feedback value corresponding to each query strategy group, and a usage frequency corresponding to each query strategy group; Determining, based on the historical strategy usage records, a plurality of candidate feedback values and a plurality of candidate usage frequencies corresponding to the plurality of candidate query strategy groups; According to the multiple candidate feedback values and the multiple candidate usage frequencies, a multi-arm selection algorithm is used to perform calculation processing to obtain multiple priority information corresponding to the multiple candidate query strategy groups; The target query strategy group is determined from the multiple candidate query strategies according to the multiple priority information.
8. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the query system adjustment method according to any one of claims 1 to 6 when executing the computer program.
9. A non-volatile computer-readable storage medium, characterized in that: The non-volatile computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the query system adjustment method according to any one of claims 1 to 6 are implemented.