An agricultural intelligent question answering system and intelligent question answering method
By building a knowledge graph with content as the core and an agricultural intelligent question-and-answer system combining large language models, the problems of low retrieval efficiency and low quality of answers in the existing technology are solved, and efficient and accurate agricultural intelligent question-and-answer system are achieved.
Patent Information
- Application Number
- CN202411871020.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-04-08
AI Technical Summary
The existing agricultural intelligent question-and-answer technology has problems such as low search efficiency and low quality of answers, which leads to users taking extra time to understand and extract useful information, which increases time cost, and there is incorrect information.
An agricultural intelligent question-and-answer system and intelligent question-and-answer method are proposed. By building a knowledge graph with content as the core, the concept of knowledge graph edges is eliminated, the entity is used as a link point, the search rate and information quality are improved, and the topic extraction and corpus collection are combined with a large language model to generate high-quality answer content.
It improves the search rate and information quality of the knowledge graph, enhances the accuracy and efficiency of large language model answers, reduces the time cost of users when understanding and extracting information, and improves the accuracy of answer results.
Smart Images

Figure CN119782476A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of agricultural intelligent question answering, and specifically to an agricultural intelligent question answering system and an intelligent question answering method. Background Art
[0002] Under the general environment of digital information construction, the agricultural field has also ushered in a booming development. Various applications in the agricultural field have sprung up like mushrooms after rain. Among many applications, it is found that the accuracy of the intelligent question-answering assistant's answers is low, and the answers provided have a lot of redundant information and the language is obscure. The above situation is caused by the current intelligent question-answering assistant using keyword matching technology. By extracting keyword information from the question and matching it in the database, the matching content containing keyword information is directly returned to the user as the answer, resulting in too much or too little content information, and a lack of induction and summary, so that users need to spend extra time to re-understand the information and extract useful information, which increases the time cost. In addition, the information provided is incorrect, causing users to prefer to find answers directly from books.
[0003] In recent years, knowledge graph technology and large language model technology have been introduced into agricultural intelligent question and answering to improve the quality of answers. However, the construction of knowledge graphs usually adopts a construction method centered on kingdom, phylum, class, order, family, genus, and species, or on entities. These methods will form a huge knowledge graph. A huge knowledge graph will lead to a decrease in retrieval speed. During the reasoning process, the reasoning chain will add a large amount of content that is irrelevant to the question, and providing irrelevant content to the large language model for answering will also affect the quality of the answer. Summary of the invention
[0004] In order to solve the problems of low retrieval efficiency and low answer result quality in the existing agricultural intelligent question answering technology, the present application proposes an agricultural intelligent question answering system and an intelligent question answering method. The present application improves the retrieval rate and the quality of retrieval information when the knowledge graph is used, so that the information content provided by the knowledge graph can improve the quality and accuracy of the answer results.
[0005] In the first aspect, the present application is implemented through the following technical solutions:
[0006] An agricultural intelligent question-answering system, the system comprising:
[0007] A question input module, the question input module is used to receive question information input by a user;
[0008] An entity extraction module, wherein the entity extraction module extracts entity information from the question information through an entity recognition module;
[0009] A topic confirmation module, wherein the topic confirmation module uses a large language model to obtain topic information according to the question information or entity information;
[0010] A corpus collection module, which confirms the corresponding knowledge graph according to the subject information, puts the entity information into the knowledge graph and the link point information to match the node content on the link point, and determines the corpus information for the large language model answer;
[0011] A prompt word assembly module, wherein the prompt word assembly module generates content information provided to the large language model for answering according to the corpus information;
[0012] A large model answering module, wherein the large model answering module uses a large language model to answer user questions according to the content information;
[0013] A result output module, which is used to display answer information of the question;
[0014] and, a result evaluation module, the result evaluation module being used to perform quality evaluation on the answer results and control the question-answer mechanism;
[0015] Among them, the knowledge graph adopts a knowledge graph that takes content as the core, eliminates the concept of knowledge graph edges, and uses entities as link points.
[0016] In some embodiments, the system further comprises:
[0017] A vector matching module is used to vectorize the question information, calculate the similarity with the vectors in the historical question vector library, take the top three question information with the highest similarity, and then retrieve the knowledge information used to answer the question at that time based on the question information, so as to provide the prompt word assembly module with corpus information for answering.
[0018] In some embodiments, the system further comprises:
[0019] A question expansion module is used to expand the question information through a large language model. During the expansion, the large language model is required to expand the question without changing the original meaning of the question through a prompt word project.
[0020] In some implementations, the entity extraction module uses a joint entropy algorithm to filter entity information during the process of extracting entity information, thereby reducing the number of irrelevant entities.
[0021] In some embodiments, the theme confirmation module provides the name of the agricultural scene theme, the definition of the theme, the common vocabulary set of the theme, the common questions set of the theme, and the method for how to perform theme analysis confirmation in the prompt word project;
[0022] Priorities need to be identified in the thematic analysis approach:
[0023] The first priority is to match the entity information extracted by the entity extraction module with the common vocabulary of the subject in the common vocabulary set of the subject. If there is an identical or similar situation, the subject to which the question belongs is directly confirmed;
[0024] The next priority is to confirm the topic to which the problem belongs by referring to the content of the topic definition;
[0025] The priority is then determined by referring to the topic definition and the topic FAQ to confirm the topic to which the question belongs.
[0026] In some embodiments, in the knowledge graph, each node directly stores content, the number of link points of each node is the same and fixed, and the link points include one-way arrow link points and two-way arrow link points;
[0027] The knowledge graph is constructed according to themes to form multiple thematic knowledge graphs; at the same time, the TF-IDF algorithm is used to assist in the selection of keywords for documents.
[0028] In some embodiments, when collecting corpus, the corpus collection module introduces concatenation words to connect scattered information into complete sentences to obtain corpus information;
[0029] The corpus information is rearranged and filtered, and the rearrangement and filtering uses the similarity calculation between the question and the content information to determine the corpus information finally used for answering.
[0030] In the second aspect, the present application also proposes an agricultural intelligent question-answering method, wherein the method is implemented based on the above-mentioned agricultural intelligent question-answering system, and the method comprises:
[0031] The user inputs question information, and the entity extraction module extracts entity information from the question information;
[0032] Inputting the entity information and question information into the subject confirmation module to obtain subject information;
[0033] Inputting the topic information and entity information into the corpus collection module, and collecting corpus information for large language model answers in the corpus collection module;
[0034] Inputting the collected corpus information into the prompt word assembly module to generate content information provided to the large language model for answering;
[0035] Inputting the generated content information into the large model answering module for answering;
[0036] The answer results are output and evaluated. If the results are satisfactory, the data is stored in the database. If the results are unsatisfactory, the F / Q question-and-answer mechanism is triggered.
[0037] In some embodiments, the F / Q question-answering mechanism includes:
[0038] The user inputs question information, which is input into the vector matching module for vectorization and similarity calculation is performed between the question information and the vectors in the historical question vectors to obtain the top three questions in terms of similarity, and the knowledge information used to answer the question at that time is obtained through the questions;
[0039] Inputting the knowledge information into the prompt word assembly module to generate content information for answering with a large language model;
[0040] Inputting the generated content information into the large model answering module for answering;
[0041] The answer result is output and evaluated. If the result is satisfactory, the answer is completed. If the result is unsatisfactory, the question expansion question and answer mechanism is triggered.
[0042] In some embodiments, the question expansion question and answer mechanism includes:
[0043] The user inputs question information, and the question information is input into the question expansion module for content expansion;
[0044] Inputting the expanded question information into the entity extraction module to extract entity information from the question information;
[0045] Inputting the entity information and the expanded question information into the subject confirmation module to obtain subject information;
[0046] Inputting the topic information and entity information into the corpus collection module, and collecting corpus information for large language model answers in the corpus collection module;
[0047] Inputting the corpus information into the prompt word assembly module to generate content information provided to the large language model for answering;
[0048] Inputting the content information into the large model answering module for answering;
[0049] The answer result is output and evaluated. If the result is satisfactory, the answer is completed. If the result is unsatisfactory, the question expansion question and answer mechanism is triggered again.
[0050] The application proposes an agricultural intelligent question-answering system and intelligent question-answering method, which constructs a knowledge graph with content as the core, which can effectively reduce the size of the knowledge graph and improve the retrieval rate. At the same time, the knowledge graph is constructed with content as the core, which saves the process of first reasoning about the relationship through entities and then reasoning about the text relationship based on the entity reasoning relationship, increases the relevance and logic between texts, and can quickly and accurately provide corpus information for the large language model; the topic extraction through the large language model replaces the traditional topic extraction model, which can not only reduce the workload of model development and avoid the problem of difficulty in obtaining high-quality data, but also improve the accuracy of text topic induction; finally, the method of controlling the question-answering process through the result evaluation mechanism adopts different types of question-answering processes to obtain the corpus content information used for the large language model to answer from multiple angles to improve the accuracy of the answer results. This application adopts the technology of combining large language models with knowledge graphs to improve the accuracy of the answer results. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The drawings described herein are used to provide a further understanding of the embodiments of the present application, constitute a part of the present application, and do not constitute a limitation on the embodiments of the present application. In the drawings:
[0052] Figure 1 A block diagram of the system principle proposed in the embodiment of the present application;
[0053] Figure 2 A schematic diagram of the knowledge graph structure used in the embodiment of the present application;
[0054] Figure 3 A flow chart of a conventional question-and-answer strategy proposed in an embodiment of the present application;
[0055] Figure 4 A flow chart of the F / Q question-answering strategy proposed in the embodiment of the present application;
[0056] Figure 5 A flow chart of the question-answering strategy for expanding the questions raised in the embodiments of the present application. DETAILED DESCRIPTION
[0057] In order to make the objectives, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with examples and drawings. The illustrative implementation scheme of the present application and its description are only used to explain the present application and are not intended to limit the present application.
[0058] Example:
[0059] The existing agricultural intelligent question-answering technology based on knowledge graph technology and large language model has low retrieval rate and low retrieval information quality, which affects the quality of question-answering results. In view of this, this embodiment proposes an agricultural intelligent question-answering system.
[0060] like Figure 1 As shown, the system proposed in this embodiment includes:
[0061] The question input module is used to receive question information input by the user.
[0062] The entity extraction module extracts entity information from user question information through an entity recognition model.
[0063] The topic confirmation module uses a large language model to analyze and confirm the topic information of the user's question.
[0064] The corpus collection module confirms the corresponding knowledge graph based on the topic information obtained by the topic confirmation module, puts the entity information extracted by the entity extraction module into the knowledge graph and the link point information for matching to obtain the node content on the link point, and determines the corpus information used for the large language model answer.
[0065] The prompt word assembly module is used to receive the corpus information used for answering in the corpus collection module, and when the large language model is required to answer in the prompt word project, the content can only come from the provided corpus information. This embodiment avoids the appearance of seemingly correct but actually wrong answers when the large language model answers the content by limiting the data information used in the training of the large language model to information related to agriculture, thereby improving the accuracy of the answer.
[0066] The large model answer module is used to collect the content information output by the prompt word assembly module and transmit the content information to the large language model so that the large language model can answer the user's question based on the provided content information. The large language model analyzes and understands the question based on the received prompt word content information, and then answers the question based on the corpus information provided in the prompt word.
[0067] The result output module is used to display the answer information of the question.
[0068] And, the result evaluation module is used to control the quality of the answer results. If the answer result is satisfactory, the information will be stored in the database in the form of [question content-answer content-provided knowledge information], and then the question will be stored in the vector database for the vector matching module. The purpose of collecting historical questions is to improve the accuracy of the answers. Since the person and method of asking questions are different each time, different description methods have different performance effects in the answering process. Using the similarity calculation of questions to questions can reduce interference factors and use the corpus information of previous satisfactory answers to answer the current question.
[0069] The result evaluation module is also used to control the process strategy of the entire question-answering system. First, the user asks a question and follows the conventional question-answering strategy process. When the output result enters the evaluation module, information about whether the user is satisfied with the result will be obtained. If the user does not choose to regenerate the answer, the answer is satisfactory. If the user chooses to regenerate the answer, the counter is incremented by one (initial value n=0). When n=1, the F / Q question-answering strategy is adopted, and the output result is also evaluated. If the user continues to regenerate the answer, the counter is incremented by one. When n>1, the question expansion question-answering strategy is adopted, and the output result is also evaluated. When n>1, only question expansion answers are used because: as a service system, the core concept in design is to make the user's operation simple and reduce the burden as much as possible. However, since the user provides limited information but is not satisfied with the result, he can only obtain more content information from the retrieval link through the background. Since the content generated by the large language model is dynamic, new content must be continuously generated to make the result satisfy the user.
[0070] Further, the system of this embodiment also includes a question expansion module, which expands the user's question information through a large language model, and requires the large language model to expand without changing the original meaning of the question through a prompt word project. The expansion of question information is to increase the number of entities, increase the accuracy of topic judgment, and improve the similarity of corpus information content. Due to the different lengths of knowledge content, in the vector calculation process, short questions will cause the long text containing correct information to score low during calculation, or even lower than the wrong short text. For example, the original question is: What can be done for prevention and control in apple planting? The question after the large model is expanded: In the process of apple planting, in order to ensure the healthy growth and yield of the fruit, what effective pest and disease control measures can be taken? Do these measures include but are not limited to the use of biological treatment, chemical spraying, physical methods, and agricultural management techniques to reduce the impact of pests and diseases on apple trees? Comparing the above two problems, it can be seen that the latter problem description is more detailed, the number of entities is increased, and the key information prevention and control is expanded to biological control, chemical control, and physical control to increase the content information.
[0071] Furthermore, the system of this embodiment also includes a vector matching module, which vectorizes the user question information, calculates the similarity with the vectors in the historical question vector library, takes the question information with the top three similarities, and then retrieves the knowledge information used to answer the question at that time based on the question information, and provides the prompt word assembly module with corpus information for answering.
[0072] Furthermore, in the process of extracting entity information, the entity extraction module uses a joint entropy algorithm to filter the entity information and reduce the number of irrelevant entities in order to improve the subsequent retrieval rate and information accuracy.
[0073] The definition of joint entropy is the sum of the entropies of two or more random variables. Joint entropy can be used to measure the correlation between multiple random variables, and can also be used to measure the uncertainty of multiple random variables. The definition of joint entropy is as follows:
[0074]
[0075] Where H(X,Y) is the joint entropy, H(X) is the entropy of random variable X, H(Y|X) is the entropy of random variable Y given random variable X, p(x,y) is the joint probability distribution of random variables X and Y, and log is the natural logarithm.
[0076] The steps for calculating joint entropy are as follows:
[0077] The bag-of-words model is used for entity quantization, as shown in Table 1 below.
[0078] Table 1
[0079] apple Planting Prevention Apple aphid Vector Expression Apple Planting 1 1 0 0 [1,1,0,0] Apple Aphid Control 1 0 1 1 [1,0,1,1]
[0080] Then the entropy of each variable is calculated by the following formula:
[0081]
[0082] The entropy of one variable given another variable is calculated by the following formula:
[0083]
[0084] Finally, calculate the joint entropy:
[0085] H(X,Y)=H(X)+H(Y|X)
[0086] If the random variables X and Y are independent of each other, then the joint entropy H(X,Y) is equal to the entropy H(X) of X plus the entropy H(Y) of Y. If the random variables X and Y are subsets of X, then the joint entropy H(X,Y) is less than or equal to the entropy H(X) of X.
[0087] Furthermore, the topic confirmation module will provide the agricultural scene topic name, topic definition, topic common vocabulary set, topic FAQ set, and how to conduct topic analysis and confirmation methods in the prompt word project. Priorities need to be clarified in the analysis method: the first priority is to extract entity information through the entity extraction module and match it with the topic common vocabulary. If there is an identical or similar situation, the topic to which the question belongs is directly confirmed. The second priority is to confirm the topic to which the question belongs with reference to the content of the topic definition. The third priority is to confirm the topic to which the question belongs with reference to the content of the topic definition and the topic FAQ set. After receiving the prompt word, the large language model will analyze and process the input content in combination with the prompt word, and the prompt word will inform the large language model of the content to be executed. The reference topic FAQ set is placed at the last priority because although the large language model has a strong understanding ability, the topic plus the FAQ set will make the amount of information too much, and a large amount of content irrelevant to the question will be generated. Since the prompt word can only tell the large language model what action to take, and the information given by the prompt word cannot be directly ignored by the large language model, this will interfere with the understanding of the large language model. The reason why the large language model is used as the topic analysis model instead of the traditional topic analysis model is that the traditional topic analysis model needs to collect data sets for training. If there is not a large amount of data information or the quality of the training data sets is poor, it will directly lead to poor performance of the topic analysis model. Therefore, how to obtain high-quality data sets is also a huge problem that needs to be faced.
[0088] Furthermore, this embodiment constructs a knowledge graph that takes content as the core, eliminates the concept of knowledge graph edges, and uses entities as link points. This knowledge graph reduces the time overhead in retrieval and provides more accurate reference information for large language model answers. Specifically, the agricultural knowledge graph is constructed using a knowledge graph that takes content as the core, where nodes represent content, and eliminates the concept of edges in the knowledge graph, converting edges into link points. Figure 2 As shown, sl represents a one-way arrow link point, dl represents a two-way arrow link point, and the number of link points of each node is the same and fixed.
[0089] The reason why content is used as a node is that most of the knowledge collected in the agricultural answering scenario comes from long documents such as encyclopedias, books, and papers. Splitting and then reorganizing the information will reduce the relevance and logic between the original knowledge. Therefore, taking advantage of the relevance and logic of the knowledge graph, the nodes directly store the content, and the entities are connected in series as link points, eliminating the need to first infer the entity relationship as a reference basis and then infer the content logic. At the same time, using content as a node gives the node information a high degree of freedom, which can enrich the content of the graph, and some content that is difficult to summarize but has a strong relevance can be directly embedded in the graph through several link points.
[0090] The reason for eliminating edges and using a fixed number of links is that if the knowledge graph is constructed in the traditional entity-centric way, the number of relationships between entities is not fixed. For nodes with many entity-connected relationships, the retrieval time overhead will increase during the reasoning process, and a large amount of information content irrelevant to the problem will be generated. Using a fixed number of links can reduce the time overhead of reasoning retrieval. For example, if each node has the same m keywords, then m*n*(n-1) edges are created between the nodes (n represents the number of nodes). Since the edges in the knowledge graph are created when loading data, this will cause the time spent loading nodes to grow exponentially, and each new node must be linked to all past nodes.
[0091] The total number of link points includes one-way arrow link points and two-way arrow link points. Since the content is the center of construction, the length of the content text can be adjusted dynamically, so there will be no fixed number of link points that cannot represent the information expressed by the content.
[0092] At the same time, since the number of keywords is fixed, when the number of nodes increases, there will be too many overlapping keywords, which will degenerate into a fully connected graph, and the edges between node pairs will reappear. To avoid this situation, this embodiment clearly defines the characteristics of agricultural knowledge classification, constructs the knowledge graph according to themes, and forms multiple thematic knowledge graphs. For example, planting themes, prevention themes, breeding themes, species attribute themes, etc., and uses the TF-IDF (term frequency-inverse document frequency) algorithm to assist in the selection of keywords for documents, and selects the words with the largest TF-IDF value as keywords.
[0093] The TF-IDF algorithm is a statistical method used to evaluate the importance of a word to a document set or a document in a corpus. The importance of a word increases in direct proportion to the number of times it appears in a document, but decreases in inverse proportion to the frequency of its appearance in the corpus.
[0094] The implementation logic of TF-IDF is as follows:
[0095] Calculate word frequency: word frequency (TF) = number of times a word appears in the article / total number of words in the article;
[0096] Since the content varies in length, word frequency normalization is required to facilitate comparison of different contents;
[0097] Calculate the inverse document frequency (IDF). The more common a word is, the larger the denominator is, and the smaller the inverse document frequency is, the closer it is to 0. The reason why the denominator is added by 1 is to avoid the denominator being 0 (that is, no documents contain the word). Inverse document frequency (IDF) = log (total number of documents in the corpus / (number of documents containing the word + 1)).
[0098] Calculate TF-IDF: TF-IDF = Term Frequency (TF) * Inverse Document Frequency (IDF).
[0099] Taking the document "Bee Farming in China" as an example, assuming the length of this article is 1,000 words, and the words "China", "bee", and "farming" each appear 20 times, then the Term Frequency (TF) of these three words is all 0.02. Then, the word "的" appears 25 billion times, "China" appears 6.23 billion times, "bee" appears 48.4 million times, and "farming" appears 97.3 million times. Then their Inverse Document Frequency (IDF) and TF-IDF are shown in Table 2 below:
[0100] Table 2
[0101]
[0102] As can be seen from the above table, the TF-IDF value of "bee" is the highest, "farming" is the second, and "China" is the lowest. Therefore, "bee" is selected as the keyword.
[0103] When the corpus collection module conducts corpus collection, since the nodes are all content information, it is necessary to concatenate the content information. The purpose of concatenation is to sort the scattered information in an orderly manner. Therefore, concatenation words are introduced to connect the scattered information into complete sentences, reducing the difficulty for the large language model to understand the information. Since there are two different types of link points between nodes, namely one-way arrows and two-way arrows, the concatenation words and concatenation methods used are also different.
[0104] Specifically, for the case of one-way arrows:
[0105]
[0106] Link representation: [Node 1][Concatenation word: can be obtained][Node 2].
[0107] Link description: The information of Node 2 can be obtained from the information of Node 1.
[0108] For the case of two-way arrows:
[0109]
[0110] Link description: [Node 1][Node 2][Concatenation word: are associated].
[0111] Link description: The information of Node 1 is associated with the information of Node 2.
[0112] The above method can obtain more corpus information, but there is also content information that is not highly relevant to the question, and the information needs to be rearranged and filtered. Rearrangement and filtering uses the similarity calculation between the question and the content information to determine the corpus information that is finally used for answering. Since the number of link points is limited, there will be no very long text. At the same time, the series connection between nodes is only two-to-two to make the text length similar. By controlling the text length, the reliability and accuracy of the similarity calculation can be improved.
[0113] This embodiment constructs a knowledge graph with content as the core, eliminates the concept of knowledge graph edges, and uses entities as link points. This knowledge graph reduces the time overhead in retrieval and provides more accurate reference information for large language model answers. The system introduces joint entropy filtering of entities with low relevance to questions in the entity extraction part, uses a large language model for topic extraction in the topic extraction module to improve the accuracy of topic affiliation, and rearranges and filters the information content in the corpus collection module. The combined operation improves the quality of the corpus provided to the large language model answer, thereby improving the accuracy of the large language model answer. At the same time, in the result evaluation module, not only the accuracy of the answer to the question is improved by controlling the answer strategy and combining multiple strategies, but also high-quality data information is collected for model optimization.
[0114] This embodiment also proposes an intelligent question-answering method based on the above-mentioned agricultural intelligent question-answering system, such as Figure 3 As shown, the intelligent question answering method proposed in this embodiment includes:
[0115] Step 10: The user inputs question information, and the entity extraction module extracts entity information from the user's question information;
[0116] Step 11, inputting the entity information and question information into the subject confirmation module to obtain subject information;
[0117] Step 12, inputting the topic information and entity information into a corpus collection module, and collecting corpus information for answering the large language model in the corpus collection module;
[0118] Step 13, inputting the collected corpus signals into the prompt word assembly module to generate content information provided to the large language model for answering;
[0119] Step 14, input the generated content information into the large model answering module for answering;
[0120] Step 15: Output the answer result and evaluate it. If the result is satisfactory, the data will be stored in the database. If the result is unsatisfactory, the F / Q question-answering mechanism will be triggered.
[0121] Furthermore, if Figure 4 As shown, the F / Q question-answering strategy process is as follows:
[0122] Step 20: The user inputs question information, which is then input into a vector matching module for vectorization and similarity calculation to obtain the top three questions in terms of similarity, and obtain the knowledge information used to answer the question at that time through the questions;
[0123] Step 21, inputting the knowledge information into the prompt word assembly module to generate content information for the large language model answer;
[0124] Step 22, input the generated content information into the large model answering module for answering;
[0125] Step 23, the answer result is output and evaluated. If the result is satisfactory, the answer is completed. If the result is unsatisfactory, the question expansion question and answer mechanism is triggered.
[0126] Furthermore, if Figure 5 As shown in the figure, the process of question expansion question answering strategy is as follows:
[0127] Step 30, the user inputs question information, and the question information is input into the question expansion module for content expansion;
[0128] Step 31, inputting the expanded question information into an entity extraction module to extract entity information from the question information;
[0129] Step 32, inputting the entity information and the expanded question information into a topic confirmation module to obtain topic information;
[0130] Step 33, inputting the topic information and entity information into a corpus collection module, and collecting corpus information for answering the large language model in the corpus collection module;
[0131] Step 34, inputting the collected corpus signal into the prompt word assembly module to generate content information provided to the large language model for answering;
[0132] Step 35, input the generated content information into the large model answering module for answering;
[0133] Step 36, the answer result is output and evaluated. If the result is satisfactory, the answer is completed. If the result is not satisfactory, the question expansion question and answer mechanism is triggered again until the result is satisfactory.
[0134] This embodiment constructs a knowledge graph with content as the core, which can effectively reduce the size of the knowledge graph and increase the retrieval rate. At the same time, constructing a knowledge graph with content as the core saves the process of first reasoning about relationships through entities and then reasoning about text relationships based on entity reasoning relationships, which increases the relevance and logic between texts; using a large language model to extract topics instead of the traditional topic extraction model can not only reduce the workload of model development and avoid the problem of difficulty in obtaining high-quality data, but also improve the accuracy of text topic summarization; finally, a method of controlling the question-answering process through a result evaluation mechanism, using different types of question-answering processes, and obtaining corpus content information for large language model answers from multiple angles to improve the accuracy of answer results. This embodiment uses a technology that combines a large language model with a knowledge graph to improve the accuracy of answer results.
[0135] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0136] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0137] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0138] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0139] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above description is only the specific implementation method of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application.
Claims
1. An agricultural intelligent question-answering system, characterized in that: The system comprises: A question input module, the question input module is used to receive question information input by a user; An entity extraction module, wherein the entity extraction module extracts entity information from the question information through an entity recognition module; A topic confirmation module, wherein the topic confirmation module uses a large language model to obtain topic information according to the question information or entity information; A corpus collection module, which confirms the corresponding knowledge graph according to the subject information, puts the entity information into the knowledge graph and the link point information to match the node content on the link point, and determines the corpus information for the large language model answer; A prompt word assembly module, wherein the prompt word assembly module generates content information provided to the large language model for answering according to the corpus information; A large model answering module, wherein the large model answering module uses a large language model to answer user questions according to the content information; A result output module, which is used to display answer information of the question; and, a result evaluation module, the result evaluation module being used to perform quality evaluation on the answer results and control the question-answer mechanism; Among them, the knowledge graph adopts a knowledge graph that takes content as the core, eliminates the concept of knowledge graph edges, and uses entities as link points.
2. The agricultural intelligent question-answering system according to claim 1, characterized in that: The system further comprises: A vector matching module is used to vectorize the question information, calculate the similarity with the vectors in the historical question vector library, take the top three question information with the highest similarity, and then retrieve the knowledge information used to answer the question at that time based on the question information, so as to provide the prompt word assembly module with corpus information for answering.
3. The agricultural intelligent question-answering system according to claim 1, characterized in that: The system further comprises: A question expansion module is used to expand the question information through a large language model. During the expansion, the large language model is required to expand the question without changing the original meaning of the question through a prompt word project.
4. An agricultural intelligent question-answering system according to any one of claims 1 to 3, characterized in that: In the process of extracting entity information, the entity extraction module uses a joint entropy algorithm to filter the entity information to reduce the number of irrelevant entities.
5. An agricultural intelligent question-answering system according to any one of claims 1 to 3, characterized in that: The theme confirmation module provides the theme name of the agricultural scene, the theme definition, the theme common vocabulary set, the theme common questions set and the method for performing theme analysis confirmation in the prompt word project; Priorities need to be identified in the thematic analysis approach: The first priority is to match the entity information extracted by the entity extraction module with the common vocabulary of the subject in the common vocabulary set of the subject. If there is an identical or similar situation, the subject to which the question belongs is directly confirmed; The next priority is to confirm the topic to which the problem belongs by referring to the content of the topic definition; The priority is then determined by referring to the topic definition and the topic FAQ to confirm the topic to which the question belongs.
6. An agricultural intelligent question-answering system according to any one of claims 1 to 3, characterized in that: In the knowledge graph, each node directly stores content, the number of link points of each node is the same and fixed, and the link points include one-way arrow link points and two-way arrow link points; The knowledge graph is constructed according to themes to form multiple thematic knowledge graphs; at the same time, the TF-IDF algorithm is used to assist in the selection of keywords for documents.
7. An agricultural intelligent question-answering system according to claim 6, characterized in that: When collecting corpus, the corpus collection module introduces concatenation words to connect scattered information into complete sentences to obtain corpus information; The corpus information is rearranged and filtered, and the rearrangement and filtering uses the similarity calculation between the question and the content information to determine the corpus information finally used for answering.
8. An agricultural intelligent question-answering method, characterized in that: The method is implemented based on the agricultural intelligent question-answering system according to any one of claims 1 to 7, and the method comprises: The user inputs question information, and the entity extraction module extracts entity information from the question information; Inputting the entity information and question information into the subject confirmation module to obtain subject information; Inputting the topic information and entity information into the corpus collection module, and collecting corpus information for large language model answers in the corpus collection module; Inputting the collected corpus information into the prompt word assembly module to generate content information provided to the large language model for answering; Inputting the generated content information into the large model answering module for answering; The answer results are output and evaluated. If the results are satisfactory, the data is stored in the database. If the results are unsatisfactory, the F / Q question-and-answer mechanism is triggered.
9. The agricultural intelligent question-answering method according to claim 8, characterized in that: The F / Q question-answering mechanism includes: The user inputs question information, which is input into the vector matching module for vectorization and similarity calculation is performed between the question information and the vectors in the historical question vectors to obtain the top three questions in terms of similarity, and the knowledge information used to answer the question at that time is obtained through the questions; Inputting the knowledge information into the prompt word assembly module to generate content information for answering with a large language model; Inputting the generated content information into the large model answering module for answering; The answer result is output and evaluated. If the result is satisfactory, the answer is completed. If the result is unsatisfactory, the question expansion question and answer mechanism is triggered.
10. An agricultural intelligent question-answering method according to claim 9, characterized in that: The question expansion question-answering mechanism includes: The user inputs question information, and the question information is input into the question expansion module for content expansion; Inputting the expanded question information into the entity extraction module to extract entity information from the question information; Inputting the entity information and the expanded question information into the subject confirmation module to obtain subject information; Inputting the topic information and entity information into the corpus collection module, and collecting corpus information for large language model answers in the corpus collection module; Inputting the corpus information into the prompt word assembly module to generate content information provided to the large language model for answering; Inputting the content information into the large model answering module for answering; The answer result is output and evaluated. If the result is satisfactory, the answer is completed. If the result is unsatisfactory, the question expansion question and answer mechanism is triggered again.