Data retrieval method and device, electronic equipment and readable storage medium
The data retrieval method performs parallel multi-channel searches to integrate local and network data, providing accurate and timely answers to user questions through a customized reply generation model, addressing the inefficiencies of existing methods.
Patent Information
- Application Number
- CN202411079857.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-07
- Publication Date
- 2024-12-06
AI Technical Summary
Existing data retrieval methods require multiple independent searches and manual judgment to handle conflicting results, making the process cumbersome and inconvenient for users.
A data retrieval method that performs parallel multi-channel searches, including local and network searches, to generate answers to user questions, using a reply generation model to integrate and customize responses based on search data and user context.
This approach simplifies the search process by allowing a single input to generate comprehensive and accurate answers without manual filtering, reducing complexity and improving response time.
Smart Images

Figure CN119088913A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data retrieval, and in particular to a data retrieval method, device, electronic device and readable storage medium. Background Art
[0002] Related technology allows users to use different search methods to perform independent searches when searching. For example, different search methods include but are not limited to graph search and web search.
[0003] However, the search results obtained by using graph search and web search are different or even conflicting. In this way, users not only need to conduct multiple independent searches, which makes the search steps complicated, but also need to make their own judgments, analyze and filter when faced with conflicting results, which makes it inconvenient to get answers in a timely manner. Summary of the invention
[0004] The present application provides a data retrieval method, device, electronic device and readable storage medium.
[0005] The present application provides a data retrieval device method, comprising:
[0006] Get the user question sentence entered by the user;
[0007] Extracting search terms based on the user question statement to generate search terms for the user question statement;
[0008] According to the search terms, a local search in a multi-channel search and a network search in a multi-channel search are performed in parallel;
[0009] Based on the search data obtained through the multi-channel search, an answer to the user's question statement is determined.
[0010] Furthermore, the step of determining the answer to the user's question statement based on the search data obtained through the multi-channel search includes:
[0011] Generating input data for a reply prompt based on the search data obtained by the multi-channel search and the user question statement; the reply prompt includes a reply requirement;
[0012] The reply requirements of the reply prompt and the input data are input into a reply generation model to output an answer to the user's question statement; the reply generation model obtains an answer to the user's question statement according to the reply requirements of the reply prompt and the input data.
[0013] Furthermore, the generation of input data for a reply prompt based on the search data obtained through the multi-channel search and the user question statement includes:
[0014] If the local search data obtained by the local search is used within the first predetermined time, the reply prompt is generated based on the user question statement and the local search data without waiting for the result of the network search.
[0015] Further, the local search data obtained by using the local search is determined by the following steps:
[0016] If the knowledge graph search and local text search of local retrieval are used within the first predetermined time, and the corresponding triple retrieval data and text retrieval data are obtained, the triple retrieval data and the text retrieval data are fused, and the retrieval data of the knowledge graph is sorted in front of the retrieval data of the local document as the local retrieval data.
[0017] Furthermore, the generation of input data for a reply prompt based on the search data obtained through the multi-channel search and the user question statement includes:
[0018] If the local search data obtained by the local search is used within the first predetermined time, and the network search data obtained by the network search is used, the input data of the reply prompt is generated using the user question statement, the local search data and the network search data.
[0019] Furthermore, if the local search data obtained by the local search is used within the first predetermined time, and the network search data obtained by the network search is used, the user question statement, the local search data and the network search data are used to generate the input data of the reply prompt, including:
[0020] If the local search data obtained by the local search is used within the first predetermined time, and the network search data obtained by the network search is used, then, if the local search data is external data, the local search data is compared with the network search data to determine whether the local search data and the network search data are consistent in content;
[0021] If the contents of the local search data and the network search data are consistent, the local search data is used as a main component and the network search data is used as a supplement to generate the input data for the reply prompt.
[0022] Furthermore, after determining whether the local search data and the network search data are consistent in content, the method further includes:
[0023] If the contents of the local search data and the network search data are inconsistent, the input data of the reply prompt is generated using the local search data, the network search data and the user question statement; the local search data includes the update time of the local search data; the network search data includes the update time of the network search data;
[0024] Accordingly, the response generation model obtains an answer to the user's question statement according to the response prompt, including:
[0025] The reply generation model obtains an answer to the user question statement according to the reply requirement of the reply prompt, the update time of the local search data, the update time of the network search data, the local search data, the network search data, the comparison result and the user question statement.
[0026] Furthermore, the method further includes: determining whether there is a cache in the cache library; if there is a cache in the cache library, searching the cache library according to the search term; the method further includes: if cache search data is obtained through the cache library, using the cache search data to determine an answer to the user's question statement without waiting for the result of the multi-channel search; accordingly, inputting the reply requirement of the reply prompt and the input data into the reply generation model;
[0027] and / or,
[0028] The method of obtaining a user question sentence input by a user includes: obtaining a user sentence input by a user; determining whether the user sentence needs to be retrieved; and if retrieval is required, using the user sentence as a user question sentence; wherein, the method of determining whether the user sentence needs to be retrieved includes: inputting the user sentence into a sentence recognition model to output a target type of the user sentence; the target type of the user sentence includes a dialogue sentence and / or a user question sentence; if the target type of the user sentence is the dialogue sentence, determining that the user sentence does not need to be retrieved; and if the target type of the user sentence is the user question sentence, determining that the user sentence needs to be retrieved.
[0029] Furthermore, the extracting of search terms based on the user question statement to generate search terms for the user question statement includes:
[0030] Using the user question statement and the user conversation history, generating a search term for the user question statement;
[0031] The step of generating input data for a reply prompt based on the search data and the user question statement includes:
[0032] The input data of the reply prompt is generated using the user conversation history, the user question sentence and the search data.
[0033] The present application provides a data retrieval device, comprising:
[0034] A sentence acquisition module is used to acquire the user question sentence input by the user;
[0035] A search term generation module, used to extract search terms based on the user question statement and generate search terms for the user question statement;
[0036] A parallel search module, used to perform local search in multi-channel search and network search in multi-channel search in parallel according to the search terms;
[0037] The answer determination module is used to determine the answer to the user's question statement based on the search data obtained by the multi-channel search.
[0038] The present application provides an electronic device, comprising one or more processors, for implementing any of the methods described above.
[0039] The present application provides a computer-readable storage medium having a program stored thereon. When the program is executed by a processor, the method described in any one of the above items is implemented.
[0040] The present application provides a computer program product, comprising a computer program / instruction, which implements any of the above methods when executed by a processor.
[0041] In some embodiments, the data retrieval device method of the present application obtains a user question statement input by a user; extracts search terms based on the user question statement to generate search terms for the user question statement; performs parallel search using multi-channel search based on the search terms; and obtains answers to the user question statement based on the search data obtained from the multi-channel search.
[0042] In the embodiment of the present application, by inputting a user question statement once, a multi-channel search can be performed in parallel to obtain an answer to the user's question statement. In this way, the user does not need to perform multiple independent searches, and the search steps are few, making the user operation simple. Moreover, the parallel multi-channel search can automatically obtain the answer to the user's question statement, and the user does not need to judge, analyze and filter by himself, and can also obtain the answer in time. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 Shown is a schematic flow chart of a data retrieval method according to an embodiment of the present application;
[0044] Figure 2 Shown Figure 1 A schematic diagram of a specific flow chart of the data retrieval method shown;
[0045] Figure 3 Shown Figure 1 The data retrieval method shown includes a schematic diagram of user sentence judgment;
[0046] Figure 4 Shown Figure 1 The overall detailed flow chart of the data retrieval method shown;
[0047] Figure 5 The figure is a schematic diagram of a module of a data retrieval device provided in an embodiment of the present application;
[0048] Figure 6 Shown is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0049] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with one or more embodiments of the present specification. Instead, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of the present specification as detailed in the appended claims.
[0050] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.
[0051] In order to solve the problem that the above retrieval steps are complicated and inconvenient for users to operate, an embodiment of the present application provides a data retrieval method.
[0052] Among them, a user question sentence input by the user is obtained; search terms are extracted based on the user question sentence to generate search terms for the user question sentence; based on the search terms, multi-channel search is used for parallel search; based on the search data obtained from the multi-channel search, an answer to the user question sentence is obtained.
[0053] In the embodiment of the present application, by inputting a user question statement once, a multi-channel search can be performed in parallel to obtain an answer to the user's question statement. In this way, the user does not need to search independently multiple times, the search steps are few, and the user operation is simple. Moreover, the parallel multi-channel search can quickly and automatically obtain the answer to the user's question statement, and the user does not need to judge, analyze and filter by himself, and can also obtain the answer in time.
[0054] Figure 1 Shown is a schematic flow chart of the data retrieval method according to an embodiment of the present application.
[0055] like Figure 1 As shown, the data retrieval method may include but is not limited to the following steps 110 to 140:
[0056] Step 110: Obtain the user question statement input by the user.
[0057] The above user question sentence is used to represent a user question sentence of a knowledge question. Accordingly, the answer to the user question sentence below also includes an answer to the knowledge question.
[0058] Step 120 , extracting search terms based on the user's question statement to generate search terms for the user's question statement.
[0059] It should be noted that the search term is used to represent key information of the user's question sentence, such as keywords. The search term is obtained by splitting and interpreting the user's question sentence and extracting keywords.
[0060] In this regard, the above step 120 may further include splitting the user question statement, extracting words from the user question statement, and performing keyword matching on the words according to a pre-configured keyword vocabulary; if it is determined that the keyword matching is successful, generating a search term for the user question statement.
[0061] Step 130, using the search terms, concurrently performs local search in the multi-channel search and network search in the multi-channel search.
[0062] The above multi-channel retrieval can be, for example, a local retrieval in one channel and a network retrieval in another channel. In this way, this article can not only develop or call the local knowledge base for local retrieval to realize local retrieval, but also call the network retrieval to make the retrieval more comprehensive and effective. The above multi-channel retrieval can be used as a multi-channel knowledge acquisition strategy to obtain retrieval data. This process can also be called hybrid retrieval.
[0063] Then, the data corresponding to the multi-channel search are all correct data, including the correct answer data. By inputting the search term once and obtaining the corresponding correct answer data through multi-channel search, accurate answers can be obtained more comprehensively and effectively.
[0064] Step 140, based on the search data obtained through the multi-channel search, determine the answer to the user's question statement.
[0065] Since the retrieval data obtained by the above multi-channel retrieval needs to be processed later to determine the answer to the user's question statement, the retrieval data obtained by the multi-channel retrieval can also be called candidate answers. The candidate answers include, for example, candidate documents. The candidate answers are input into the response generation model to obtain the final answer to the user's question statement. Please refer to the following for detailed description.
[0066] When generating, the large model of the related technology may give wrong answers and cannot guarantee the accuracy of the output. For example, when answering user questions, the large model is prone to give wrong answers, such as: "If all cats are afraid of water, and my cat is not afraid of water, then is my cat a dog?" Under this question, GPT (Generative Pre-trained Transformer) will reply "yes", but the correct answer is "No, even if your cat is not afraid of water, it does not mean that it has become a dog, it still belongs to the cat family."
[0067] Compared with the related art, in this article, by inputting a user question statement once, multi-channel retrieval can be realized for parallel retrieval to obtain the answer to the user question statement. In this way, the user does not need to switch to different retrieval positions one by one for retrieval, and the user operation is simple. At the same time, multi-channel retrieval and the correct answer data corresponding to the multi-channel retrieval can obtain accurate answers more comprehensively and effectively, and reduce wrong answers.
[0068] Figure 2 Shown Figure 1 The specific flow chart of the data retrieval method shown.
[0069] Combination Figure 1 As shown, Figure 2 As shown, the above step 140 may further include the following steps 141 to 142:
[0070] Step 141, based on the search data obtained through multi-channel search and the user's question statement, generate input data for a reply prompt; the reply prompt includes a reply requirement.
[0071] The above reply prompt allows users to guide the model to generate the expected output by designing and inputting specific text prompts. This method allows users to customize the behavior of the model according to specific tasks or application scenarios, rather than relying solely on a fixed mapping relationship between input and output. This flexibility allows the model to adapt to different contexts and needs more accurately.
[0072] Step 142, input the reply requirements and input data of the reply prompt into the reply generation model to output the answer to the user's question statement; the reply generation model obtains the answer to the user's question statement according to the reply requirements and input data of the reply prompt.
[0073] The specific implementation method of the above step 142 to obtain the answer to the user's question statement is: input the reply requirement and input data of the reply prompt into the reply generation model, and obtain the answer to the user's question statement through the reply generation model.
[0074] The above-mentioned reply generation model represents the answer that can be replied to the user's question statement. The reply generation model can be a model applied to various fields, such as a dialogue model, an evaluation model, etc., which will not be given as examples here. The dialogue model is, for example, a dialogue model based on a recurrent neural network (RNN), an encoding transformer, etc. architecture, which realizes automatic dialogue generation by learning the distribution of the dialogue history and the target generated response.
[0075] The above reply generation model may include but is not limited to various neural network and / or attention mechanism models. Various neural networks may include but are not limited to one or more of the following: Convolutional Neural Networks (CNNs), reinforcement learning models, and Generative Adversarial Networks (GANs).
[0076] The above-mentioned reply generation model in this article can be determined by the following steps: obtaining training sample data, the training sample data includes user question sentences, answers to user question sentences, reply requirements of reply prompts, and input data of reply prompts; obtaining a reply generation model to be trained, and inputting the training sample data into the reply generation model to be trained to obtain a trained reply generation model as the reply generation model in this article. Subsequently, the answer to the user question sentence is obtained by using the reply generation model.
[0077] In related technologies, external knowledge such as web retrieval knowledge, local retrieval knowledge, and knowledge graph knowledge are used for enhancement. However, this knowledge often exists in isolation and lacks effective interaction and integration, which makes user retrieval complex when the model handles complex tasks.
[0078] Compared with the related art, in this paper, multi-channel retrieval is performed in parallel, and input data for reply prompts is generated based on retrieval data and user question statements, realizing data fusion for multi-channel retrieval and reducing the complexity of retrieval. In addition, according to the reply requirements and input data of the reply prompt, the answer to the user's question statement is obtained, which can provide customized and targeted services for the user's question statement, which is more flexible and can improve the output quality of the reply generation model and user experience.
[0079] Combination Figure 1 and Figure 2 As shown, the above step 120 can be implemented by the following two optional implementation methods:
[0080] In an optional implementation, the user question statement and the user conversation history are used to generate search terms for the user question statement.
[0081] The application scenario of this optional implementation method is as follows: when the user question statement is not input for the first time and has a context, that is, a user conversation history, the user conversation history and the user question statement are used to generate a search term for the user question statement.
[0082] For example, a user question sentence is, for example, "What is the weather like in Guangzhou today?" The answer to the user question sentence is, for example, "The current temperature in Guangzhou is 29°, cloudy, with an east wind of level 1. The temperature range today is 27° to 34°, and the air quality is excellent." The user question sentence and the answer to the reply in this question-and-answer process can be called the user conversation history.
[0083] Next, the user question is "How is Xi'an?" Combined with the above content, that is, the above user conversation history, it can be determined that the search term of the user question is, for example, "Xi'an, today's weather." It can be seen that the actual question of this user question is: "How is the weather in Xi'an today?" Based on this, continue to determine the answer to the user question.
[0084] Combination Figure 2As shown in the figure and an optional implementation of the above step 120, correspondingly, the input data for generating a reply prompt based on the search data and the user question statement in the above step 141 may include but is not limited to: using the user conversation history, the user question statement and the search data to generate the input data for the reply prompt. In this way, the user question statement and all the contents of the above are combined to make the user question statement more comprehensive and accurate, and the search terms are extracted more effectively, so that the answer to the user question statement is more comprehensive and accurate.
[0085] Of course, for the above optional implementation, if the user conversation history does not exist, the user conversation history may be assumed to be empty and the execution may continue.
[0086] In another optional implementation, the user question statement is used to directly generate the search terms of the user question statement. Exemplarily, the application scenario of this optional implementation is as follows: when the user question statement is input for the first time and there is no previous context, i.e., user conversation history, the user question statement is directly used to generate the search terms of the user question statement.
[0087] Combination Figure 2 As shown in the figure and another optional implementation of the above step 120, correspondingly, the input data for generating a reply prompt based on the search data and the user question statement in the above step 141 may include but is not limited to: using the user question statement and the search data to generate the input data for the reply prompt. In this way, the answer to the reply to the user question statement can be quickly obtained.
[0088] Figure 3 Shown Figure 1 The data retrieval method shown includes a schematic diagram of user sentence judgment.
[0089] Combination Figure 1 As shown, Figure 3 As shown, the above step 110 may further include the following steps 111 to 114:
[0090] Step 111: Obtain the user sentence input by the user.
[0091] The above user statement is used to indicate that the user needs to interact with the system. The user statement refers to the information input by the user at the input position of the display interface of the system. The display interface can be a web page display interface of an electronic device or a display interface of an APP (Application), which will not be given one by one here.
[0092] Step 112, determining whether the user statement needs to be retrieved.
[0093] Among them, the above-mentioned step 112 may, but is not limited to, include inputting the user sentence into a sentence recognition model to output the target type of the user sentence; the target type of the user sentence includes a dialogue sentence and / or a user question sentence; if the target type of the user sentence is a dialogue sentence, it is determined that the user sentence does not need to be retrieved; if the target type of the user sentence is a user question sentence, it is determined that the user sentence needs to be retrieved.
[0094] The above sentence recognition model is, for example, a binary classification model. Among them, the binary classification model is, for example, a neural network model (Neural Networks): including multi-layer perceptron (MLP) and deep neural network, etc., which learn the complex mapping relationship between input and output through multi-level neurons and activation functions. Another example of this binary classification model is a support vector machine (SVM): SVM is a classic binary classification model that classifies by finding the optimal hyperplane in the feature space. It improves generalization ability by maximizing the interval (margin) between categories.
[0095] Step 113: When retrieval is required, the user statement is used as the user question statement.
[0096] Step 114, without the need for retrieval, generates a dialogue that does not contain knowledge in response to the user's statement.
[0097] The difference between the answer to the user's question statement and the replied dialogue is that the replied dialogue does not include knowledge, but only completes the communication dialogue without returning knowledge. However, the answer to the user's question statement contains knowledge, which is used to return the knowledge required by the user, and the knowledge is presented in the form of an answer.
[0098] For example, a user statement such as a regular communication dialogue directly generates a dialogue in which the regular communication dialogue is replied. For example, the user statement is "Hello". The dialogue in which the user statement is replied is "Hello, how can I help you?"
[0099] Combination Figure 1 As shown, the method further includes: step 121, determining whether there is cache in the cache library. Step 122, if there is cache in the cache library, searching in the cache library according to the search term. If there is no cache in the cache library, continuing to execute step 130.
[0100] The cache library can implement a cache mechanism. The cache data of the cache library is the user question statements that have been searched and the answers to them. Further, the cache data of the cache library can be the answers to the user question statements and the user question statements determined after the mixed search in step 130.
[0101] In some examples, the cache data of the cache library may be network search data obtained by network search. For example, the cache library is indexed by search terms, and the network search data includes network titles, website addresses, time, network content, etc., which will not be listed one by one here.
[0102] In other examples, the cached data of the cache library may also be local search data obtained by local search. For example, the local search data is a local document, the cache library is indexed by the search term, and the cached local search data includes local documents, local document addresses, and local document answers, which are not listed one by one here.
[0103] Continue as Figure 3 As shown, the method further includes: step 123, if the cache retrieval data is obtained through the cache library, the cache retrieval data is used to determine the answer to the user's question statement without waiting for the result of the multi-channel retrieval; accordingly, the reply requirement and input data of the reply prompt are input into the reply generation model. In this way, the cache retrieval data is directly used to reply the answer, so that the answer to the user's question statement does not need to be repeatedly used to regenerate the answer to the user's question statement, and the user's question statement can be responded to more quickly and effectively.
[0104] The specific scheme for the above cache library retrieval is as follows:
[0105] (1) Set up a local cache library, and record the "search terms and cached search results" of knowledge retrieval using search terms in the cache.
[0106] (2) Set the cache time to N hours. The stored content will be automatically deleted after N hours. N represents the length of time, which can be set according to user needs.
[0107] (3) Each time a search obtains an answer, the cache library will be searched synchronously. If there are results in the search library, the results of the cache library will be returned.
[0108] In an optional embodiment of the present application, a cache mechanism implemented using a cache library can reduce retrieval time, improve retrieval efficiency, and in certain circumstances can also cope with a surge in retrieval in response to sudden events.
[0109] Of course, in other optional embodiments, it is also possible to not set up a cache mechanism and directly use the search term to execute the above step 120, which is not limited here.
[0110] Figure 4 Shown Figure 1 The overall detailed flowchart of the data retrieval method is shown.
[0111] Combination Figures 1 to 3 As shown, Figure 4As shown, for the hybrid search in the above step 120, when the local search in the multi-channel search and the network search in the multi-channel search are performed in parallel, various search situations may occur.
[0112] In the first search situation, the local search may obtain the local search data first within the first scheduled time without waiting for the network search data. The local search data is then used first to output the answer given by the response generation model. Since the local search time is short and the network search time is longer, returning the local search data first can quickly respond to the user's question statement. At the same time, using multi-channel search and the selection logic between the multiple knowledge corresponding to the multi-channel search, the search time is limited through the first scheduled time to solve the problem that the web search may time out. Please see below for detailed description.
[0113] Among them, the local search in the above multi-channel search may include but is not limited to local text search and / or local knowledge graph search. Among them, local text search may include but is not limited to text search enhancement. Local knowledge graph search may include but is not limited to knowledge graph search enhancement.
[0114] 1. Local text search in local search can include but is not limited to the following three methods to perform text search:
[0115] 1) By labeling and classifying the text in advance, search by searching the text’s label. For example, search target: international economic news in November 2023. Label 1: News; Label 2: International Economy; Label 3: 2023; Label 4: November. By matching these four labels, news that meets the user’s intent can be found.
[0116] 2) Text retrieval by keywords. One is the most basic full-text retrieval, which scans every file in the entire document collection and matches keywords to each file; the other is index retrieval, which first creates an index for all files, and when searching, directly searches for keywords in the index, greatly improving search efficiency. Common retrieval methods include TF-IDF, BM25, etc.
[0117] 3) Through text vectorization (Embedding). Use the vector space (Embedding) model to vectorize and store the documents in advance, and then embed the user questions during the query, and finally perform similarity matching between the two.
[0118] 4) Comprehensively search the above steps 1), 2) and 3) and conduct joint search.
[0119] 2. Knowledge graph retrieval in local retrieval is a graph database that stores knowledge in the form of triples, such as "someone-nationality-China". The detailed description of knowledge graph retrieval is as follows:
[0120] 1) Extract the entity that the user wants to ask from the user conversation. For example, "Where was someone born?" Extract the entity "someone".
[0121] 2) Knowledge graph retrieval. It can retrieve all the relationship-entities around the entity, such as: all information related to a certain thing, "a certain thing-nationality-China", "a certain thing-foreign name-mǒu mǒu", "a certain thing-ethnicity-Han"... etc.
[0122] 3) Relationship matching. Based on the user's statement, determine which relationship the user wants to inquire about. "Where was someone born?" matches the relationship "birthplace" and obtains the triple: "someone-birthplace-Xuhui District, Shanghai".
[0123] 4) Provide the retrieved triple information to the response generation model, so that the response generation model can generate answers that conform to human habits, such as: "So-and-so was born in Xuhui District, Shanghai".
[0124] Combination Figure 2 As shown, Figure 4 As shown, step 141 may include but is not limited to: if the local search data obtained by the local search is used within the first predetermined time, a reply prompt is generated based on the user question statement and the local search data without waiting for the result of the network search.
[0125] Combination Figure 4 As shown, the local search data obtained by local search is determined by the following multiple optional embodiments:
[0126] Continue as Figure 4 As shown, in a first optional embodiment, if the knowledge graph search in the local search is used to search for triple retrieval data within the first predetermined time, the triple retrieval data is used as the local retrieval data. The user question statement and the local retrieval data are used to generate input data for the reply prompt.
[0127] The first predetermined time in this article and the second predetermined time below are both used to limit the duration of the search to avoid a long search time. The first predetermined time and the second predetermined time below can be set according to user needs. The second predetermined time can be longer than the first predetermined time. Exemplarily, the first predetermined time can be but not limited to less than 10 seconds. Exemplarily, the first predetermined time can be but not limited to 2 seconds, 3 seconds, 4 seconds, 5 seconds, 6 seconds, 7 seconds.
[0128] In the first example, the above knowledge graph retrieval generates a reply prompt prompt1:
[0129] """
[0130] You are an assistant who responds to the user's statements based on the text given by Human.
[0131] Response requirements for reply prompts:
[0132] -Reply to the user Human from the given [candidate answers] based on the [user conversation history] and [user statements].
[0133] -The content of the reply must be derived from the [candidate answer] and cannot be fabricated out of thin air.
[0134] -If there is no suitable answer in [Candidate Answers], it means that you don’t know.
[0135] -Reply in a tone close to that of a human.
[0136] - The reply should not exceed 200 words.
[0137]
User conversation history
[0138] Human: I really like so-and-so
[0139] AI: She seems to have died recently.
[0140]
User statement
[0141] Human: When did she die? [Candidate answer]
[0142] Tuple1: (someone, date of death, year, month, day)
[0143] tuple2: ...
[0144] """
[0145] In a second optional embodiment, if the local text search in the local search is used within the first predetermined time to obtain text search data, the text search data is used as the local search data. The user question statement and the local search data are used to generate input data for the reply prompt.
[0146] This second example is similar to the first example above, where the knowledge graph is retrieved to generate the reply prompt prompt1, except that the final candidate answer is different. In this second example, based on the local text retrieval, the reply prompt prompt2 is generated:
[0147] """
[0148] You are an assistant who responds to the user's statements based on the text given by Human.
[0149] Response requirements for reply prompts:
[0150] -Reply to the user Human from the given [candidate answers] based on the [user conversation history] and [user statements].
[0151] -The content of the reply must be derived from the [candidate answer] and cannot be fabricated out of thin air.
[0152] -If there is no suitable answer in [Candidate Answers], it means that you don’t know.
[0153] -Reply in a tone close to that of a human.
[0154] - The reply should not exceed 200 words.
[0155]
User conversation history
[0156] Human: I really like so-and-so
[0157] AI: She seems to have died recently.
[0158]
User statement
[0159] Human: When did she die? [Candidate answer]
[0160] text1: On a certain day of a certain month of a certain year, someone died of illness at the age of X.
[0161] text2:... ...
[0163] """
[0164] In a third optional embodiment, if the knowledge graph search and local text search in the local search are used within the first predetermined time, and the corresponding triple search data and text search data are obtained, the triple search data and the text search data are merged, and the search data of the knowledge graph is sorted before the search data of the local document as the local search data. The user question statement and the local search data are used to generate input data for the reply prompt.
[0165] This third example is similar to the knowledge graph retrieval to generate the reply prompt prompt1 in the first example above, except that the final candidate answers are different. In this third example, the reply prompt prompt3 is generated based on the knowledge graph and local text data:
[0166] """
[0167] You are an assistant who responds to the user's statements based on the text given by Human.
[0168] Response requirements for reply prompts:
[0169] -Reply to the user Human from the given [candidate answers] based on the [user conversation history] and [user statement question].
[0170] -The content of the reply must be derived from the [candidate answer] and cannot be fabricated out of thin air.
[0171] -If there is no suitable answer in [Candidate Answers], it means that you don’t know.
[0172] -Reply in a tone close to that of a human.
[0173] - The reply should not exceed 200 words.
[0174] PROM, input content: Spelled input
[0175]
User conversation history
[0176] Human: I really like XXXX (knowledge graph) and documents
[0177] AI: She seems to have died recently.
[0178]
User statement
[0179] Human: When did she die? [Candidate answers] (sort the candidate answers)
[0180] Tuple 1: (someone, date of death, year, month, day)
[0181] tuple2: ...
[0182] text1 (document): On a certain day of a certain month of a certain year, someone died of illness at the age of X.
[0183] text2:...
[0184] Reply to the model output: subsequently retrieve all the answer candidates for prompt3, do splicing, and answer this question, such as answering the question: So-and-so died on a certain day of a certain month of a certain year due to illness and ineffective treatment. He was so-and-so in age.
[0185] """
[0186] Compared with the large-model retrieval of related technologies that only relies on a single knowledge retrieval channel, this article combines network retrieval with knowledge graph retrieval and local text retrieval in local retrieval, so as to obtain knowledge from three different retrieval methods at the same time, increasing the richness of knowledge.
[0187] Compared with the web search in the related art, which relies on network search and takes a long time to search or cannot be searched when the network search is not smooth, in this paper, the multi-channel knowledge acquisition strategy is used to use the search results obtained by local search. Because local search has no network delay, the search is faster to make up for the search timeout and network disconnection that may occur in web search, and achieve a quick response to user questions. At the same time, local knowledge is knowledge that has been screened, has higher reliability, and is more in line with user needs.
[0188] Continue to see Figure 4 As shown, compared with the first retrieval situation, in the second retrieval situation, the difference is that if no local retrieval data is obtained by using the local retrieval within the first predetermined time, and the network retrieval data is obtained by using the network retrieval within the second predetermined time, the network retrieval data is used to output the answer replied by the reply generation model. The user question statement and the network retrieval data are used to generate input data for the reply prompt.
[0189] Among them, the network search in the above-mentioned multi-channel search may include but is not limited to network web search enhancement.
[0190] We leverage web retrieval to enhance our generative response model by first using a Transformer-based neural network model to generate representations of questions and documents, and then ranking these representations to determine which documents are most likely to contain the answer to the question.
[0191] The above network search is described in detail as follows:
[0192] 1) Question understanding: When a user asks a question, the system first uses a large language model (such as
[0193] GPT-3) to understand and handle this problem.
[0194] 2) Document retrieval: Next, the system performs a web search to find documents that may contain the answer. This process uses a method called "dense vector retrieval", which embeds both the question and the document into a high-dimensional vector space and determines which documents are most relevant to the question by calculating the distance between the vectors.
[0195] 3) Document ranking: The system ranks the retrieved documents according to their relevance to the question. This step uses a Transformer-based neural network model that is trained to determine which documents are most likely to contain the answer to the question.
[0196] 4) Answer generation: The system uses another large language model to read and understand the highest-ranked documents and generate an answer. This process uses a method called "extractive question answering", which can extract information from the document to directly answer the question.
[0197] Based on this, a maximum time limit is set for the three searches of knowledge graph search, local text search and network search. After the time limit is exceeded, the search results will be discarded. In addition to the first predetermined time limit, the web search also has a second predetermined time limit.
[0198] For the second search case mentioned above, based on the network search data, a reply prompt prompt4 is generated:
[0199] """
[0200] You are an assistant who responds to the user's statements based on the text given by Human.
[0201] Response requirements for reply prompts:
[0202] -Reply to the user Human from the given [candidate answers] based on the [user conversation history] and [user statements].
[0203] -The content of the reply must be derived from the [candidate answer] and cannot be fabricated out of thin air.
[0204] -If there is no suitable answer in [Candidate Answers], it means that you don’t know.
[0205] -Reply in a tone close to that of a human.
[0206] - The reply should not exceed 200 words.
[0207]
User conversation history
[0208] Human: I really like so-and-so
[0209] AI: She seems to have died recently.
[0210]
User statement
[0211] Human: When did she die? [Candidate answer]
[0212] Title1: The cause of death of XXX is officially announced
[0213] time1: year, month, and day
[0214] text1: The cause of death of a certain person was officially announced: A certain person, a woman full of vitality and charm, died at the age of only a certain year. According to medical identification, she was not a patient with lupus erythematosus as rumored on the Internet, but a patient with a sudden heart attack. This young woman left...
[0215] title2:...
[0216] time2:...
[0217] text2:... ...
[0219] """
[0220] Continue to see Figure 4 As shown, in the third retrieval situation, within the first predetermined time, local retrieval data is obtained by using local retrieval, and network retrieval data is obtained by using network retrieval. Based on the fusion of these retrieval data, the answer replied by the reply generation model is output. The detailed description is as follows:
[0221] Combination Figure 2 As shown, the above step 141 may further include using the user question statement, local search data and network search data to generate input data for a reply prompt if the local search data obtained by the local search is used within the first predetermined time, and the network search data obtained by the network search is used.
[0222] Compared with the single knowledge strategy of related technologies, in this paper, the fusion strategy between multiple knowledge uses local knowledge to verify network knowledge, which can ensure that the content retrieved from the web is accurate to a certain extent, and then uses network knowledge and local documents to expand the content of the knowledge graph, thereby improving the richness of knowledge graph knowledge and the logic of document knowledge.
[0223] Furthermore, if the local search data obtained by the local search is used, and the network search data obtained by the network search is used, the user question statement, the local search data and the network search data are used to generate the input data for the reply prompt, which may include but is not limited to the following three steps:
[0224] In the first step, if the local search data obtained by the local search is used within the first predetermined time, and the network search data obtained by the network search is used, then in the case where the local search data is external data, the local search data and the network search data are compared to determine whether the contents of the local search data and the network search data are consistent.
[0225] The above external data refers to data other than the company's internal data, which can also be called open domain knowledge. The above external data is data stored on web pages. The company's internal data can include but is not limited to internal company documents, business-related documents, and maintenance content.
[0226] Based on this, the above method further includes using the local search data as local search data when the local search data is company internal data, and using the user question statement and the local search data to generate input data for a reply prompt, so as to continue to execute step 140.
[0227] In the second step, if the content of the local search data and the network search data is consistent, the local search data is used as the main data and the network search data is used as the supplement to generate the input data for the reply prompt. In this way, the local search data of the present application is more accurate and the network search data is supplemented, making the search data richer and more comprehensive.
[0228] The content consistency in this article refers to the search answers that represent the same content. For example, the same content uses sentences or documents containing the same keywords. For another example, the same content contains the same keywords. I will not give examples one by one here.
[0229] For the same content, online search data is richer and has more detailed data information. Local search data is manually screened, so local search data is more accurate. Therefore, the above is mainly based on local search data, and it can be considered that local data is a high-quality answer that has been manually screened. The above uses online search data as a supplementary answer to local search data to make the final answer more complete.
[0230] For example, the user's question sentence is "What is the closing time of a certain meeting in Hangzhou?" The corresponding keywords are, for example, "Hangzhou", "certain meeting" and "closing time".
[0231] The local search data is "The closing ceremony of a certain meeting in Hangzhou was held on the evening of a certain day of a certain month of a certain year."
[0232] The online search data is "The closing ceremony of a certain meeting in Hangzhou is the closing event of a certain meeting in Hangzhou. It is held at the Hangzhou Olympic Sports Center Stadium on the evening of a certain day in a certain month of a certain year."
[0233] In an embodiment of the present application, network retrieval is combined with knowledge graph retrieval and local text retrieval in local retrieval, and the results obtained from the three are integrated through multi-channel knowledge to generate input data for reply prompts, and the final candidate answers (knowledge answers) are obtained. The obtained candidate answers are given to the reply generation model to generate answers to the user's question statement.
[0234] The third step is to use the local search data, network search data and user question statements to generate input data for reply prompts if the contents of the local search data and the network search data are inconsistent; the local search data includes the update time of the local search data; the network search data includes the update time of the network search data.
[0235] Accordingly, the reply generation model obtains the answer to the user's question statement according to the reply prompt, including:
[0236] The reply generation model obtains an answer to the user's question statement according to the reply requirements of the reply prompt, the update time of the local search data, the update time of the network search data, the local search data, the network search data, the comparison results and the user's question statement.
[0237] Specifically, <1> If the update time of the local search data is newer (later) than the network search data, the local search data is used to reply to the user, and the network search data is discarded;
[0238] <2> If the time of the network search data is newer (later) than the update time of the local search data, the network search data is used to reply to the user, and the local search data and the network search data are recorded, and the local search knowledge base is updated after manual review.
[0239] In some examples, the contents of the network search data obtained by network search and the local search data obtained by local search are inconsistent:
[0240] """
[0241] From the given [local document 1] (, [local document 2], ...), determine whether there are documents in the [candidate documents] that have the same answer to the [user question], and output the consistent documents and inconsistent documents respectively.
[0242] If the contents are consistent, please output the consistent contents and the local document serial number related to the candidate document;
[0243] If all the contents are inconsistent, please output the document serial number of all the inconsistent contents and explain the reason, and only output valid sample JSON. Here is an example of inconsistent content:
[0244] '”
[0245]
User Question
[0246] What is the closing time of a certain meeting in Hangzhou?
[0247]
Local Document 1
[0248] Hangzhou XXXX Conference, referred to as "Hangzhou XXXX Conference", will be held in Hangzhou, Zhejiang, China, from XXXX to XXXX.
[0249]
Local Document 2
[0250] Hangzhou XX Conference, referred to as "Hangzhou XX Conference", Hangzhou XX Conference was held in Hangzhou, Zhejiang, China from XX year to XX month. The Olympic Council of Asia announced that the time was changed.
[0251]
Candidate Document
[0252] Title: Hangzhou XXX Club
[0253] time: year, month, day
[0254] Text: Hangzhou XXXX meeting officially closed on the evening of XXXX month
[0255]
Output
[0256] [{'Result':'Inconsistent','Document Serial Number':['Local Document 1'],'Reason':'On a certain date in a certain month in a certain year, the Olympic Council of Asia announced that the Hangzhou XX Conference had changed its date and would be held from a certain date in a certain month in a certain year to a certain date in a certain month'},{'Result':'Consistent','Document Serial Number':['Local Document 2']}]
[0257] '”
[0258] Input only the following generated reply prompt prompt5 to the above reply generation model:
[0259]
User Question
[0260] When did XXX die?
[0261]
Local Document 1
[0262] (XXX, date of birth, year, month, day)
[0263]
Candidate Document
[0264] Title: The cause of death of XXX is officially announced
[0265] time: year, month, day
[0266] text: The cause of death of XXX is officially announced: XXX, a woman full of vitality and charm, died at the age of XXX. The cause of death was officially announced on a certain date in a certain month in a certain year. According to medical identification, she was not a patient with lupus erythematosus as rumored on the Internet, but a patient with sudden heart attack. This young woman left...
[0267] """
[0268] In this way, by replying to prompt5, the output will be [{'result':'inconsistent', 'reason':'the candidate document shows that someone has died on a certain date in a certain year, but it is not mentioned in the local document'}, {'result':'consistent', 'document number': []}]
[0269] In other examples, the contents of the network search data obtained based on the network search and the local search data obtained based on the local search are consistent, and the generated reply prompt prompt6 is:
[0270] """
[0271] You are an assistant who responds to the user's statements based on the text given by Human.
[0272] Response requirements for reply prompts:
[0273] -Reply to the user Human from the given [high-quality answers] and [supplementary answers] based on [user conversation history] and [user statements].
[0274] -Focus on [high-quality answers], and use [supplementary answers] as a supplement to [high-quality answers].
[0275] -The content of the reply must be derived from [high-quality answers] and [supplementary answers] and cannot be fabricated out of thin air.
[0276] -If there is no suitable content in [Quality Answer] and [Supplementary Answer], it means that you don’t know.
[0277] -Reply in a tone close to that of a human.
[0278] - The reply should not exceed 200 words.
[0279]
User conversation history
[0280] Human: I really like so-and-so
[0281] AI: She seems to have died recently.
[0282]
User statement
[0283] Human: When did she die? [Quality answer]
[0284] text1: On a certain day of a certain month of a certain year, someone died due to illness and ineffective medical treatment.
[0285] Tuple1: (XXX, date of death, year, month, day)
[0286]
Supplementary answer
[0287] Title1: The cause of death of XXX is officially announced
[0288] time1: year, month, and day
[0289] text1: The cause of death of a certain person was officially announced: A certain person, a woman full of vitality and charm, died at the age of only a certain year. According to medical identification, she was not a patient with lupus erythematosus as rumored on the Internet, but a patient with a sudden heart attack. This young woman left...
[0290]
Quality Answer
[0291] text1:...
[0292]
Supplementary answer
[0293] title1:...
[0294] time1:...
[0295] text1:...
[0296] """
[0297] In this way, based on local knowledge, the response prompt 6 is handed over to the response generation model for generation. At this time, the output will be "XXX died of a sudden heart attack on a certain day of a certain month of a certain year, and the medical treatment was ineffective."
[0298] Continue to see Figure 4 As shown, in the fourth retrieval situation, no local retrieval data is obtained by using local retrieval within the first predetermined time, and no network retrieval data is obtained by using network retrieval within the second predetermined time after the first predetermined time has passed, so no knowledge is obtained and no knowledge is returned. Let the reply generation model generate a reply and indicate that it is the content generated by the reply generation model, and the return indicates that there is no knowledge.
[0299] For example, if the local search does not obtain local search data within 4 seconds, and the network search does not obtain network search data within 6 seconds, no knowledge is returned.
[0300] In the above embodiments, the data retrieval method is described in detail, and the present application also provides an embodiment corresponding to a data retrieval device. It should be noted that the present application describes the embodiments of the device part from two perspectives, one is based on the perspective of functional modules, and the other is based on the perspective of hardware structure.
[0301] Figure 5 Shown is a module schematic diagram of a data retrieval device provided in an embodiment of the present application.
[0302] like Figure 5 As shown, the data retrieval device may include, but is not limited to, the following modules:
[0303] A sentence acquisition module 31 is used to acquire a user question sentence input by a user;
[0304] A search term generation module 32, used to extract search terms based on the user's question statement and generate search terms for the user's question statement;
[0305] A parallel search module 33, for performing local search in multi-channel search and network search in multi-channel search in parallel according to the search terms;
[0306] The answer determination module 34 is used to determine the answer to the user's question statement based on the search data obtained through the multi-channel search.
[0307] In some embodiments, the answer determination module 34 specifically includes:
[0308] The reply prompt generation submodule is used to generate input data for the reply prompt based on the search data obtained from the multi-channel search and the user question statement; the reply prompt includes a reply requirement;
[0309] The sending submodule is used to input the reply requirements and input data of the reply prompt into the reply generation model, so that the reply generation model obtains an answer to the user's question statement according to the reply requirements and input data of the reply prompt;
[0310] The receiving and displaying submodule is used to receive and output the answer given by the response generation model.
[0311] The implementation process of the functions and effects of each module / sub-module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and the same technical effect can be achieved, which will not be repeated here.
[0312] An embodiment of the present application provides an electronic device, including the above data retrieval device.
[0313] The data retrieval device of the embodiment of the present application is applied to an electronic device. The electronic device may be a server device. The server device may include but is not limited to a server, a desktop computer, a tablet computer or a laptop computer.
[0314] Figure 6 Shown is a schematic structural diagram of an electronic device 50 provided in an embodiment of the present application.
[0315] like Figure 6 As shown, the electronic device 50 includes one or more processors 51 for implementing the above data retrieval device method.
[0316] In some embodiments, the electronic device 50 may include a storage medium 59. For example, the computer-readable storage medium may store a program that can be called by the processor 51, and may include a non-volatile storage medium. In some embodiments, the electronic device 50 may include a memory 58 and an interface 57. In some embodiments, the electronic device 50 may also include other hardware according to actual applications.
[0317] The computer-readable storage medium of the embodiment of the present application stores a program thereon, and when the program is executed by the processor 51, it is used to implement the data retrieval device method described above.
[0318] The present application provides a computer program product, comprising a computer program / instruction, which implements any of the above methods when executed by a processor.
[0319] The present application may take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing program code. Computer-readable storage media include permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer-readable storage media include but are not limited to: phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
[0320] The above description is only a preferred embodiment of this specification and is not intended to limit this specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this specification should be included in the scope of protection of this specification.
[0321] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the phrase "includes a ..." defines an element, and does not exclude the presence of other identical elements in the process, method, commodity or device including the element.
Claims
1. A data retrieval method, characterized in that: include: Get the user question sentence entered by the user; Extracting search terms based on the user question statement to generate search terms for the user question statement; According to the search terms, a local search in a multi-channel search and a network search in a multi-channel search are performed in parallel; Based on the search data obtained through the multi-channel search, an answer to the user's question statement is determined.
2. The data retrieval method according to claim 1, characterized in that: Determining the answer to the user's question statement based on the search data obtained by the multi-channel search includes: Generating input data for a reply prompt based on the search data obtained by the multi-channel search and the user question statement; the reply prompt includes a reply requirement; The reply requirements of the reply prompt and the input data are input into a reply generation model to output an answer to the user's question statement; the reply generation model obtains an answer to the user's question statement according to the reply requirements of the reply prompt and the input data.
3. The data retrieval method according to claim 2, characterized in that: The step of generating input data for a reply prompt based on the search data obtained through the multi-channel search and the user question statement includes: If the local search data obtained by the local search is used within the first predetermined time, the reply prompt is generated based on the user question statement and the local search data without waiting for the result of the network search.
4. The data retrieval method according to claim 3, characterized in that: The local search data obtained by using the local search is determined by the following steps: If the knowledge graph search and local text search of local retrieval are used within the first predetermined time, and the corresponding triple retrieval data and text retrieval data are obtained, the triple retrieval data and the text retrieval data are fused, and the retrieval data of the knowledge graph is sorted in front of the retrieval data of the local document as the local retrieval data.
5. The data retrieval method according to claim 2, characterized in that: The step of generating input data for a reply prompt based on the search data obtained through the multi-channel search and the user question statement includes: If the local search data obtained by the local search is used within the first predetermined time, and the network search data obtained by the network search is used, the input data of the reply prompt is generated using the user question statement, the local search data and the network search data.
6. The data retrieval method according to claim 5, characterized in that: If the local search data obtained by the local search is used within the first predetermined time, and the network search data obtained by the network search is used, the input data of the reply prompt is generated using the user question statement, the local search data and the network search data, including: If the local search data obtained by the local search is used within the first predetermined time, and the network search data obtained by the network search is used, then, if the local search data is external data, the local search data is compared with the network search data to determine whether the local search data and the network search data are consistent in content; If the contents of the local search data and the network search data are consistent, the local search data is used as a main component and the network search data is used as a supplement to generate the input data for the reply prompt.
7. The data retrieval method according to claim 6, characterized in that: After determining whether the local search data and the network search data are consistent in content, the method further includes: If the contents of the local search data and the network search data are inconsistent, the input data of the reply prompt is generated using the local search data, the network search data and the user question statement; the local search data includes the update time of the local search data; the network search data includes the update time of the network search data; Accordingly, the response generation model obtains an answer to the user's question statement according to the response prompt, including: The reply generation model obtains an answer to the user question statement according to the reply requirement of the reply prompt, the update time of the local search data, the update time of the network search data, the local search data, the network search data, the comparison result and the user question statement.
8. The data retrieval method according to claim 1, characterized in that: The method further includes: determining whether there is a cache in the cache library; if there is a cache in the cache library, searching the cache library according to the search term; the method further includes: if cache search data is obtained through the cache library, using the cache search data to determine an answer to the user question statement without waiting for the result of the multi-channel search; accordingly, inputting the reply requirement of the reply prompt and the input data into the reply generation model; and / or, The method of obtaining a user question sentence input by a user includes: obtaining a user sentence input by a user; determining whether the user sentence needs to be retrieved; and if retrieval is required, using the user sentence as a user question sentence; wherein, the method of determining whether the user sentence needs to be retrieved includes: inputting the user sentence into a sentence recognition model to output a target type of the user sentence; the target type of the user sentence includes a dialogue sentence and / or a user question sentence; if the target type of the user sentence is the dialogue sentence, determining that the user sentence does not need to be retrieved; and if the target type of the user sentence is the user question sentence, determining that the user sentence needs to be retrieved.
9. The data retrieval method according to claim 1, wherein: The extracting of search terms based on the user question statement to generate search terms for the user question statement includes: Using the user question statement and the user conversation history, generating a search term for the user question statement; The step of generating input data for a reply prompt based on the search data and the user question statement includes: The input data of the reply prompt is generated using the user conversation history, the user question sentence and the search data.
10. A data retrieval device, characterized in that: include: A sentence acquisition module is used to acquire the user question sentence input by the user; A search term generation module, used to extract search terms based on the user question statement and generate search terms for the user question statement; A parallel search module, used to perform local search in multi-channel search and network search in multi-channel search in parallel according to the search terms; The answer determination module is used to determine the answer to the user's question statement based on the search data obtained by the multi-channel search.
11. An electronic device, characterized in that: The method comprises one or more processors for implementing the data retrieval method according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that: A program is stored thereon, and when the program is executed by a processor, the data retrieval method as described in any one of claims 1 to 9 is implemented.
Citation Information
Cited By
Information retrieval method and device, electronic equipment and computer readable storage medium
CN120429396A
