Disease and pest question answering system fusing knowledge graph and large model

By integrating knowledge graphs and large models into a pest and disease question-and-answer system, the accuracy and rigor of pest and disease control knowledge acquisition in existing technologies have been solved. This system enables accurate understanding and professional answers to farmers' colloquial questions, thereby improving the accuracy and practicality of pest and disease control.

CN121958508APending Publication Date: 2026-05-01YUNNAN AGRICULTURAL UNIVERSITY

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
YUNNAN AGRICULTURAL UNIVERSITY
Filing Date
2026-04-01
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing methods for acquiring knowledge about pest and disease control are insufficient in understanding user questions and the rigor of answers is poor. Traditional knowledge graph systems have low recall rates, while large language model systems lack rigor.

Method used

This pest and disease question-answering system integrates knowledge graphs and large-scale models. It extracts corpora from multi-source data and constructs vertical domain knowledge graphs through a knowledge base construction module. It then uses a large-scale model semantic parsing module to extract entities and relationships and a collaborative retrieval module to perform semantic matching to generate structured answers.

Benefits of technology

It achieves accurate understanding and professional responses to farmers' colloquial expressions, improves the accuracy and rigor of pest and disease control recommendations, reduces the rate of misdiagnosis and missed detection, and outputs results that are logically fluent and conform to human language habits.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121958508A_ABST
    Figure CN121958508A_ABST
Patent Text Reader

Abstract

The invention relates to the field of knowledge questions and answers, in particular to a disease and insect pest questions and answers system fusing a knowledge graph and a large model. The uniqueness and accuracy of underlying facts are ensured through an automatic extraction and disambiguation mechanism driven by a large model, and the illusion phenomenon of the large model is effectively inhibited in combination with hard constraints of a knowledge graph, so that the accuracy and preciseness of disease and pest control suggestions are superior to those of a traditional data-driven method; the deep semantic understanding capability of the large language model is utilized, oral expressions, wrongly written characters and implicit intentions of peasant households are accurately recognized, compared with syntactic rule matching in the prior art, the misdiagnosis and omission ratio can be greatly reduced, and higher practicability is shown in a complex consultation scene; structured multi-source data representing expert knowledge is seamlessly fused into a large model generation process, an output result has professional constraints and conforms to human language habits, logic is smooth, the sense of speech is natural, and the interactive experience is far better than that of stiff template reply in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of knowledge-based question answering, specifically to a pest and disease question answering system that integrates knowledge graphs and large-scale models. Background Technology

[0002] In the process of modern agricultural informatization, the rapid and accurate acquisition of knowledge on pest and disease control is of great significance for ensuring crop yield and quality. Traditional agricultural consultation mainly relies on expert field surveys or farmers consulting paper manuals, which suffers from poor real-time performance, limited coverage, and high acquisition costs. With the development of artificial intelligence technology, automatic question answering systems based on deep learning (such as retrieval-based question answering or general large language models) have been gradually introduced into the field of agricultural consultation. However, how to achieve deep integration of expert knowledge and deep learning has always been the core research bottleneck.

[0003] Specifically, existing technologies mainly employ two methods for acquiring knowledge about pest and disease control. The first is a reasoning system centered on knowledge graphs. This type of system stores pest and disease control knowledge through predefined entity-relation triples, ensuring the accuracy of generated answers. However, users must use terminology completely consistent with the entities and relations in the knowledge graph when asking questions, making it difficult to handle colloquial, misspelled, or abbreviated user questions, resulting in a relatively low recall rate in practical use. The second type is a generative system centered on large language models. This type of system possesses powerful semantic understanding capabilities and can quickly process various types of questions. However, due to the lack of knowledge constraints specific to the agricultural vertical domain, the generated content often contains fabricated information or confuses the characteristics of different pests and diseases, thus exhibiting poor rigor. Summary of the Invention

[0004] To address the shortcomings of existing technologies, this invention provides a pest and disease question-and-answer system that integrates knowledge graphs and large models, solving the problems of existing methods for obtaining pest and disease control knowledge, which suffer from difficulty in fully understanding user questions and poor rigor in their answers.

[0005] To achieve the above objectives, the present invention provides the following technical solution: a pest and disease question-answering system integrating knowledge graphs and large models, comprising: The knowledge base construction module is used to extract the corpus of pre-acquired multi-source data and input it into the pre-built large language model. The large language model is guided by prompt words to generate agricultural knowledge text. At the same time, standardized triples composed of entities and relations are extracted from the agricultural knowledge text to construct a knowledge graph and establish a bottom-level fact base for the vertical domain. The large model semantic parsing module is used to inject standard entity types and relation attributes from the knowledge graph ontology schema into prompt words, guide the large language model to extract entities and relations according to the schema, and map non-standard entity expressions in user questions to the ontology standard vocabulary of the knowledge graph. The collaborative retrieval module is used to represent user questions and triples in the knowledge graph as semantic vectors. Then, the semantic vectors corresponding to user questions and reasoning paths in the knowledge graph are mapped to a high-dimensional semantic space for matching and filtering to obtain the core reasoning path. The knowledge enhancement generation module is used to execute two independent subtasks in parallel during the answer generation stage. The first subtask is to format the core reasoning path into an explicit inference chain. The second subtask is to extract the answer entities and their key attributes that directly match the user's question from the knowledge graph, organize them into a structured answer list, and then integrate the explicit inference chain and the answer list through a large language model to obtain an answer result that conforms to the preset language rules.

[0006] Preferably, the multi-source data includes at least web page data and PDF data, and the specific steps for acquiring the corpus are as follows: For web page data, the BeautifulSoup library is used in combination with tag filtering and regular expressions to remove HTML tags and sidebar noise information, and extract the main text content to obtain the corresponding corpus. For PDF data, the MinerU engine is used to perform multimodal layout analysis, converting the fixed layout into structured Markdown format, and removing headers and footers by parsing Markdown identifiers to obtain clean text as corpus.

[0007] Preferably, after the guiding large language model extracts entities and relations according to the schema, it also includes disambiguation of entity ambiguity. The specific steps are as follows: using vector space mapping, the entity and its context are encoded into high-dimensional feature vectors, the semantic alignment of different references is achieved by quantizing spatial similarity, and knowledge redundancy is eliminated by global unique identity to ensure the uniqueness of the graph entity.

[0008] Preferably, the specific steps for mapping non-canonical entity representations in user questions to the ontology standard lexicon of the knowledge graph are as follows: Standard entities in the knowledge graph ontology standard lexicon are pre-converted into standard high-dimensional semantic vectors; Extract candidate entities from user questions and transform them into high-dimensional semantic vectors; Calculate the cosine similarity between the high-dimensional semantic vector corresponding to the user's question and the high-dimensional semantic vector corresponding to each standard entity in the knowledge graph; Set a similarity threshold and select the standard entity with the largest cosine similarity value that is greater than or equal to the similarity threshold as the mapping result.

[0009] Preferably, the specific steps for obtaining the core reasoning path are as follows: Based on user questions, Cypher query statements are constructed, and multiple candidate reasoning paths are retrieved from the knowledge graph as an initial candidate set; The query statement and each candidate reasoning path in the initial candidate set are vectorized and encoded separately. By calculating the cosine similarity between the vector corresponding to the query statement and the vector corresponding to each candidate reasoning path, a semantic relevance score is generated for each candidate reasoning path. Set a semantic relevance threshold and filter out candidate reasoning paths whose semantic relevance scores are greater than the semantic relevance threshold in the initial candidate set to obtain the core reasoning path.

[0010] Preferably, the process of extracting standardized triples consisting of entities and relations from agricultural knowledge text further includes real-time detection and resolution of knowledge conflicts, the specific steps of which are as follows: Using entities as nodes and relationships as edges, an entity relationship conflict graph is constructed, and each edge is assigned an initial confidence weight, which is determined based on the authority of the source document and the consistency of extraction. When a new triplet appears, check whether there are edges in the conflict graph that are connected to the two entities in the new triplet and whether the relation type is logically contradictory to the relation in the new triplet. The logical contradictions include mutually exclusive relations and attribute value conflicts. In response to the detection of a logical contradiction, the semantic distance between the newly added triple and the existing triple is calculated; Set a base distance threshold and calculate a semantic distance threshold based on the average frequency of the two entities in the new triplet across all corpora. If the semantic distance between the newly added triple and the existing triple is less than or equal to the semantic distance threshold, the newly added triple is determined to be a knowledge redundancy and is discarded; otherwise, the newly added triple is retained and the confidence weight of the corresponding edge in the entity relationship conflict graph is updated to the larger of the initial confidence weight and the existing confidence weight of the corresponding edge. The global confidence propagation algorithm is executed periodically to mark triples in the entity relationship conflict graph whose confidence is lower than the preset confidence threshold and then manually verify them.

[0011] Preferably, when the large model semantic parsing module obtains user questions from the same user in multiple rounds of dialogue, it continuously tracks and dynamically corrects entities in the multiple rounds of dialogue. The specific steps are as follows: Build the dialogue state stack ,in, , and These represent the core entity, entity type, and entity confidence level confirmed in the nth round of dialogue, respectively. When a user question is received in the current round, the historical entity most relevant to the semantics of the user question is retrieved from the dialogue state stack to obtain the historical entity most relevant to the user question. Determine if the relevance is greater than the preset context threshold. If so, add the historical entity as an implicit entity supplement to the current user question, and together with the explicitly resolved entity in the current user question, they form the query entity set. If the current round of user questions contains an intention to correct errors, then the semantic distance between the entities in the current round of user questions and the historical entities is calculated to obtain the corrected semantic distance; Determine if the corrected semantic distance is less than the preset corrected semantic distance threshold; if so, determine that the entity in the current round of user questions and the historical entity are the same entity, and increase the confidence of the entity; otherwise, determine that it is an entity replacement, replace the entity at the corresponding position in the dialogue state stack with the entity in the current round of user questions, and reset the confidence. Periodically decay the entity confidence in the dialogue state stack and remove entities whose entity confidence is less than a preset entity confidence threshold.

[0012] Compared with existing technologies, this invention provides a pest and disease question-answering system that integrates knowledge graphs and large models, which has the following beneficial effects: 1. Through the automated extraction and disambiguation mechanism driven by the large model, the uniqueness and accuracy of the underlying facts are ensured. Combined with the hard constraints of the knowledge graph, the "illusion" phenomenon of the large model is effectively suppressed, making the accuracy and rigor of pest and disease control recommendations significantly better than traditional data-driven methods.

[0013] 2. By leveraging the deep semantic understanding capabilities of large language models, the system can accurately identify farmers' colloquial expressions, misspellings, and implied intentions. Compared with existing syntactic rule matching technologies, this solution greatly reduces the rate of misdiagnosis and missed detection, demonstrating stronger practicality in complex consultation scenarios.

[0014] 3. The structured multi-source data representing expert knowledge is seamlessly integrated into the large model generation process. The output results are both professionally constrained and in line with human language habits. The logic is fluent and the language is natural. In terms of interactive experience, it far surpasses the rigid template-based responses in existing technologies. Attached Figure Description

[0015] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 This is a structural block diagram of the pest and disease question-and-answer system of the present invention.

[0016] In the diagram: 1. Knowledge base construction module; 2. Large model semantic parsing module; 3. Collaborative retrieval module; 4. Knowledge enhancement generation module. Detailed Implementation

[0017] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. This will allow for a full understanding of how the present application uses technical means to solve technical problems and achieve technical effects, and to facilitate its implementation.

[0018] Those skilled in the art will understand that all or part of the steps in the methods of the following embodiments can be implemented by a program instructing related hardware. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0019] To address the shortcomings of existing methods for acquiring pest and disease control knowledge, such as insufficient understanding of user questions and poor rigor in responses, this invention provides a pest and disease question-answering system integrating knowledge graphs and large-scale models. The system comprises a knowledge base construction module 1, a large-scale model semantic parsing module 2, a collaborative retrieval module 3, and a knowledge enhancement and generation module 4. These four modules collaborate to complete the entire process from multi-source data collection and user question acquisition to final answer generation. The specific content of each module will be described below: 1. Knowledge Base Construction Module 1. This module first acquires multi-source data, including web page data and PDF data. PDF data includes books and documents in PDF format. Then, it extracts the corpus from the multi-source data. Traditional knowledge graph construction relies heavily on manual preprocessing, making it difficult to efficiently extract knowledge from unstructured agricultural documents, web pages, and other data. In this embodiment, the methods for extracting corpus data from web page data and PDF data differ. For web page data, the BeautifulSoup library is used in conjunction with tag filtering and regular expressions to remove HTML tags and sidebar noise, and then extract the main text content to obtain the corresponding corpus. BeautifulSoup is a commonly used HTML parsing library in Python, capable of traversing the document tree and extracting the required elements. Tag filtering refers to retaining the main text area (e.g., ...). <article> 、 The text within the tags is processed by removing irrelevant content such as scripts and styles. Regular expressions are used to further clean up residual noise characters. The processed text constitutes the corpus of web page data. For PDF data, the MinerU engine is used for multimodal layout analysis. MinerU is a tool capable of parsing complex PDF layouts, recognizing elements such as titles, paragraphs, tables, and images. The fixed layout is then converted to Markdown format. Markdown is a lightweight markup language that preserves the hierarchical structure of the text. Subsequently, Markdown identifiers are parsed to remove noise such as headers and footers, resulting in clean text for use as corpus. After obtaining the corpus of multi-source data, it is input into a pre-built large language model. In this embodiment, large language models such as IPM-AgriGPT and Sinon can be used. The large language model is guided by prompt words to generate agricultural knowledge text. At the same time, standardized triples consisting of entities and relations are extracted from the agricultural knowledge text. The standardized triples are then stored in the Neo4j knowledge graph to construct the knowledge graph and establish a bottom-level fact base for the vertical domain.

[0020] During the process of extracting triples from multi-source data, there is a high probability of knowledge conflicts occurring. For example, document A states that "triadimefon can be used to control wheat powdery mildew," while document B states that "triadimefon is banned." The triples extracted from these two documents will create a logical contradiction—one document recommends the use of triadimefon, while the other states that triadimefon is banned. If this situation is not addressed and the triples extracted from both documents are directly stored in the knowledge graph, logically contradictory information will appear in the subsequent question-and-answer generated based on user questions, seriously affecting the reliability of the system. Therefore, it is necessary to detect and resolve such knowledge conflicts in real time during the construction phase to ensure the consistency and accuracy of knowledge in the knowledge graph. The specific steps are as follows: First, an entity-relationship conflict graph is constructed, with entities as nodes and relationships as edges. Each edge is then assigned an initial confidence weight, determined based on the authority of the source document and the consistency of the extraction. The calculation formula can be expressed as:

[0021] In the above formula, This represents the initial confidence weight of the edge between nodes i and j. , is the preset balance coefficient, The score for the source document's authority is pre-set based on the document's source (such as official journals, journal authority, and personal blogs). To extract the consistency score, which represents the degree of consistency when extracting the same triples multiple times from the same document or different documents, the source document authority score is normalized to an interval. .

[0022] When a new triple is added, the conflict graph is checked to see if there are edges connecting the two entities in the new triple and if the relation type is logically contradictory to the relation in the new triple. Logical contradictions include mutually exclusive relations (such as "prevention method" and "disabled method") and attribute value conflicts (such as "applicable temperature: 20-25℃" and "applicable temperature: 10-15℃"). Multiple logical contradiction rules can be predefined to form a contradiction rule base, and the rules in the contradiction rule base can be traversed for conflict detection during subsequent use.

[0023] In response to the detection of a logical contradiction, the semantic distance between the newly added triple and the existing triples is calculated. Its calculation formula can be expressed as:

[0024] In the above formula, and These represent the vector representations of the newly added triples and the existing triples, respectively. The smaller the semantic distance, the closer the two triples are semantically; the larger the distance, the greater the semantic difference. This step is used to calculate whether the newly added knowledge is redundant compared to the existing knowledge.

[0025] Set a base distance threshold, and calculate a semantic distance threshold based on the average frequency of the two entities in the newly added triplet across all corpora. Its calculation formula can be expressed as:

[0026] In the above formula, Indicates the base distance threshold. For adjustment coefficients, The threshold is the average frequency of the two entities in the newly added triplet across all corpora. For high-frequency entities (generally common diseases), there is a greater possibility of knowledge redundancy. Therefore, the threshold is appropriately increased to increase the tendency to judge them as redundant. For low-frequency entities, knowledge may be scarce. Therefore, the threshold is lowered to tend to retain the newly added knowledge.

[0027] If the semantic distance between the newly added triple and the existing triple is less than or equal to the semantic distance threshold, the newly added triple is considered a knowledge redundancy and is discarded; otherwise, the newly added triple is retained, and the confidence weight of the corresponding edge in the entity relationship conflict graph is updated to the larger of the initial confidence weight and the existing confidence weight of the corresponding edge.

[0028] The global confidence propagation algorithm is executed periodically. The confidence propagation algorithm is an iterative algorithm on the graph. It propagates and updates the global confidence by influencing the confidence of adjacent nodes. After multiple rounds of propagation, triples in the entity relationship conflict graph with confidence below the preset confidence threshold are marked and manually reviewed to ensure the quality of knowledge finally stored in the main knowledge graph.

[0029] 2. Large-Scale Semantic Parsing Module 2. When farmers consult the system, they often use relatively colloquial expressions, sometimes containing typos and abbreviations. Traditional rule-based or dependency parsing methods struggle to accurately understand user intent. Furthermore, the system needs to map natural language questions onto standard entities and relations in the knowledge graph for precise retrieval. Therefore, this embodiment leverages the deep semantic understanding capabilities of the large-scale language model, combined with the constraints of the knowledge graph ontology schema, to map standard entity types (such as "crops," "diseases," and "pesticides") and relation attributes (such as "prevention") in the knowledge graph ontology schema. The prompt words (such as "treatment methods" and "symptoms") are injected to guide the large language model to extract entities and relations from the user's question according to the schema, converting the natural language question into entity-relation triples. For example, "wheat powdery mildew" is mapped to the "Disease" entity, and "prevention methods" is mapped to the "hasPrevention" relation. At the same time, non-standard entity expressions in the user's question are mapped to the ontology standard lexicon of the knowledge graph, realizing the transformation from "fuzzy input" to "standard entities". This embodiment achieves this mapping through semantic vector projection technology, and its specific steps are as follows: First, standard entities in the knowledge graph ontology's standard lexicon are pre-converted into standard high-dimensional semantic vectors. A semantic coding model (such as Sentence-BERT) can be used to encode each standard entity (e.g., "wheat powdery mildew" and "triazine"), generating a corresponding vector representation. This step only needs to be performed once, significantly reducing computational overhead during online queries. Next, candidate entities from the user's question are extracted and converted into high-dimensional semantic vectors. First, the schema-guided extraction mechanism described earlier can be used to identify candidate entities from the user's question. These candidate entities may be non-canonical expressions. Then, the previously used semantic coding model is used to convert these candidate entities into high-dimensional semantic vectors. Next, the cosine similarity between the high-dimensional semantic vector corresponding to the user's question and the high-dimensional semantic vectors corresponding to each standard entity in the knowledge graph is calculated. Finally, a similarity threshold is set, such as 0.85. The standard entity with the highest cosine similarity value, greater than or equal to the similarity threshold, is selected as the mapping result. If all similarities are below the threshold, it is determined that the user has input an entity that does not exist in the knowledge graph, and a corresponding prompt can be output to inform the user.

[0030] Furthermore, the same entity may have multiple different expressions in multi-source data, such as "wheat powdery mildew" versus "wheat powdery mildew fungus" and "Blumeria". Entity redundancy, such as "graminis", would be directly stored in the knowledge graph, affecting the user's subsequent retrieval efficiency. Therefore, after guiding the large language model to extract entities and relations based on the schema, entity ambiguity needs to be disambiguated. The specific steps are as follows: Using vector space mapping, entities and their contexts (such as the sentences and paragraphs in which the entity is located) are encoded into high-dimensional feature vectors. Commonly used encoding models can be pre-trained language models such as BERT and Sentence-BERT, which can capture the semantic information of entities. Then, semantic alignment of different references is achieved by quantizing spatial similarity. For example, the cosine similarity between the vectors corresponding to different entity references is calculated. If the similarity is higher than a preset threshold, they are considered to point to the same real-world entity. Knowledge redundancy is eliminated by using a globally unique identifier to ensure the uniqueness of the graph entities. That is, for the same real-world entity, the same globally unique identifier (such as UUID) is assigned to it to eliminate knowledge redundancy. Finally, each entity in the graph retains only one standard expression, and other expressions can be recorded as aliases for subsequent query mapping.

[0031] During user consultations, farmers often use a progressive questioning approach based on the search results. For example, a farmer might first ask, "How do you treat wheat powdery mildew?", and after receiving an answer, might then ask, "What about rust?", or correct themselves midway, saying, "No, I meant rust, not powdery mildew." Existing single-turn question-and-answer systems struggle to track entities already identified in previous dialogues, leading to entity loss or mismatches during subsequent question parsing. Therefore, in this embodiment, the large-model semantic parsing module 2 continuously tracks and dynamically corrects entities across multiple dialogues when acquiring user questions from the same user. The specific steps are as follows: First, in order to record entities in each round of user dialogue for subsequent retrieval, a dialogue state stack is constructed. ,in, , and These represent the core entities confirmed in the nth round of dialogue (such as "wheat" and "powdery mildew"), entity types (such as "crops" and "diseases"), and entity confidence, respectively. The initial value of the entity confidence can be set to 1.0. The dialogue state stack records all important entities mentioned and confirmed by the system during the dialogue process, serving as the contextual basis for understanding the user's intent in subsequent rounds.

[0032] When a user question is received in the current round, the most semantically relevant historical entity to the user question is retrieved from the dialogue state stack. This relevance can be calculated using weighted cosine similarity, expressed as:

[0033] In the above formula, Represents the weighted cosine similarity. , is the balance coefficient. and These are the vector representations of the user's question in the current round and the historical entities, respectively. For the current round of dialogue, The order in which historical entities are generated. To maximize the number of effective memory rounds, for example, set it to 10 rounds.

[0034] Subsequently, it is determined whether the relevance is greater than a preset context threshold, such as 0.65. If so, the historical entity is used as an implicit entity supplement to the current user question, and together with the entity explicitly parsed in the current user question, they form a query entity set. This allows the entities omitted by the user in multi-turn dialogues (such as "What medicine should we use?" which implies "wheat powdery mildew" mentioned earlier) to be automatically completed, greatly reducing the probability of information loss.

[0035] If the current user question contains an intention to correct errors, the presence of such an intention can be determined by detecting error-correction trigger words such as "incorrect," "actually," and "I misspoke." Then, the semantic distance between entities in the current user question and historical entities can be calculated to obtain the corrected semantic distance. The formula for calculating this distance can be expressed as follows:

[0036] In the above formula, This indicates a correction of semantic distance. and These represent entities in the current round of user questions and historical entities, respectively.

[0037] Finally, it is determined whether the corrected semantic distance is less than the preset corrected semantic distance threshold, such as 0.3. If so, the entity in the current user question and the historical entity are determined to be the same entity, that is, different expressions of the same entity, such as powdery mildew and powdery mildew fungus. In this case, the confidence of the entity can be increased, for example, by increasing the confidence according to a preset step size or other rules. Otherwise, it is determined to be an entity replacement. For example, if the user corrects "powdery mildew" to "rust disease", the entity at the corresponding position in the dialogue state stack is replaced with the entity in the current user question, and the confidence can be reset, that is, reset to the initial entity confidence, such as 1.0. This step allows the system to flexibly identify the user's correction behavior and avoid the continuous accumulation of errors.

[0038] To simulate the decay of human memory over time, the system will also periodically decay the entity confidence in the dialogue state stack and remove entities whose entity confidence is less than a preset entity confidence threshold. The calculation expression can be represented as:

[0039] In the above formula, and Let represent the entity confidence score in the i-th round of dialogue and the decayed entity confidence score, respectively. As the attenuation factor, This represents the time interval between the i-th round of dialogue and the current round of dialogue. This mechanism effectively controls the size of the state stack and avoids useless information occupying resources for a long time.

[0040] 3. Collaborative Retrieval Module 3. Currently, while symbolic retrieval relying solely on knowledge graphs (such as Cypher queries) can accurately match entity relationships, it struggles to handle semantically ambiguous user questions and is prone to missing relevant reasoning paths in the knowledge graph due to inconsistencies in terminology. Pure vector retrieval, while capable of semantic matching, may overlook multi-hop reasoning relationships implicit in the graph structure. Therefore, this embodiment represents user questions and triples in the knowledge graph as semantic vectors. Then, the semantic vectors corresponding to the user questions and reasoning paths in the knowledge graph are mapped to a high-dimensional semantic space for matching and filtering to obtain the core reasoning path. The specific steps for obtaining the core reasoning path are described in detail below: First, the user's question is parsed using the large model semantic parsing module 2, outputting standard entities and relations to construct a Cypher query. Then, multiple candidate inference paths are retrieved from the knowledge graph. For example, for the question "methods for controlling wheat powdery mildew", the query can be constructed as: MATCH(c:Crop{name:'wheat'})-[r:hasDisease]->(d:Disease{name:'powdery mildew'})-[p:hasControl]->(m:Method) RETURN path. This query returns all possible inference paths (such as "wheat→disease→powdery mildew→control→triadimefon", "wheat→disease→powdery mildew→control→reasonable planting density", etc.), forming an initial candidate set. This step ensures that all possible association paths are recalled.

[0041] Subsequently, the query statement and each candidate reasoning path in the initial candidate set are vectorized and encoded. By calculating the cosine similarity between the vector corresponding to the query statement and the vector corresponding to each candidate reasoning path, a semantic relevance score is generated for each candidate reasoning path. The cosine similarity is the semantic relevance score. Finally, a semantic relevance threshold is set, such as 0.7, to filter out candidate reasoning paths in the initial candidate set whose semantic relevance scores are greater than the semantic relevance threshold, thereby obtaining the core reasoning path.

[0042] 4. Knowledge Enhancement Generation Module 4 is used to execute two independent subtasks in parallel during the answer generation stage. The first subtask is to format the core reasoning path into an explicit derivation chain. The second subtask is to extract the answer entities and their key attributes that directly match the user's question from the knowledge graph and organize them into a structured answer list. For example, for a query on "methods for controlling wheat powdery mildew", the output format of this module is as follows: 1. Control methods: Triadimefon (chemical control, suitable for the early stage of disease). 2. Prevention and control methods: Reasonable planting density (agricultural measures, applicable to the sowing period); 3. Prevention and control methods: Disease-resistant varieties (biological breeding, applicable before planting); The two modules remain independent, without deep integration, providing only clear and original factual input for subsequent generation. Then, a large language model integrates the explicit reasoning chain and answer list to obtain answers conforming to preset language rules. Based on prompts encapsulating the integration task, the model integrates the core reasoning path with the answer list to generate professional expressions conforming to preset language rules. For example, it can organize words according to the grammatical rules of languages ​​like Chinese or English, or it can customize new language rules based on the grammatical rules of Chinese or English. These prompts clearly define the model's role (agricultural knowledge question-and-answer assistant), input sources (path module and answer list), and output requirements (integration of information from both, fluent and professional language), ensuring that the generated results are both faithful to the original facts and highly readable. For example, given the path module "wheat → disease → powdery mildew" and the answer list module "1. triadimefon, 2. reasonable planting density, 3. disease-resistant varieties", the model synthesis result is: "The retrieval path indicates that wheat may be infected with powdery mildew. The main control methods include chemical control with triadimefon, agricultural measures such as reasonable planting density, and selection of disease-resistant varieties." This process ensures the interpretability, accuracy, and professional expression of the generated results, realizing the conversion from structured knowledge to natural language.

[0043] It should be noted that the system provided in the above embodiments is only illustrated by the division of the above functional modules when implementing its functions. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the system and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0044] The above embodiments provide a detailed description of the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention. < / article>

Claims

1. A pest and disease question-answering system integrating knowledge graphs and large-scale models, characterized in that, include: The knowledge base construction module (1) is used to extract the corpus of pre-acquired multi-source data and input it into the pre-built large language model. The large language model is guided by prompt words to generate agricultural knowledge text. At the same time, standardized triples composed of entities and relations are extracted from the agricultural knowledge text to construct a knowledge graph and establish a vertical domain underlying fact base. The large model semantic parsing module (2) is used to inject the standard entity types and relation attributes in the knowledge graph ontology schema into the prompt words, guide the large language model to extract entities and relations according to the schema, and map the non-standard entity expressions in the user's question to the ontology standard vocabulary of the knowledge graph. The collaborative retrieval module (3) is used to represent the user question and the triple in the knowledge graph as semantic vectors respectively. Then, the semantic vectors corresponding to the user question and the reasoning path in the knowledge graph are mapped to the high-dimensional semantic space for matching and filtering to obtain the core reasoning path. The knowledge enhancement generation module (4) is used to execute two independent subtasks in parallel during the answer generation stage. The first subtask is to format the core reasoning path into an explicit inference chain. The second subtask is to extract the answer entities and their key attributes that directly match the user's question from the knowledge graph, organize them into a structured answer list, and integrate the explicit inference chain and the answer list through a large language model to obtain an answer result that conforms to the preset language rules.

2. The pest and disease question-and-answer system according to claim 1, characterized in that, The multi-source data includes at least webpage data and PDF data, and the specific steps for acquiring the corpus are as follows: For web page data, the BeautifulSoup library is used in combination with tag filtering and regular expressions to remove HTML tags and sidebar noise information, and extract the main text content to obtain the corresponding corpus. For PDF data, the MinerU engine is used to perform multimodal layout analysis, converting the fixed layout into structured Markdown format, and removing headers and footers by parsing Markdown identifiers to obtain clean text as corpus.

3. The pest and disease question-and-answer system according to claim 1, characterized in that, After the guided large language model extracts entities and relations according to the schema, it also includes disambiguation of entity ambiguity. The specific steps are as follows: using vector space mapping, the entity and its context are encoded into high-dimensional feature vectors, the semantic alignment of different references is achieved by quantizing spatial similarity, and knowledge redundancy is eliminated by global unique identity to ensure the uniqueness of the graph entities.

4. The pest and disease question-and-answer system according to claim 1, characterized in that, The specific steps for mapping non-canonical entity representations in user questions to the ontology standard lexicon of the knowledge graph are as follows: Standard entities in the knowledge graph ontology standard lexicon are pre-converted into standard high-dimensional semantic vectors; Extract candidate entities from user questions and transform them into high-dimensional semantic vectors; Calculate the cosine similarity between the high-dimensional semantic vector corresponding to the user's question and the high-dimensional semantic vector corresponding to each standard entity in the knowledge graph; Set a similarity threshold and select the standard entity with the largest cosine similarity value that is greater than or equal to the similarity threshold as the mapping result.

5. The pest and disease question-and-answer system according to claim 1, characterized in that, The specific steps for obtaining the core reasoning path are as follows: Based on user questions, Cypher query statements are constructed, and multiple candidate reasoning paths are retrieved from the knowledge graph as an initial candidate set; The query statement and each candidate reasoning path in the initial candidate set are vectorized and encoded separately. By calculating the cosine similarity between the vector corresponding to the query statement and the vector corresponding to each candidate reasoning path, a semantic relevance score is generated for each candidate reasoning path. Set a semantic relevance threshold and filter out candidate reasoning paths whose semantic relevance scores are greater than the semantic relevance threshold in the initial candidate set to obtain the core reasoning path.

6. The pest and disease question-and-answer system according to claim 1, characterized in that, The process of extracting standardized triples consisting of entities and relations from agricultural knowledge texts also includes real-time detection and resolution of knowledge conflicts, the specific steps of which are as follows: Using entities as nodes and relationships as edges, an entity relationship conflict graph is constructed, and each edge is assigned an initial confidence weight, which is determined based on the authority of the source document and the consistency of extraction. When a new triplet appears, check whether there are edges in the conflict graph that are connected to the two entities in the new triplet and whether the relation type is logically contradictory to the relation in the new triplet. The logical contradictions include mutually exclusive relations and attribute value conflicts. In response to the detection of a logical contradiction, the semantic distance between the newly added triple and the existing triple is calculated; Set a base distance threshold and calculate a semantic distance threshold based on the average frequency of the two entities in the new triplet across all corpora. If the semantic distance between the newly added triple and the existing triple is less than or equal to the semantic distance threshold, the newly added triple is determined to be a knowledge redundancy and is discarded; otherwise, the newly added triple is retained and the confidence weight of the corresponding edge in the entity relationship conflict graph is updated to the larger of the initial confidence weight and the existing confidence weight of the corresponding edge. The global confidence propagation algorithm is periodically executed to mark triples in the entity relationship conflict graph whose confidence is lower than the preset confidence threshold and then manually verify them.

7. The pest and disease question-and-answer system according to claim 1, characterized in that, When the large model semantic parsing module (2) obtains user questions from the same user in multiple rounds of dialogue, it continuously tracks and dynamically corrects entities in the multiple rounds of dialogue. The specific steps are as follows: Build the dialogue state stack ,in, , and These represent the core entity, entity type, and entity confidence level confirmed in the nth round of dialogue, respectively. When a user question is received in the current round, the historical entity most relevant to the semantics of the user question is retrieved from the dialogue state stack to obtain the historical entity most relevant to the user question. Determine if the relevance is greater than the preset context threshold. If so, add the historical entity as an implicit entity supplement to the current user question, and together with the explicitly resolved entity in the current user question, they form the query entity set. If the current round of user questions contains an intention to correct errors, then the semantic distance between the entities in the current round of user questions and the historical entities is calculated to obtain the corrected semantic distance; Determine if the corrected semantic distance is less than the preset corrected semantic distance threshold; if so, determine that the entity in the current round of user questions and the historical entity are the same entity, and increase the confidence of the entity; otherwise, determine that it is an entity replacement, replace the entity at the corresponding position in the dialogue state stack with the entity in the current round of user questions, and reset the confidence. Periodically decay the entity confidence in the dialogue state stack and remove entities whose entity confidence is less than a preset entity confidence threshold.

Citation Information

Patent Citations

  • Agricultural disease knowledge question and answer retrieval method and system based on heterogeneous knowledge fusion

    CN118550991A

  • Dynamic knowledge base collaborative improvement method based on multiple rounds of dialogues

    CN121168609A

  • LLM-based constraint and self-repairing uniformization equipment knowledge graph automatic construction method

    CN121413730A

  • Question answering using enhanced retrieval-augmented generation

    US20260073184A1

Cited By

  • Retrieval enhancement generation method and device

    CN121901401A