Retrieval request processing method, device and system and storage medium
By extracting and utilizing the slot information in the search request for full slot search and comprehensive scoring, the problem of low search accuracy in the prior art is solved, and more efficient search results matching and sorting are achieved.
Patent Information
- Application Number
- CN202311619449.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-29
- Publication Date
- 2025-05-30
AI Technical Summary
When existing search engines handle accurate Q&A search scenarios, they are unable to effectively determine the key information in the search request, resulting in the loss of key information required by users, which in turn affects the accuracy of the search results.
By extracting the slot information in the search request, generating a search field, and performing full slot search in the preset database, combining multiple preset indicators to comprehensively score the search results to determine the highest-scoring target search results.
It effectively avoids the loss of key information required by users, improves the accuracy of search results, ensures that results with high matching degrees are returned first, and meets user needs.
Smart Images

Figure CN120067409A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of information retrieval, and particularly relates to a method, device, system and storage medium for processing retrieval requests. Background Art
[0002] In search scenarios for some precise question answering, such as the search for travel routes, users often have many restrictive statements, and certain conditions cannot be wrong, otherwise the results cannot meet the user's needs. Traditional search engines cannot determine the key information in the retrieval request, easily resulting in the loss of key information, enabling certain results that do not meet the user's needs to obtain high scores, and thus unable to accurately recall and rank the documents that meet the user's needs at the front.
[0003] For example, the search term is: A 3-day tour route starting from Beijing on the weekend, passing through Shandong, and going to Shanghai to play in the water. Existing search solutions will build an inverted index for each document and use the matching of the query term and the document title for recall. It often does not require all query terms to be hit in the document, calculates the text relevance between the query term and the document, and sorts the results according to the relevance to output the results. As a result, certain results that do not meet the user's needs obtain high scores. For example, a document title: A 3-day tour route from Beijing to Shanghai but not passing through Shandong, or a document title: A 2-day tour route starting from Beijing, passing through Shandong, and going to Shanghai to play in the water. Although the relevance between these two documents and the query term will be calculated to be very high, they cannot meet the user's needs.
[0004] It can be seen that the existing retrieval accuracy is not high, especially for some search scenarios of precise question answering, and its retrieval accuracy is even lower. Therefore, how to improve the retrieval accuracy has become an urgent technical problem to be solved. Summary of the Invention
[0005] The present application provides a method, device, system and storage medium for processing retrieval requests to improve the retrieval accuracy.
[0006] The present application provides a method for processing retrieval requests, including:
[0007] When receiving a retrieval request, extracting slot information in the retrieval request, where the slot information is key information representing the user's intention;
[0008] Generating a retrieval field according to the slot information;
[0009] Performing full-slot retrieval in a preset database according to the retrieval field to obtain a retrieval result;
[0010] When the search results include search results with full slot matching, comprehensively score the search results with full slot matching through multiple preset metrics, where at least one of the multiple preset metrics includes relevance information to the query request;
[0011] Determine the target search result with the highest score among the search results with full slot matching. The search results with full slot matching contain all slot information, and the higher the relevance of the search results with full slot matching to the query request, the higher the corresponding score;
[0012] Generate a reply message according to the target search result.
[0013] The beneficial effects of this application are as follows: When receiving a search request, extract the slot information in the search request to determine the key information in the search request; then, generate a search field according to the slot information; perform a full slot search in a preset database according to the search field to obtain search results, thereby avoiding the loss of key information of user needs; finally, when the search results include search results with full slot matching, comprehensively score the search results with full slot matching through multiple preset metrics, where at least one of the multiple preset metrics includes relevance information to the query request; determine the target search result with the highest score among the search results with full slot matching. The search results with full slot matching contain all slot information, and the higher the relevance of the search results with full slot matching to the query request, the higher the corresponding score; generate a reply message according to the target search result. Since all key information of user needs is included and the search results containing all key information are sorted, it is ensured that the results with high matching degree are returned first, thereby realizing the recall and sorting of documents that meet user needs and improving the accuracy of the search.
[0014] In one embodiment, the extracting the slot information in the search request includes:
[0015] Obtain the query word information in the search request;
[0016] Input the query word information in the search request into a preset model;
[0017] Obtain the slot information in the query word information output by the preset model.
[0018] In one embodiment, before inputting the query word information in the search request into the preset model, the method further includes:
[0019] Scrape data from a preset website;
[0020] Annotate the slot information in the data;
[0021] Use the data with slot information marked as training data and input it into a pre-constructed model to train the pre-constructed model with the training data until the pre-constructed model is trained into the preset model with the ability to recognize slot information.
[0022] In one embodiment, the comprehensive scoring of the retrieval results of full-slot matching through multiple preset metrics includes:
[0023] Score the retrieval results through at least one of the following metrics:
[0024] The document popularity corresponding to the retrieval results, the occurrence frequency of slot information in the retrieval results, and the relevance information between the document corresponding to the retrieval results and the query request.
[0025] In one embodiment, when performing full-slot retrieval, the method further includes:
[0026] Retrieve through the complete document corresponding to the retrieval request in the preset database;
[0027] Obtain the retrieval results with a similarity greater than the preset similarity to the complete document corresponding to the retrieval request as the full-text matching retrieval results.
[0028] In one embodiment, the method further includes:
[0029] When the retrieval results do not include the retrieval results of full-slot matching, obtain the full-text matching retrieval results;
[0030] Generate reply information according to the full-text matching retrieval results.
[0031] In one embodiment, the generating reply information according to the target retrieval results and the generating reply information according to the full-text matching retrieval results include:
[0032] When the target retrieval results or the full-text matching retrieval results are structured data, convert the structured data corresponding to the target retrieval results and the full-text matching retrieval results into texts that conform to natural grammar rules to obtain reply information.
[0033] This application also provides a retrieval request processing device, including:
[0034] An extraction module, configured to extract slot information in the retrieval request when receiving the retrieval request, where the slot information is the key information characterizing the user's intention;
[0035] A generation module, configured to generate retrieval fields according to the slot information;
[0036] The first retrieval module is used to perform full-slot retrieval in a preset database according to the retrieval fields to obtain retrieval results;
[0037] The scoring module is used to comprehensively score the retrieval results with full-slot matching through multiple preset metrics when the retrieval results include retrieval results with full-slot matching. Among them, at least the relevance information with the query request is included in the multiple preset metrics;
[0038] The determination module is used to determine the target retrieval result with the highest score among the retrieval results with full-slot matching. Among them, the retrieval results with full-slot matching contain all slot information, and the higher the relevance of the retrieval results with full-slot matching to the query request, the higher the corresponding score;
[0039] The first reply module is used to generate reply information according to the target retrieval result.
[0040] In one embodiment, the extraction module includes:
[0041] The acquisition sub-module is used to acquire the query word information in the retrieval request;
[0042] The input sub-module is used to input the query word information in the retrieval request into a preset model;
[0043] The acquisition sub-module is used to acquire the slot information in the query word information output by the preset model.
[0044] In one embodiment, the device further includes:
[0045] The scraping module is used to scrape data from a preset website;
[0046] The annotation module is used to annotate the slot information in the data;
[0047] The training module is used to input the data with the slot information annotated as training data into a pre-constructed model, so as to train the pre-constructed model through the training data until the pre-constructed model is trained into the preset model with the ability to identify slot information.
[0048] In one embodiment, the scoring module is further used to:
[0049] Score the retrieval results through at least one of the following metrics:
[0050] The document popularity corresponding to the retrieval result, the occurrence frequency of the slot information in the retrieval result, and the relevance information between the document corresponding to the retrieval result and the query request.
[0051] In one embodiment, the device further includes:
[0052] A second retrieval module, configured to perform a retrieval in a preset database through the complete document corresponding to the retrieval request;
[0053] A first acquisition module, configured to acquire a retrieval result with a similarity greater than a preset similarity to the complete document corresponding to the retrieval request as a full-text matching retrieval result.
[0054] In one embodiment, the apparatus further includes:
[0055] A second acquisition module, configured to acquire the full-text matching retrieval result when the retrieval result does not include a retrieval result with full slot matching;
[0056] A second reply module, configured to generate a reply message according to the full-text matching retrieval result.
[0057] In one embodiment, the first reply module and the second reply module include:
[0058] A conversion sub-module, configured to convert the structured data into text conforming to natural grammar rules when the retrieval result with full slot matching or the full-text matching retrieval result is structured data.
[0059] The present application further provides a retrieval request processing system, including:
[0060] At least one processor; and,
[0061] A memory communicatively connected to the at least one processor; wherein,
[0062] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to implement the retrieval request processing method described in any one of the above embodiments.
[0063] The present application further provides a computer-readable storage medium. When the instructions in the storage medium are executed by a processor corresponding to the retrieval request processing system, the retrieval request processing system can implement the retrieval request processing method described in any one of the above embodiments.
[0064] Other features and advantages of the present application will be described in the following specification, and will, in part, become apparent from the specification, or be understood by implementing the present application. The objectives and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written specification, claims, and drawings.
[0065] The technical solutions of the present application will be further described in detail below through the drawings and embodiments. Description of the Drawings
[0066] The accompanying drawings are used to provide a further understanding of the present application and form a part of the specification. Together with the embodiments of the present application, they are used to explain the present application and do not constitute a limitation to the present application. In the accompanying drawings:
[0067] Figure 1 It is a flowchart of a method for processing a retrieval request in an embodiment of the present application;
[0068] Figure 2 It is a schematic structural diagram of a device for processing a retrieval request in an embodiment of the present application;
[0069] Figure 3 It is a schematic hardware structure diagram of a system for processing a retrieval request in an embodiment of the present application. Detailed implementation manners
[0070] The following describes the preferred embodiments of the present application with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application and are not used to limit the present application.
[0071] In the prior art, for the search information of users, full-text retrieval is often performed according to the content of the search information, and the solution with the highest similarity is returned. Since traditional search engines focus more on text relevance when processing query terms and documents, they ignore the precise structured characterization of query terms and documents. As a result, in some search scenarios for precise question answering, information that meets the user's needs cannot be returned. For example, in the search for travel routes, users often have many restrictive statements, and certain conditions cannot be wrong, otherwise the results cannot meet the user's needs. For example, the search term: A 3-day travel route starting from Beijing on the weekend, passing through Shandong, and going to Shanghai to play in the water. Traditional full-text search will create an inverted index for each document and use the matching of query terms and document titles for recall. It often does not require all query terms to be hit in the document, calculates the text relevance between the query terms and the document, sorts the results according to the relevance, and outputs the results. This causes some results that do not meet the user's needs to receive a high score. For example, a document title: A 3-day travel route from Beijing to Shanghai but not passing through Shandong, or a document title: A 2-day travel route starting from Beijing, passing through Shandong, and going to Shanghai to play in the water. Although the relevance between these two documents and the query terms will be calculated to be very high, they cannot meet the user's needs. And there is a document whose title is written as A 3-day travel route in Shanghai, and much information in the query term is lost, but through the content, it can express the information of starting from Beijing, passing through Shandong, and playing in the water. In fact, it meets the requirements. Since it is very difficult to characterize such information through relevance, the corresponding results cannot be returned, and results that meet more precise matching cannot be returned.
[0072] Therefore, the present application provides a method for processing a retrieval request to improve the accuracy of processing the retrieval request. Figure 1The following is a flowchart of a method for processing a retrieval request in an embodiment of this application. As Figure 1 shown, this method can be implemented as the following steps S101 - S105:
[0073] In step S101, when a retrieval request is received, the slot information in the retrieval request is extracted, where the slot information is the key information characterizing the user's intention;
[0074] In step S102, retrieval fields are generated according to the slot information;
[0075] In step S103, full - slot retrieval is performed in a preset database according to the retrieval fields to obtain a retrieval result;
[0076] In step S104, when the retrieval result includes a retrieval result with full - slot matching, a comprehensive score is given to the retrieval result with full - slot matching through multiple preset metrics, where at least one of the multiple preset metrics includes information related to the relevance of the query request;
[0077] In step S105, the target retrieval result with the highest score in the retrieval results with full - slot matching is determined. Among the retrieval results with full - slot matching, those containing all slot information and having a higher relevance to the query request have higher corresponding scores;
[0078] In step S106, a reply message is generated according to the target retrieval result.
[0079] In this application, when a retrieval request is received, slot information in the retrieval request is extracted, where the slot information is key information characterizing the user's intention. For example, the slot information can be key information extracted from the question or query input by the user in a dialogue system or a search engine. The slot information can be understood as different aspects or specific details of the user's requirements. For example, assume the query input by the user is: "I want to find a hotel in Beijing, the check-in date is October 30th, and the check-out date is November 1st." Then the slot information that can be extracted from this query includes: location (Beijing), hotel type (hotel), check-in date (October 30th), check-out date (November 1st), etc. The purpose of extracting the slot information is to better understand the user's intention and requirements, and the system can perform subsequent processing and responses based on this slot information, such as providing search results that meet the user's needs or giving corresponding answers. Specifically, on the document side, query term information in the retrieval request is obtained; where the query term is the keyword or phrase input by the user when performing information retrieval or search. The entire content of the user's query can be directly used as the query term, including the title and the body field; or the query content can be processed to extract the query term from the title and the body field through text processing technology and natural language processing technology. This application does not make any limitations in this regard. Then, the query term information in the retrieval request is input into a pre-trained preset model to extract the required slot information, such as where to start, where to pass through, where the destination is, etc.
[0080] Generate retrieval fields according to the slot information; on the query term side, a large model is trained by constructing training data (extracting information of the same slots as those on the document side from the query term and the standardized query term to be output), and the large model is used to extract slot information of the same structure as well as the query terms required for the full-text index from the user's query term.
[0081] Perform full-slot retrieval in a preset database according to the retrieval fields to obtain retrieval results. For example, the matching of the query term slots and the corresponding slots in the document is called matching and recall. The full-slot matching between the query term and the document and the key-slot matching between the document and the query term are performed. If there is a match, the document is recalled as the document recalled for the query term.
[0082] When the retrieval results include retrieval results of full-slot matching, comprehensive scoring is performed on the retrieval results of full-slot matching through multiple preset metrics, where at least one of the multiple preset metrics includes information related to the query request. Specifically, when the retrieval results include retrieval results of full-slot matching, the retrieval results are scored according to at least one of the following metrics: the popularity of the document corresponding to the retrieval result, the occurrence frequency of the slot information in the retrieval result, and the relevance information between the document corresponding to the retrieval result and the query request;
[0083] Determine the target retrieval result with the highest score among the retrieval results of full slot matching. Among them, the retrieval results of full slot matching contain all slot information, and the higher the relevance of the retrieval results of full slot matching to the query request, the higher the corresponding score. By sorting the scored retrieval results and determining the retrieval result with the highest score ranking among the sorted retrieval results as the target retrieval result, the information that best meets the user's needs can be returned preferentially. When sorting the retrieval results, they can be directly sorted according to various indicators such as document popularity, query term popularity, the occurrence frequency of slot information in the retrieval results, and the relevance between the document corresponding to the retrieval result and the query request. Of course, for multiple indicators, after operations such as setting different weights and normalization processing, a comprehensive score can be given to the retrieval results, and the retrieval results can be sorted according to the comprehensive score. This application does not make any limitations in this regard. It can be understood that when the retrieval results do not include the retrieval results of full slot matching, the full text matching retrieval results can be obtained; and reply information can be generated according to the full text matching retrieval results.
[0084] In an embodiment of the present application, while performing full slot retrieval, retrieve through the complete document corresponding to the retrieval request in a preset database; obtain the retrieval results with a similarity greater than the preset similarity to the complete document corresponding to the retrieval request as the full text matching retrieval results. That is to say, while performing full slot retrieval, traditional ES is also used for full text retrieval. By adding multiple retrieval strategies, the retrieval accuracy is improved.
[0085] When there are multiple retrieval results, different priorities can be set. In one embodiment, core slot information is selected from the slot information. Then, when returning the results, the highest priority is the retrieval result of full slot matching, that is, query term - document index full slot matching; the second priority is the core slot full matching retrieval result: query term - document index core slot full matching; the last priority is the traditional full text index recall. Of course, different importance coefficients can also be set for the slot information, combined with the similarity of the retrieval results, to obtain the matching degrees of different retrieval results, and the priorities of the returned retrieval results can be determined according to the matching degrees.
[0086] Finally, generate a response message based on the target retrieval result. Moreover, when the target retrieval result or the full-text matching retrieval result is structured data, convert the structured data into text that conforms to natural grammar rules. To improve the user experience, when the target retrieval result or the full-text matching retrieval result is structured data, convert the structured data into text that conforms to natural grammar rules. For example, convert structured data into natural language through NLG technology (Natural Language Generation). During the conversion process, factors such as context, grammar, and language style need to be considered to make the generated text conform to language habits and user expectations. Suppose there is the following structured data and slot information:
[0087] Location: Beijing
[0088] Hotel type: Hotel
[0089] Check-in date: October 30th
[0090] Check-out date: November 1st
[0091] Through natural language generation, these information can be converted into natural language text. For example:
[0092] Hello! There is a hotel suitable for you in Beijing. You can check in on October 30th and the check-out date is November 1st.
[0093] In this way, the structured data is converted into natural language text with stronger readability for better presentation to users.
[0094] The beneficial effects of this application are as follows: when receiving a retrieval request, extract the slot information in the retrieval request to determine the key information in the retrieval request; then, generate retrieval fields according to the slot information; perform full-slot retrieval in a preset database according to the retrieval fields to obtain retrieval results, thereby avoiding the loss of key information of user needs; finally, when the retrieval results include full-slot matching retrieval results, comprehensively score the full-slot matching retrieval results through multiple preset metrics, where at least the multiple preset metrics include relevance information to the query request; determine the target retrieval result with the highest score among the full-slot matching retrieval results, where the full-slot matching retrieval results contain all slot information, and the higher the relevance of the full-slot matching retrieval results to the query request, the higher the corresponding score; generate a response message according to the target retrieval result. Since all key information of user needs is included and the retrieval results containing all key information are sorted, it ensures that the results with high matching degree are returned first, thereby realizing the recall and sorting of documents that meet user needs and improving the accuracy of retrieval.
[0095] In one embodiment, the above step S101 may be implemented as the following steps A1 - A3:
[0096] In step A1, obtain the query word information in the retrieval request;
[0097] In step A2, input the query word information in the retrieval request into a preset model;
[0098] In step A3, obtain the slot information in the query word information output by the preset model.
[0099] In this embodiment, obtain the query word information in the retrieval request; specifically, the query word is the keyword or phrase input by the user when performing information retrieval or search. The entire content of the user's query can be directly used as the query word, including the title and the body field, or the query content can be processed to extract the query word from the title and the body field through text processing technology and natural language processing technology. This application does not make any limitations in this regard.
[0100] Then, input the query word information in the retrieval request into the preset model to extract the slot information we want, such as where to start, where to pass through, and where the destination is, etc.
[0101] In one embodiment, before inputting the query word information in the retrieval request into the preset model, the method may also be implemented as the following steps B1 - B3:
[0102] In step B1, crawl data from a preset website;
[0103] In step B2, annotate the slot information in the data;
[0104] In step B3, use the data with the annotated slot information as training data to input into a pre - constructed model, so as to train the pre - constructed model with the training data until the pre - constructed model is trained into the preset model with the ability to recognize slot information.
[0105] In this embodiment, in order to obtain a preset model, data is scraped from a preset website, and slot information in the data is labeled to obtain training data. Finally, the data with labeled slot information is used as training data and input into a pre-constructed model, and the pre-constructed model is trained with the training data to obtain the preset model. For example, travel information data is scraped from a travel website, 70% of the data is labeled as the training set, 30% of the remaining data is reserved as an unlabeled test set, and another labeled copy is reserved as the validation set. During the labeling process, the required slot information is labeled through the title and the text, such as where to depart from and where to go. Then the model is trained. After the model is trained according to the training set, the model is verified through the validation set. When the verification result reaches the preset accuracy rate (for example, the accuracy rate is greater than 95%), it means that the training is completed and the preset model is obtained. Finally, the model is evaluated through the test set to evaluate and determine the effect of the model.
[0106] In one embodiment, step S104 above may be implemented as the following steps:
[0107] Score the retrieval results through at least one of the following metrics:
[0108] The popularity of the document corresponding to the retrieval result, the occurrence frequency of the slot information in the retrieval result, and the relevance information between the document corresponding to the retrieval result and the query request.
[0109] In this embodiment, the retrieval results are sorted to preferentially return the information that best meets the user's needs. Specifically, when multiple retrieval results with full slot matching are obtained, score the retrieval results according to at least one of the following metrics: the popularity of the document corresponding to the retrieval result, the occurrence frequency of the slot information in the retrieval result, and the relevance information between the document corresponding to the retrieval result and the query request;
[0110] Furthermore, sort the scored retrieval results, and determine the retrieval result with the highest score ranking in the sorted retrieval results as the target retrieval result. When sorting the retrieval results, the sorting can be directly performed according to various metrics such as document popularity, query term popularity, the occurrence frequency of slot information in the retrieval result, and the relevance between the document corresponding to the retrieval result and the query request. Of course, for multiple metrics, different weights can be set, normalization processing and other operations can be performed, and then a comprehensive score of the retrieval results can be obtained, and the sorting can be performed according to the comprehensive score. For this, the present application does not make any limitations.
[0111] In one embodiment, when performing full slot retrieval, the method may also be implemented as the following steps D1 - D2:
[0112] In step D1, retrieve in a preset database through the complete document corresponding to the retrieval request;
[0113] In step D2, obtain a retrieval result with a similarity greater than a preset similarity to the complete document corresponding to the retrieval request as the full-text matching retrieval result.
[0114] In this embodiment, while performing full-slot retrieval, retrieve in a preset database through the complete document corresponding to the retrieval request; obtain a retrieval result with a similarity greater than a preset similarity to the complete document corresponding to the retrieval request as the full-text matching retrieval result. That is to say, while performing full-slot retrieval, traditional ES is also used for full-text retrieval. By adding multiple retrieval strategies, the retrieval accuracy is improved.
[0115] In one embodiment, the method can also be implemented as the following steps E1 - E2:
[0116] In step E1, when the retrieval result does not include a full-slot matching retrieval result, obtain the full-text matching retrieval result;
[0117] In step E2, generate a reply message according to the full-text matching retrieval result.
[0118] In one embodiment, the above step S106, and step E2 can also be implemented as the following steps:
[0119] When the target retrieval result or the full-text matching retrieval result is structured data, respectively convert the structured data corresponding to the target retrieval result and the full-text matching retrieval result into text conforming to natural grammar rules to obtain a reply message.
[0120] To improve the user experience, when the target retrieval result or the full-text matching retrieval result is structured data, convert the structured data into text conforming to natural grammar rules. For example, convert structured data into natural language through NLG technology (Natural Language Generation). In the conversion process, factors such as context, grammar, and language style need to be considered to make the generated text conform to language habits and user expectations. Suppose there is the following structured data and slot information:
[0121] Location: Beijing
[0122] Hotel type: Hotel
[0123] Check-in date: October 30th
[0124] Check-out date: November 1st
[0125] Through natural language generation, this information can be converted into natural language text, for example:
[0126] Hello! There is a hotel suitable for you in Beijing. You can check in on October 30th and check out on November 1st.
[0127] In this way, the structured data is converted into natural language text with stronger readability for better presentation to users.
[0128] In an embodiment of the present application, (1) On the document side, a lot of data sources are obtained by crawling, and training data is constructed (the required slot information such as where to start and where to go is marked through the title and the text), a preset model is trained, and the required slot information (such as where to start, where to pass through, and where the destination is) is extracted from the title and the text fields by the model. These information are used to generate a field data table offline, and a das (Drizzle Automation System, an automation system, is a tool for querying structured data in a large-scale distributed database system) query index is generated through the capabilities provided by ES (abbreviation of Elasticsearch, a search engine based on query terms and document content). (2) On the query term side, a model is trained by constructing training data (extracting the same slot information as that on the document side from the query term and the standardized query term expected to be output), and the model is used to extract the slot information with the same structure as that of the user's query term and the query terms required for the full-text index. (3) At the retrieval end for recall, we construct a das query through the capabilities of ES itself (the query term slot matches the corresponding slot in the document, that is, matching recall) and stack it with the traditional full-text retrieval recall method of ES for recall. Two priorities will be set for the das retrieval, full slot matching between the query term and the corresponding document and key slot matching between the document and the corresponding query term. If a match is found, the document will be recalled as the document recalled for the query term. The full-text index will use the traditional recall capabilities of ES for recall. (4) Sort the recalled resources. The sorting model is a tree model, and comprehensive sorting is performed according to document popularity, query term popularity, the relevance between the query term and the document text, etc. And the final order is arranged according to the set priority rules. We will intercept the one with the highest score after sorting and give it to the large model. (5) The final reply information will be generated based on the retrieval results and presented to the user. If the search return result is 0, an automatic reply will be generated as a fallback.
[0129] Figure 2 It is a structural schematic diagram of a retrieval request processing device in an embodiment of the present application, including:
[0130] An extraction module 201, configured to extract slot information in the retrieval request when receiving the retrieval request, where the slot information is key information characterizing the user's intention;
[0131] A generation module 202, configured to generate retrieval fields according to the slot information;
[0132] A first retrieval module 203, configured to perform full-slot retrieval in a preset database according to the retrieval fields to obtain a retrieval result;
[0133] A scoring module 204, configured to, when the retrieval result includes a retrieval result with full-slot matching, comprehensively score the retrieval result with full-slot matching through multiple preset metrics, where at least one of the multiple preset metrics includes correlation information with a query request;
[0134] A determination module 205, configured to determine a target retrieval result with the highest score among the retrieval results with full-slot matching, where the retrieval result with full-slot matching contains all slot information, and the higher the correlation with the query request of the retrieval result with full-slot matching, the higher the corresponding score;
[0135] A first reply module 206, configured to generate reply information according to the target retrieval result.
[0136] In one embodiment, the extraction module includes:
[0137] An acquisition sub-module, configured to acquire query word information in a retrieval request;
[0138] An input sub-module, configured to input the query word information in the retrieval request into a preset model;
[0139] An acquisition sub-module, configured to acquire slot information in the query word information output by the preset model.
[0140] In one embodiment, the apparatus further includes:
[0141] A scraping module, configured to scrape data from a preset website;
[0142] A labeling module, configured to label slot information in the data;
[0143] A training module, configured to input the data with labeled slot information as training data into a pre-constructed model to train the pre-constructed model through the training data until the pre-constructed model is trained into the preset model with the ability to identify slot information.
[0144] In one embodiment, the scoring module is further configured to:
[0145] Score the retrieval result through at least one of the following metrics:
[0146] The popularity of the document corresponding to the retrieval result, the occurrence frequency of the slot information in the retrieval result, and the correlation information between the document corresponding to the retrieval result and the query request.
[0147] In one embodiment, the device further comprises:
[0148] A second retrieval module, configured to retrieve in a preset database through the complete document corresponding to the retrieval request;
[0149] A first acquisition module, configured to acquire, as a full-text matching retrieval result, a retrieval result whose similarity to the complete document corresponding to the retrieval request is greater than a preset similarity.
[0150] In one embodiment, the device further comprises:
[0151] A second acquisition module, configured to acquire the full-text matching retrieval result when the retrieval result does not include a retrieval result with full slot matching;
[0152] A second reply module, configured to generate a reply message according to the full-text matching retrieval result.
[0153] In one embodiment, the first reply module and the second reply module include:
[0154] A conversion sub-module, configured to, when the target retrieval result or the full-text matching retrieval result is structured data, convert the structured data corresponding to the target retrieval result and the full-text matching retrieval result into text conforming to natural grammar rules, so as to obtain a reply message.
[0155] Figure 3 FIG. is a schematic hardware structure diagram of a retrieval request processing system according to an embodiment of the present application. As Figure 3 shown, the retrieval request processing system includes:
[0156] At least one processor 320; and,
[0157] A memory 304 communicatively connected to the at least one processor 320; wherein,
[0158] The memory 304 stores instructions executable by the at least one processor 320, and the instructions are executed by the at least one processor 320 to implement the retrieval request processing method described in any one of the above embodiments.
[0159] Referring to Figure 3 , the retrieval request processing system 300 may include one or more of the following components: a processing component 302, a memory 304, a power supply component 306, a multimedia component 308, an audio component 310, an input / output (I / O) interface 312, a sensor component 314, and a communication component 316.
[0160] The processing component 302 generally controls the overall operation of the retrieval request processing system 300. The processing component 302 may include one or more processors 320 to execute instructions to complete all or part of the steps of the above - mentioned methods. In addition, the processing component 302 may include one or more modules to facilitate the interaction between the processing component 302 and other components. For example, the processing component 302 may include a multimedia module to facilitate the interaction between the multimedia component 308 and the processing component 302.
[0161] The memory 304 is configured to store various types of data to support the operation of the retrieval request processing system 300. Examples of such data include instructions for any application or method operating on the retrieval request processing system 300, such as text, pictures, videos, etc. The memory 304 can be implemented by any type of volatile or non - volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read - only memory (EEPROM), erasable programmable read - only memory (EPROM), programmable read - only memory (PROM), read - only memory (ROM), magnetic memory, flash memory, magnetic disks or optical disks.
[0162] The power component 306 provides power for various components of the retrieval request processing system 300. The power component 306 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the retrieval request processing system 300.
[0163] The multimedia component 308 includes a screen that provides an output interface between the retrieval request processing system 300 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can not only sense the boundaries of touch or swipe actions, but also detect the duration and pressure associated with the touch or swipe operation. In some embodiments, the multimedia component 308 may also include a front - facing camera and / or a rear - facing camera. When the retrieval request processing system 300 is in an operation mode, such as a shooting mode or a video mode, the front - facing camera and / or the rear - facing camera can receive external multimedia data. Each front - facing camera and rear - facing camera can be a fixed optical lens system or have focal length and optical zoom capabilities.
[0164] The audio component 310 is configured to output and / or input audio signals. For example, the audio component 310 includes a microphone (MIC), which is configured to receive external audio signals when the retrieval request processing system 300 is in an operation mode, such as an alarm mode, a recording mode, a voice recognition mode, and a voice output mode. The received audio signals can be further stored in the memory 304 or transmitted via the communication component 316. In some embodiments, the audio component 310 further includes a speaker for outputting audio signals.
[0165] The I / O interface 312 provides an interface between the processing component 302 and a peripheral interface module, and the peripheral interface module can be a keyboard, a click wheel, buttons, etc. These buttons can include, but are not limited to: a home button, a volume button, a start button, and a lock button.
[0166] The sensor component 314 includes one or more sensors for providing a status assessment of various aspects of the retrieval request processing system 300. For example, the sensor component 314 can include a sound sensor. Additionally, the sensor component 314 can detect the open / closed state of the retrieval request processing system 300, the relative positioning of components, such as the display and keypad of the retrieval request processing system 300. The sensor component 314 can also detect the operating state of the retrieval request processing system 300 or a component of the retrieval request processing system 300, such as the operating state of the air distribution board, the structural state, the operating state of the discharge scraper, etc., the orientation or acceleration / deceleration of the retrieval request processing system 300, and the temperature change of the retrieval request processing system 300. The sensor component 314 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor component 314 can also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor component 314 can further include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, a material accumulation thickness sensor, or a temperature sensor.
[0167] The communication component 316 is configured to enable the retrieval request processing system 300 to provide communication capabilities with other devices and cloud platforms in a wired or wireless manner. The retrieval request processing system 300 can access a wireless network based on communication standards, such as WiFi, 2G, or 3G, or a combination thereof. In an exemplary embodiment, the communication component 316 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 316 further includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0168] In an exemplary embodiment, the retrieval request processing system 300 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components, and is used to execute the retrieval request processing method described in any of the foregoing embodiments.
[0169] The present application also provides a computer-readable storage medium. When the instructions in the storage medium are executed by a processor corresponding to the retrieval request processing system, the retrieval request processing system can implement the retrieval request processing method described in any of the foregoing embodiments.
[0170] Those skilled in the art should understand that the embodiments of the present application may be provided as a method, a system, or a computer program product. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories and optical memories, etc.) containing computer-usable program code.
[0171] The present application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, as well as the combination of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for implementing the specified function in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0172] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device, and the instruction device implements the specified function in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0173] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus, so that a series of operation steps are performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions for implementing the steps specified in one process or a plurality of processes and / or boxes Figure 1 one process or a plurality of processes and / or boxes Figure 1 in one box or a plurality of boxes.
[0174] Obviously, those skilled in the art can make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalent technologies, this application is also intended to include these modifications and variations.
Claims
1. A method for processing a retrieval request, characterized in that, it includes: When receiving a retrieval request, extracting slot information in the retrieval request, where the slot information is key information characterizing the user's intention; Generating retrieval fields according to the slot information; Performing a full-slot retrieval in a preset database according to the retrieval fields to obtain a retrieval result; When the retrieval result includes a retrieval result with full-slot matching, comprehensively scoring the retrieval result with full-slot matching through multiple preset metrics, where at least one of the multiple preset metrics includes relevance information to the query request; Determining a target retrieval result with the highest score among the retrieval results with full-slot matching, where the retrieval result with full-slot matching contains all slot information, and the higher the relevance of the retrieval result with full-slot matching to the query request, the higher the corresponding score; Generating a reply message according to the target retrieval result.
2. The method according to claim 1, characterized in that, The extracting the slot information in the retrieval request includes: Obtaining query word information in the retrieval request; Inputting the query word information in the retrieval request into a preset model; Obtaining the slot information in the query word information output by the preset model.
3. The method according to claim 2, characterized in that, Before inputting the query word information in the retrieval request into the preset model, the method further includes: Scraping data from a preset website; Annotating the slot information in the data; Taking the data with the annotated slot information as training data and inputting it into a pre-constructed model to train the pre-constructed model through the training data until the pre-constructed model is trained into the preset model with the ability to recognize slot information.
4. The method according to claim 1, characterized in that, The comprehensively scoring the retrieval result with full-slot matching through multiple preset metrics includes: Scoring the retrieval result through at least one of the following metrics: The popularity of the document corresponding to the retrieval result, the occurrence frequency of the slot information in the retrieval result, and the relevance information of the document corresponding to the retrieval result to the query request.
5. The method according to claim 1, characterized in that, When performing a full-slot retrieval, the method further includes: Performing a retrieval in the preset database through the complete document corresponding to the retrieval request; Obtaining a retrieval result with a similarity greater than a preset similarity to the complete document corresponding to the retrieval request as a full-text matching retrieval result.
6. The method according to claim 5, characterized in that, The method further includes: When the retrieval result does not include a retrieval result with full-slot matching, obtaining the full-text matching retrieval result; Generating a reply message according to the full-text matching retrieval result.
7. The method according to claim 6, characterized in that, The generating a reply message according to the target retrieval result and the generating a reply message according to the full-text matching retrieval result include: When the target retrieval result or the full-text matching retrieval result is structured data, the structured data corresponding to the target retrieval result and the full-text matching retrieval result are respectively converted into texts that conform to natural grammar rules to obtain a reply message.
8. A retrieval request processing device, characterized in that, it includes: an extraction module, configured to extract slot information in a retrieval request when receiving the retrieval request, where the slot information is key information characterizing the user's intention; a generation module, configured to generate retrieval fields according to the slot information; a first retrieval module, configured to perform full-slot retrieval in a preset database according to the retrieval fields to obtain a retrieval result; a scoring module, configured to comprehensively score the full-slot matching retrieval results through a variety of preset metrics when the retrieval results include full-slot matching retrieval results, where at least one of the variety of preset metrics includes relevance information to the query request; a determination module, configured to determine a target retrieval result with the highest score among the full-slot matching retrieval results, where the full-slot matching retrieval results contain all slot information, and the higher the relevance of the full-slot matching retrieval results to the query request, the higher the corresponding score; a first reply module, configured to generate a reply message according to the target retrieval result.
9. A retrieval request processing system, characterized in that, it includes: at least one processor; and, a memory communicatively connected to the at least one processor; where the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to implement the retrieval request processing method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, when the instructions in the storage medium are executed by the processor corresponding to the retrieval request processing system, the retrieval request processing system can implement the retrieval request processing method according to any one of claims 1-7.