Laying hen epidemic disease symptom knowledge graph construction method based on large language model

Through a method based on a large language model, using zero-sample learning and structured generation algorithms, the problems of low efficiency and insufficient accuracy of building knowledge graphs for laying hen epidemic symptoms in the existing technology are solved, and efficient and accurate knowledge graph construction is achieved. Adapt to complex and varied knowledge of epidemics.

CN118916496AInactive Publication Date: 2024-11-08BEIJING WODEBOCHUANG INFORMATION TECH CO LTD

Patent Information

Application Number
CN202411414762.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-11
Publication Date
2024-11-08
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The prior art has problems of low efficiency, high cost and insufficient accuracy when building the knowledge graph of laying hen epidemic symptoms, especially manual drawing, word segmentation rules and recurrent neural network methods are difficult to meet the needs of efficient construction.

Method used

Using the method based on the large language model chatglm4-9b, through the steps of data preprocessing, entity extraction, relationship extraction, entity calibration and knowledge graph construction, using zero-sample learning ability and structured generation algorithms and semantics designed specifically for laying hen disease Embed the model to construct a knowledge graph of laying hen epidemic symptoms.

Benefits of technology

It realizes efficient extraction of epidemic symptom information from any style of epidemic diagnosis sample data, builds an accurate and adaptable knowledge graph, reduces dependence on supervised samples, and improves the accuracy of relationship extraction between entities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure SMS_1
    Figure SMS_1
  • Figure SMS_2
    Figure SMS_2
  • Figure SMS_3
    Figure SMS_3
Patent Text Reader

Abstract

The invention discloses a laying hen epidemic disease symptom knowledge graph construction method based on a large language model, and the method comprises the following steps: S1, data preprocessing: carrying out the paragraph segmentation and text partitioning processing of an input text, and obtaining input text blocks; s2, entity extraction: identifying and extracting entities in the input text block by utilizing a large language model to form an entity set; s3, relation extraction: inputting the input text block into a relation retriever to extract a relation, and forming a relation set; s4, entity calibration: recalibrating entities in the entity set and relationships in the relationship set by using a large language model, and filtering irrelevant or wrong entities and relationships to obtain the calibrated entity set and relationship set; and S5, knowledge graph construction: constructing a laying hen epidemic disease symptom knowledge graph based on the calibrated entity set and relation set.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of constructing a knowledge graph, and in particular to a method for constructing a knowledge graph of laying hen disease symptoms based on a large language model. Background Art

[0002] The existing symptoms of laying hen diseases can be summarized into common symptoms of laying hen diseases based on experience. The symptoms of laying hen diseases are classified into symptoms such as appearance symptoms, anatomical symptoms, changes in production performance, respiratory conditions, fecal abnormalities, behavioral abnormalities, temperature changes, and disease conditions. Each symptom classification is divided into different symptom manifestations or characteristics. Each symptom manifestation or characteristic relies on the experience accumulation of veterinarians, and is then organized into standard symptom knowledge items, and finally forms a symptom knowledge map of laying hen diseases.

[0003] At present, there are mainly the following methods to manually construct knowledge graphs of laying hen disease symptoms: 1. Manual drawing method: Veterinarians manually collect and organize relevant knowledge to build a knowledge graph. This method is time-consuming, costly, and easily limited by expert knowledge and experience, which affects the coverage and update speed of the knowledge graph.

[0004] 2. Word segmentation rule-based method: Use a predefined word segmentation rule library to extract knowledge from text and build a knowledge graph. This method is highly dependent on word segmentation rules and has difficulty processing complex and diverse language expressions, which limits the accuracy and comprehensiveness of the knowledge graph.

[0005] 3. Based on the recurrent neural network (RNN) method: Use algorithms such as recurrent neural networks to automatically extract knowledge from a large amount of text and construct a knowledge graph. However, the recurrent neural network method requires a large amount of high-quality labeled data for training, and it is often difficult to obtain high-quality data. Moreover, recurrent neural networks often perform poorly when processing unseen data and have difficulty coping with complex and changing epidemic knowledge.

[0006] In summary, the above methods all have the disadvantages of low efficiency and high cost, and it is difficult to meet the needs of efficiently constructing a knowledge graph of laying hen disease symptoms in practical applications. Therefore, it is necessary to propose a more efficient, accurate and adaptable knowledge graph construction method. Summary of the invention

[0007] To solve the above problems, the purpose of the present invention is to provide a method for constructing a knowledge graph of laying hen disease symptoms, which can extract relevant information of disease symptoms from any style of disease diagnosis sample data and construct a corresponding knowledge graph.

[0008] This method takes unstructured laying hen disease diagnosis sample data as input, extracts entities and relationships, and constructs a knowledge graph. The method consists of the following key steps: data preprocessing, entity extraction, relationship extraction, entity alignment, and knowledge graph construction. Among them, entity extraction and relationship extraction are the most critical steps.

[0009] In entity extraction, this method is built on the large language model chatglm4-9b, combining the structured generation algorithm designed for laying hen diseases with disease ontology knowledge. Without the need to prepare supervised samples in advance and without training from scratch, the powerful zero-sample learning ability of chatglm4-9b can be used to extract symptom entities from any style of laying hen disease diagnosis sample text. In relation extraction, this method designs a relation retriever for laying hen diseases and disease symptoms, maps the defined entity relationship and diagnosis sample text into the vector space, measures the correlation between the two through cosine similarity, that is, the possibility of the entity relationship appearing in the diagnosis sample text, sets an appropriate threshold and finally extracts the corresponding entity relationship.

[0010] The present invention provides a method for constructing a knowledge graph of laying hen disease symptoms based on a large language model, comprising the following steps: Step S1, data preprocessing: segmenting the input text into paragraphs and dividing the text into blocks to obtain input text blocks; Step S2, entity extraction: using a large language model to identify and extract entities in the input text block to form an entity set; Step S3, relation extraction: input the input text block to the relation retriever to extract relations and form a relation set; Step S4, entity calibration: using the large language model to recalibrate the entities in the entity set and the relationships in the relationship set, filtering out irrelevant or erroneous entities and relationships, and obtaining a calibrated entity set and relationship set; Step S5, knowledge graph construction: construct a knowledge graph of laying hen disease symptoms based on the calibrated entity set and relationship set.

[0011] A further improvement of the present invention is that step S1 comprises the following steps: Step S11: dividing the input text into multiple paragraphs according to natural paragraphs; the input text is a sample text of laying hen disease diagnosis; Step S12: Check the number of tokens for each of the multiple paragraphs; if the number of tokens in a paragraph is less than a preset value, the paragraph is formed into a single text block; Step S13: if the number of tokens in the paragraph exceeds a preset value, the paragraph is divided into multiple text blocks; there is an overlapping area between two adjacent text blocks in the multiple text blocks; Step S14: Save the text blocks obtained in steps S12 and S13 into the input text block.

[0012] A further improvement of the present invention is that step S2 comprises the following steps: Step S21, extracting laying hen disease terms: extracting laying hen disease terms from the input text block; Step S22, extracting related laying hen disease terms: based on the extracted laying hen disease terms, extracting related laying hen disease terms and pronouns in the input text block to obtain a disease term set and a pronoun set; Step S23, entity extraction: input the disease terminology set and the pronoun set into the large language model to obtain the entity set.

[0013] A further improvement of the present invention is that step S21 includes the following steps: Step S211, laying hen disease ontology construction: constructing laying hen disease ontology containing various disease terms based on national standards; Step S212, matching laying hen disease terms: using a string matching algorithm, searching and extracting laying hen disease terms existing in each text block of the input text block in the laying hen disease ontology, and saving the matching results to temporary results; Step S213, negative keyword detection: using a preset negative keyword list and regular expression template, identify negative keywords in each text block of the input text block; if negative keywords are detected, exclude laying hen disease terms associated with the negative keywords, and update the temporary results.

[0014] A further improvement of the present invention is that step S22 includes the following steps: Step S221, constructing a proprietary structured generation algorithm for extracting relevant laying hen disease terms; Step S222, extracting related laying hen disease terms: inputting the updated temporary results and the input text block into the large language model, the large language model extracts related laying hen disease terms from each text block of the input text block based on a proprietary structured generation algorithm for extracting related laying hen disease terms, identifies the pronouns, and matches the identified pronouns with the related laying hen disease terms; Step S223, saving the associated laying hen disease terms and pronouns: adding the extracted associated laying hen disease terms to the disease term set, and saving the pronouns to the pronoun set.

[0015] A further improvement of the present invention is that step S23 includes the following steps: Step S231: constructing a proprietary structured generation algorithm for entity extraction; Step S232, entity recognition and classification: input the disease term set, the pronoun set and the laying hen disease ontology into the large language model; the large language model identifies the entities associated with laying hen disease in each text block of the input text block based on a proprietary structured generation algorithm for entity extraction, and classifies them according to entity type; Step S233, entity result saving: the large language model outputs the identified entity as a single JSON object in a predetermined format and saves it into the entity set.

[0016] A further improvement of the present invention is that the relationship retriever is formed by a reconstructed semantic embedding model M3E; the reconstructed semantic embedding model M3E is obtained by training through the InfoNCE loss function.

[0017] A further improvement of the present invention is that step S4 comprises the following steps: Step S41, constructing a proprietary structured generation algorithm for entity calibration; Step S42, entity and relationship calibration: input the entity set and the relationship set into the large language model, and the large language model calibrates the entities in the entity set and the relationships in the relationship set, filtering out irrelevant or erroneous entities and relationships; Step S43, saving the calibration results: the large language model outputs the calibrated entities and relationships in a predetermined format, and updates them to the entity set and relationship set.

[0018] A further improvement of the present invention is that the knowledge graph construction of step S5 refers to: importing the calibrated entity set and relationship set into the Neo4j database one by one in the form of triples, creating and storing entity nodes and relationship edges through the API of the Neo4j database, and constructing a knowledge graph of laying hen disease symptoms.

[0019] A further improvement of the present invention is that the large language model is chatglm4-9b.

[0020] Beneficial effects of the present invention: The present invention proposes a method for constructing a knowledge graph of laying hen disease symptoms. Compared with traditional manual drawing, rule-based methods and recurrent neural network-based methods, the present method can extract disease symptom entities from laying hen disease diagnosis texts of any style without a large number of supervised samples through the zero-sample learning ability of the large language model chatglm4-9b. The present invention innovatively introduces a structured generation algorithm and disease ontology knowledge designed specifically for laying hen diseases, optimizes the entity extraction process, and uses the reconstructed semantic embedding model M3E as a relationship retriever to improve the accuracy of relationship extraction between entities. DETAILED DESCRIPTION

[0021] The technical solutions in the embodiments of the present invention are described clearly and completely below in conjunction with the embodiments of the present invention. In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention can also be implemented in other ways different from those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present invention, so the present invention is not limited by the specific embodiments disclosed below.

[0022] The purpose of the present invention is to provide a method for automatically constructing a knowledge graph of laying hen disease symptoms, which can extract relevant information of disease symptoms from disease diagnosis sample data of any style and construct a corresponding knowledge graph.

[0023] The present invention uses unstructured laying hen disease diagnosis sample text as input text. In the data preprocessing stage, the input text is segmented into paragraphs and the text is divided into blocks to meet the input requirements of the large language model chatglm4-9b. Next, the entity extraction stage is entered, and the large language model is used to identify and extract key entities in the text to form an entity set {E1, E2, ..., En}, such as disease name, disease symptoms, means of transmission, etc. In the relationship extraction stage. In order to enable the large language model to accurately understand and extract key information in the diagnosis sample text, a proprietary structured generation algorithm is designed for laying hen disease entity extraction, and laying hen disease ontology knowledge is added to the proprietary structured generation algorithm. The laying hen disease ontology knowledge includes standard terminology in the field of laying hen diseases, disease classification, symptom description, transmission route, prevention and treatment measures, and other information. The large language model chatglm4-9b is guided to accurately identify and extract through the proprietary structured generation algorithm. In the relation extraction stage, the relation retriever is used to identify and extract the relationship between entities to form a relation set {R1, R2, ..., Rn}, such as the relationship between disease and symptoms, the relationship between cause and disease, etc. The relation retriever is a semantic embedding model M3E for the reconstruction of egg-laying chicken disease entities and entity relationships. In the entity calibration stage, entities from different sources and descriptions are unified into standardized entities to ensure the consistency and accuracy of the knowledge graph. Finally, a knowledge graph is constructed based on the extracted entities and relationships.

[0024] The data of the knowledge graph of laying hen disease symptoms constructed by this method are integrated in the form of triples, which are in the form of (head entity, relationship, tail entity), so it is necessary to form the abstract concepts in the text into specific entities and the relationship between entities. After dividing the entity categories in the laying hen disease diagnosis sample text, 11 entity categories are obtained, and the first three letters of the English words corresponding to the entity are used as the definition of the entity category. The specific entity categories are shown in Table 1. After completing the entity category division, 10 types of entity relationships are abstracted from the entities, as shown in Table 2.

[0025] Table 1 Definition of chicken disease entity categories

[0026] Table 2 Chicken disease entity relationship definition table

[0027] Specifically, the present application provides a method for constructing a knowledge graph of laying hen disease symptoms based on a large language model by following the steps below: Step S1, data preprocessing: The input text is segmented into paragraphs and divided into blocks to obtain input text blocks {T1, T2, ..., Tn}.

[0028] Before entity extraction, the input sample text of egg-laying chicken disease diagnosis needs to be preprocessed because the large language model chatglm4-9b used in this method has a token limit of 8000 for the input text (token is the basic unit for large language model to process text, usually one Chinese character is two tokens). In order to ensure that the text can be processed efficiently and accurate extraction results can be obtained, the maximum length of the input and output parts in the proprietary structured generation algorithm designed in this method is 2000 tokens. This length limit is based on the following considerations: first, the total length of the input and output parts must not exceed the maximum token limit of the large language model to ensure that the proprietary structured generation algorithm can be fully processed; second, the sample text of egg-laying chicken disease diagnosis is divided into input text blocks {T1, T2, ..., Tn} with less than 2000 tokens, which can effectively avoid the decline in the ability of the large language model to utilize contextual relationships due to excessively long text, while maintaining the context consistency within the paragraph, thereby improving the accuracy of entity extraction. The paragraph segmentation process of the input text is as follows: Step S11: Segment the input text into multiple paragraphs according to natural paragraphs, where the input text is a sample text of laying hen disease diagnosis.

[0029] Step S12: For each of the multiple paragraphs, check the number of tokens in each paragraph one by one. If the number of tokens in a paragraph is less than tokenLimit, then treat the paragraph directly as a text block.

[0030] Step S13: If the number of tokens in a paragraph exceeds tokenLimit, the paragraph is further processed: the paragraph is cut according to tokenLimit to form multiple text blocks. The number of tokens in each cut text block does not exceed tokenLimit, and there is an overlap area of ​​overlapTokens tokens between adjacent text blocks to retain context information. tokenLimit and overlapTokens are both preset values ​​based on actual needs.

[0031] Step S14: Save the text blocks formed in steps S12 and S13 into the input text block {T1, T2, ..., Tn}.

[0032] Step S2, entity extraction: A large language model is used to identify and extract entities in the input text block {T1, T2, ..., Tn} and form an entity set {E1, E2, ..., En}.

[0033] This method divides entity extraction into three sub-steps: egg-laying chicken disease term extraction, related egg-laying chicken disease term extraction and entity extraction. The performance of the large language model chatglm4-9b can be improved by gradually solving complex problems. A proprietary structured generation algorithm is designed to guide the large language model for extracting related egg-laying chicken disease terms and extracting entities. Each proprietary structured generation algorithm contains egg-laying chicken disease ontology knowledge. This division enables the large language model to focus on processing specific tasks in each sub-step, thereby better utilizing the egg-laying chicken disease ontology knowledge to improve the overall entity extraction effect. The specific implementation steps are as follows: Step S21: Extracting laying hen disease terms; Step S211, laying hen disease ontology construction: construct laying hen disease ontology {disease_knowledge} including various laying hen disease terms according to a series of national standards, such as "Diagnosis Technology of Marek's Disease in Chickens", "Diagnosis Technology of Newcastle Disease" and other relevant standards. Laying hen disease ontology {disease_knowledge} includes 38 typical laying hen common diseases, and the disease types are shown in Table 3.

[0034] Table 3 Classification of laying hen diseases

[0035] Step S212, egg-laying chicken disease term matching: extract egg-laying chicken disease terms from the input text block {T1, T2, ..., Tn}, use the string matching algorithm to search and extract the egg-laying chicken disease terms existing in a single text block of the input text block {T1, T2, ..., Tn} in the egg-laying chicken disease ontology {disease_knowledge}, and save the matching results to the temporary result {disease_terms}; Step S213, negative keyword detection: in order to avoid misextraction, negative keywords are identified in a single text block of the input text block {T1, T2, ..., Tn} through a preset negative keyword list and regular expression template; if negative keywords are detected, laying hen disease terms associated with the negative keywords are excluded, and the temporary result {disease_terms} is updated.

[0036] Table 4 Proprietary structured generation algorithm for related laying hen disease terms

[0037] Step S22: Extraction of related laying hen disease terms; related laying hen disease terms refer to other terms related to laying hen disease terms, including possible word form variations. This is accomplished by the following steps: Step S221: construct a proprietary structured generation algorithm for extracting related laying hen disease terms; the proprietary structured generation algorithm for extracting related laying hen disease terms, as shown in Table 4, clearly lists the task objectives (extracting related laying hen disease terms and pronouns), entity definitions, precautions, and output format requirements.

[0038] Step S222: extracting related laying hen disease terms; Input the updated temporary result {disease_terms} and the input text block {T1, T2, ..., Tn} into the large language model. The large language model extracts the related laying hen disease terms from the single text block in the input text block {T1, T2, ..., Tn} based on the proprietary structured generation algorithm for extracting related laying hen disease terms, and simultaneously identifies the pronouns, and matches the identified pronouns with the related laying hen disease terms; Step S223: adding the extracted related laying hen disease terms to the disease term set {medical_terms}, and saving the pronouns to the pronoun set {anaphor}; Table 5 Proprietary structured generation algorithm for entity extraction

[0039]

[0040] Step S23: entity extraction; Step S231, construct a proprietary structured generation algorithm for entity extraction; the structured generation algorithm for entity extraction is shown in Table 5, including task description, entity definition, precautions, and output format. The task description clearly requires the extraction of various entities including disease names, symptoms, and preventive measures from the text.

[0041] Step S232, entity recognition and classification: input the disease term set {medical_terms}, the pronoun set {anaphor} and the laying hen disease ontology {disease_knowledge} into the large language model; the large language model uses a proprietary structured generation algorithm based on entity extraction to identify entities associated with laying hen diseases in a single text block and classify them according to entity type; Step S233, entity result saving: the large language model outputs the identified entity as a single JSON object in a predetermined format, and saves the result into the entity set {E1, E2, ..., En}.

[0042] Step S3, relation extraction: After entity extraction, relation extraction is performed through a relation retriever and the extracted relations are output to a relation set {R1, R2, ..., Rn}.

[0043] Since the relationships of the knowledge graph of laying hen disease symptoms have been standardized, the defined relationships and input text blocks {T1, T2, ..., Tn} are converted into vector representations in a high-dimensional vector space through the reconstructed semantic embedding model M3E, where the cosine similarity between vectors can reflect the correlation between the input text block {T1, T2, ..., Tn} and the relationship, that is, the possibility of a certain relationship appearing in the input text block {T1, T2, ..., Tn}.

[0044] It is worth noting that the similarity space of the reconstructed semantic embedding model M3E is different from that of the standard semantic embedding model. The cosine similarity in the vector space of the standard semantic embedding model reflects semantic equivalence, while the standard semantic embedding model is reconstructed using text and its corresponding relations. The semantic embedding model is reconstructed to specifically match between input text blocks and relations. Although semantic similarity is still used as a similarity measure, the reconstruction of the semantic embedding model makes this similarity more reflect the relevance of the relations in the input text blocks {T1, T2, ..., Tn}, rather than just semantic relevance.

[0045] The reconstruction method of the semantic embedding model uses the relationship between standard text and corresponding standardized definitions to construct a training set. In the training set, for a given text-relation pair ( , ),exist Apply a directive template to generate new text _inst; _inst = Extract relations existing in standard text\n Query: { }.

[0046] New text generated by this instruction template _inst, combines the standard text with the target relationship definition so that the semantic embedding model can accurately distinguish the correct relationship related to the standard text from other irrelevant relationships during fine-tuning, and then reconstruct the semantic embedding model. The reconstructed semantic embedding model is trained by inputting the training set into the InfoNCE loss function, and the formula is as follows:

[0047] Here, N represents the number of negative sample sets. Represents the cosine similarity function.

[0048] Negative sample set refers to a data set consisting of negative samples. Negative samples refer to relations that are irrelevant or unrelated to the correct relations of the standard text.

[0049] After training with the InfoNCE loss function, the reconstructed semantic embedding model M3E is obtained. The reconstructed semantic embedding model M3E can distinguish the correct relations related to the given text from other irrelevant relations. Using the reconstructed semantic embedding model M3E as a relation retriever, the relations are extracted for each text block in the input text block {T1, T2, ..., Tn}, and the extracted relations are saved to the relation set {R1, R2, ..., Rn} and output. These relations are represented as structured data in JSON format.

[0050] Table 6 Proprietary structured generation algorithm for entity calibration

[0051]

[0052]

[0053] Step S4, physical calibration: The goal of this method is to build a knowledge graph based on the extraction results. Often many entities may not have defined relationships with other entities. After analyzing the extraction results, it was observed that entities without any relationships are more likely to be irrelevant in the context or to be incorrectly classified as medical entities. For example, the system identified the term "epidemic" in the entity extraction stage. However, in the relationship extraction, the system failed to detect any "referential" or other relationships, indicating that it is just a general term and can be ignored in this context. In other cases, some erroneous symptoms and signs were also effectively excluded. Therefore, an entity calibration step was introduced after the relationship extraction.

[0054] Step S41: Construct a proprietary structured generation algorithm for entity calibration; Construct a proprietary structured generation algorithm for entity calibration. The proprietary structured generation algorithm for entity calibration is shown in Table 6, including task description, entity definition, precautions, and output format. The task description clearly requires verification of all extracted entities and relationships to ensure their accuracy and relevance in the knowledge graph of laying hen disease symptoms.

[0055] Step S42: Entity and relationship calibration: Input the entity set {E1, E2, ..., En} and the relationship set {R1, R2, ..., Rn} into the large language model, and the large language model re-analyzes the entities in the entity set {E1, E2, ..., En} and the relationships in the relationship set {R1, R2, ..., Rn} to filter out irrelevant or erroneous entities and relationships; The calibration process includes: Check whether each entity is related to other entities and relationships in the context.

[0056] Determine which entities may need to be excluded due to lack of appropriate context or relationships.

[0057] Correct the misclassified entities to ensure that they conform to the definition and standards of the knowledge graph of laying hen disease symptoms.

[0058] Step S43: the calibration result is saved; the large language model outputs the calibrated entities and relations in a predetermined format and updates them to the entity set {E1, E2, ..., En} and the relationship set {R1, R2, ..., Rn}; Step S5, knowledge graph construction: Using the Neo4j database, the calibrated entity set {E1, E2, ..., En} and relationship set {R1, R2, ..., Rn} were imported one by one in the form of triples. Neo4j is a graph database suitable for storing and processing complex network data structures. Through the Neo4j API, entity nodes and relationship edges were created and stored to build a knowledge graph of laying hen disease symptoms.

[0059] Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

Claims

1. A method for constructing a knowledge graph of laying hen disease symptoms based on a large language model, characterized in that: The following steps are involved: Step S1, data preprocessing: segmenting the input text into paragraphs and dividing the text into blocks to obtain input text blocks; Step S2, entity extraction: using a large language model to identify and extract entities in the input text block to form an entity set; Step S3, relation extraction: input the input text block to the relation retriever to extract relations and form a relation set; Step S4, entity calibration: using the large language model to recalibrate the entities in the entity set and the relationships in the relationship set, filtering out irrelevant or erroneous entities and relationships, and obtaining a calibrated entity set and relationship set; Step S5, knowledge graph construction: construct a knowledge graph of laying hen disease symptoms based on the calibrated entity set and relationship set.

2. According to claim 1, a method for constructing a knowledge graph of laying hen disease symptoms based on a large language model, characterized in that: The step S1 comprises the following steps: Step S11: dividing the input text into multiple paragraphs according to natural paragraphs; the input text is a sample text of laying hen disease diagnosis; Step S12: Check the number of tokens for each of the multiple paragraphs; if the number of tokens in a paragraph is less than a preset value, the paragraph is formed into a single text block; Step S13: if the number of tokens in the paragraph exceeds a preset value, the paragraph is divided into multiple text blocks; there is an overlapping area between two adjacent text blocks in the multiple text blocks; Step S14: Save the text blocks obtained in steps S12 and S13 into the input text block.

3. The method for constructing a knowledge graph of laying hen disease symptoms based on a large language model according to claim 1, characterized in that: The step S2 comprises the following steps: Step S21, extracting laying hen disease terms: extracting laying hen disease terms from the input text block; Step S22, extracting related laying hen disease terms: based on the extracted laying hen disease terms, extracting related laying hen disease terms and pronouns in the input text block to obtain a disease term set and a pronoun set; Step S23, entity extraction: input the disease terminology set and the pronoun set into the large language model to obtain the entity set.

4. The method for constructing a knowledge graph of laying hen disease symptoms based on a large language model according to claim 3, characterized in that: Step S21 includes the following steps: Step S211, laying hen disease ontology construction: constructing laying hen disease ontology containing various disease terms based on national standards; Step S212, matching laying hen disease terms: using a string matching algorithm, searching and extracting laying hen disease terms existing in each text block of the input text block in the laying hen disease ontology, and saving the matching results to temporary results; Step S213, negative keyword detection: using a preset negative keyword list and regular expression template, identify negative keywords in each text block of the input text block; if negative keywords are detected, exclude laying hen disease terms associated with the negative keywords, and update the temporary results.

5. The method for constructing a knowledge graph of laying hen disease symptoms based on a large language model according to claim 4, characterized in that: Step S22 includes the following steps: Step S221, constructing a proprietary structured generation algorithm for extracting relevant laying hen disease terms; Step S222, extracting related laying hen disease terms: inputting the updated temporary results and the input text block into the large language model, the large language model extracts related laying hen disease terms from each text block of the input text block based on a proprietary structured generation algorithm for extracting related laying hen disease terms, identifies the pronouns, and matches the identified pronouns with the related laying hen disease terms; Step S223, saving the associated laying hen disease terms and pronouns: adding the extracted associated laying hen disease terms to the disease term set, and saving the pronouns to the pronoun set.

6. The method for constructing a knowledge graph of laying hen disease symptoms based on a large language model according to claim 5, characterized in that: Step S23 includes the following steps: Step S231: constructing a proprietary structured generation algorithm for entity extraction; Step S232, entity recognition and classification: input the disease term set, the pronoun set and the laying hen disease ontology into the large language model; the large language model identifies the entities associated with laying hen disease in each text block of the input text block based on a proprietary structured generation algorithm for entity extraction, and classifies them according to entity type; Step S233, entity result saving: the large language model outputs the identified entity as a single JSON object in a predetermined format and saves it into the entity set.

7. The method for constructing a knowledge graph of laying hen disease symptoms based on a large language model according to claim 1, characterized in that: The relationship retriever is formed by a reconstructed semantic embedding model M3E; the reconstructed semantic embedding model M3E is trained by the InfoNCE loss function.

8. The method for constructing a knowledge graph of laying hen disease symptoms based on a large language model according to claim 1, characterized in that: Step S4 includes the following steps: Step S41, constructing a proprietary structured generation algorithm for entity calibration; Step S42, entity and relationship calibration: input the entity set and the relationship set into the large language model, and the large language model calibrates the entities in the entity set and the relationships in the relationship set, filtering out irrelevant or erroneous entities and relationships; Step S43, saving the calibration results: the large language model outputs the calibrated entities and relationships in a predetermined format, and updates them to the entity set and relationship set.

9. The method for constructing a knowledge graph of laying hen disease symptoms based on a large language model according to claim 1, characterized in that: The knowledge graph construction in step S5 refers to: importing the calibrated entity sets and relationship sets into the Neo4j database one by one in the form of triples, creating and storing entity nodes and relationship edges through the API of the Neo4j database, and constructing a knowledge graph of laying hen disease symptoms.

10. The method for constructing a knowledge graph of laying hen disease symptoms based on a large language model according to claim 1, characterized in that: The large language model is chatglm4-9b.

Citation Information

Patent Citations

  • Livestock and poultry disease diagnosis method and system based on multi-modal knowledge graph

    CN117059261A

  • Knowledge graph construction method and system based on BERT

    CN117371534A

  • Poultry health data processing method based on knowledge graph and big language model fusion reasoning

    CN118522443A

Cited By

  • Standard term library construction method based on artificial intelligence technology

    CN119513108A

  • Temporomandibular joint disease diagnosis method and system based on large language model

    CN121354862A