Construction method and question-answering system of kiwifruit whole industry chain knowledge graph database
By constructing a knowledge graph database for the entire kiwifruit industry chain and designing an automatic question-and-answer system, the problem of inconvenient knowledge acquisition in kiwifruit cultivation has been solved, achieving efficient and convenient knowledge acquisition and intelligent transformation of the industry.
Patent Information
- Application Number
- CN202310390183.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-12
- Publication Date
- 2025-12-30
- Estimated Expiration
- 2043-04-12
AI Technical Summary
The lack of a professional knowledge graph database and question-and-answer system for the entire kiwifruit industry chain in existing technologies makes it difficult for agricultural practitioners to acquire knowledge in kiwifruit cultivation.
A knowledge graph database for the entire kiwifruit industry chain was constructed, including concept design, entity annotation, entity recognition, and triple assembly. The database was persisted using the Neo4j graph database. An automatic question-answering system was designed to realize knowledge-based question answering for the entire kiwifruit industry chain.
It has enabled efficient and convenient knowledge acquisition, improved the ease and speed of knowledge acquisition for users in the kiwifruit field, and promoted the intelligent transformation of the kiwifruit industry and the construction of agricultural information service platforms.
Smart Images

Figure CN116663661B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of agronomy, and relates to a knowledge graph database construction, in particular to a construction method of a kiwi fruit whole industry chain knowledge graph database and a question and answer system. BACKGROUND
[0002] A knowledge graph is a knowledge base that uses a graph structure data model or topology to integrate data. The core of the knowledge graph is a knowledge model: a collection of interrelated descriptions of concepts, entities, relationships, and events. The knowledge graph places data in context through links and semantic metadata. This approach provides a framework for data integration, unification, analysis, and sharing. Unlike previous approaches that focus more on the individual characteristics of data, the knowledge graph increases the connection between data. The essence of the knowledge graph is a semantic network knowledge base. The knowledge graph defines knowledge as "entities" and connects entities using relationships, so that all data is stored in the form of a "entity-relation-entity" triple set, forming a semantic network knowledge base.
[0003] The construction method of the knowledge graph can be mainly divided into top-down (Top-Down) and bottom-up (Bottom-Up). The top-down construction method defines the data mode of the knowledge graph first, and then uses the data mode as the top concept, and gradually refines from the top layer down. Then add entities to the concept ontology. It is generally used to construct vertical industry knowledge graph. The bottom-up construction method organizes and induces the existing knowledge entity structure to form the bottom concept, and then abstracts the upper concept from the bottom concept. It is generally used to construct a general knowledge graph that focuses on the breadth of knowledge.
[0004] The construction of the knowledge graph requires a large amount of instance knowledge data, and these knowledge comes from various sources. According to the organization and storage structure of the data, it can be divided into structured data, semi-structured data and unstructured data. Therefore, how to extract knowledge from data of different structures becomes the first step of knowledge graph construction, and the extraction of data involves the extraction of relationships, entities, attributes and other elements.
[0005] There is no free and open kiwi fruit knowledge graph and question and answer system in the prior art. Agricultural practitioners can only search in books or on the network when facing problems in kiwi fruit cultivation. Most professional kiwi fruit knowledge exists in the form of books or documents, which is not only difficult for farmers to obtain, but also inconvenient for them to find at any time. SUMMARY
[0006] In view of the deficiencies in the prior art, the purpose of the present application is to provide a construction method of a kiwi fruit whole industry chain knowledge graph database, so as to solve the technical problem that there is no professional kiwi fruit whole industry chain knowledge graph database in the prior art.
[0007] Another object of the present application is to provide a kiwi fruit full industry chain Q&A system to solve the technical problem of inconvenient acquisition of kiwi fruit field knowledge in the prior art.
[0008] To solve the above technical problems, the present application adopts the following technical solutions:
[0009] A construction method of a kiwi fruit full industry chain knowledge graph database, the method comprising the following steps:
[0010] Step S1, conceptual design:
[0011] The concept includes 32 types of entities.
[0012] The categories of the 32 types of entities include kiwi fruit, alias, type, geographical location, part, structure, form, planting management, substance, trigger word, implementer, object, tool, period, method, influencing factor, growth influencing factor, growth and development period, disease and pest, disease, pathogen, symptom, disease incidence, pest, control method, control agent, damage characteristics, contraindication, processed product, process flow, time and numerical value.
[0013] Step S2, construct a kiwi fruit text data set, label the 32 types of entities in BIO labeling mode, and obtain the labeled data set.
[0014] Step S3, based on the labeling result of step S2, for the original text, perform entity recognition through a BiLSTM-CRF model to obtain a formatted text.
[0015] Step S4, under the guidance and constraint of the concept mode of the BiLSTM-CRF model, assemble the formatted text into triples, i.e., the entity layer.
[0016] Step S5, persistently save the triples using a Neo4j graph database to realize the construction of the kiwi fruit full industry chain knowledge graph database.
[0017] The present application also has the following technical features:
[0018] Specifically, the method for obtaining the 32 types of entities is:
[0019] Step S101, based on field monographs, design a top-level concept of the knowledge graph database.
[0020] The top-level concept includes kiwi fruit basic information, kiwi fruit morphological characteristics, kiwi fruit flowering and fruiting characteristics, kiwi fruit growth habit, and kiwi fruit planting management.
[0021] Step S102, according to the field monographs, refine the top-level concept to obtain a secondary concept.
[0022] The secondary concept of the basic information of the kiwifruit includes kiwifruit species and geographical distribution.
[0023] The secondary concept of the morphological characteristics of the kiwifruit includes kiwifruit root system, bud, leaf, flower, fruit and seed.
[0024] The secondary concept of the flowering and fruiting characteristics of the kiwifruit includes flower bud differentiation characteristics, flowering characteristics, pollination and fertilization characteristics and fruiting characteristics.
[0025] The secondary concept of the growth habit of the kiwifruit includes phenological period and environment.
[0026] The secondary concept of the planting management of the kiwifruit includes kiwifruit seedling technology, kiwifruit orchard establishment, kiwifruit water, fertilizer and soil comprehensive management, kiwifruit shaping and pruning, kiwifruit flower and fruit management, kiwifruit disease and pest control, kiwifruit harvesting and storage and postharvest processing.
[0027] In step S103, the secondary concepts are represented as entities, and the connections between the secondary concepts are represented as relationships; and 32 types of entities are defined after merging similar secondary concepts.
[0028] Specifically, step S2 includes the following steps:
[0029] In step S201, an electronic picture book is obtained by scanning a kiwifruit professional book, and a text document is obtained by manually correcting the picture format book, and then invalid information and repeated information in the text document are deleted and modified to complete data cleaning.
[0030] In step S202, a semi-automatic labeling technology is used to label the book processed in step S201.
[0031] Preferably, in step S202, the semi-automatic labeling technology is that: common entities in the field are manually constructed, the coding format is utf-8, and Python is used to label the processed text data.
[0032] Preferably, in step S3, for an input sentence X=(x1, x2,...,x n ) and its corresponding label sequence Y=(y1, y2,...,y n ), the final score of the BiLSTM-CRF model can be calculated by the following formula:
[0033]
[0034] In the formula:
[0035] y i represents the label of the i-th word.
[0036] y i-1 denotes the label of the i-1th word;
[0037] denotes matrix multiplication;
[0038] f i-1 denotes the BiLSTM output of the i-1th word;
[0039] denotes the BiLSTM output of the i-1th word;
[0040] T denotes a state transition matrix;
[0041] b denotes a bias term of the emission matrix.
[0042] Preferably, in step S4, the triple is in the form of <head entity, relationship, tail entity>.
[0043] The present application also protects a kiwifruit full-industry chain knowledge question-answering system, which adopts a kiwifruit full-industry chain knowledge graph database, and the kiwifruit full-industry chain knowledge graph database is obtained by using the construction method of the kiwifruit full-industry chain knowledge graph database.
[0044] The system further comprises steps S6 and S7.
[0045] In step S6, an automatic question-answering method is designed.
[0046] In step S7, a kiwifruit automatic question-answering system is designed and implemented.
[0047] Specifically, step S6 comprises the following steps:
[0048] In step S601, the key words representing the relationship that can be matched by the designed concept pattern are analyzed.
[0049] In step S602, the entities appearing in the question are matched according to the identified relationship key words.
[0050] In step 603, the corresponding cypher statement is used to query the Neo4j database in combination with the identified entities and relationships.
[0051] In step S604, the result returned by the Neo4j database is processed into natural language and returned to the user.
[0052] Specifically, step S7 comprises the following steps:
[0053] In step S701, the architecture of the kiwifruit full-industry chain knowledge question-answering system is divided into a data layer, a business layer and a display layer.
[0054] Step S702, the data layer of the bottom layer provides data support for the service layer of the upper layer, and uses a Neo4j graph database for data storage.
[0055] Step S703, the service layer realizes the kiwi automatic question and answer module through the data layer of the bottom layer, and the functions of the kiwi automatic question and answer module are realized through two modules of question intention understanding and question entity recognition.
[0056] Step S704, the display layer is a module for interacting with the user, and the kiwi knowledge automatic question and answer system with a visual interface is provided to the user through a browser of a PC terminal, and the display layer includes a question input box and a result display box.
[0057] Compared with the prior art, the present application has the following technical effects:
[0058] (I) The method of the present application extracts knowledge from multi-source heterogeneous data using a deep language model, and assembles the extracted knowledge into a knowledge graph according to a kiwi full industry chain concept mode design. The constructed knowledge graph database has low cost, high knowledge completeness and convenient updating and maintenance.
[0059] (II) The method of the present application divides the construction of the kiwi full industry chain knowledge graph database into two stages of concept mode design and entity construction, and under the constraint of the concept mode, the efficiency of triple construction can be improved.
[0060] (III) The present application realizes the design and construction of the automatic question and answer system under the support of the knowledge graph database, changes the knowledge from the visual database representation to the question and answer system form which is easier to understand and use, and can improve the convenience and speed of users in knowledge acquisition. BRIEF DESCRIPTION OF DRAWINGS
[0061] Figure 1 is a technical roadmap of the construction method of the kiwi full industry chain knowledge graph database.
[0062] Figure 2 is a knowledge extraction instance schematic diagram.
[0063] Figure 3 is a knowledge graph database (part) schematic diagram.
[0064] Figure 4 is a processing flow schematic diagram of the automatic question and answer method of the kiwi full industry chain knowledge question and answer system.
[0065] Figure 5 is a running effect schematic diagram of the automatic question and answer method of the kiwi full industry chain knowledge question and answer system.
[0066] Figure 6 is a general architecture diagram of the kiwi full industry chain knowledge question and answer system.
[0067] Figure 7 is a schematic diagram of the operation effect of the kiwifruit full-industry chain knowledge question and answer system.
[0068] The specific content of the application is further explained and described in detail in combination with the embodiments below. DETAILED DESCRIPTION
[0069] It should be noted that all software, modules and layers in the present application, unless otherwise specified, all use known software, modules and layers in the prior art.
[0070] In view of the problems described in the background art, the present application aims to help farmers and related practitioners to directly obtain answers when encountering agricultural related problems in the process of kiwifruit planting. Based on professional data in the field of kiwifruit, a knowledge graph of kiwifruit is constructed, and the knowledge graph is used as a data source to design an automatic question and answer method. Under the business support provided by the automatic question and answer module, an automatic question and answer system is realized. The present application helps to promote the intelligent transformation of the kiwifruit industry, the construction of agricultural information service platform, the construction of smart agriculture, and provides new power for the modernization and informatization of the economic structure of agriculture and rural areas.
[0071] A knowledge graph is a collection of interrelated descriptions of concepts, entities, relationships and events. The knowledge graph places data in context through links and semantic metadata. This method provides a framework for data integration, unification, analysis and sharing.
[0072] The construction method of the knowledge graph can be mainly divided into top-down and bottom-up. The top-down construction method defines the data mode of the knowledge graph first, then takes the data mode as the top concept, and gradually refines from the top layer down, and then adds entities into the concept ontology. It is generally used for constructing vertical industry knowledge graph. The bottom-up construction method organizes and induces the existing knowledge entity structure to form the bottom concept, and then abstracts the upper concept from the bottom concept step by step, which is generally used for constructing general knowledge graph that pays attention to the breadth of knowledge.
[0073] With the development of modern information industry, the amount of knowledge contained in the Internet increases rapidly. How to quickly obtain the required relevant knowledge from the massive information to learn and use has become a new problem. When obtaining agricultural knowledge, people mostly rely on search engines. However, the traditional search engine has low accuracy and the search results have loose organization structure. Moreover, the traditional search engine mostly returns to the user some title-related web pages instead of specific and accurate answers. Therefore, the question and answer system becomes a new knowledge retrieval method, which has the advantages of high accuracy and fast speed. When processing the user's question, the automatic question and answer system applies natural language processing technology to understand the information meaning in the question. However, the traditional question and answer system has the defects of single and limitation due to the low degree of structuring of the knowledge base and the lack of sufficient high-quality knowledge. The emergence of the question and answer system based on the knowledge graph makes up for this defect. The knowledge graph with structured data is used as the data source of the question and answer system, which has great effect on improving the question and answer response rate, directly returning the question and answer results to the user, improving the question and answer satisfaction and the application in the professional field.
[0074] According to the above technical solution, the specific embodiments of the present application are given below. It should be noted that the present application is not limited to the following specific embodiments. Any equivalent transformation based on the technical solution of the present application falls within the protection scope of the present application.
[0075] Embodiment 1
[0076] This embodiment gives a method for constructing a kiwifruit full-industry chain knowledge graph database, as shown in the figure, the method comprises the following steps: Figure 1
[0077] In this embodiment, in order to design a knowledge graph mode 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 the related knowledge of kiwifruit and the connection of the knowledge itself, it is necessary to organize and analyze the knowledge in the field of kiwifruit.
[0078] Step S1, concept design:
[0079] The concept includes 32 types of entities.
[0080] Specifically, the categories of the 32 types of entities include: kiwifruit, alias, type, geographical location, part, structure, form, planting management, substance, trigger word, implementer, object, tool, period, method, influencing factor, growth influencing factor, growth and development period, disease and pest, disease, pathogen, symptom, disease rule, pest, control method, control agent, damage characteristics, taboo, processed product, process flow, time and numerical value.
[0081] As a preferred scheme of this embodiment, the method for obtaining the 32 types of entities is:
[0082] Step S101: Based on domain monographs, design the top-level concepts of the knowledge graph database.
[0083] In this embodiment, based on the characteristics of existing text formats, step S1 adopts a combination of top-down and bottom-up approaches to construct the conceptual model of the knowledge graph.
[0084] Top-level concepts include basic information about kiwifruit, morphological characteristics of kiwifruit, flowering and fruiting characteristics of kiwifruit, growth habits of kiwifruit, and kiwifruit planting and management.
[0085] Preferred publications in the field include publicly published works such as "Practical Technology for Kiwi Fruit Processing", "Research on Integrated Pest and Disease Control Technology for Kiwi Fruit", "High-Efficiency Cultivation of Kiwi Fruit" and "Practical Cultivation Technology for Kiwi Fruit".
[0086] Step S102: Based on the field monographs, refine the top-level concepts to obtain second-level concepts.
[0087] The secondary concepts of basic information about kiwifruit include kiwifruit varieties and geographical distribution.
[0088] The secondary concepts of kiwifruit morphological characteristics include kiwifruit roots, buds, leaves, flowers, fruits, and seeds.
[0089] The secondary concepts of kiwifruit flowering and fruiting characteristics include flower bud differentiation characteristics, flowering characteristics, pollination and fertilization characteristics, and fruiting characteristics.
[0090] The secondary concepts of kiwifruit growth habits include phenological periods and environment.
[0091] The secondary concepts of kiwifruit planting and management include kiwifruit seedling technology, kiwifruit orchard establishment, kiwifruit integrated water, fertilizer and soil management, kiwifruit shaping and pruning, kiwifruit flower and fruit management, kiwifruit disease and pest control, kiwifruit harvesting and storage and post-harvest treatment.
[0092] Step S103: Represent the second-level concepts as entities, and represent the relationships between the second-level concepts as relations. After merging similar second-level concepts, a total of 32 entity classes are defined.
[0093] Step S2: Construct a kiwi fruit text dataset, annotate 32 types of entities using BIO annotation, and obtain the annotated dataset.
[0094] Step S2 includes the following steps:
[0095] Step S201: Scan the kiwifruit 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 in the text documents to complete the data cleaning work.
[0096] The kiwifruit professional books used are the commonly known and frequently used kiwifruit professional books.
[0097] Step S202: Use semi-automatic annotation technology to perform BIO annotation on the books processed in step S201.
[0098] As a preferred embodiment, the semi-automatic annotation technology is as follows: manually construct common entities in the domain, with the encoding format being UTF-8, and use Python to annotate the processed text data.
[0099] In this embodiment, the BIO entity annotation strategy is adopted, where B represents the start of a named entity, I indicates that the word is inside the named entity, and O represents an irrelevant word outside the named entity. Category information of named entities, i.e., the entity's tag attributes, is added to the BIO annotation, facilitating the extraction of triple information by determining the relationships between entities through entity tags.
[0100] In this embodiment, the BIO annotation method is as follows: the first character of a class entity is labeled as Ba, the middle or last character is labeled as Ia, and other irrelevant characters are labeled as O. For example, for the sentence "Kiwifruit is 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-GEOGRAPHY O 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.
[0101] Step S3: Based on the annotation results, for the original text, entity recognition is performed using the BiLSTM-CRF model, i.e., bidirectional long short-term memory network-conditional random field model, to obtain formatted text.
[0102] Specifically, the BiLSTM-CRF model uses a bidirectional LSTM network (Long Short-Term Memory network) to extract features, and then adds a CRF layer (Conditional Random Field) 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 BiLSTM model, the label at each time step t is directly predicted. However, this method yields poor results 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 BiLSTM layer. The CRF layer is used to determine the logical dependencies between the previous and current labels, improving the model's accuracy.
[0103] Given an input sentence X = (x1, x2, ..., x...), n ,) and its corresponding label sequence Y=(y1,y2,...,y n The final score of the BiLSTM-CRF model can be calculated using the following formula:
[0104]
[0105] In the formula:
[0106] y i The label representing the i-th word;
[0107] y i-1 The label representing the (i-1)th word;
[0108] • Represents matrix multiplication;
[0109] f i-1 This represents the BiLSTM output of the (i-1)th word;
[0110] This represents the BiLSTM output of the i-th word;
[0111] T represents the state transition matrix;
[0112] b represents the bias term of the emission matrix.
[0113] Step S4: Under the guidance and constraints of the conceptual pattern of the BiLSTM-CRF model, the formatted text is assembled into triples, i.e., the entity layer.
[0114] As a preferred embodiment, the triple takes the form of <head entity, relation, tail entity>.
[0115] In this specific embodiment, for sentence-level entities, such as Figure 2 As shown, the original text is "Kiwifruit, also known as vine pear, has a main variety called Chinese kiwifruit.", and its corresponding formatted text is "{text:"Kiwifruit, also known as vine pear, has a main variety called Chinese kiwifruit.", entities:[["Kiwifruit", FRUIT"],["vine pear", "NAME"],["Chinese kiwifruit", "SORT"]]}". According to the entity relationships obtained in step S2, the relationship between FRUIT (kiwifruit entity concept) and NAME (kiwifruit alternative name concept) is "alternative name", thus obtaining the triple <kiwifruit, alternative name, vine pear>; the relationship between NAME (kiwifruit alternative name concept) and SORT (kiwifruit variety concept) is "variety", thus obtaining the triple <kiwifruit, variety, Chinese kiwifruit>.
[0116] In this specific embodiment, a fixed range is defined, specifically three natural segments.
[0117] Step S5: Persist the triples using the Neo4j graph database, such as... Figure 3 As shown, a knowledge graph database for the entire kiwifruit industry chain is constructed.
[0118] Comparative Example 1:
[0119] This comparative example presents a knowledge extraction network. The difference between this method and the deep learning and structured prediction joint extraction network in Example 1 is that this method does not include a deep learning network.
[0120] Comparative Example 2:
[0121] This comparative example presents a knowledge extraction network. The difference between this method and the deep learning and structured prediction joint extraction network in Example 1 is that this method does not include a sequence labeling model.
[0122] Experimental verification:
[0123] 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.
[0124] The experimental evaluation metrics are precision, recall, and F1 score:
[0125] Precision (P): The proportion of all correctly predicted entities in the sample out of all entities, calculated as shown in the formula below.
[0126]
[0127] Recall (R): The proportion of all correctly predicted entities in the dataset, calculated as follows:
[0128]
[0129] F1 score: The harmonic mean of precision and recall, which combines precision and recall to reflect the overall result. The calculation formula is shown below.
[0130]
[0131] Entity recognition results:
[0132] In Example 1 of this invention, the precision was 91.90%, the recall was 87.28%, and the F1 score was 89.53%. The differences in performance between the models and the comparative examples are shown in Table 1, and the entity type recognition results in Example 1 of this invention are shown in Table 2.
[0133] Table 1 Performance of each model
[0134] Method P R F1 Comparative Example 1 78.65 82.26 80.37 Comparative Example 2 87.03 86.61 86.82 Embodiment of the Invention 91.90 87.28 89.53
[0135] Table 2 Entity type recognition results in Example 1
[0136] Entity Category P R F1 Kiwi 0.9898 0.9959 0.9928 Part 0.9611 0.9816 0.9689 Structure 0.9740 0.8865 0.9282 Influencing Factor 0.9508 0.8233 0.8825 Control Agent 0.8364 0.7419 0.7863 Time 0.8182 0.7500 0.7867 Value 0.9397 0.7880 0.8571 Alias 1.0000 1.0000 1.0000 Category 0.9930 0.9845 0.9887 Geographical Location 0.9133 0.8354 0.8726 Form 0.8931 0.6573 0.7573 Planting Management 0.9863 0.9615 0.9737 Substance 0.9860 0.9847 0.9853 Trigger Word 0.9460 0.8036 0.8690 Implementer 1.0000 1.0000 1.0000 Object 0.9480 0.9297 0.9388 Tool 0.9452 0.8519 0.8961 Period 0.9730 0.9600 0.9664 Growth Influencing Factor 0.9230 0.8065 0.8929 Growth Period 0.9452 0.8752 0.9085 Disease 0.9986 0.9091 0.9546 Pathogen 0.9850 0.9231 0.9531 Symptom 0.8600 0.8275 0.8434 Disease Regularity 0.4167 0.3125 0.3571 Pest 0.9444 0.8021 0.8674 Control Method 0.8548 0.6625 0.7465 Damage Characteristic 0.7837 0.7325 0.7572 Taboo 0.5354 0.3249 0.4044 Processing Product 0.9256 0.8215 0.8704 Process Flow 0.9714 0.9435 0.9572
[0137] Results analysis:
[0138] Using data from professional books in the field of kiwifruit as the data source, and after manual cleaning and screening, the data was used as experimental data. The dataset contains 133,813 characters, 2,143 labeled entities, and 2,410 kiwifruit-related triplet data.
[0139] As shown in Table 1, the embodiments of the present invention show improvements in all metrics compared to the two comparative examples. The CRF model can constrain text sequence labeling results at the sentence level; the BiLSTM model can effectively learn the contextual features of the input sequence. The deep learning and structured prediction joint extraction network that combines the two can effectively utilize the characteristics of both models to autonomously and effectively extract contextual features from the text.
[0140] As shown in Table 2, except for the "pathology" and "contraindications" entities, the F1 scores were all above 74%. The main reason for the poor performance of these two types of entities was that the entity texts in the initial entity design were long and the entity boundaries were difficult to distinguish. They also lacked obvious identifying words and were distributed in various types of text sentences. The reason why the "alternative" and "performer" entities achieved a score of 1 was that the entity texts were short, the entity boundaries were clear, and there were fewer types that needed to be labeled.
[0141] In summary, the BiLSTM-CRF model presented in this paper achieved relatively good results in entity type recognition of the kiwifruit knowledge graph. It is an efficient knowledge extraction method that can be used for knowledge graph database construction.
[0142] Example 2:
[0143] This embodiment provides a knowledge question-and-answer system for the entire kiwifruit industry chain. The system uses a knowledge graph database for the entire kiwifruit industry chain, which is obtained using the construction method for the knowledge graph database for the entire kiwifruit industry chain given in Embodiment 1.
[0144] In this embodiment, the automatic question answering method is implemented using the traditional pattern matching method. Query templates are defined for key question words in different questions, and the text is converted into query expressions, which effectively simplifies the query process and improves the accuracy of semantic parsing.
[0145] The system also includes steps S6 and S7.
[0146] Step S6: Design an automatic question-and-answer method.
[0147] like Figure 4 As shown, step S6 includes the following steps:
[0148] Step S601: Analyze the keywords that can be matched to the question representing the relationship based on the conceptual pattern of the design.
[0149] Step S602: Match the entities appearing in the question based on the identified relational keywords.
[0150] Step 603: Based on the identified entities and relationships, use the corresponding Cypher statements to query the Neo4j database.
[0151] Step S604: Process the results returned by the Neo4j database into natural language and return it to the user, such as... Figure 5 As shown.
[0152] Cypher statements are a database manipulation language used in Neo4j databases to describe the relationships between nodes and edges in a graph, and how to retrieve and manipulate data from the graph.
[0153] Step S7: Design and implement an automatic question-and-answer system for kiwifruit.
[0154] like Figure 6 As shown, step S7 includes the following steps:
[0155] Step S701: Divide the architecture of the kiwifruit whole industry chain knowledge Q&A system into a data layer, a business layer, and a presentation layer.
[0156] Step S702: The underlying data layer provides data support for the upper business layer, using the Neo4j graph database for data storage.
[0157] In this embodiment, the stored data includes knowledge about the morphological characteristics, growth habits, planting and management processes, pest and disease control, and processing and transportation of kiwifruit.
[0158] In step S703, the business layer implements the kiwi automatic question answering module through the underlying data layer. The function of the kiwi automatic question answering module is realized through two modules: question intent understanding and question entity recognition.
[0159] Step S704: The presentation layer is the module for user interaction. It provides users with a visually appealing automated question-and-answer system for kiwifruit knowledge through a PC browser. The presentation layer includes question input boxes and result display boxes, such as... Figure 7 As shown.
[0160] Experimental verification:
[0161] 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.
[0162] System response time test:
[0163] Table 3 System Response Time Test
[0164] Group Number Response Time 1 2.16s 2 2.55s Average 2.35s
[0165] In summary, the construction method and question-answering system of the kiwifruit whole industry chain knowledge graph database constructed by this invention have the following characteristics: a knowledge graph storing knowledge of the entire kiwifruit 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 constructed 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 kiwifruit full-industry chain knowledge graph database, characterized in that, The method comprises the following steps: Step S1, conceptual design: The concept includes 32 types of entities: The categories of the 32 types of entities include: kiwifruit, alias, species, geographical location, part, structure, form, planting management, substance, trigger word, implementer, object, tool, period, method, influencing factor, growth influencing factor, growth and development period, disease and pest, disease, pathogen, symptom, disease regularity, pest, control method, control agent, damage characteristics, taboo, processed product, process flow, time and numerical value; Step S2, construct a kiwifruit text data set, label 32 types of entities in BIO label mode, and obtain a labeled data set; Step S3, based on the labeling result of step S2, for the original text, entity recognition is performed through a BiLSTM-CRF model to obtain a formatted text; In step S3, for an input sentence and its corresponding label sequence The final score of the BiLSTM-CRF model can be calculated by the following formula: In the formula: a label representing the first word; a label representing the first word; denotes a matrix multiplication; BiLSTM output representing the th word; represents the BiLSTM output for the th word; denotes the state transition matrix; denotes the bias term of the transmit matrix; Step S4, under the guidance and constraint of the concept mode of the BiLSTM-CRF model, the formatted text is assembled into triples, i.e. an entity layer; Step S5, the triples are saved persistently using a Neo4j graph database, and a kiwifruit industry chain knowledge graph database is constructed.
2. The construction method of the kiwifruit full-industry-chain knowledge graph database according to claim 1, characterized in that, In step S1, the method for obtaining the 32 types of entities is: Step S101, based on a field monograph, design a top-level concept of the knowledge graph database; The top-level concept includes kiwifruit basic information, kiwifruit morphological characteristics, kiwifruit flowering and fruiting characteristics, kiwifruit growth habit, and kiwifruit planting management; Step S102, according to the field monograph, refine the top-level concept to obtain a secondary concept; The secondary concept of the kiwifruit basic information includes kiwifruit species and geographical distribution; The secondary concept of the kiwifruit morphological characteristics includes kiwifruit root system, bud, leaf, flower, fruit and seed; The secondary concept of the kiwifruit flowering and fruiting characteristics includes flower bud differentiation characteristics, flowering characteristics, pollination and fertilization characteristics, and fruiting characteristics; The secondary concept of the kiwifruit growth habit includes phenophase and environment; The secondary concept of the kiwifruit planting management includes kiwifruit seedling raising technology, kiwifruit orchard establishment, kiwifruit water and fertilizer soil comprehensive management, kiwifruit shaping and pruning, kiwifruit flower and fruit management, kiwifruit disease and pest control, kiwifruit harvesting and storage, and postharvest processing; Step S103, represent the secondary concept as an entity, represent the relationship between the secondary concepts as a relationship, and combine similar secondary concepts to define 32 types of entities.
3. The construction method of the kiwifruit full-industry-chain knowledge graph database according to claim 1, characterized in that, In step S2, the following steps are included: Step S201, obtain an electronic picture book by scanning a kiwifruit professional book, then obtain a text document by manually calibrating the picture format book, and then delete and modify invalid information and repetitive information in the text document to complete data cleaning work; Step S202, use a semi-automatic labeling technology to perform BIO labeling on the book processed in step S201.
4. The construction method of the kiwifruit full-industry-chain knowledge graph database according to claim 3, characterized in that, In step S202, the semi-automatic labeling technology is: manually construct common entities in the field, encode in utf-8 format, and use Python to label the processed text data.
5. The construction method of the kiwifruit full-industry-chain knowledge graph database according to claim 1, characterized in that, In step S4, the form of the triple is <head entity, relationship, tail entity>.
6. A kiwifruit full-industry-chain knowledge Q&A system, characterized in that, The system adopts the kiwi fruit whole industry chain knowledge graph database, and the kiwi fruit whole industry chain knowledge graph database is obtained by using the construction method of the kiwi fruit whole industry chain knowledge graph database according to any one of claims 1 to 5.
7. The kiwifruit full-industry-chain knowledge Q&A system of claim 6, wherein, The system further comprises steps S6 and S7; Step S6, designing an automatic question answering method; Step S7, designing and implementing a kiwi fruit automatic question answering system.
8. The kiwifruit full-industry-chain knowledge Q&A system of claim 7, wherein, Step S6 comprises the following steps: Step S601, analyzing the key words representing the relationship that can be matched by the question according to the designed concept mode; Step S602, matching the entity appearing in the question according to the recognized relationship key words; Step 603, combining the recognized entity and relationship, and using the corresponding cypher statement to query the Neo4j database; Step S604, processing the result returned by the Neo4j database into natural language and returning it to the user.
9. The kiwifruit full-industry-chain knowledge Q&A system of claim 8, wherein, Step S7 comprises the following steps: Step S701, dividing the architecture of the kiwi fruit whole industry chain knowledge question answering system into a data layer, a business layer and a display layer; Step S702, the data layer at the bottom provides data support for the business layer at the top, and uses a Neo4j graph database for data storage; Step S703, the business layer is supported by the data layer at the bottom to realize the kiwi fruit automatic question answering module, and the function of the kiwi fruit automatic question answering module is realized through two modules of question intention understanding and question entity recognition; Step S704, the display layer is a module for interacting with the user, and provides the user with a kiwi fruit knowledge automatic question answering system with a visual interface through a PC browser, and the display layer includes a question input box and a result display box.
Citation Information
Patent Citations
Kiwi fruit whole industry chain knowledge graph database construction method and recommendation system
CN120832416A