Apple planting knowledge graph database construction method and question answering system
By combining top-down and bottom-up approaches to construct a knowledge graph database for the entire apple industry chain, and using the BERT-CRF model for entity recognition, the problem of insufficient knowledge completeness in existing technologies has been solved. This has enabled an efficient apple knowledge acquisition and automatic question-answering system, enhancing professional support for agricultural practitioners in apple cultivation.
Patent Information
- Application Number
- CN202410538213.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-30
- Publication Date
- 2025-10-31
AI Technical Summary
Existing methods for constructing apple knowledge graphs lack sufficient database knowledge completeness and a publicly available apple knowledge graph question-and-answer system, making it difficult for agricultural practitioners to obtain professional and convenient answers to apple cultivation questions.
We construct a knowledge graph database for the entire Apple industry chain using a combination of top-down and bottom-up approaches, use the BERT-CRF model for entity recognition, and store triples in the Neo4j graph database. We also design an automatic question-answering system to achieve efficient knowledge acquisition.
The constructed knowledge graph database boasts high knowledge completeness, is easy to update and maintain, and enables an efficient automatic question-answering system, improving the convenience and speed for users to acquire knowledge.
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This invention belongs to the field of agronomic technology and relates to the construction of knowledge graph databases, specifically to a method for constructing a knowledge graph database for the entire apple industry chain and a question-answering system. Background Technology
[0002] A knowledge graph is a knowledge base that integrates data using a graph-structured data model or topology. The core of a knowledge graph is a knowledge model: a collection of interrelated descriptions of concepts, entities, relations, and events. Knowledge graphs place data within a context through links and semantic metadata, providing a framework for data integration, unification, analysis, and sharing. Unlike previous approaches that focused more on the individual characteristics of data, knowledge graphs add connections between data. Essentially, a knowledge graph is a semantic network knowledge base. Knowledge graphs define knowledge as "entities" and connect entities using relations, storing all data as sets of "entity-relationship-entity" triples, forming a semantic network knowledge base.
[0003] Knowledge graph construction methods can be mainly divided into two types: top-down and bottom-up. The top-down construction method first defines the data pattern of the knowledge graph, then uses this data pattern as the top-level concept, and gradually refines it downwards from the top level. Then, entities are added into the concept ontology. This method is generally used to build knowledge graphs for vertical industry sectors. The bottom-up construction method organizes and summarizes the existing knowledge entity structure to form the bottom-level concepts, and then gradually abstracts the bottom-level concepts upwards to form the upper-level concepts. This method is generally used to build general knowledge graphs that emphasize the breadth of knowledge.
[0004] Knowledge graph construction requires a large amount of instance knowledge data, and this knowledge comes from various sources. Based on the data organization and storage structure, it can be divided into three types: structured data, semi-structured data, and unstructured data. Therefore, how to extract knowledge from data with different structures becomes the first step in knowledge graph construction. Data extraction involves the extraction of elements such as relationships, entities, and attributes.
[0005] With the advent of the big data era, my country's agricultural information industry has developed rapidly, and agricultural big data has come into view. How to integrate agricultural big data technology into agricultural production and life, so as to improve the productivity of farmers and agricultural practitioners and create new value, has become a new hot topic. my country has a long history of apple cultivation. Apples are nutritious and have good economic benefits. In recent years, the global apple industry has risen, and apples have gradually become a mainstream consumer fruit in the world and a popular fruit economic crop. At present, my country does not have a free and open apple knowledge graph and question-and-answer system. When facing problems in apple cultivation, agricultural practitioners can only search in books or online. However, professional apple knowledge is mostly in the form of books or documents, which is not only inconvenient for farmers to access, but also inconvenient to look up at any time.
[0006] To address the aforementioned issues, this design aims to help farmers and related practitioners directly obtain answers to agricultural-related questions encountered during apple cultivation. Based on professional data in the apple field, an apple knowledge graph is constructed, and using this knowledge graph as a data source, an automatic question-answering method is designed. With the business support provided by the automatic question-answering module, an automatic question-answering system is implemented. This research, to a certain extent, contributes to promoting the intelligent transformation of the apple industry, the construction of agricultural information service platforms, the development of smart agriculture, and provides new impetus for the modernization and informatization of the agricultural and rural economic structure. Summary of the Invention
[0007] To address the shortcomings of existing technologies, the present invention aims to provide a method for constructing an Apple full-industry chain knowledge graph database, thereby solving the technical problems of the need to further improve the completeness of database knowledge obtained by existing construction methods and the lack of a publicly available Apple knowledge graph question-answering system.
[0008] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: A method for constructing a knowledge graph database for the entire apple industry chain and the development of its question-answering system are disclosed. The method is carried out according to the following steps: In order to design a knowledge graph pattern structure that meets the needs of agricultural production and is suitable for data sources, effectively improve the application efficiency of the knowledge graph, and better describe apple-related knowledge and the relationship between knowledge itself, it is necessary to organize and analyze knowledge in the apple field.
[0009] Step S1: Design the top-level concepts of the knowledge graph database. Based on the characteristics of existing text formats, this invention adopts a combination of top-down and bottom-up approaches to construct the conceptual model of the knowledge graph.
[0010] Step S2: Construct an Apple text dataset, annotate 30 types of entities using BIO annotation, and obtain the annotated dataset.
[0011] The abstract concept of apple from step S1 is represented as an entity, and the relationships between abstract concepts are represented as relations. After merging similar concepts, a total of 30 entity classes are defined.
[0012] Step S2 includes the following steps: Step S201: Scan relevant professional books to obtain electronic image books, then manually calibrate the image format books to obtain text documents, and then delete and modify invalid and duplicate information to complete the simple data cleaning work.
[0013] Step S202: Use semi-automatic annotation technology to perform BIO annotation on the processed books; Step S3, based on the annotation results, performs entity recognition using the BERT-CRF model, i.e., a bidirectional long short-term memory network-conditional random field model, including: This paper adopts the BIO entity annotation strategy, where B represents the beginning of a named entity, I indicates that the word is inside the named entity, and O represents an irrelevant word outside the named entity. The category information of the named entity, i.e. the tag attribute of the entity, is added to the BIO annotation, which makes it easier to extract triple information by determining the relationship between entities through entity tags.
[0014] A neural network-based algorithm was adopted to address the named entity recognition problem, using the currently popular BERT-CRF model.
[0015] LSTM networks are unidirectional propagation networks, which can only consider information in one direction. In contrast, BERT networks use two LSTM networks in opposite directions to consider information in both directions simultaneously, which can better capture bidirectional semantic dependencies. For the entity extraction task of Apple, it can better determine the semantic information in the text.
[0016] Step S4: Under the guidance and constraints of the conceptual pattern constructed in step S1, the formatted text is assembled into triples; Step S5: The triples are persistently saved using the Neo4j graph database, and the target triples are transformed using Cypher statements to realize the construction of the Apple full-industry chain knowledge graph database.
[0017] Step S6: Based on the construction of the Apple full-industry chain knowledge graph database, further implement the automatic question answering method; The automatic question answering method adopts the traditional pattern matching method, defines query templates for key question words in different questions, and converts text into query expressions, effectively simplifying the query process and improving the accuracy of semantic parsing. Step S6 includes the following steps: Step S601: Analyze the keywords representing relationships that can be matched with the questions in the design concept pattern analysis; Step S602: Match the entities appearing in the question based on the identified relational keywords; Step S603: Combining the identified entities and relationships, query the Neo4j database using the corresponding Cypher statements; Step S604: Process the results returned by the Neo4j database into natural language and return them to the user.
[0018] Step S7: Design and implement Apple's automatic question-and-answer system; Step S701: The main architecture of the knowledge graph-based automatic question answering system for the entire Apple industry chain is divided into a data layer, a business layer, and a presentation layer. Step S702: The underlying data layer provides data support for the upper-layer apple automatic question-and-answer business. It uses the Neo4j graph database for data storage, which includes knowledge about apple morphological characteristics, growth habits, planting management process, pest and disease control, processing and transportation, etc.
[0019] In step S703, the business layer implements the Apple automatic question answering module through the data support of the underlying Apple knowledge graph. Its main functions are realized through two modules: question intent understanding and question entity recognition. The specific implementation process is the same as in step S7. In step S704, the presentation layer is the module for user interaction. It provides users with an Apple knowledge automatic question answering system with a visual interface through a PC browser, which includes a question input box and a result display box.
[0020] The present invention also has the following technical features: In step S101, the top-level concepts include: basic apple information, apple morphological characteristics, apple firing and fruiting characteristics, apple growth habits, and apple planting management.
[0021] The aforementioned apple planting and management categories also include: apple seedling cultivation techniques, apple orchard establishment, integrated water, fertilizer and soil management for apples, apple shaping and pruning, apple flower and fruit management, apple pest and disease control, apple harvesting, storage and post-harvest treatment.
[0022] In step S2, the entity categories include: apple, alias, variety, geographical location, part, structure, morphology, planting management, substance, trigger word, implementer, object, tool, period, method, influencing factors, growth influencing factors, growth and development period, pests and diseases, disease, pathogen, symptoms, disease pattern, pests, control methods, damage characteristics, taboos, processed products, process flow, time, and numerical value.
[0023] In step S2, the relationships between the concepts include: the relationship between the apple entity and its alternative name entity; the relationship between the apple entity and its variety entity, or between the planting management entity and the pest and disease entity, or between the pest and disease entity and the disease entity or insect entity; the relationship between the apple entity and its geographical location entity; the relationship between the apple entity and its part entity, or between its part entity and its morphological entity, or between its structural entity and its morphological entity; the relationship between its part entity and its structural entity, or between its growth influencing factor entity and its structural entity; the relationship between structural entities, method entities, trigger word entities, object entities, material entities, influencing factor entities, and numerical entities; the relationship between the apple entity and its growth and development period entity, or between its growth and development period entity, growth influencing factor entity, method entity, and period entity; the relationship between its growth and development period entity, growth influencing factor entity, planting management entity, object entity, and influencing factor entity; and the relationship between growth and development... The relationships between the period entity, planting management entity, and method entity; the relationships between the period entity, method entity, trigger word entity, influencing factor entity, and time entity; the relationships between the method entity and trigger word entity; the relationships between the trigger word entity and object entity; the relationships between the method entity, trigger word entity, and tool entity; the relationships between the trigger word entity, influencing factor entity, and material entity; the relationships between the method entity, trigger word entity, influencing factor entity, object entity, and taboo entity; the relationships between the disease entity and pathogen entity; the relationships between the disease entity and symptom entity; the relationships between the disease entity and disease pathogenesis; the relationships between the disease entity, pest entity, and control method entity; the relationships between the disease entity, pest entity, and control agent entity; the relationships between the pest entity and damage characteristics entity; the relationships between the method entity and processed product entity; and the relationships between processed product entity and technological process entity.
[0024] In step S201, the professional books refer to publicly published books on various aspects such as basic knowledge of apple design, planting process, pest and disease control, post-harvest storage and transportation, and processing.
[0025] In step S202, the BIO annotation method is as follows: the first character of a class entity is marked as Ba, the middle or end character is marked as Ia, and other irrelevant characters are marked as O.
[0026] In step S6, the triple is in the form of <head entity, relation, tail entity>.
[0027] In step S6, the Cypher statement is a database operation language used in the Neo4j database to describe the relationships between nodes and edges in a graph, and how to retrieve and manipulate data from the graph.
[0028] In step S7, the matching keywords set include: "alternative name", "also called", "also known as", "called" are queries for alternative name relationships; "geographical location", "distribution", "located in", "grown in" are queries for geographical distribution relationships; "disease pattern", "disease situation", "disease appearance" are queries for disease pattern relationships; "prevention and control agents", "prevention and control drugs", "prevention and control medications" are queries for prevention and control agent relationships; "prevention and control methods", "prevention methods", "prevention measures", "prevention and control measures", "prevention and control measures" are queries for prevention and control method relationships.
[0029] Compared with the prior art, the present invention has the following technical effects: (I) The method of this invention utilizes a deep language model to extract knowledge from multi-source heterogeneous data. Based on the concept model of Apple's entire industry chain, it assembles the extracted knowledge into a knowledge graph. The constructed knowledge graph database has low cost, high knowledge completeness, and is convenient to update and maintain.
[0030] (II) The method of the present invention divides the construction of the knowledge graph database of the entire Apple industry chain into two stages: conceptual schema design and entity construction. Under the constraint of conceptual schema, the efficiency of triple construction can be improved.
[0031] (Ш) This invention realizes the design and construction of an automatic question-answering system with the support of a knowledge graph database, transforming knowledge from a visual database representation into a question-answering system form that is easier to understand and use, thereby improving the convenience and speed of knowledge acquisition for users. Attached Figure Description
[0032] Figure 1 This is a flowchart illustrating the construction method and question-answering system of Apple's entire industry chain knowledge graph database.
[0033] Figure 2 It is a technical roadmap for constructing a knowledge graph database for the entire Apple industry chain and a question-answering system.
[0034] Figure 3 This is a schematic diagram of a knowledge extraction example.
[0035] Figure 4 This is a schematic diagram of a knowledge graph database (partial).
[0036] Figure 5 A schematic diagram of the processing flow of the question-and-answer system provided in this embodiment of the invention.
[0037] Figure 6 This is a schematic diagram illustrating the operation effect of the automatic question-answering method provided in the embodiments of the present invention.
[0038] Figure 7This is an architecture diagram of Apple's entire industry chain question-answering system based on knowledge graphs.
[0039] Figure 8 This is a schematic diagram illustrating the operation of the question-and-answer system provided in an embodiment of the present invention. Detailed Implementation
[0040] It should be noted that, unless otherwise specified, all software, modules and layers in this invention are software, modules and layers known in the prior art.
[0041] Following the above technical solutions, specific embodiments of the present invention are given below. It should be noted that the present invention is not limited to the following specific embodiments, and all equivalent modifications made based on the technical solutions of this application fall within the protection scope of the present invention.
[0042] A knowledge graph is a collection of interconnected descriptions of concepts, entities, relationships, and events. By placing data in context through links and semantic metadata, knowledge graphs provide a framework for data integration, unification, analysis, and sharing.
[0043] Knowledge graph construction methods can be mainly divided into two types: top-down and bottom-up. The top-down approach first defines the data schema of the knowledge graph, then uses this schema as the top-level concept, progressively refining it downwards, and finally adding entities into the concept ontology. This method is generally used to build industry-specific knowledge graphs. The bottom-up approach organizes and summarizes existing knowledge entity structures to form lower-level concepts, and then progressively abstracts these lower-level concepts upwards to form higher-level concepts. This method is generally used to build general knowledge graphs that emphasize breadth of knowledge.
[0044] With the development of the modern information industry, the amount of knowledge contained on the internet has increased rapidly. How to quickly extract the necessary knowledge from this massive amount of information for learning and application has become a new challenge. Traditionally, acquiring agricultural knowledge largely relies on search engines. However, traditional search engines suffer from low accuracy, loosely organized search results, and often return only a few title-related web pages rather than specific, accurate answers. Therefore, question-answering systems have emerged as a new knowledge retrieval method, offering advantages such as high accuracy and speed. Automatic question-answering systems use natural language processing (NLP) technology to understand the meaning of user questions. Traditional question-answering systems, however, suffer from low-structured knowledge bases, lack sufficient high-quality knowledge, and exhibit limitations and singularity. Knowledge graph-based question-answering systems address these shortcomings. By using structured knowledge graphs as the data source, they significantly improve response speed, directly return answers to users, enhance user satisfaction, and increase applicability in specialized fields. Example
[0045] This embodiment presents a method for constructing a knowledge graph database covering the entire Apple industry chain, such as... Figure 1 As shown, the method is performed according to the following steps: To address the shortcomings of existing technologies, the present invention aims to provide a method for constructing an Apple full-industry chain knowledge graph database, thereby solving the technical problems of the need to further improve the completeness of database knowledge obtained by existing construction methods and the lack of a publicly available Apple knowledge graph question-answering system.
[0046] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: A method for constructing a knowledge graph database for the entire apple industry chain and the development of its question-answering system are disclosed. The method is carried out according to the following steps: In order to design a knowledge graph pattern structure that meets the needs of agricultural production and is suitable for data sources, effectively improve the application efficiency of the knowledge graph, and better describe apple-related knowledge and the relationship between knowledge itself, it is necessary to organize and analyze knowledge in the apple field.
[0047] Step S1: Based on domain monographs, design the top-level concepts of the knowledge graph database. Based on the characteristics of existing text formats, this invention adopts a combination of top-down and bottom-up approaches to construct the conceptual model of the knowledge graph.
[0048] The top-level concepts include: basic information about apples, morphological characteristics of apples, flowering and fruiting characteristics of apples, growth habits of apples, and apple planting and management.
[0049] The monographs mentioned include the publicly published "Practical Techniques for Apple Processing", "Research on Integrated Pest and Disease Management Technology for Apples", "High-Efficiency Apple Cultivation", and "Practical Apple Cultivation Techniques".
[0050] Step S102: Based on domain monographs, refine the top-level concepts to obtain second-level concepts; The basic information about apples also includes apple varieties and geographical distribution.
[0051] The morphological characteristics of the apple peach also include apple roots, buds, leaves, flowers, fruits, and seeds.
[0052] The apple flowering and fruiting characteristics also include flower bud differentiation characteristics, flowering characteristics, pollination and fertilization characteristics, and fruiting characteristics.
[0053] The apple growth habit category also includes phenological period and environment.
[0054] The apple planting management category also includes: apple seedling technology, apple orchard establishment, integrated management of apple water, fertilizer and soil, apple shaping and pruning, apple flower and fruit management, apple disease and pest control, apple harvesting, storage and post-harvest treatment.
[0055] The abstract concept of apple in step S1 is represented as an entity, and the relationship between abstract concepts is represented as a relation. After merging similar concepts, a total of 30 specific entity categories are defined. These entity categories include: apple, alternative names, varieties, geographical location, parts, structure, morphology, planting management, substances, trigger words, implementers, objects, tools, periods, methods, influencing factors, growth influencing factors, growth and development periods, pests and diseases, diseases, pathogens, symptoms, disease patterns, pests, control methods, control agents, characteristics of damage, contraindications, processed products, technological processes, time, and numerical values.
[0056] Step S2, construct the Apple text dataset, annotate 30 types of entities using BIO annotation, and obtain the annotated dataset. Step S2 includes the following steps: Step S201: Scan relevant professional books to obtain electronic image books, then manually calibrate the image format books to obtain text documents, and then delete and modify invalid and duplicate information to complete the simple data cleaning work.
[0057] Step S202: Use semi-automatic annotation technology to perform BIO annotation on the processed books; Specifically, the semi-automated annotation technology involves manually constructing common entities in the domain, encoding them in UTF-8, and then using Python to annotate the processed text data.
[0058] This paper adopts the BIO entity annotation strategy, where B represents the beginning of a named entity, I indicates that the word is inside the named entity, and O represents an irrelevant word outside the named entity. The category information of named entities, i.e., the entity's tag attribute, is added to the BIO annotation, which facilitates the extraction of triple information by determining the relationships between entities through entity tags.
[0059] Specifically, the BIO annotation method is as follows: the first character of an entity of type 'a' is labeled 'Ba', the middle or last character is labeled 'Ia', and other irrelevant characters are labeled 'O'. For example, for the sentence "Apples are mainly distributed in Shaanxi and Yunnan", the annotation sequence using the BIO annotation method is "B-FRUIT I-FRUIT I-FRUIT OOOO B-GEOGRAPHY I-GEOGRAPHYO B-GEOGRAPHY I-GEOGRAPHY"; the encoding format of the annotation result is UTF-8, with each line storing one character and one tag, and sentences separated by blank lines. Step S3: Based on the annotation results, perform entity recognition using the BERT-CRF model. Specifically, the BERT-CRF model uses a bidirectional LSTM network to extract features, and then adds a CRF layer to the output layer for decoding. Its purpose is to find the optimal output solution for predicting text labels. This model has achieved good performance in tasks such as named entity recognition, part-of-speech tagging, and Chinese word segmentation. In the BERT model, the label for each time step t is directly predicted. However, this method produces poor label predictions because it doesn't consider the logical relationships between labels, leading to logically conflicting label information. Therefore, to consider the logical dependencies between different labels, a CRF layer is added after the BERT layer. The CRF layer is used to determine the logical dependencies between the previous and current labels, improving the model's accuracy.
[0060] Step S4: Under the guidance and constraints of the ontology layer, the formatted text is assembled into triples, i.e., the entity layer; Specifically, the triplet takes the form of <head entity, relation, tail entity>; Specifically, for sentence-level entities, such as Figure 3 As shown, the original text is "Eros rose, requires sufficient potassium fertilizer, pay attention to the prevention of downy mildew during the rainy season.", and its corresponding formatted text is "{text:"Apple is also known as vine pear, the main variety is Chinese apple.",entities:[["Apple",FRUIT"],["vine pear","NAME"],["Chinese apple","SORT"]]}". According to the entity relationship obtained in step S2, the relationship between FRUIT (Apple entity concept) and NAME (Apple alias concept) is "alias", so we get the triple <Apple, alias, vine pear>; the relationship between NAME (Apple alias concept) and SORT (Apple variety concept) is "variety", so we get the triple <Apple, variety, Chinese apple>; Specifically, the fixed range, in this embodiment, is taken as 3 natural segments; Step S5: Persistently save the triples using the Neo4j graph database, such as... Figure 5 As shown, the construction of a knowledge graph database covering the entire Apple industry chain is realized.
[0061] Experimental environment: A PC with Windows 10 x64 operating system, Intel(R) Core(TM) i5-8300H CPU, 8.0GB RAM, and 118GB disk space. The development language is Python 3.9, PyCharm is used as the development tool, and TensorFlow 1.4 is used to build the model.
[0062] Experimental evaluation metrics: precision, recall, and F1 score Precision (P): The proportion of all entities in the sample that are correctly predicted out of all entities.
[0063] Recall (R): The proportion of all correctly predicted entities in the dataset.
[0064] F1 score: The harmonic mean of precision and recall, which combines precision and recall to reflect the overall result.
[0065] Entity recognition results: The results for this model show a precision of 91.90%, a recall of 87.28%, and an F1 score of 89.53%.
[0066] This paper uses data from professional books in the field of apples as the data source. After manual cleaning and screening, the data is used as experimental data. The dataset contains 133,813 characters and 2,143 labeled entities, forming 2,410 apple-related triple data.
[0067] Except for the OCCURRENCE and RECOVERY classes, the F1 scores were all above 74%. The main reason for the poor performance of these two types of entities was that the entity text was long in the initial entity design and the entity boundaries were difficult to distinguish. They also lacked obvious identifying words and were distributed in various types of text sentences. On the other hand, the NAME and EXECUTOR entities achieved a score of 1 because the entity text was short, the entity boundaries were clear, and there were fewer types that needed to be labeled.
[0068] In summary, the BERT-CRF model presented in this paper achieved relatively good results in entity type recognition in Apple's knowledge graph. It is an efficient knowledge extraction method that can be used for knowledge graph database construction.
[0069] Step S6: Based on the construction of the Apple full-industry chain knowledge graph database, further implement the automatic question answering method; The automatic question answering method adopts the traditional pattern matching method, defines query templates for key question words in different questions, and converts text into query expressions, effectively simplifying the query process and improving the accuracy of semantic parsing. Step S7 includes the following steps: Step S601: Analyze the keywords representing relationships that can be matched with the questions in the design concept pattern analysis; Step S602: Match the entities appearing in the question based on the identified relational keywords; Step 603: Based on the identified entities and relationships, use the corresponding Cypher statements to query the Neo4j database; Step S604: Process the results returned by the Neo4j database into natural language and return them to the user.
[0070] Step S7: Design and implement Apple's automatic question-and-answer system; Step S701: The main architecture of the knowledge graph-based automatic question answering system for the entire Apple supply chain is divided into a data layer, a business layer, and a presentation layer. Step S702: The underlying data layer provides data support for the upper-layer apple automatic question-and-answer business, using the Neo4j graph database for data storage. This includes knowledge about apple morphological characteristics, growth habits, planting management processes, pest and disease control, processing, and transportation.
[0071] In step S703, the business layer implements the Apple automatic question answering module through the data support of the underlying Apple knowledge graph. Its main functions are realized through two modules: question intent understanding and question entity recognition. The specific implementation process is the same as in step S7. In step S704, the presentation layer is the module for user interaction. It provides users with an Apple knowledge automatic question answering system with a visual interface through a PC browser, which includes a question input box and a result display box.
[0072] System operating environment: Windows x86 PC, with the following configuration: 8GB RAM, Intel(R) Core(TM) i5-8300H CPU, 118GB total disk space, developed using JetBrains PyCharm 2021.3.2, and Google Chrome as the test browser. In summary, the construction method and question-answering system of the Apple full-industry chain knowledge graph database constructed in this invention have the following characteristics: a knowledge graph storing knowledge of the entire Apple industry chain is constructed, using the Neo4j graph database, which has a higher degree of visualization than traditional databases; and a question-answering system is built using the constructed Neo4j database, providing services to users through a PC browser, making it more convenient and efficient for users to acquire knowledge.
Claims
1. A method for constructing a knowledge graph database for the entire apple industry chain, characterized in that, This method is performed according to the following steps: Step S1: Design the top-level concepts of the knowledge graph database. Based on the characteristics of existing text formats, this invention adopts a combination of top-down and bottom-up approaches to construct the conceptual model of the knowledge graph. Step S2: Construct an Apple text dataset, annotate 30 types of entities using BIO annotation, and obtain the annotated dataset; The abstract apple concept in step S1 is represented as an entity, the relationship between abstract concepts is represented as a relation, and after merging similar concepts, a total of 30 types of entities are defined. Step S2 includes the following steps: Step S201: Scan relevant professional books to obtain electronic image books, then manually calibrate the image format books to obtain text documents, and then delete and modify invalid and duplicate information to complete the simple data cleaning work. Step S202: Use semi-automatic annotation technology to perform BIO annotation on the processed books; Step S3, based on the annotation results, performs entity recognition using the BERT-CRF model, i.e., a bidirectional long short-term memory network-conditional random field model, including: This paper adopts the BIO entity annotation strategy, where B represents the beginning of a named entity, I represents the word inside the named entity, and O represents irrelevant words outside the named entity. The category information of named entities, i.e. the tag attributes of entities, is added to the BIO annotation, which makes it easier to extract triple information by determining the relationship between entities through entity tags. To address the named entity recognition problem, a neural network-based algorithm was adopted, using the currently popular BERT-CRF model (Bidirectional Long Short-Term Memory Network-Conditional Random Field model). LSTM networks (Long Short-Term Memory networks) are unidirectional propagation networks that can only consider information in one direction. In contrast, BERT networks (Bidirectional Long Short-Term Memory networks) use two LSTM networks in opposite directions to consider information in both directions simultaneously, which can better capture bidirectional semantic dependencies. For the entity extraction task of apples, it can better determine the semantic information in the text. Step S4: Under the guidance and constraints of the conceptual pattern constructed in step S1, the formatted text is assembled into triples; Step S5: Persistently save the triples using the Neo4j graph database, and transform the target triples using Cypher statements to realize the construction of Apple's entire industry chain knowledge graph database; Step S6: Based on the construction of the Apple full-industry chain knowledge graph database, further implement the automatic question answering method; The automatic question answering method adopts the traditional pattern matching method, defines query templates for key question words in different questions, and converts text into query expressions, effectively simplifying the query process and improving the accuracy of semantic parsing. Step S7 includes the following steps: Step S601: Analyze the keywords that can be matched to represent the relationship in the question based on the conceptual pattern of the design; Step S602: Match the entities appearing in the question based on the identified relational keywords; Step S603: Combining the identified entities and relationships, query the Neo4j database using the corresponding Cypher statements; Step S604: Process the results returned by the Neo4j database into natural language and return them to the user; Step S7: Design and implement Apple's automatic question-and-answer system; Step S701: The main architecture of the knowledge graph-based automatic question answering system for the entire Apple supply chain is divided into a data layer, a business layer, and a presentation layer. Step S702: The underlying data layer provides data support for the upper-layer apple automatic question-and-answer business. It uses the Neo4j graph database for data storage, which includes knowledge about apple morphological characteristics, growth habits, planting management process, pest and disease control, processing and transportation, etc. In step S703, the business layer implements the Apple automatic question answering module with the support of data from the underlying Apple knowledge graph. Its main functions are achieved through two modules: question intent understanding and question entity recognition. The specific implementation process is the same as in step S7. Step S704: The presentation layer is the module for user interaction. It provides users with an Apple knowledge auto-answer system with a visual interface through a PC browser, including a question input box and a result display box.