Paper question answering method and system based on large language model
By extracting the structure of the paper and determining the chapter description information, combined with the large language model, the problem of low response efficiency of existing question-and-answer methods is solved, achieving more accurate and efficient question-and-answer effects.
Patent Information
- Application Number
- CN202510608513.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-13
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2045-05-13
AI Technical Summary
Existing paper-based question-and-answer methods are inefficient in response and it is difficult to quickly and accurately obtain the required information from academic papers.
A paper question-and-answer method based on a large language model is proposed. By extracting the paper structure, spanning the tree structure, and determining the chapter description information based on the node information in the tree structure, using the big model to obtain the target content matching the question, and then generating the answer.
By connecting the logical context of the chapter, the big model accurately grasps the semantic relationship of the target node context, improves the accuracy and efficiency of the question and answer, and avoids information isolation and misjudgment.
Smart Images

Figure CN120124638A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of question - answering technology, and particularly to a method and system for paper question - answering based on large language models. Background Art
[0002] In today's era of information explosion, the speed of knowledge update is accelerating continuously. Therefore, how to quickly obtain the required information from the vast ocean of academic papers has become one of the key factors restricting scientific research progress. However, the response efficiency of current paper - based question - answering methods still needs to be improved. Summary of the Invention
[0003] This application aims to solve at least one of the technical problems in the related art to some extent.
[0004] To this end, the first object of this application is to propose a method for paper question - answering based on large language models.
[0005] The second object of this application is to propose a system for paper question - answering based on large language models.
[0006] The third object of this application is to propose an electronic device.
[0007] The fourth object of this application is to propose a computer - readable storage medium.
[0008] The fifth object of this application is to propose a computer program product.
[0009] To achieve the above object, the first - aspect embodiment of this application proposes a method for paper question - answering based on large language models, including: Based on the composition content of the target paper, extracting the paper structure of the target paper to obtain a tree structure corresponding to the target paper; For any target node in the tree structure, based on the information of the nodes included in the path from the root node of the tree structure to the target node, determining the chapter description information corresponding to the target node; In response to receiving a question about the target paper, using a large model, based on the chapter description information corresponding to the nodes in the tree structure, obtaining the target content in the target paper that matches the question; Based on the target content, answering the question.
[0010] To achieve the above object, the second - aspect embodiment of this application proposes a system for paper question - answering based on large language models, including: An extraction module, configured to extract the paper structure of the target paper based on the composition content of the target paper to obtain a tree structure corresponding to the target paper; A determination module, configured to determine, for any target node in the tree structure, chapter description information corresponding to the target node based on information of nodes included in a path from the root node of the tree structure to the target node; A first acquisition module, configured to, in response to receiving a question about the target paper, use a large language model to acquire target content in the target paper that matches the question based on the chapter description information corresponding to nodes in the tree structure; An answering module, configured to answer the question based on the target content.
[0011] The technical solution provided by this application at least brings the following beneficial effects: Based on the composition content of the target paper, this application extracts the paper structure of the target paper to obtain a tree structure corresponding to the target paper; for any target node in the tree structure, it determines the chapter description information corresponding to the target node based on the information of nodes included in the path from the root node of the tree structure to the target node; in response to receiving a question about the target paper, it uses a large language model to acquire target content in the target paper that matches the question based on the chapter description information corresponding to nodes in the tree structure; and answers the question based on the target content. The path from the root node to the target node can connect the chapter logical context, enabling the large language model to accurately grasp the semantic association of the context of the target node, thereby more accurately and efficiently locating the target content, avoiding misjudgment due to information isolation, and making the answer more in line with the original meaning and logical system of the paper, thus improving the accuracy of the question and answer.
[0012] The additional aspects and advantages of this application will be partially given in the following description, partially become obvious from the following description, or be understood through the practice of this application. Description of the Drawings
[0013] The above and / or additional aspects and advantages of this application will become obvious and easy to understand from the following description of the embodiments in conjunction with the drawings, where: Figure 1 is a schematic flowchart of a method for paper question and answer based on a large language model provided by an embodiment of this application; Figure 2 is a schematic flowchart of a method for paper question and answer based on a large language model provided by another embodiment of this application; Figure 3 is a schematic flowchart of a method for paper question and answer based on a large language model provided by another embodiment of this application; Figure 4 is a schematic flowchart of a method for paper question and answer based on a large language model provided by another embodiment of this application; Figure 5Schematic diagram of a paper Q&A system based on a large language model provided by an embodiment of the present application. Detailed implementation manners
[0014] The embodiments of the present application will be described in detail below. Examples of the embodiments are shown in the accompanying drawings, where the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to explain the present application, but should not be construed as limiting the present application.
[0015] In the related art, the Q&A method based on papers includes: 1. Retrieving relevant content using traditional keyword search and generating answers based on a large language model The solution includes two stages: preparation and execution. In the preparation stage, the paper is segmented and keywords are indexed. In the execution stage, relevant document fragments are indexed based on the keywords in the question (query) as the basis for answering, and finally, the large language model (Large Language Model, LLM) is input to generate answers. Among them, the large language model can be abbreviated as the large model.
[0016] 2. Retrieving relevant content and generating answers based on Retrieval-augmented Generation (RAG) technology There are various solutions for answer generation based on RAG technology, mainly including: (1) Conventional RAG technology solution Directly perform the RAG process on the query, where strategies such as semantic vector retrieval, hybrid retrieval, and retrieval result re-ranking are used.
[0017] The solution includes two stages: preparation and execution. In the preparation stage, the paper is segmented and semantic vectors are generated. In the execution stage, the top N (Top-N) text blocks that are most similar are calculated based on the semantic vector of the query as the basis for answering, and finally, the large language model is input to generate answers.
[0018] (2) Rewriting the query from multiple perspectives + RAG technology First, rewrite the query from different perspectives to increase the coverage of recall, and then use the RAG technology to retrieve and generate answers for the original query and each rewritten query.
[0019] (3) Generating an initial answer + RAG technology First, use the large language model to generate an initial answer for the query based on its own knowledge, and then use the RAG technology to retrieve and generate answers by replacing the query with the initial answer.
[0020] 3. Use the hierarchical abstract method and filter relevant content based on the large language model to generate answers The solution includes two stages: preparation and execution. Among them, the preparation stage is divided into a tree structure according to the paper structure, and then the large language model is used to generate abstracts for the content of each node of the tree structure; the execution stage starts from the vertex of the tree structure, and the large language model is used to select the nodes at the next layer of the vertex according to the query and the abstracts of each node, and then continue to repeat the drill-down execution and screening with the selected nodes as the vertices. Finally, the paper fragments related to the query are obtained, and finally the large language model is input to generate answers.
[0021] 4. Directly use the fine-tuned large language model to generate answers The solution includes two stages: preparation and execution. Among them, the preparation stage requires collecting paper-related information to fine-tune the large language model so that the large model can learn relevant knowledge; the execution stage directly uses the fine-tuned large language model to answer the query.
[0022] 5. Directly use the general large language model to generate answers This solution uses the current large language model's ability to understand long texts to directly answer questions. During execution, the full text of the paper and the query are input into the large language model together, so that the large model can find useful information and generate answers.
[0023] However, the above solutions have some problems respectively. Specifically: 1. Retrieve relevant content using traditional keywords and generate answers based on the large language model For questions without effective keywords in general questions, it cannot answer, and it cannot understand the semantic information of the query, resulting in too much retrieved content and too little content that conforms to the query semantics, affecting the accuracy and comprehensiveness of the answer.
[0024] 2. Retrieve relevant content based on the RAG technology and generate answers Conventional RAG technology solution: For general questions, the effective keywords included are few and the semantics are different from the semantics of the target answer, so accurate retrieval cannot be performed and useful answers cannot be generated.
[0025] Rewriting the query from multiple angles + RAG technology: It has the same disadvantages as the "conventional RAG technology solution".
[0026] Generating an initial answer + RAG technology: The generated initial answer is very likely to deviate from the target answer, and the accuracy of the results retrieved based on the initial answer is poor, and the answering effect is unstable.
[0027] 3. Use the hierarchical abstract method and filter relevant content based on the large language model to generate answers On the one hand, the process of generating summaries for all nodes is time-consuming. In real-time interaction scenarios, users often start asking questions immediately after importing a paper, and this solution cannot meet the requirement of immediacy. On the other hand, a lot of specific details are lost during the process of extracting the summary, so the answering effect for specific questions is unstable.
[0028] 4. Directly use the fine-tuned large language model to generate answers Whether the fine-tuning corpus of the large model contains relevant information cannot support new papers; not all the content in the paper can be internalized into the large model through fine-tuning; there are still hallucinations in fine-tuning the large model, and the fine-tuning process is time-consuming and resource-consuming.
[0029] 5. Directly use the general large language model to generate answers In a long context, the ability to identify relevant content for specific questions is still limited, resulting in unstable answering results. In addition, the input context is too long, seriously increasing the response latency of question answering.
[0030] It should be noted that general questions refer to questions that do not contain specific content, such as "What is the main content?", "What are the research highlights?", "What are the key technologies?", etc.; specific questions refer to questions that specify specific content, such as "How does the multi-head attention mechanism improve the ability of the transformer?", "What are the key steps in the lithium battery charge and discharge experiment?", "In the ablation experiment, how much loss is there after removing the regularization term?", etc.
[0031] In view of the above problems, the present application proposes a paper question-answering method and system based on a large language model.
[0032] Figure 1 It is a schematic flow chart of a paper question-answering method based on a large language model provided by an embodiment of the present application.
[0033] As Figure 1 shown, the paper question-answering method based on a large language model includes the following steps: Step 101, based on the composition content of the target paper, extract the paper structure of the target paper to obtain a tree structure corresponding to the target paper.
[0034] In the embodiment of the present application, the target paper may refer to a paper file uploaded by the user, or a paper file that the user browses online using the publisher's reading platform, or a paper file returned by the search. For example, the target paper may refer to an academic paper in the coal field.
[0035] In the embodiment of the present application, the composition content of the target paper may include content such as the paper name, author, abstract, text, and references.
[0036] In the embodiments of the present application, according to elements such as the title of the paper, the author, the abstract, the body text, and the references, the element content corresponding to each element can be obtained in the target paper, and the element content can be spliced into a tree structure according to the article structure. Among them, the above elements correspond to chapter content. For example, the abstract corresponds to the abstract chapter content, the body text corresponds to the body text chapter content, and the references correspond to the references chapter content.
[0037] Step 102, for any target node in the tree structure, based on the information of the nodes included in the path from the root node of the tree structure to the target node, determine the chapter description information corresponding to the target node.
[0038] In the embodiments of the present application, the target node can refer to any node in the tree structure; the chapter description information corresponding to the target node can include the chapter description information corresponding to the nodes included in the path from the root node of the tree structure to the target node.
[0039] As an example, the chapter description information can include the chapter keywords of the chapter content corresponding to the node.
[0040] As an example, in addition to the chapter keywords, the chapter description information can also include the importance level of the corresponding chapter content, and the importance level can be used to indicate whether the chapter content is the core content of the target paper. For example, the importance level of the chapter content can be indicated by the importance score of the chapter content.
[0041] Step 103, in response to receiving a question about the target paper, use a large model, and based on the chapter description information corresponding to the nodes in the tree structure, obtain the target content in the target paper that matches the question.
[0042] In the embodiments of the present application, the question can be input into the large model to obtain the target content recalled by the large model.
[0043] Step 104, based on the target content, answer the question.
[0044] In the embodiments of the present application, a large model can be used to generate an answer to the question based on the target content.
[0045] It should be noted that the large model used to generate the answer and the large model used to obtain the target content can be the same large model or different large models.
[0046] In this embodiment, based on the composition content of the target paper, the paper structure of the target paper is extracted to obtain the tree structure corresponding to the target paper. For any target node in the tree structure, based on the information of the nodes included in the path from the root node of the tree structure to the target node, the chapter description information corresponding to the target node is determined. In response to receiving a question about the target paper, a large model is used to obtain the target content in the target paper that matches the question based on the chapter description information corresponding to the nodes in the tree structure. Based on the target content, an answer is given to the question. The path from the root node to the target node can concatenate the chapter logic context, enabling the large model to accurately grasp the semantic association of the context of the target node, thereby more accurately and efficiently locating the target content, avoiding misjudgment due to information isolation, and making the answer more in line with the original meaning and logical system of the paper, thus improving the accuracy of the question and answer.
[0047] This embodiment provides another paper question and answer method based on a large language model. Figure 2 It is a schematic flowchart of a paper question and answer method provided by an embodiment of the present application based on a large language model.
[0048] As Figure 2 shown, the paper question and answer method based on the large language model may include the following steps: Step 201, based on the composition content of the target paper, extract the paper structure of the target paper to obtain the tree structure corresponding to the target paper.
[0049] Step 202, for any target node in the tree structure, based on the information of the nodes included in the path from the root node of the tree structure to the target node, determine the chapter description information corresponding to the target node.
[0050] In some embodiments, the composition content of the target paper includes the paper title and the author.
[0051] In response to the target node being the root node corresponding to the paper title, use the paper title and / or keywords extracted based on the paper title as the chapter description information corresponding to the root node; and / or, for the node corresponding to the author in the tree structure, use the chapter description information corresponding to the root node and the author name as the corresponding chapter description information.
[0052] In some embodiments, the composition content of the target paper further includes an abstract, hierarchical headings, and references.
[0053] In response to the target node being the node corresponding to the abstract, hierarchical heading, or reference, obtain the hierarchical headings included in the path from the root node of the tree structure to the target node, and obtain the chapter keywords of the chapter content corresponding to the target node; based on the hierarchical headings and chapter keywords included in the path, generate the chapter description information corresponding to the target node.
[0054] Optionally, chapter keywords of the chapter content corresponding to the target node can be obtained through algorithms such as the graph sorting-based algorithm (TextRank) or the term frequency-inverse document frequency (TF-IDF).
[0055] Optionally, the hierarchical titles included in the path can be concatenated to obtain a hierarchical title text; the hierarchical title text + the chapter keywords are used to obtain the corresponding chapter description information. Among them, the chapter description information can also be referred to as the chapter description language.
[0056] Generating the chapter description information corresponding to the target node based on the hierarchical titles and chapter keywords included in the path helps the large model understand the core content and key detail information of the chapter, so that the large model can make a correct and reasonable relevant chapter selection for questions (including general questions and specific questions).
[0057] Step 203: In response to receiving a question about the target paper, input the question and the chapter description information corresponding to the node in the tree structure into the first large model for inference analysis to obtain the recalled content output by the first large model.
[0058] In the embodiment of the present application, the first large model can analyze, compare, and judge the chapter description information corresponding to each node according to the question, so as to select the chapter content that matches the question as the recalled content.
[0059] In the embodiment of the present application, the first large model can output the chapter number of the recalled content.
[0060] Among them, the number of chapter contents to be recalled can be preset. For example, the number of chapter contents to be recalled can be 3 or 4.
[0061] Step 204: Determine whether the question can be answered based on the recalled content.
[0062] In the embodiment of the present application, the question and the recalled content are input into the second large model for inference analysis to obtain the indication information output by the second large model; among them, the indication information is used to indicate whether the question can be answered based on the recalled content, and the model parameters of the second large model are less than those of the first large model.
[0063] Among them, the second large model is used to evaluate the support degree of the recalled content, that is, to evaluate whether the question can be answered based on the recalled content.
[0064] Optionally, the indication information output by the second large model can be "support" or "not support", or the indication information output can be "yes" or "no".
[0065] As an example, the number of model parameters of the first large model can be at the 30B (Billion) level, and the number of model parameters of the second large model can be at the 10B level.
[0066] Step 205: When the retrieved content can answer the question, use the retrieved content as the target content.
[0067] Among them, if the retrieved content can answer the question, the answer to the question can be directly generated based on the retrieved content.
[0068] Step 206: When the retrieved content cannot answer the question, extract the question keywords in the question and obtain the semantic vector corresponding to the question; query the target content blocks including the question keywords in multiple content blocks, and / or query the target content blocks with a similarity greater than the set threshold based on the similarity between the semantic vector corresponding to the question and the semantic vector corresponding to the content block; use the retrieved target content blocks as the target content.
[0069] In the embodiments of the present application, in addition to extracting the paper structure of the target paper, the constituent content of the target paper can also be segmented into multiple content blocks (for example, segmented by paragraph), and corresponding semantic vectors are generated for each content block and stored in the vector library.
[0070] As an example, the keyword extraction algorithm can be used to extract keywords from the question to obtain the question keywords.
[0071] In the embodiments of the present application, if the retrieved content cannot answer the question, then the question is more likely to be a specific question. In this case, in order to improve the accuracy of the answer, RAG semantic + keyword hybrid retrieval can be used for specific content matching, so as to retrieve the relevant chapter content containing the correct detailed content.
[0072] Step 207: Answer the question based on the target content.
[0073] For the relevant content in Step 207, reference can be made to the relevant description in Step 104, which will not be elaborated here.
[0074] In this embodiment, in response to receiving a question about a target paper, the question and the chapter description information corresponding to the nodes in the tree structure are input into the first large model for inference and analysis to obtain the recalled content output by the first large model; it is determined whether the question can be answered based on the recalled content; in the case where the question can be answered based on the recalled content, the recalled content is used as the target content; in the case where the question cannot be answered based on the recalled content, the question keywords in the question are extracted, and the semantic vector corresponding to the question is obtained; the target content block including the question keywords is queried in multiple content blocks, and / or, based on the similarity between the semantic vector corresponding to the question and the semantic vector corresponding to the content block, the target content block with a similarity greater than the set threshold is queried; the queried target content block is used as the target content. Using the description method of hierarchical title + chapter keywords greatly compresses the text length of the chapter content description, that is, compresses the context length input to the large model, improves the response speed of the large model, and at the same time, through the hint of the hierarchical title and chapter keywords, the large model can understand the core content and key detail information of each chapter, so as to make correct and reasonable relevant chapter selections for general questions and some specific questions. In addition, in the case where the question cannot be answered based on the recalled content, RAG hybrid retrieval is used as a fallback to recall the target content containing the correct detail content, ensuring the robustness of the recall effect.
[0075] This embodiment provides another paper Q&A method based on a large language model. Figure 3 It is a schematic flowchart of a paper Q&A method based on a large language model provided by an embodiment of the present application.
[0076] As Figure 3 shown, the paper Q&A method based on a large language model may include the following steps: Step 301, based on the composition content of the target paper, perform paper structure extraction on the target paper to obtain the tree structure corresponding to the target paper.
[0077] Step 302, for any target node in the tree structure, based on the information of the nodes included in the path from the root node of the tree structure to the target node, determine the chapter description information corresponding to the target node.
[0078] Step 303, in response to receiving a question about the target paper, detect whether the first language type corresponding to the question is the same as the second language type corresponding to the target paper.
[0079] Among them, the first language type and the second language type may refer to any one of language types such as Chinese, English, Korean, Japanese, etc.
[0080] In the embodiments of the present application, a third large model can be used to detect whether the first language type corresponding to the question is the same as the second language type corresponding to the target paper.
[0081] Step 304, in the case where the first language type and the second language type are different, perform language conversion on the question based on the second language type.
[0082] In the embodiments of the present application, a third large model can be used to perform language conversion on the question to convert the language type of the question into the language type of the target paper.
[0083] Step 305, based on the chapter description information corresponding to the nodes in the tree structure, obtain the target content in the target paper that matches the question after language conversion.
[0084] Among them, the question after language conversion and the chapter description information corresponding to the nodes in the tree structure can be input into the first large model for inference and analysis to obtain the recalled content output by the first large model; determine whether the question can be answered based on the recalled content; in the case where the question can be answered based on the recalled content, use the recalled content as the target content; in the case where the question cannot be answered based on the recalled content, extract the question keywords in the question after language conversion, and obtain the semantic vector corresponding to the question after language conversion; query the target content block including the question keywords in multiple content blocks, and / or, based on the similarity between the semantic vector corresponding to the question after language conversion and the semantic vector corresponding to the content block, query the target content block with a similarity greater than the set threshold; use the queried target content block as the target content.
[0085] Step 306, in the case where the first language type and the second language type are different, generate an answer in the first language type based on the target content.
[0086] In the embodiments of the present application, a fourth large model can be used to generate an answer in the first language type. Among them, the fourth large model needs to think and reason based on the target content. Therefore, the model parameters of the third large model are less than those of the fourth large model.
[0087] As an example, the number of model parameters of the third large model can be at the 10B level, and the number of model parameters of the second large model can be at the 30B level.
[0088] The relevant content in Step 301 can refer to the relevant description in Step 101, which will not be elaborated here.
[0089] In this embodiment, in response to receiving a question regarding a target paper, it is detected whether the first language type corresponding to the question is the same as the second language type corresponding to the target paper; in the case where the first language type and the second language type are different, the question is subjected to language conversion based on the second language type; based on the chapter description information corresponding to the nodes in the tree structure, the target content in the target paper that matches the question after language conversion is obtained; in the case where the first language type and the second language type are different, an answer in the first language type is generated based on the target content. In the case where the first language type and the second language type are different, language conversion can ensure the accuracy of question understanding, and finally generate an answer consistent with the language type of the question, which can enhance the user experience and the Q&A effect.
[0090] This embodiment provides another paper Q&A method based on a large language model. Figure 4 It is a schematic flowchart of a paper Q&A method provided by an embodiment of the present application.
[0091] The present application improves the accuracy and comprehensiveness of question answers by designing an effective content recall strategy and execution process; by integrating multiple complementary recall methods for query-related content, it well balances the answering effects for general questions and specific questions; by optimizing the settings of each module, it balances the accuracy of the answer and the response latency.
[0092] As Figure 4 shown, the method specifically includes: (1) Paper document parsing: Identify elements such as the paper name, author, abstract, hierarchical markers, chapters, paragraphs, references, etc. in the target paper, and store the corresponding texts. (2) Structure extraction: Assemble each element into a tree structure according to the article structure to obtain the tree structure corresponding to the target paper. (3) Document segmentation and storage in the vector library: Segment the document content into chunks (such as by paragraphs), generate semantic vectors, and store them in the vector library. (4) Chapter keyword generation: Generate the top 10 keywords according to the chapter content, and algorithms such as TextRank or TF-IDF can be used to generate keywords.
[0093] (5) Chapter description information (chapter description) splicing: The chapter description is the basis for the next step of the LLM to select relevant chapters for recall according to the query, and it is composed of the hierarchical title + chapter keywords. For any node: According to the tree structure, from the vertex (root node) to the current node, splice all hierarchical node titles to generate the hierarchical title text, and append the keywords of this chapter to obtain the chapter description corresponding to the node.
[0094] (6)Query Language Recognition and Conversion: Automatically identify whether the language type of the query is the same as that of the target paper; if not, perform language conversion on the query. This step can be implemented using an LLM with a relatively small number of model parameters (the third largest model); (7)LLM-driven Relevant Chapter Retrieval: Use the LLM (the largest model) to analyze, compare, and judge the spliced text of each chapter according to the query, and select the chapters that can support answering the query as the retrieved content. The number of retrieved chapters can be set to 3 or 4; (8)Support Degree Evaluation of Retrieved Content: Use an LLM with a relatively small number of model parameters (the second largest model) to judge whether the retrieved content can answer the query, and output "supported" or "not supported"; (9)RAG-based Hybrid Retrieval and Recall: If the support degree evaluation is "not supported", then use RAG hybrid retrieval (dense + sparse retrieval) technology, that is, match and retrieve the paper content based on the query semantics and keywords, and recall relevant document fragments (target content blocks); (10)LLM Answer: The LLM (the fourth largest model) answers the query according to the retrieved content, matching the language type of the query.
[0095] This application has the following beneficial effects: (1) This application uses the description method of hierarchical headings + chapter keywords, which greatly compresses the text length of describing the chapter content, that is, compresses the context length input to the LLM, and improves the response speed of the LLM; at the same time, through the prompts of hierarchical headings and chapter keywords, the LLM can understand the core content and key detail information of the corresponding chapter, so as to make correct and reasonable relevant chapter selections for general questions and some specific questions.
[0096] (2) This application uses RAG hybrid retrieval as a backup, which forms a complementary advantage with (1) and ensures the robustness of the retrieval effect. If the support degree of the retrieved content for the question is insufficient, it means that the query is more likely to be a specific detail question, and RAG semantic + keyword hybrid retrieval can be used for specific content matching, so as to recall relevant chapter information containing the correct detail content.
[0097] (3) The architecture and process of this application are simple, and at the same time, the LLM configuration is optimized, shortening the overall execution time. Specifically, this application includes the following LLM execution processes: ① The first time is in process (6), the LLM is recommended to be about 10B, with a small number of parameters. At the same time, since the query content is generally very short, the LLM responds quickly; ②Secondly, in process (7), the LLM recommends models above 30B. Since the description method of hierarchical headings + keywords is used and the output can be chapter numbers, and the context content is not long, the LLM responds quickly; ③Thirdly, in process (8), the LLM recommends models around 10B. The parameter quantity is small, and the output is "yes" or "no", and the LLM responds quickly; ④Fourthly, in process (10), since it is necessary to answer questions based on the retrieved information, the LLM recommends models above 30B.
[0098] To implement the above embodiments, an embodiment of the present application also proposes a paper Q&A system based on a large language model.
[0099] Figure 5 It is a schematic structural diagram of a paper Q&A system based on a large language model provided by an embodiment of the present application.
[0100] As Figure 5 shown, the paper Q&A system 500 based on a large language model includes: An extraction module 510, configured to perform paper structure extraction on a target paper based on the composition content of the target paper to obtain a tree structure corresponding to the target paper; A determination module 520, configured to, for any target node in the tree structure, determine chapter description information corresponding to the target node based on the information of the nodes included in the path from the root node of the tree structure to the target node; A first acquisition module 530, configured to, in response to receiving a question about the target paper, use a large model to acquire target content in the target paper that matches the question based on the chapter description information corresponding to the nodes in the tree structure; An answer module 540, configured to answer the question based on the target content.
[0101] Optionally, the composition content of the target paper includes an abstract, hierarchical headings, and references. The determination module 520 is specifically configured to: In response to the target node being a node corresponding to an abstract, hierarchical heading, or reference, obtain the hierarchical headings included in the path from the root node of the tree structure to the target node, and obtain the chapter keywords of the chapter content corresponding to the target node; Generate chapter description information corresponding to the target node based on the hierarchical headings and chapter keywords included in the path.
[0102] Optionally, the composition content of the target paper further includes a paper name and an author. The determination module 520 is specifically configured to: In response to the target node being the root node corresponding to the paper name, use the paper name and / or keywords extracted based on the paper name as the chapter description information corresponding to the root node; and / or, in response to the target node being the node corresponding to the author, use the chapter description information corresponding to the root node and the author name as the corresponding chapter description information.
[0103] Optionally, the first acquisition module 530 is specifically configured to: Input the question and the chapter description information corresponding to the node in the tree structure into the first large model for inference and analysis to obtain the recalled content output by the first large model; Determine whether the question can be answered based on the recalled content; In the case where the question can be answered based on the recalled content, use the recalled content as the target content.
[0104] Optionally, the first acquisition module 530 is specifically configured to: Input the question and the recalled content into the second large model for inference and analysis to obtain the indication information output by the second large model; Wherein, the indication information is used to indicate whether the question can be answered based on the recalled content, and the model parameters of the second large model are less than those of the first large model.
[0105] Optionally, the composition content of the target paper is divided into multiple content blocks, and each content block corresponds to a semantic vector. The system further includes: A second acquisition module, configured to extract the question keywords in the question and obtain the semantic vector corresponding to the question in the case where the question cannot be answered based on the recalled content; A query module, configured to query the target content block including the question keywords in multiple content blocks, and / or query the target content block with a similarity greater than a set threshold based on the similarity between the semantic vector corresponding to the question and the semantic vector corresponding to the content block; A processing module, configured to use the queried target content block as the target content.
[0106] Optionally, the first acquisition module 530 is specifically configured to: Detect whether the first language type corresponding to the question is the same as the second language type corresponding to the target paper; In the case where the first language type and the second language type are different, perform language conversion on the question based on the second language type; Based on the chapter description information corresponding to the nodes in the tree structure, obtain the target content in the target paper that matches the question after language conversion.
[0107] Optionally, the answering module 540 is specifically configured to: In the case where the first language type and the second language type are different, generate an answer in the first language type based on the target content.
[0108] Optionally, use a third large model to perform language conversion on the question, and / or use a fourth large model to generate an answer in the first language type; wherein the model parameters of the third large model are fewer than those of the fourth large model.
[0109] It should be noted that the foregoing explanation of the embodiments of the paper Q&A method based on the large language model also applies to the paper Q&A system based on the large language model of this embodiment, and will not be elaborated here.
[0110] In this embodiment, based on the composition content of the target paper, extract the paper structure of the target paper to obtain a tree structure corresponding to the target paper; for any target node in the tree structure, determine the chapter description information corresponding to the target node based on the information of the nodes included in the path from the root node of the tree structure to the target node; in response to receiving a question about the target paper, use a large model to obtain the target content in the target paper that matches the question based on the chapter description information corresponding to the nodes in the tree structure; answer the question based on the target content. The path from the root node to the target node can concatenate the chapter logical context, enabling the large model to accurately grasp the semantic association of the target node's context, thereby more accurately and efficiently locating the target content, avoiding information isolation misjudgment, making the answer more in line with the original meaning and logical system of the paper, and thus improving the accuracy of the Q&A.
Claims
1. A paper question answering method based on a large language model, characterized in that: The following steps are involved: Based on the composition of the target paper, extract the paper structure of the target paper to obtain a tree structure corresponding to the target paper; For any target node in the tree structure, based on information of nodes included in a path from a root node of the tree structure to the target node, determine chapter description information corresponding to the target node; In response to receiving a question for the target paper, using a large model, based on the chapter description information corresponding to the node in the tree structure, obtaining target content in the target paper that matches the question; Based on the target content, answer the question.
2. The method according to claim 1, characterized in that The target paper includes an abstract, a hierarchical title, and references. The determining of the chapter description information corresponding to the target node based on the information of the nodes included in the path from the root node of the tree structure to the target node includes: In response to the target node being a node corresponding to the abstract, hierarchical title or reference, obtaining the hierarchical title included in the path from the root node of the tree structure to the target node, and obtaining the chapter keywords of the chapter content corresponding to the target node; Based on the hierarchical titles and the chapter keywords included in the path, chapter description information corresponding to the target node is generated.
3. The method according to claim 2, characterized in that The target paper also includes the paper title and author. The determining of the chapter description information corresponding to the target node based on the information of the nodes included in the path from the root node of the tree structure to the target node includes: In response to the target node being a root node corresponding to the paper title, using the paper title and / or keywords extracted based on the paper title as chapter description information corresponding to the root node; and / or, In response to the target node being the node corresponding to the author, the chapter description information corresponding to the root node and the author name are used as the corresponding chapter description information.
4. The method according to claim 1, characterized in that: The adopting of the large model, based on the chapter description information corresponding to the nodes in the tree structure, to obtain the target content in the target paper that matches the question, includes: Inputting the question and the chapter description information corresponding to the node in the tree structure into the first large model for reasoning analysis to obtain the recall content output by the first large model; Determine whether the question can be answered based on the recall content; If the question can be answered based on the recalled content, the recalled content is used as the target content.
5. The method according to claim 4, characterized in that The determination is based on whether the recalled content can answer the question, including: Inputting the question and the recall content into the second largest model for reasoning analysis to obtain indication information output by the second largest model; The indication information is used to indicate whether the question can be answered based on the recalled content, and the model parameters of the second largest model are less than those of the first largest model.
6. The method according to claim 4, characterized in that The target paper is divided into a plurality of content blocks, each of which has a corresponding semantic vector. The method further includes: In the case that the question cannot be answered based on the recalled content, extracting question keywords from the question and obtaining a semantic vector corresponding to the question; Searching for a target content block including the question keyword in the multiple content blocks, and / or, based on the similarity between the semantic vector corresponding to the question and the semantic vector corresponding to the content block, searching for a target content block whose similarity is greater than a set threshold; The queried target content block is used as the target content.
7. The method according to claim 1, characterized in that In response to receiving the question for the target paper, obtaining target content in the target paper that matches the question based on the chapter description information corresponding to the node in the tree structure includes: Detecting whether the first language type corresponding to the question and the second language type corresponding to the target paper are the same; When the first language type and the second language type are different, performing language conversion on the question based on the second language type; Based on the chapter description information corresponding to the nodes in the tree structure, the target content in the target paper that matches the language-converted question is obtained.
8. The method according to claim 7, characterized in that The answering of the question based on the target content includes: In a case where the first language type and the second language type are different, an answer in the first language type is generated based on the target content.
9. The method according to claim 8, characterized in that Using a third model to perform language conversion on the question, and / or using a fourth model to generate an answer of the first language type; Among them, the model parameters of the third largest model are less than those of the fourth largest model.
10. A paper question answering system based on a large language model, characterized in that: include: An extraction module, used to extract the structure of the target paper based on the composition content of the target paper, and obtain a tree structure corresponding to the target paper; A determination module, configured to determine, for any target node in the tree structure, chapter description information corresponding to the target node based on information of nodes included in a path from a root node of the tree structure to the target node; A first acquisition module is used for, in response to receiving a question for the target paper, using a large model to acquire target content in the target paper that matches the question based on the chapter description information corresponding to the nodes in the tree structure; The answering module is used to answer the question based on the target content.
Citation Information
Patent Citations
Method and system of data retrieval
CN101685455A
User question and knowledge point matching method and device
CN109857846A
Large language model question and answer optimization method and device, electronic equipment and storage medium
CN117851575A
Data question-answering method, data question-answering model training method, device and equipment
CN118657222A
Knowledge text retrieval method and device, storage medium and computer equipment
CN119807328A
Cited By
Method and device for obtaining question reply through large language model
CN120929580A