Information retrieval method, apparatus, device, and storage medium

CN117407482BActive Publication Date: 2026-09-15BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210787231.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-04
Publication Date
2026-09-15
Estimated Expiration
2042-07-04

AI Technical Summary

Technical Problem

在用户实际使用搜索引擎等检索技术时,针对用户在搜索引擎提供的搜索框中输入的检索词(Query),存在搜索引擎不能够预测出对应Query的搜索结果的问题

Benefits of technology

[0009]It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117407482B_ABST
    Figure CN117407482B_ABST
Patent Text Reader

Abstract

The present disclosure provides an information retrieval method, device and equipment, and a storage medium, relates to the technical field of artificial intelligence, in particular to the field of natural language processing and deep learning. The method comprises the following steps: obtaining to-be-retrieved information; determining a retrieval keyword corresponding to the to-be-retrieved information based on a pre-constructed word slot and recognition model; and performing retrieval based on the retrieval keyword to obtain a retrieval result. The information retrieval method provided by the present disclosure improves retrieval efficiency, guarantees the effectiveness of the retrieval result, and further improves the retrieval experience of users.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer science, specifically to artificial intelligence fields such as natural language processing and deep learning, and particularly to information retrieval methods, devices, equipment, and storage media. Background Technology

[0002] With the continuous development of computer network technology, users can retrieve more and more information from computer networks. In recent years, as the amount of data on computer networks has increased, users' demand for accurately and quickly retrieving information that meets their needs has also been increasing. However, when users actually use search engines and other retrieval technologies, there is a problem that search engines cannot predict the search results corresponding to the search terms (Query) entered by users in the search box provided by the search engine. Summary of the Invention

[0003] This disclosure provides an information retrieval method, apparatus, device, and storage medium.

[0004] According to a first aspect of this disclosure, an information retrieval method is provided, comprising: acquiring information to be retrieved; determining search keywords corresponding to the information to be retrieved based on a pre-constructed slot and recognition model; and performing a search based on the search keywords to obtain search results.

[0005] According to a second aspect of this disclosure, an information retrieval device is provided, comprising: an acquisition module configured to acquire information to be retrieved; a first determination module configured to determine search keywords corresponding to the information to be retrieved based on a pre-constructed slot and recognition model; and a retrieval module configured to perform a retrieval based on the search keywords to obtain retrieval results.

[0006] According to a third aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform a method as described in any implementation of the first aspect.

[0007] According to a fourth aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions for causing a computer to perform a method as described in any implementation of the first aspect.

[0008] According to a fifth aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the method as described in any implementation of the first aspect.

[0009] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0010] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:

[0011] Figure 1 This is an exemplary system architecture diagram to which this disclosure can be applied;

[0012] Figure 2 This is a flowchart of an embodiment of the information retrieval method according to the present disclosure;

[0013] Figure 3 This is an application scenario diagram of the information retrieval method based on this disclosure;

[0014] Figure 4 This is a flowchart of another embodiment of the information retrieval method according to the present disclosure;

[0015] Figure 5 This is a schematic diagram of the structure of an embodiment of the information retrieval device according to the present disclosure;

[0016] Figure 6 This is a block diagram of an electronic device used to implement the information retrieval method of the embodiments of this disclosure. Detailed Implementation

[0017] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0018] It should be noted that, unless otherwise specified, the embodiments and features described in this disclosure can be combined with each other. This disclosure will now be described in detail with reference to the accompanying drawings and embodiments.

[0019] Figure 1 An exemplary system architecture 100 is shown, to which embodiments of the information retrieval methods or devices of this disclosure may be applied.

[0020] like Figure 1As shown, system architecture 100 may include terminal devices 101, 102, and 103, a network 104, and a server 105. Network 104 serves as the medium for providing communication links between terminal devices 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.

[0021] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send information, etc. Various client applications can be installed on terminal devices 101, 102, and 103.

[0022] Terminal devices 101, 102, and 103 can be either hardware or software. When terminal devices 101, 102, and 103 are hardware, they can be various electronic devices, including but not limited to smartphones, tablets, laptops, and desktop computers. When terminal devices 101, 102, and 103 are software, they can be installed in the aforementioned electronic devices. They can be implemented as multiple software programs or software modules, or as a single software program or software module. No specific limitations are made here.

[0023] Server 105 can provide various services. For example, server 105 can analyze and process the information to be retrieved obtained from terminal devices 101, 102, and 103, and generate processing results (such as search results).

[0024] It should be noted that server 105 can be either hardware or software. When server 105 is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When server 105 is software, it can be implemented as multiple software programs or software modules (e.g., used to provide distributed services), or as a single software program or software module. No specific limitations are made here.

[0025] It should be noted that the information retrieval method provided in this embodiment is generally executed by server 105, and correspondingly, the information retrieval device is generally located in server 105.

[0026] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0027] Continue to refer to Figure 2 The diagram illustrates a flow 200 of an embodiment of an information retrieval method according to the present disclosure. The information retrieval method includes the following steps:

[0028] Step 201: Obtain the information to be retrieved.

[0029] In this embodiment, the execution subject of the information retrieval method (e.g.) Figure 1 The server 105 shown will obtain the information to be retrieved. The information to be retrieved can be any information that the user inputs that can express their needs, such as information input by the user through input devices, such as keyboards, touchpads, touch screens, etc.

[0030] Step 202: Based on the pre-built slots and recognition model, determine the search keywords corresponding to the information to be retrieved.

[0031] In this embodiment, the execution entity determines the search keywords corresponding to the search information based on pre-built slots and a recognition model. That is, in this embodiment, preliminary requirement matching is performed first. If the information to be searched directly contains entity information, the entity names in the information to be searched are determined through pre-built slots, and these entity names are used as search keywords. For example, assuming the information to be searched contains a person's name, a hospital name, etc., the execution entity will directly use these names as search keywords for retrieval.

[0032] When constructing keyword slots, the aforementioned execution entity collects users' historical search data. For example, when constructing keyword slots for medical needs, the entity collects search results containing only doctor and hospital information, including the titles displayed on the search results pages. Entity recognition is then performed on the title data to obtain doctor and hospital names. Based on the frequency and positional weight of these entities (doctor and hospital names) in the text, scores are determined for each entity. Finally, these entities are filtered according to their scores, and those meeting the criteria are added to the keyword list, thus obtaining the keyword slots.

[0033] When using slots and rules to determine user needs, there may be situations where the information to be retrieved contains an entity name, but the entity name is not in the slots. In this case, the execution entity will use the pre-trained recognition model as a supplement, that is, use the recognition model to determine the search keywords corresponding to the information to be retrieved.

[0034] Here, the aforementioned execution entity acquires a training sample set, which includes sample requirement information and its category labeling results. For each training sample, a positive-negative sample pair is constructed. Then, a pre-trained language representation model, such as BERT (Bidirectional Encoder Representation from Transformers), is built and used to extract features from the positive samples in the training samples. Simultaneously, the execution entity initializes a Generative Adversarial Network (GAN) and trains the discriminator within it to classify positive samples as positive examples. The generator within the GAN is trained based on negative samples, aiming to fit the original negative samples as closely as possible. The discriminator is also trained to classify negative samples as negative examples. Finally, based on the predicted and labeled categories of the training samples, a loss value for each category is calculated, and the parameters of each model are updated in reverse order based on these loss values. Optionally, by iteratively obtaining a trained model, the aforementioned execution entity uses the trained model as the teacher model and initializes a fully connected network as the student model. The student model learns the results from the teacher model, and finally, the trained fully connected network is used as the trained recognition model and deployed online. This reduces the model size and computational resources while maintaining the accuracy of the student model.

[0035] Step 203: Perform a search based on the search keywords to obtain the search results.

[0036] In this embodiment, the execution entity will perform a search based on the search keywords determined in step 202, thereby obtaining search results that match the search keywords, and then displaying the search results to the user.

[0037] The information retrieval method provided in this embodiment first obtains the information to be retrieved; then, based on a pre-built slot and recognition model, it determines the search keywords corresponding to the information to be retrieved; finally, it performs a search based on the search keywords to obtain the search results. This information retrieval method in this embodiment can determine the search keywords in the information to be retrieved based on a pre-built slot and recognition model, integrating the original retrieval recall system and the demand recognition model. This solves the problem that some information with unclear intent cannot be retrieved, improves retrieval efficiency, ensures the validity of the search results, and thus enhances the user's search experience.

[0038] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0039] Further reference Figure 3 , Figure 3 An application scenario diagram of the information retrieval method according to this disclosure is shown. Figure 3 The application scenario shown is a medical demand scenario. In this scenario, the executing entity first obtains the user's input regarding their medical needs (i.e., the query) online. Then, the executing entity performs preliminary query matching, that is, using pre-established slots, it retrieves names containing doctor names and hospital names from the query through slot matching. If the pre-established slots can determine the corresponding search keywords for the query, and relevant services can be retrieved based on the search keywords, then the search results are returned online and displayed to the user.

[0040] If no relevant service can be retrieved based on the pre-established slots, the aforementioned execution entity will use a pre-trained recognition model to identify the query's requirements, that is, to determine the query's search keywords using the recognition model. Then, a post-hoc interception is performed on the identified query requirements, which involves calculating the relevance between the search results and the query, and determining whether the search results correspond to the query based on the relevance. If the search results do not correspond to the query requirements, the process returns to the preceding query requirements matching step and re-performs the preceding requirements matching; if the search results correspond to the query requirements, the search results are returned online and displayed to the user.

[0041] Continue to refer to Figure 4 , Figure 4 A flow 400 of another embodiment of the information retrieval method according to the present disclosure is shown. The information retrieval method includes the following steps:

[0042] Step 401: Obtain the information to be retrieved.

[0043] Step 401 is basically the same as step 201 in the aforementioned embodiment. For the specific implementation method, please refer to the aforementioned description of step 201, which will not be repeated here.

[0044] Step 402: Perform word segmentation on the information to be retrieved to obtain the word segmentation results.

[0045] In this embodiment, the execution subject of the information retrieval method (e.g.) Figure 1 The server 105 shown will perform word segmentation on the information to be retrieved, thereby obtaining the corresponding word segmentation results. The specific word segmentation method can be implemented using existing technologies, and will not be elaborated here.

[0046] Step 403: Match the word segmentation results with the entities in the pre-built word slots, and determine the search keywords based on the matching results.

[0047] In this embodiment, the execution entity matches the word segmentation results with entities in the pre-built slots and determines the search keywords based on the matching results. Since the pre-built slots contain multiple entities, taking a medical scenario as an example, the entities here refer to doctor names, hospital names, etc. The execution entity matches each word segmentation result of the information to be retrieved with the entities in the slots. If the word segmentation result matches at least one entity in the slot, step 404 is executed; if the word segmentation result does not match at least one entity in the slot, step 405 is executed.

[0048] In some optional implementations of this embodiment, the word slots are obtained through the following steps: obtaining demand information and the result data corresponding to the demand information; determining the score corresponding to each entity based on the word frequency and position weight of each entity in the result data; determining the target entity based on the score corresponding to each entity, and adding the target entity to the word slot.

[0049] In this implementation, the execution entity first acquires data for constructing slots, namely the user's historical search data. It then obtains the user's input query and the corresponding result data. Taking a medical scenario as an example, the execution entity collects queries containing only "doctor" and "hospital," along with the titles displayed at the bottom of the search results page. Entity recognition is then performed on the titles to identify the entity information in the result data, namely the doctor's name and hospital name. Next, the execution entity determines the score for each entity based on its frequency of occurrence in the current text and its positional weight within the text. Finally, the mined entities, such as doctor's names and hospital names, are filtered and selected according to their scores from highest to lowest, and those meeting the criteria are added to the terminology, thus obtaining slots. Slots constructed based on these steps contain updated and more comprehensive entity information, thereby improving the comprehensiveness and accuracy of the slots and enhancing the efficiency and accuracy of determining the search keywords corresponding to the information to be retrieved based on the slots.

[0050] In some optional implementations of this embodiment, the score corresponding to each entity is determined based on the word frequency and position weight of each entity in the result data, including: performing entity recognition on the result data to determine each entity in the result data; counting the word frequency of each entity in the result data; determining the position weight of each entity based on the position information of each entity in the result data; and for each entity, weighted summing of the word frequency and position weight of that entity to obtain the score corresponding to that entity.

[0051] In this implementation, the aforementioned execution entity first performs entity recognition on the result data to determine each entity in the result data, and then counts the characteristics of each entity in the result data, such as the text information and location information of the title where the entity is located, and counts whether the resource number is the resource number of a specific precise doctor or precise hospital, and whether the currently displayed information is the official website of the doctor or hospital.

[0052] Then, the aforementioned executing entity will count the doctor and hospital entities appearing in the current text, as well as the frequency of each entity appearing in the current text, that is, count the number of times each entity appears in the text.

[0053] Subsequently, the aforementioned implementing entity will assign weights to the positions of the doctor's name and hospital name entities. Specifically, the weights can be set in such a way that entities appearing earlier in the position have a larger weight and entities appearing later in the position have a smaller weight. In particular, the position information of entities appearing in the first three positions of the displayed information will be assigned a larger weight.

[0054] Finally, the aforementioned executing entity will convert the word frequency, position weight, entity resource number, official website of the doctor or hospital, and other information of each entity into digital codes, and then perform a weighted summation of the above codes to obtain the score corresponding to the entity.

[0055] When generating the score for each entity, information such as the word frequency and position weight of the entity are taken into account to ensure the accuracy of the entity's score.

[0056] Step 404: In response to determining that the word segmentation result matches at least one entity in the pre-built slots, the successfully matched entity is used as the search keyword.

[0057] In this embodiment, the execution entity will use the successfully matched entity as the search keyword if it determines that the word segmentation result of the information to be retrieved matches at least one entity in the pre-built slots. That is, if the slots determine that the information to be retrieved contains precise search keywords, then the successfully matched entity will be used as the search keyword.

[0058] Step 405: In response to determining that the word segmentation result does not match at least one entity in the pre-built slots, the information to be retrieved is input into the pre-trained recognition model, and the search keywords corresponding to the information to be retrieved are output.

[0059] In this embodiment, when the execution entity determines that the word segmentation result of the information to be retrieved does not match at least one entity in the pre-built slots, that is, the information to be retrieved does not contain entity information in the slots, the execution entity will input the information to be retrieved into a pre-trained recognition model, thereby outputting the search keywords corresponding to the information to be retrieved. In other words, when using slots and rules to obtain user needs, there may be cases where the information to be retrieved contains demand words representing entities such as doctors or hospitals, but these demand words are not in the slots. Therefore, using a recognition model as a supplement allows for more accurate determination of the search keywords corresponding to the information to be retrieved.

[0060] In some optional implementations of this embodiment, the recognition model is trained through the following steps: obtaining a training sample set, wherein the training samples in the training sample set include sample demand information and category labeling results of the sample demand information; extracting features of the sample demand information using the language model in the initial recognition model; inputting the features of the sample demand information and negative samples of the sample demand information into the generative adversarial network in the initial recognition model to obtain the predicted category information of the sample demand information; calculating the category loss value based on the predicted category information of the sample demand information and the category labeling results; and updating the parameters of the initial recognition model in reverse based on the category loss value to obtain the recognition model.

[0061] In this implementation, since the main purpose of building the recognition model is to provide a fallback for some unrecoverable queries, the aforementioned execution entity first collects sample request information in five categories within a health scenario: queries related to precise doctor name searches, precise hospital name searches, queries without a specific medical need, queries requiring doctor recommendations in the current query scenario, and queries requiring hospital recommendations. This constitutes the query data. Simultaneously, queries that are not medical in nature are also collected to enhance the generalization ability and anti-fitness of the query recognition model.

[0062] After collecting queries from the five categories mentioned above, each category was manually annotated. During the annotation process, 10% of each annotator's data overlapped with that of other annotators to verify the accuracy of the annotation. Queries containing uncommon characters, misspellings, or excessively long queries were removed to prevent them from affecting the final model performance.

[0063] Then, the aforementioned execution entity generates a training sample set and a test sample set based on the collected query data. The training samples in the training sample set include sample requirement information and the category labeling results of the sample requirement information. Specifically, positive and negative sample pairs can be constructed from queries of the current category and queries of other categories that are different from the current category. At the same time, 10% of the positive sample data is used as the test set.

[0064] Next, the execution entity processes the Query into a vectorized feature representation. First, it obtains an initial recognition model, which can be a pre-trained BERT model trained on Chinese corpora. This model can segment the Query into individual characters and map them to corresponding character vectors. Simultaneously, it obtains the positional information of each character within the current sentence and encodes this information to obtain positional encodings. Then, it obtains the segment information for each character in the current Query and marks whether it belongs to the same sentence. Finally, it adds these three types of information together to obtain the feature vector representation of the Query.

[0065] Next, the execution entity utilizes the language model in the initial recognition model to extract high-order features of positive samples. Specifically, it uses the language model to extract high-order features based on the feature vector representation of the query, and simultaneously updates the language model parameters based on the gradient obtained from the negative samples. The execution entity then inputs the negative sample data into the generative adversarial network (GAN) in the initial recognition model to obtain the predicted category information of the sample demand information. The main function of the GAN is to generate a large number of similar negative samples based on the original negative samples to help the model learn better features. Simultaneously, the execution entity initializes a GAN network and trains the discriminator within it, enabling the discriminator to classify positive samples as positive examples. It also trains the generator in the GAN network based on the negative samples, aiming to fit the original negative samples as closely as possible, while simultaneously training the discriminator to classify negative samples as negative examples as much as possible. Finally, based on the predicted category information of the sample demand information and the category labeling results, a category loss value is calculated; and the parameters of the initial recognition model are updated based on this category loss value, resulting in the updated recognition model.

[0066] Finally, through repeated iterations, a trained recognition model is obtained. This trained model is used as the teacher model, while a fully connected layer network is initialized as the student model to learn from the teacher model's results. The trained fully connected layer network is then used as the final recognition model and deployed online. This approach reduces model size and computational resources while maintaining the accuracy of the student model.

[0067] The recognition model trained through the above steps has higher recognition accuracy and can more accurately identify the search keywords in the information to be retrieved.

[0068] Step 406: Perform a search based on the search keywords to obtain the search results.

[0069] Step 406 is basically the same as step 203 in the aforementioned embodiment. For the specific implementation method, please refer to the aforementioned description of step 203, which will not be repeated here.

[0070] Step 407: Calculate the relevance between the information to be retrieved and the search results.

[0071] In this embodiment, the execution entity calculates the relevance between the information to be retrieved and the search results. Although the recognition model can provide a fallback for queries that are not matched in the slots, the recognition model has a certain error rate and cannot guarantee 100% classification accuracy. Therefore, the classification results need to be verified. Thus, in this embodiment, when retrieving doctor and hospital information online using queries supplemented by the recognition model, the relevance between the query search content and the query requirement is checked. Specifically, the execution entity checks the resource numbers contained in the search results retrieved from the query information retrieval, checking whether the current search results contain medical resource sites and whether these medical resource sites are medical service demand resource sites of the required category. This yields the relevance result between the information to be retrieved and the search results.

[0072] Step 408: In response to the determination that the relevance does not meet the preset conditions, the search keywords corresponding to the information to be retrieved are redefined.

[0073] In this embodiment, after calculating the relevance between the information to be retrieved and the search results, the execution entity determines whether the relevance meets a preset condition. If it does, the search results are displayed to the user; if not, the execution entity redetermines the search keywords corresponding to the information to be retrieved and performs a new search based on the search keywords. The preset condition here can be whether the relevance result is greater than a preset threshold. Of course, other preset conditions can be set according to actual circumstances, and this embodiment does not specifically limit this. By calculating the relevance between the information to be retrieved and the search results, the relevance between the search results and the information to be retrieved can be guaranteed based on the relevance result, thereby improving the accuracy of the search.

[0074] from Figure 4 It can be seen from this that, with Figure 2 Compared to the corresponding embodiments, the information retrieval method in this embodiment perfectly integrates slots and recognition models, and ensures the relevance of retrieval results to the information to be retrieved through demand post-testing. Thus, while ensuring the most comprehensive coverage of query demands, it guarantees the accuracy and effectiveness of the pushed information (retrieval results), thereby improving the user's retrieval experience.

[0075] Further reference Figure 5 As an implementation of the methods shown in the above figures, this disclosure provides an embodiment of an information retrieval device, which is similar to... Figure 2 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.

[0076] like Figure 5 As shown, the information retrieval device 500 of this embodiment includes: an acquisition module 501, a first determination module 502, and a retrieval module 503. The acquisition module 501 is configured to acquire information to be retrieved; the first determination module 502 is configured to determine the retrieval keywords corresponding to the information to be retrieved based on pre-built slots and a recognition model; and the retrieval module 503 is configured to perform a retrieval based on the retrieval keywords to obtain retrieval results.

[0077] In this embodiment, the specific processing of the acquisition module 501, the first determination module 502, and the retrieval module 503 in the information retrieval device 500, and the resulting technical effects, can be referred to respectively. Figure 2 The relevant descriptions of steps 201-203 in the corresponding embodiments will not be repeated here.

[0078] In some optional implementations of this embodiment, the first determining module includes: a word segmentation submodule, configured to segment the information to be retrieved into words to obtain word segmentation results; and a matching submodule, configured to match the word segmentation results with entities in pre-built word slots and determine retrieval keywords based on the matching results.

[0079] In some optional implementations of this embodiment, the matching submodule includes: a unit configured to, in response to determining that the word segmentation result matches at least one entity in the pre-built slots, use the successfully matched entity as a search keyword; and an input unit configured to, in response to determining that the word segmentation result does not match at least one entity in the pre-built slots, input the information to be searched into a pre-trained recognition model and output the search keyword corresponding to the information to be searched.

[0080] In some optional implementations of this embodiment, the information retrieval device 500 further includes: a calculation module configured to calculate the relevance between the information to be retrieved and the retrieval results; and a second determination module configured to re-determine the retrieval keywords corresponding to the information to be retrieved in response to the determination that the relevance does not meet a preset condition.

[0081] In some optional implementations of this embodiment, the information retrieval device 500 further includes: a construction module for constructing word slots, the construction module including: an acquisition submodule configured to acquire demand information and result data corresponding to the demand information; a determination submodule configured to determine the score corresponding to each entity based on the word frequency and position weight of each entity in the result data; and an addition submodule configured to determine the target entity based on the score corresponding to each entity and add the target entity to the word slot.

[0082] In some optional implementations of this embodiment, the determining submodule is further configured to: perform entity recognition on the result data to determine each entity in the result data; count the word frequency of each entity in the result data; determine the position weight of each entity based on the position information of each entity in the result data; and for each entity, perform a weighted sum of the word frequency and position weight of the entity to obtain the score corresponding to the entity.

[0083] In some optional implementations of this embodiment, the information retrieval device 500 further includes a training module for training the recognition model. The training module is further configured to: acquire a training sample set, wherein the training samples in the training sample set include sample demand information and category labeling results of the sample demand information; extract features of the sample demand information using the language model in the initial recognition model; input the features of the sample demand information and negative samples of the sample demand information into the generative adversarial network in the initial recognition model to obtain predicted category information of the sample demand information; calculate a category loss value based on the predicted category information of the sample demand information and the category labeling results; and update the parameters of the initial recognition model in reverse based on the category loss value to obtain the recognition model.

[0084] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0085] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0086] like Figure 6As shown, device 600 includes a computing unit 601, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 602 or a computer program loaded from storage unit 608 into random access memory (RAM) 603. RAM 603 may also store various programs and data required for the operation of device 600. The computing unit 601, ROM 602, and RAM 603 are interconnected via bus 604. Input / output (I / O) interface 605 is also connected to bus 604.

[0087] Multiple components in device 600 are connected to I / O interface 605, including: input unit 606, such as keyboard, mouse, etc.; output unit 607, such as various types of monitors, speakers, etc.; storage unit 608, such as disk, optical disk, etc.; and communication unit 609, such as network card, modem, wireless transceiver, etc. Communication unit 609 allows device 600 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0088] The computing unit 601 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above, such as information retrieval methods. For example, in some embodiments, the information retrieval method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of the information retrieval method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the information retrieval method by any other suitable means (e.g., by means of firmware).

[0089] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0090] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0091] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0092] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0093] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0094] Cloud computing refers to a technology system that enables access to a shared pool of physical or virtual resources via a network. These resources can include servers, operating systems, networks, software, applications, and storage devices, and can be deployed and managed on demand and in a self-service manner. Cloud computing technology can provide efficient and powerful data processing capabilities for applications such as artificial intelligence and blockchain, as well as for model training.

[0095] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.

[0096] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0097] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. An information retrieval method, comprising: Retrieve the information to be searched; Based on pre-built slots and a recognition model, the search keywords corresponding to the information to be retrieved are determined, including: segmenting the information to be retrieved into words to obtain segmentation results; in response to determining that the segmentation results match at least one entity in the pre-built slots, using the successfully matched entity as the search keyword; in response to determining that the segmentation results do not match at least one entity in the pre-built slots, inputting the information to be retrieved into a pre-trained recognition model, and outputting the search keywords corresponding to the information to be retrieved. The search was performed based on the search keywords, and the search results were obtained. The method further includes: Calculate the relevance between the information to be retrieved and the search results; In response to the determination that the relevance does not meet the preset conditions, the search keywords corresponding to the information to be retrieved are redefined; The recognition model is trained through the following steps: Obtain a training sample set, wherein the training samples in the training sample set include sample requirement information and the category labeling results of the sample requirement information; Constructing a positive and negative sample pair for each training sample in the training sample set includes: combining the sample demand information of the current category with the sample demand information of at least one other category to form the positive and negative sample pair; The features of the sample demand information are extracted using the language model in the initial recognition model; The features of the sample demand information and the negative samples are input into the generative adversarial network in the initial recognition model to obtain the predicted category information of the sample demand information, including: training the generator in the generative adversarial network based on the negative samples, so that the generator fits the original negative samples as closely as possible; and training the discriminator in the generative adversarial network, so that the discriminator identifies the negative samples as negative examples as much as possible. Based on the predicted category information and category labeling results of the sample demand information, the category loss value is calculated. The parameters of the initial recognition model are updated in reverse based on the category loss value to obtain the updated recognition model; The trained recognition model is used as the teacher model, and a fully connected layer network is initialized as the student model. The student model learns the results of the teacher model and uses the trained fully connected layer network as the final recognition model.

2. The method of claim 1, wherein, The slots are obtained through the following steps: Obtain the demand information and the corresponding result data; Based on the word frequency and position weight of each entity in the result data, the score corresponding to each entity is determined; The target entity is determined based on the score corresponding to each entity, and the target entity is added to the word slot.

3. The method of claim 2, wherein, The step of determining the score corresponding to each entity based on the word frequency and position weight of each entity in the result data includes: Entity recognition is performed on the result data to identify each entity in the result data; Calculate the word frequency of each entity in the result data; Based on the position information of each entity in the result data, the position weight of each entity is determined; For each of the entities, the word frequency and position weight of that entity are weighted and summed to obtain the score corresponding to that entity.

4. An information retrieval device, comprising: The acquisition module is configured to acquire the information to be retrieved. The first determining module is configured to determine the search keywords corresponding to the information to be retrieved based on pre-built slots and a recognition model, including: segmenting the information to be retrieved into words to obtain segmentation results; in response to determining that the segmentation results match at least one entity in the pre-built slots, using the successfully matched entity as the search keyword; in response to determining that the segmentation results do not match at least one entity in the pre-built slots, inputting the information to be retrieved into a pre-trained recognition model, and outputting the search keywords corresponding to the information to be retrieved. The search module is configured to perform a search based on the search keywords and obtain search results; The device further includes: The calculation module is configured to calculate the relevance between the information to be retrieved and the search results; The second determining module is configured to re-determine the search keywords corresponding to the information to be retrieved in response to determining that the relevance does not meet the preset conditions. The device further includes a training module for training a recognition model, the training module being further configured to: Obtain a training sample set, wherein the training samples in the training sample set include sample requirement information and the category labeling results of the sample requirement information; Constructing a positive and negative sample pair for each training sample in the training sample set includes: combining the sample demand information of the current category with the sample demand information of at least one other category to form the positive and negative sample pair; The features of the sample demand information are extracted using the language model in the initial recognition model; The features of the sample demand information and the negative samples are input into the generative adversarial network in the initial recognition model to obtain the predicted category information of the sample demand information, including: training the generator in the generative adversarial network based on the negative samples, so that the generator fits the original negative samples as closely as possible; and training the discriminator in the generative adversarial network, so that the discriminator identifies the negative samples as negative examples as much as possible. Based on the predicted category information and category labeling results of the sample demand information, the category loss value is calculated. The parameters of the initial recognition model are updated in reverse based on the category loss value to obtain the updated recognition model; The trained recognition model is used as the teacher model, and a fully connected layer network is initialized as the student model. The student model learns the results of the teacher model and uses the trained fully connected layer network as the final recognition model.

5. The apparatus of claim 4, wherein, The apparatus further includes a construction module for constructing word slots, the construction module comprising: The acquisition submodule is configured to acquire requirement information and the corresponding result data. The determination submodule is configured to determine the score corresponding to each entity based on the word frequency and position weight of each entity in the result data; The addition submodule is configured to determine the target entity based on the scores corresponding to each entity, and add the target entity to the word slot.

6. The apparatus according to claim 5, wherein, The determining submodule is further configured to: Entity recognition is performed on the result data to identify each entity in the result data; Calculate the word frequency of each entity in the result data; Based on the position information of each entity in the result data, the position weight of each entity is determined; For each of the entities, the word frequency and position weight of that entity are weighted and summed to obtain the score corresponding to that entity.

7. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-3.

8. A non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-3.

9. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-3.

Citation Information

Patent Citations

  • Retrieval method and device, electronic equipment and storage medium

    CN110659422A

  • Information interaction method and device based on intention recognition, equipment and storage medium

    CN111104495A