Question and answer type paper retrieval method
By matching processing functions and parameters with the question-and-answer model, retrieval results are generated, which solves the problem of complexity and low efficiency of existing paper retrieval methods, realizes question-and-answer retrieval, and improves retrieval efficiency and accuracy.
Patent Information
- Application Number
- CN202410765324.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2024-08-27
AI Technical Summary
Existing paper retrieval methods are complex and require users to manually enter keywords and determine their logical relationships, resulting in low retrieval efficiency and the inability to provide search results in a question-and-answer format.
Using the question and answer model, the search results are generated by inputting the matching processing function and function parameters of the questions to be retrieved, and the initial question set is obtained and expanded using large model training to determine whether to obtain the user's historical dialogue and implement question and answer retrieval.
It simplifies the search operation, improves the search efficiency, and provides search results in the form of questions and answers. The operation is simple and accurate.
Smart Images

Figure CN118551017A
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of paper retrieval, and in particular relates to a question-and-answer type paper retrieval method. Background Art
[0002] With the rise of large-scale models, these huge models have demonstrated amazing capabilities, especially in the field of natural language processing. Based on their massive real-world data, large language models not only have powerful logical reasoning capabilities, but also have excellent question-answering capabilities. These models can accurately capture and understand the semantic information in the conversation, thereby providing users with accurate and efficient answers. In addition, large language models can also learn various language rules and knowledge from large amounts of text data, further enhancing their performance in various application scenarios.
[0003] Existing paper retrieval methods usually require users to manually input keywords, which is a cumbersome process. Users are required to judge the keywords and their types, as well as the logical relationship between keywords, and then sort and filter them. This method may be a challenge for users because it requires users to have certain retrieval skills and an in-depth understanding of the retrieval system. Users need to check the front-end text box and then enter the specified keywords. Retrieval results cannot be obtained in the form of dialogue or questions. There are technical problems such as complex retrieval process operations and low retrieval efficiency. Summary of the invention
[0004] In view of the above analysis, the embodiments of the present invention aim to provide a question-and-answer paper retrieval method, device, equipment and medium to solve one or more of the above problems existing in the prior art.
[0005] The object of the present invention is achieved in that:
[0006] The first embodiment of the present invention provides a question-answering paper retrieval method, comprising:
[0007] Inputting the question to be retrieved into the question-answering model, and determining a processing function matching the question to be retrieved;
[0008] Determining function parameters that match keywords of the question to be searched based on the processing function that matches the question to be searched;
[0009] Generate a search result based on the processing function and the function parameters;
[0010] The question-answering model is trained using the following steps:
[0011] Constructing a function set, the function set including processing functions for the problem in the field of the paper and function parameters corresponding to each processing function;
[0012] Construct an initial question set for the processing function according to different combinations among the parameters in each processing function;
[0013] Use the function set and the corresponding initial question set as a training set to fine-tune the pre-trained model to obtain a question-answering model.
[0014] Further, the constructing an initial question set for each processing function according to different combinations among the parameters in each processing function includes:
[0015] Randomly select k parameters from m parameters {p1, p2, p3,..., p m} of each processing function for combination, where k < m, to obtain types of parameter combinations
[0016] Use the large model to generate initial questions for the processing function according to the parameter combination method to form an initial question set
[0017] Further, the determining the processing function that matches the to-be-retrieved question includes:
[0018]
[0018] Calculate the first relevance degree between the to-be-retrieved question and each processing function, and use the processing function with the highest first relevance degree as the processing function that matches the to-be-retrieved question, which is expressed as follows:
[0019]
[0020] where R1 represents the first relevance degree, f i represents the processing function, Q pri represents the to-be-retrieved question, Sim(·,·) represents the relevance degree calculation, Vf i represents the vector representation of the processing function, represents the vector representation of the to-be-retrieved question; f max represents the processing function with the highest first relevance degree.
[0021] Further, the determining the function parameter that matches the keyword of the to-be-retrieved question according to the processing function that matches the to-be-retrieved question includes:
[0022] Calculate the second relevance degree between the keyword in the to-be-retrieved question and different parameter combinations in the processing function with the highest first relevance degree, and use the parameter combination with the highest second relevance degree as the function parameter that matches the keyword of the to-be-retrieved question, which is expressed as follows:
[0023]
[0024] where f maxrepresents the processing function with the highest first relevance, R2 represents the second relevance, Key represents the keyword in the question to be searched, P(f max ) represents the parameter combination of the processing function with the highest first correlation, V Key The vector representation of the keyword, The vector representation of the parameter combination of the first processing function with the highest correlation, P max Indicates the second most relevant parameter combination.
[0025] Furthermore, it also includes:
[0026] According to the information related to the paper in the database, the initial set of questions is expanded through the large model, which is expressed as:
[0027] Q i ′=prompt1(Q i ||Database mess )
[0028] Among them, Q i represents the initial problem set, Q i ′ represents the expanded initial question set, prompt1(·) represents the instruction for the large model to expand the initial question set, ·||· represents the splicing operation, Database mess Represents information related to papers in the database.
[0029] Furthermore, it also includes: determining whether it is necessary to obtain the user's historical conversations; if so, obtaining the historical conversations of a preset round before the question to be retrieved, and integrating the historical conversations into the question to be retrieved; if not, inputting the question to be retrieved into the question-answering model.
[0030] Furthermore, the determining whether it is necessary to obtain the user's historical conversations includes:
[0031] The AC automaton is used to determine whether the query to be searched contains keywords involving historical information, expressed as:
[0032] flag1 = trie(Q pri )
[0033] Among them, flag1 represents the first judgment flag, trie(·) represents the dictionary tree of AC automaton, Q pri Indicates the question to be searched;
[0034] If the first judgment flag is true, it is necessary to obtain the user's historical conversations; if the first judgment flag is false, it is not necessary to obtain the user's historical conversations.
[0035] Furthermore, the determining whether it is necessary to obtain the user's historical conversations also includes:
[0036] The pre-trained large model is used to determine whether the answer to the question to be retrieved needs to be combined with the user's historical conversation, which is expressed as:
[0037] flag2=prompt2(Q pri )
[0038] Among them, flag2 represents the second judgment flag, prompt2(·) represents the instruction for the large model to judge whether it is necessary to obtain the user's historical conversation, Q pri Indicates the question to be searched;
[0039] If the second judgment flag is true, it is necessary to obtain the user's historical conversations; if the second judgment flag is false, it is not necessary to obtain the user's historical conversations.
[0040] A second aspect of the present invention provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the question-and-answer paper retrieval method described in any embodiment is implemented.
[0041] A third aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the question-and-answer paper retrieval method described in any one of the embodiments.
[0042] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects:
[0043] The question-and-answer type paper retrieval method provided by the present invention calls a processing function that matches the question to be searched through a question-and-answer model, and uses the keywords of the question to be searched as function parameters to generate retrieval results, thereby providing retrieval results to users in the form of questions and answers, is simple to operate, and improves retrieval efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of this specification. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0045] Figure 1 A flowchart of the question-answering paper retrieval method provided in Example 1 of the present invention;
[0046] Figure 2 A flow chart of the training process of the question-answering model provided in Example 1 of the present invention;
[0047] Figure 3This is a schematic diagram of the electronic device architecture provided in Example 2 of the present invention. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. It should be noted that, in the absence of conflict, the embodiments and features in the embodiments disclosed in this disclosure can be combined, separated, interchanged and / or rearranged with each other. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0049] Example 1
[0050] A specific embodiment of the present invention, as Figure 1-2 As shown, a question-answering paper retrieval method is disclosed, comprising the following steps:
[0051] S11. Input the question to be retrieved into the question-answering model, and determine a processing function that matches the question to be retrieved.
[0052] Specifically, step S11 includes:
[0053] The first correlation between the question to be retrieved and each processing function is calculated, and the processing function with the highest first correlation is used as the processing function matching the question to be retrieved, which is expressed as follows:
[0054]
[0055]
[0056] Among them, R1 represents the first correlation, f i represents the processing function, Q pri represents the question to be retrieved, Sim(·,·) represents the relevance calculation, Vf i represents the vector representation of the processing function, The vector representation of the question to be retrieved; f max Represents the first processing function with the highest correlation.
[0057] S12: Determine function parameters that match keywords of the question to be searched based on the processing function that matches the question to be searched.
[0058] Specifically, step S12 includes:
[0059] Calculate the second correlation between the keyword in the question to be searched and different parameter combinations in the processing function with the highest first correlation, and use the parameter combination with the highest second correlation as the function parameter matching the keyword in the question to be searched, as shown below:
[0060]
[0061] Among them, f max represents the processing function with the highest first relevance, R2 represents the second relevance, Key represents the keyword in the question to be searched, P(f max ) represents the parameter combination of the processing function with the highest first correlation, V Key The vector representation of the keyword, The vector representation of the parameter combination of the first processing function with the highest correlation, P max Indicates the second most relevant parameter combination.
[0062] S13. Generate search results based on the processing function and the function parameters.
[0063] Specifically, after obtaining the first processing function with the highest relevance and the second parameter combination with the highest relevance through steps S11 and S12, the question-answering model calls the first processing function with the highest relevance, and uses the keywords of the question to be retrieved as the corresponding function parameters, and then generates a search result in combination with the question to be retrieved, which is expressed as follows:
[0064] mess out =Q pri ||(f max (Key)
[0065] Among them, mess out represents the search results, Q pri represents the question to be retrieved, f max It represents the processing function with the highest first relevance, and Key represents the keyword of the question to be searched.
[0066] Compared with the prior art, the question-and-answer type paper retrieval method provided in this embodiment calls the processing function that matches the question to be searched through the question-and-answer model, and uses the keywords of the question to be searched as function parameters to generate retrieval results, thereby providing retrieval results to users in the form of questions and answers. The operation is simple and the retrieval efficiency is improved.
[0067] In this embodiment, the question-answering model is trained using the following steps:
[0068] S21. Construct a function set, wherein the function set includes processing functions for problems in the field of the paper and function parameters corresponding to each processing function.
[0069] Exemplarily, the personBasicInfo() function is used to provide the basic information of a single scholar, including their affiliated institution, title, gender, email, and personal profile; the personInterest() function is used to obtain the research interests of the scholar; the personIndices() function is used to obtain the academic indicators of the scholar, such as academic activity, paper citation volume, academic diversity, G-index, H-index, total number of papers, and social index, etc.; the personCoauthors() function is used to obtain the co-authors of a specific scholar, including their names and the degree of closeness of the cooperation relationship; the personPubs() function is used to obtain the works of the scholar, providing the latest or most famous works; the pubInfo() function is used to provide the basic information of a paper, such as the publication time, journal, and author, etc.; the searchPublication() function is used to provide the paper abstract and the affiliated institution of the author; these functions include parameters such as scholar name, paper name, scholar institution, time, etc.
[0070] S22. Construct an initial question set for the processing functions according to different combinations among the parameters in each processing function.
[0071] In this embodiment, step S22 specifically includes:
[0072] Randomly select k parameters from the m parameters {p1, p2, p3,..., p m} of each processing function, where k < m, to obtain parameter combinations
[0073] Use the large model to generate initial questions for the processing functions according to the parameter combination method, forming an initial question set.
[0074] S23. Use the function set and the corresponding initial question set as a training set to fine-tune the pre-trained model to obtain a question-answering model.
[0075] Exemplarily, use the function set and the initial question set as a training set, and use the LoRA (Low Rank Adaptation) fine-tuning technique to fine-tune the pre-trained model, and then obtain a specialized question-answering model for processing the questions to be retrieved input by the user.
[0076] In some embodiments, step S22 further includes:
[0077] According to the information related to papers in the database, use the large model to expand the initial question set, expressed as:
[0078] Q i′=prompt1(Q i ||Database mess )
[0079] Among them, Q i represents the initial problem set, Q i ′ represents the expanded initial question set, prompt1(·) represents the instruction for the large model to expand the initial question set, ·||· represents the splicing operation, Database mess Represents information related to papers in the database.
[0080] Compared with the prior art, the question-answering paper retrieval method provided in this embodiment expands the initial question set through a large model, so that the question-answering model can more accurately determine the processing functions and parameter combinations that need to be called to answer the questions to be retrieved.
[0081] In some embodiments, since the question to be searched input by the user is relatively simple, the search result may be wrong. Therefore, it is necessary to obtain the user's historical conversation and add it to the question to be searched, as follows:
[0082] Determine whether it is necessary to obtain the user's historical conversations. If necessary, obtain the preset rounds of historical conversations before the question to be retrieved and integrate the historical conversations into the question to be retrieved. If not, input the question to be retrieved into the question-answering model.
[0083] In some embodiments, it can be determined whether the user's historical conversation needs to be obtained by determining whether the question to be searched includes keywords related to historical information, as follows:
[0084] The AC automaton is used to determine whether the query to be searched contains keywords involving historical information, expressed as:
[0085] flag1 = trie(Q pri )
[0086] Among them, flag1 represents the first judgment flag, trie(·) represents the dictionary tree of AC automaton, Q pri Indicates the question to be searched;
[0087] If the first judgment flag is true, it is necessary to obtain the user's historical conversations; if the first judgment flag is false, it is not necessary to obtain the user's historical conversations.
[0088] It should be noted that the AC automaton needs to be constructed manually. The specific construction process is: first, construct a set of keywords, such as "above", "his", "hers", etc.; then, establish a dictionary tree that stores the vocabulary strings; and then define the status of the corresponding nodes and the failure path mechanism.
[0089] In some embodiments, it is also possible to determine whether it is necessary to obtain the user's historical conversations through a large model, as follows:
[0090] The pre-trained large model is used to determine whether the answer to the question to be retrieved needs to be combined with the user's historical conversation, which is expressed as:
[0091] flag2=prompt2(Q pri )
[0092] Among them, flag2 represents the second judgment flag, prompt2(·) represents the instruction for the large model to judge whether it is necessary to obtain the user's historical conversation, Q pri Indicates the question to be searched;
[0093] If the second judgment flag is true, it is necessary to obtain the user's historical conversations; if the second judgment flag is false, it is not necessary to obtain the user's historical conversations.
[0094] Compared with the prior art, the question-answering paper retrieval method provided in this embodiment determines whether it is necessary to obtain the user's historical conversations to answer the question to be retrieved, so that the question-answering model fully understands the user's needs, thereby providing more accurate retrieval results.
[0095] In some embodiments, since the user's questions to be retrieved may include some questions that are irrelevant or insignificant to the field of the paper, in order to improve the efficiency and accuracy of information retrieval, a classification model is used to pre-process these input questions. The task of the classification model is to classify the user's questions into two categories: relevant and irrelevant. For questions that are judged to be irrelevant, the classification model will filter them out, thereby avoiding unnecessary waste of resources and ensuring that the system focuses on processing those queries that are directly related to the task. This method helps to improve the overall user experience because it can reduce user waiting time and ensure that the information obtained by the user is accurate and valuable. By continuously training and optimizing the classification model, its ability to identify relevant questions can be further improved, thereby playing a greater role in processing user queries.
[0096] In some embodiments, the method further includes: storing the question to be searched and the corresponding search results in a log, and optimizing the question-answering model according to the content in the log, specifically including:
[0097] (I) Extract some questions from the log by regularization, expressed as: Q1 = re(Q text )
[0098] Among them, re represents the regularization rule, Q text Indicates a problem stored in the log.
[0099] (II) Calculate the perplexity of the problem and extract the problems whose perplexity is less than the preset threshold, which are expressed as follows:
[0100]
[0101] Among them, ppl(·) represents the perplexity, Indicates the preset threshold.
[0102] (III) Eliminate questions that are not relevant to the paper’s field through screening with a large model;
[0103] (IV) expanding the screened problems, establishing a corresponding relationship between the problems and matching processing functions and function parameters, and obtaining an optimization problem set and an optimization function set;
[0104] (V) Continue to train the question-answering model using the set of optimization questions and the set of optimization functions to improve the accuracy of the model.
[0105] Compared with the prior art, the question-and-answer paper retrieval method provided in this embodiment records the questions to be retrieved and the retrieval results generated by the question-and-answer model in a log, extracts and filters them through regularization and perplexity methods, and then continues to train the question-and-answer model, thereby optimizing the question-and-answer model and improving the accuracy of the model.
[0106] Example 2
[0107] This embodiment provides an electronic device, such as Figure 3 As shown, it includes a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the question-and-answer paper retrieval method as described in any of the above embodiments is implemented.
[0108] Example 3
[0109] This embodiment provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the question-and-answer paper retrieval method as described in any of the above embodiments is implemented.
[0110] Computer readable storage media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer 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, 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 media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0111] The professionals should further realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0112] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0113] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A question-answering paper retrieval method, characterized in that: include: Inputting the question to be retrieved into the question-answering model, and determining a processing function matching the question to be retrieved; Determining function parameters that match keywords of the question to be searched based on the processing function that matches the question to be searched; Generate a search result based on the processing function and the function parameters; The question-answering model is trained using the following steps: Constructing a function set, the function set including processing functions for the problem in the field of the paper and function parameters corresponding to each processing function; According to different combinations of parameters in each processing function, an initial set of questions is constructed for the processing function; The function set and the corresponding initial question set are used as a training set to fine-tune the pre-trained model to obtain a question-answering model.
2. The question-answering paper retrieval method according to claim 1, characterized in that: According to different combinations of parameters in each processing function, an initial set of questions is constructed for each processing function, including: Randomly select k parameters from the m parameters {p1, p2, p3,..., p m} for combination, where k < m, to obtain parameter combinations The large model generates a processing function based on the parameter combination method. Initial Question Composing an initial set of questions 3. The question-answering paper retrieval method according to claim 1, characterized in that: The step of determining a processing function that matches the question to be searched includes: The first correlation between the question to be retrieved and each processing function is calculated, and the processing function with the highest first correlation is used as the processing function matching the question to be retrieved, which is expressed as follows: Among them, R1 represents the first correlation, f i represents the processing function, Q pri represents the question to be retrieved, Sim(·,·) represents the relevance calculation, Vf i Represents the vector representation of the processing function, V Qpri The vector representation of the question to be retrieved; f max Represents the first processing function with the highest correlation.
4. The question-answering paper retrieval method according to claim 3, characterized in that: The step of determining function parameters that match keywords of the question to be searched based on the processing function that matches the question to be searched includes: Calculate the second correlation between the keyword in the question to be searched and different parameter combinations in the processing function with the highest first correlation, and use the parameter combination with the highest second correlation as the function parameter matching the keyword in the question to be searched, as shown below: Among them, f max represents the processing function with the highest first relevance, R2 represents the second relevance, Key represents the keyword in the question to be searched, P(f max ) represents the parameter combination of the processing function with the highest first correlation, V Key The vector representation of the keyword, The vector representation of the parameter combination of the first processing function with the highest correlation, P max Indicates the second most relevant parameter combination.
5. The question-answering paper retrieval method according to claim 2, characterized in that: Also includes: According to the information related to the paper in the database, the initial set of questions is expanded through the large model, which is expressed as: Q i ′=prompt1(Q i ||Database mess ) Among them, Q i represents the initial problem set, Q i ′ represents the expanded initial question set, prompt1(·) represents the instruction for the large model to expand the initial question set, ·||· represents the splicing operation, Database mess Represents information related to papers in the database.
6. The question-answering paper retrieval method according to any one of claims 1 to 5, characterized in that: Also includes: Determine whether it is necessary to obtain the user's historical conversations. If necessary, obtain the preset rounds of historical conversations before the question to be retrieved and integrate the historical conversations into the question to be retrieved. If not, input the question to be retrieved into the question-answering model.
7. The question-answering paper retrieval method according to claim 6, characterized in that: The step of determining whether it is necessary to obtain the user's historical conversations includes: The AC automaton is used to determine whether the query to be searched contains keywords involving historical information, expressed as: flag1=trie(Q pri ) Among them, flag1 represents the first judgment flag, trie(·) represents the dictionary tree of AC automaton, Q pri Indicates the question to be searched; If the first judgment flag is true, it is necessary to obtain the user's historical conversations; if the first judgment flag is false, it is not necessary to obtain the user's historical conversations.
8. The question-answering paper retrieval method according to claim 6, characterized in that: The step of determining whether it is necessary to obtain the user's historical conversations also includes: The pre-trained large model is used to determine whether the answer to the question to be retrieved needs to be combined with the user's historical conversation, which is expressed as: flag2=prompt2(Q pri ) Among them, flag2 represents the second judgment flag, prompt2(·) represents the instruction for the large model to judge whether it is necessary to obtain the user's historical conversation, Q pri Indicates the question to be searched; If the second judgment flag is true, it is necessary to obtain the user's historical conversations; if the second judgment flag is false, it is not necessary to obtain the user's historical conversations.
9. An electronic device, characterized in that: It includes a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, it implements the question-and-answer paper retrieval method as described in any one of claims 1 to 8.
10. A storage medium, characterized in that: A computer program is stored thereon, and when the program is executed by a processor, the question-and-answer paper retrieval method described in any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Multi-engine intelligent question answering system for multi-type knowledge base
CN115238101A
Multi-scene intelligent question answering method and system based on multi-path recall
CN115470338A
Medical auxiliary question and answer method and system based on knowledge calibration and retrieval enhancement
CN117573843A
Question and answer model optimization method and device
CN117992596A
Information retrieval method and apparatus
US20160098437A1
