Knowledge graph-based method for generating popular science content of local livestock and poultry germplasm resources
By extracting trait attributes from the knowledge graph of local livestock and poultry germplasm resources and utilizing the semantic opposition relationships of the common sense knowledge base, highly significant analogies are selected to generate popular science content with analogies. This solves the problem of the lack of vivid metaphors and cognitive bridges in existing technologies, and improves the scientific accuracy and readability of popular science content.
Patent Information
- Application Number
- CN202610903984.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-23
- Publication Date
- 2026-08-25
AI Technical Summary
Existing knowledge graph-based methods for generating popular science content cannot automatically establish analogical relationships between variety-specific traits and the public's existing cognitive experience, resulting in popular science content lacking vivid metaphors and cognitive bridges, thus weakening its dissemination effect.
Trait attributes are extracted from the knowledge graph of local livestock and poultry germplasm resources, comparable attributes are identified, and a mirror lookup is performed using semantic opposition relationships in the common sense knowledge base. The common sense knowledge base is independently searched through physical dimensions and functional semantic dimensions to select highly significant analogous items, and a mapping relationship for visual appearance description is established to generate popular science content.
It improves the readability and dissemination adaptability of popular science content by automatically converting professional trait parameters into descriptions of appearance characteristics familiar to the public, forming a scientific and vivid cognitive bridge, and enhancing the comprehension and dissemination effect of the content.
Smart Images

Figure CN122634221A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer information processing technology, and more specifically, to a method for intelligently generating popular science content on local livestock and poultry germplasm resources based on knowledge graphs. Background Technology
[0002] Existing knowledge graph-based methods for generating popular science content primarily focus on domain ontology, storing structured information such as the biological traits and breed origins of local livestock and poultry germplasm resources as entities and relationships. When generating popular science text, the system queries the attribute values associated with breed entities and directly converts them into natural language descriptions according to pre-defined templates or general language models. This approach ensures the scientific accuracy of the generated content. However, knowledge graphs only solidify explicit attribute relationships within a domain and lack the ability to represent and utilize implicit similarities between common-sense concepts from different domains, limiting content output to the direct paraphrasing of parameters.
[0003] This content generation method, which relies solely on domain-specific attribute queries, fails to automatically establish analogical connections between variety-specific traits and the public's existing cognitive experience when expressing variety characteristics in a popular way. This results in popular science content lacking vivid metaphors and cognitive bridges that can help non-professional audiences understand unfamiliar concepts, thus weakening the dissemination effect of knowledge graphs in the context of intelligent popular science generation. Summary of the Invention
[0004] In order to overcome the above-mentioned defects of the prior art, the present invention provides a method for intelligent generation of popular science content on local livestock and poultry germplasm resources based on knowledge graphs to solve the problems mentioned in the background art.
[0005] To achieve the above objectives, the present invention provides the following technical solution:
[0006] A method for intelligently generating popular science content on local livestock and poultry germplasm resources based on knowledge graphs includes the following steps:
[0007] S1: Obtain the trait attributes and attribute value text associated with the target variety entity from the local livestock and poultry germplasm resource knowledge graph;
[0008] S2: Perform pattern matching on the attribute value text. If it is found that it contains both a numeric substring and a functional description substring, then mark the trait attribute as a comparable attribute.
[0009] S3: Use the functional description substring of each comparable attribute as a search term, query the reverse functional description substring in the common sense knowledge base that is semantically opposite to it, and obtain the ratio of the number of item items associated with each of the two substrings as the cognitive coverage. If it is lower than the preset coverage threshold, the comparable attribute is removed.
[0010] S4: For each retained comparable attribute, retrieve the common sense knowledge base based on the numerical substring and the functional description substring to obtain the first item set ranking and the second item set ranking. Calculate the local significance level of the rank correlation coefficient of each candidate item in the two item set rankings. Only retain the candidate comparable items with significance higher than the preset significance threshold and use the normalized significance as the analogy matching degree.
[0011] S5: Select the candidate analogous items with the highest analogy matching degree, extract their visual appearance descriptions, and establish an analogy mapping relationship between comparable attributes and visual appearance descriptions;
[0012] S6: Fill the analogy mapping relationship into the description position corresponding to the comparable attribute in the popular science narrative template to generate popular science content text with analogy.
[0013] Furthermore, S1 includes:
[0014] Extract all trait attribute triples associated with the target breed entity in the knowledge graph of local livestock and poultry germplasm resources;
[0015] Filter attribute triples from all trait attribute triples to attribute triples whose attribute type is biological trait;
[0016] The attribute value field in the filtered attribute triples is parsed into attribute value text, and the attribute name field in the filtered attribute triples is taken as the trait attribute. The trait attribute and its attribute value text are then combined to obtain the trait attribute.
[0017] Furthermore, S2 includes:
[0018] Attribute value text is segmented and part-of-speech tagged, and numerical segmented words are extracted as numerical substrings;
[0019] Extract the description text other than the numeric substring from the attribute value text, perform dependency parsing on the description text, and extract the overlay text fragment of the syntactic subtree that plays the role of describing the attribute function as the function description substring.
[0020] Determine whether the attribute value text contains both a numeric substring and a functional description substring. If both exist, mark the trait attribute as a comparable attribute.
[0021] Furthermore, S3 includes:
[0022] Using the functional description substring as a search term, query the common sense knowledge base for inverse functional description substrings that have a semantically opposite relationship with the functional description substring.
[0023] Get the number of item entries directly associated with the function description substring in the common knowledge base;
[0024] Get the number of item entries directly associated with the reverse function description substring in the common sense knowledge base;
[0025] Calculate the ratio of the number of item items associated with the reverse functional description substring to the number of item items associated with the functional description substring, and use the ratio as the cognitive coverage.
[0026] Determine whether the cognitive coverage is lower than a preset coverage threshold. If it is lower than the preset coverage threshold, remove the comparable attribute from the set of comparable attributes.
[0027] Further, querying the common sense knowledge base for inverse functional description substrings that have a semantic opposition to the functional description substring includes: mapping the functional description substring to a semantic vector, retrieving the term with the smallest cosine distance to the semantic vector and labeled as an antonymous term in the antonym tagging vocabulary of the common sense knowledge base, and using the term as the inverse functional description substring.
[0028] Furthermore, S4 includes:
[0029] The numerical substrings are mapped to physical units, and the physical units index of the common sense knowledge base is retrieved using the physical units to obtain the first item set. The items in the first item set are sorted in descending order according to the similarity of the physical units to obtain the sorting of the first item set.
[0030] The functional description substring is mapped to a functional semantic vector. The functional semantic vector is used to retrieve the functional semantic index of the common sense knowledge base to obtain the second item set. The items in the second item set are sorted in descending order according to the functional semantic similarity to obtain the sorting of the second item set.
[0031] For each candidate item that appears in both the first item set sorting and the second item set sorting, extract the first ranking number of the candidate item in the first item set sorting and the second ranking number in the second item set sorting;
[0032] Calculate the Kendall rank correlation coefficient between the first and second ranking numbers of all candidate items, and calculate the local significance level of the ranking pair under the Kendall rank correlation coefficient for each candidate item;
[0033] Candidate analogies with local saliency levels higher than a preset saliency threshold are retained. The local saliency levels of the retained candidate analogies are normalized, and the normalized local saliency levels are used as the analogy matching degree.
[0034] Furthermore, the physical dimension index of the common sense knowledge base is retrieved using physical dimensions to obtain the first item set, including: matching the physical dimensions with the physical attribute tags of each item in the common sense knowledge base, obtaining item items whose dimensions under the physical attribute tags are consistent with the physical dimensions and incorporating them into the first item set, calculating the absolute value of the difference between the value under the physical attribute tag and the value substring for each item in the first item set, and using the absolute value of the difference as the physical dimension approximation.
[0035] Furthermore, S5 includes:
[0036] For each comparable attribute, select the candidate comparable item with the highest analogy matching degree from the retained candidate comparable items;
[0037] Query the item description field of candidate analogous items from the common sense knowledge base, and extract the text fragments marked as visual appearance attributes in the item description field as visual appearance descriptions.
[0038] The attribute names of comparable attributes are associated with the visual appearance descriptions of candidate comparable items and stored together to establish an analogy mapping relationship between comparable attributes and visual appearance descriptions.
[0039] Furthermore, S6 includes:
[0040] Analyze the popular science narrative template and locate the template fragment corresponding to the description position marked as comparable attribute in the popular science narrative template;
[0041] For each comparable attribute, extract the visual appearance description corresponding to the comparable attribute from the analogy mapping relationship, and write the extracted visual appearance description into the located template fragment.
[0042] The template fragments written in the visual appearance description are merged with the remaining template fragments in the popular science narrative template to form popular science content text with analogies.
[0043] Furthermore, the extracted visual appearance description is written into the located template fragment, including: if the located template fragment already contains an original visual appearance description of the same category, then it is determined whether the confidence level of the visual appearance description in the item description field of the candidate analogous item is higher than the confidence level of the original visual appearance description in the corresponding item description field. If it is higher, the original visual appearance description is replaced; otherwise, the original visual appearance description is retained.
[0044] Compared with the prior art, the present invention has the following beneficial effects:
[0045] 1. By extracting trait attributes from the knowledge graph of local livestock and poultry germplasm resources and identifying comparable attributes, and leveraging the public comprehensibility of the mirror-reverse evaluation function of semantic opposition relationships in the common sense knowledge base, attributes unsuitable for analogical expression are eliminated before the matching stage, avoiding the generation of far-fetched or obscure analogies in popular science texts. The retained comparable attributes are independently retrieved from the common sense knowledge base from both the physical dimension and functional semantic dimension and ranked separately. The statistical significance of ranking consistency is used instead of the direct product of numerical similarity as the joint screening criterion for cross-domain items, so that the finally matched analogies have statistically significant synergistic advantages in both cognitive dimensions, improving the rationality of the selection of analogies and the naturalness of the expression.
[0046] 2. By extracting visual appearance descriptions from the selected optimal analogies and establishing mapping relationships with comparable attributes, and then filling the mapping relationships into the popular science narrative template, the professional trait parameters originally presented in numerical and terminological terms in the knowledge graph are automatically transformed into descriptions of the appearance characteristics of items familiar to the public. This allows the generated popular science text to maintain scientific accuracy while possessing a visual cognitive bridge. The entire process, from attribute identification, analogy verification, cross-domain item matching to analogy text generation, forms a complete information processing chain. Each step involves the automatic processing of knowledge graph data and common sense knowledge base data by the computer, improving the readability and dissemination adaptability of the generated popular science content on local livestock and poultry germplasm resources. Attached Figure Description
[0047] Figure 1 This is a flowchart of the intelligent generation method for popular science content on local livestock and poultry germplasm resources based on knowledge graphs, according to the present invention. Detailed Implementation
[0048] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0049] Example: Figure 1 This invention presents a method for intelligently generating popular science content on local livestock and poultry germplasm resources based on knowledge graphs, which includes the following steps:
[0050] S1: Obtain the trait attributes and attribute value text associated with the target variety entity from the local livestock and poultry germplasm resource knowledge graph;
[0051] S2: Perform pattern matching on the attribute value text. If it is found that it contains both a numeric substring and a functional description substring, then mark the trait attribute as a comparable attribute.
[0052] S3: Use the functional description substring of each comparable attribute as a search term, query the reverse functional description substring in the common sense knowledge base that is semantically opposite to it, and obtain the ratio of the number of item items associated with each of the two substrings as the cognitive coverage. If it is lower than the preset coverage threshold, the comparable attribute is removed.
[0053] S4: For each retained comparable attribute, retrieve the common sense knowledge base based on the numerical substring and the functional description substring to obtain the first item set ranking and the second item set ranking. Calculate the local significance level of the rank correlation coefficient of each candidate item in the two item set rankings. Only retain the candidate comparable items with significance higher than the preset significance threshold and use the normalized significance as the analogy matching degree.
[0054] S5: Select the candidate analogous items with the highest analogy matching degree, extract their visual appearance descriptions, and establish an analogy mapping relationship between comparable attributes and visual appearance descriptions;
[0055] S6: Fill the analogy mapping relationship into the description position corresponding to the comparable attribute in the popular science narrative template to generate popular science content text with analogy.
[0056] This process extracts all trait attribute triples associated with target breed entities from a pre-constructed knowledge graph of local livestock and poultry germplasm resources. The construction process of the knowledge graph is as follows: Local livestock and poultry breeds already included in Anhui Province are abstracted into breed entities, each assigned a unique breed identifier, and stored as nodes in the graph database. Each breed entity is connected to at least one attribute value node through outgoing relationships, the type of which is labeled as the attribute name. Attribute value nodes store attribute value fields and attribute type fields. The content of the attribute value field can be numeric, string, or a composite structure, while the attribute type field distinguishes whether the attribute belongs to a biological trait, a breeding management trait, or a cultural descriptive trait. The initial data for the knowledge graph comes from the breed registration database of the livestock and poultry genetic resource gene bank and published breed literature. A data import script reads the basic breed information table and trait measurement table from the relational tables of the breed registration database. The breed name and breed number from the basic breed information table are imported as breed entities, and the measurement index names from the trait measurement table are used as attribute names. Measurement results and units are combined and stored in the attribute value field. The attribute type field is labeled as biological trait or non-biological trait according to a pre-compiled biological trait mapping table. The biological trait mapping table is compiled as follows: experts in the field of livestock and poultry genetic resources list all indicator names related to the breed's physiological characteristics and production performance according to the germplasm resource identification and evaluation standards. Examples include daily weight gain, feed conversion ratio, intramuscular fat content, backfat thickness, hair density, cold resistance grade, and roughage tolerance score. Each of the listed indicator name strings is entered into the mapping table, with each indicator name corresponding to the attribute type "biological trait". After the knowledge graph is constructed, the graph database is deployed in a queryable computing environment. When generating popular science content for a specific breed, the breed identifier of the target breed entity is obtained from external input, such as the breed name string "Huoshou Black Pig". A graph traversal query is submitted using the query interface provided by the graph database, starting with the breed identifier of the target breed entity. The query condition is set to expand one step along all outgoing relationships from the starting point, obtaining all directly related attribute names and attribute value nodes. The query result set contains multiple records, each consisting of an attribute name, attribute value field, and attribute type field. The records in the result set are organized into triples, each containing the breed entity identifier, attribute name, and attribute value field, forming triples of all trait attributes extracted from the local livestock and poultry germplasm resource knowledge graph.
[0057] The process involves filtering attribute triples from all trait attribute triples that specify "biological trait" as the attribute type. In each extracted trait attribute triple, the attribute value node carries an attribute type field that was labeled according to the biological trait mapping table during the knowledge graph construction phase. During filtering, all trait attribute triples are traversed, and the string value of the attribute type field stored in the attribute value node of each triple is read. This string value is then compared with the preset string "biological trait," retaining all triples where the attribute type field equals "biological trait" and discarding those where the attribute type field equals any other string. If the knowledge graph does not uniformly store the attribute type field in the attribute value node during construction but instead uses attribute name matching, a predefined set of biological trait attribute names needs to be introduced during filtering. This set is generated by domain experts compiling several standard attribute name strings based on livestock and poultry germplasm resource evaluation standards, and then combining these standard attribute name strings into a set. During the filtering process, the attribute name string in each triplet is compared with the set of biological trait attribute names. If the attribute name belongs to the set of biological trait attribute names, the triplet with that attribute name is retained. When using the attribute name set method, it is necessary to ensure that the attribute names used in the knowledge graph construction are completely consistent with the standard names in the biological trait attribute name set. For synonymous attribute names, all attribute names must be normalized before filtering. Normalization includes replacing synonymous attribute names with standard name strings. This embodiment uses attribute type fields to ensure filtering accuracy and efficiency.
[0058] The attribute value field in the selected attribute triples is parsed into attribute value text, and the attribute name field in the selected attribute triples is used as the trait attribute. These are combined to obtain the trait attribute and its attribute value text. For each attribute triple with the attribute type being a biological trait, the original content of the attribute value field stored in the attribute triple is retrieved. The original content of the attribute value field is stored in the knowledge graph in formats including plain text strings, numerical structures with units, enumeration strings, or range strings. During parsing, the data type identifier of the attribute value field is first checked. If the data type is a string and does not contain any preset numerical markers, the string of the attribute value field is directly used as the attribute value text. If the data type is a numerical structure with units, the number in the numerical part and the unit abbreviation in the unit part are extracted. The number is converted into the literal corresponding to an integer or floating-point number, and then the literal and the unit abbreviation are concatenated to form a continuous string, which is the attribute value text. For example, if the attribute value field stores the numerical value 3.8 and the unit percentage, the numerical value 3.8 and the unit abbreviation symbol %, are extracted and concatenated to form the string "3.8%" as the attribute value text. If the attribute value field stores an enumeration string, the enumeration string is directly used as the attribute value text. For example, the enumeration string "yellowish-brown" is directly used as the attribute value text. If the attribute value field stores a range string, the original style of the range string is maintained as the attribute value text. For example, the range string "1.2 to 1.5" is directly used as the attribute value text. The string of the attribute name field in the filtered attribute triples is directly assigned to the trait attribute variable. The trait attribute variable is paired with the parsed attribute value text to establish a mapping pair from trait attribute to attribute value text. The mapping pair serves as the basis for data transfer in subsequent steps. For example, for a triple with the attribute name "intrinsic fat content", the parsed attribute value text is "3.8%", and the trait attribute is "intrinsic fat content", the combination gives the correspondence between "intrinsic fat content" and "3.8%"; for a triple with the attribute name "coat color", the parsed attribute value text is "yellowish-brown", and the trait attribute is "coat color", the combination gives the correspondence between "coat color" and "yellowish-brown". After completing the parsing of attribute value fields and the combination of trait attributes, the trait attributes and their attribute value text associated with the target variety entity were obtained from the local livestock and poultry germplasm resource knowledge graph, providing a complete and standardized input for subsequent identification of comparable attributes.
[0059] The attribute value text is segmented and tagged with parts of speech, and numerical segments are extracted as numerical substrings. The attribute value text is the attribute value text obtained from the trait attributes and their attribute value texts in step S1. For example, "intramuscular fat content" corresponds to the attribute value text "3.8%", "coat color" corresponds to the attribute value text "yellowish-brown", and "daily weight gain" corresponds to the attribute value text "530 grams". Segmentation and tagged with parts of speech are performed using a pre-deployed Chinese word segmentation tool. This tool has a built-in general vocabulary and tagged with parts of speech, dividing the input attribute value text into a segmented sequence and tagging each segment with a corresponding part of speech label. For example, for the attribute value text "3.8%", the output of the Chinese word segmentation tool is the segment "3.8" tagged with the part of speech label "numeral", and the segment "%" tagged with the part of speech label "punctuation". For the attribute value text "530 grams", the output is the segment "530" tagged with the part of speech label "numeral", and the segment "gram" tagged with the part of speech label "quantifier". Taking the attribute value text "yellowish-brown" as an example, the output is the word segment "yellowish-brown" labeled with the part-of-speech tag "adjective". After word segmentation and part-of-speech tagging, each word in the segmentation sequence is traversed, and each word's corresponding part-of-speech tag is checked to see if it belongs to a preset set of numerical part-of-speech tags. The set of numerical part-of-speech tags includes two types of tags: "numeral" and "quantifier". If the part-of-speech tag corresponding to a word is "numeral", then the word is extracted into a numerical substring. If the part-of-speech tag corresponding to a word is "quantifier", then the word is appended and merged to the end of the immediately preceding word that has been extracted into a numerical substring to form a complete numerical substring. For example, for the word segmentation sequence "530 / numeral, gram / quantifier", "530" is extracted into a numerical substring and "gram" is merged to obtain the numerical substring "530 gram". For the word segmentation sequence "3.8 / numeral, % / punctuation", "3.8" is extracted into a numerical substring, and the punctuation marks are not included in the merging, so the numerical substring is "3.8". If the attribute value text does not contain any words whose part-of-speech tags belong to the set of numeric part-of-speech tags, it indicates that the attribute value text does not contain numeric substrings.
[0060] The descriptive text, excluding the numerical substring, is extracted from the attribute value text. Dependency parsing is then performed on the descriptive text to extract the overlay text fragments of the syntactic subtree that function as the attribute description. After extracting the numerical substring, the character fragments matching the numerical substring in the attribute value text are deleted; the remaining string is the descriptive text. For example, with the attribute value text "530 grams," the numerical substring is "530 grams," and deleting "530 grams" results in an empty descriptive text. Similarly, with the attribute value text "muscle fat content 3.8%," the numerical substring is "3.8%," and deleting it results in "muscle fat content." If the attribute value text is "yellowish-brown," and no numerical substring is extracted, the descriptive text is equal to the attribute value text "yellowish-brown." When performing dependency parsing on the descriptive text, a pre-deployed dependency parsing tool is used. This tool constructs a dependency parsing tree from the descriptive text. Each node in the dependency parsing tree corresponds to a word, and the directed edges between nodes represent the syntactic dependency relationships between words. The directed edges are labeled with the dependency relationship type, which includes subject-verb, verb-object, attributive-head, adverbial-head, and coordinate relationships. After performing dependency parsing, the syntactic subtrees that carry the attribute function description role are located in the dependency parsing tree. These subtrees are those rooted at attribute function words. The identification method for attribute function words is as follows: all nodes in the dependency parsing tree are traversed, and the words corresponding to the nodes are matched with a pre-constructed attribute function vocabulary list. This list contains typical words that carry the trait description function in the context of livestock and poultry germplasm resource description, such as "content," "density," "thickness," "grade," "rating," "heavy," "high," "low," "strong," "weak," "resistant," and "tolerant." If a node's corresponding word matches the attribute function vocabulary, then the subtree rooted at the node corresponding to the matched word is determined as the syntactic subtree that assumes the attribute function description role. The text fragment obtained by concatenating all words covered by the syntactic subtree assuming the attribute function description role in their original word order is the function description substring. For example, if the description text is "muscle fat content", and "content" matches the attribute function vocabulary in the dependency syntax tree, the subtree rooted at "content" covers all words in "muscle fat content", and the function description substring is "muscle fat content". Similarly, if the description text is "daily weight gain", and "weight gain" matches the attribute function vocabulary in the dependency syntax tree, the function description substring is "daily weight gain". Likewise, if the description text is "backfat thickness", and "thickness" matches the attribute function vocabulary in the dependency syntax tree, the function description substring is "backfat thickness". If the description text is an empty string or no node in the dependency syntax tree matches the attribute function vocabulary, then the attribute value text does not have a function description substring.
[0061] Determine whether the attribute value text contains both a numeric substring and a functional description substring. If both exist, mark the morphological attribute as a comparable attribute. Extract the morphological attribute variable from the mapping pairs of morphological attributes and their attribute value texts obtained in step S1, using this as the current morphological attribute to be judged. Check whether the numeric substring was successfully extracted after performing the aforementioned word segmentation and part-of-speech tagging on the attribute value text, and check whether the functional description substring was successfully extracted after performing the aforementioned description text separation and dependency parsing on the attribute value text. If both the numeric substring extraction result and the functional description substring extraction result are not empty, then the attribute value text is determined to contain both a numeric substring and a functional description substring, and the corresponding morphological attribute is marked as a comparable attribute. The comparable attribute marking is achieved by appending a Boolean flag to the morphological attribute variable. A Boolean flag set to true indicates that the morphological attribute has been marked as a comparable attribute. Subsequent steps can determine whether a morphological attribute is a comparable attribute based on whether the corresponding Boolean flag is set to true when processing the morphological attribute. If the extracted numerical substring or functional description substring is empty, it is determined that the attribute value text does not simultaneously contain both a numerical substring and a functional description substring. Therefore, the corresponding trait attribute is not marked, and it will not be included in the comparable attribute set for processing in subsequent steps. Through the above judgment process, comparable attributes are selected from all trait attributes obtained in step S1. Each comparable attribute carries both a corresponding numerical substring and a functional description substring, which are passed to subsequent steps as supplementary data along with the comparable attribute.
[0062] Using functional descriptive substrings as search terms, the system queries the common sense knowledge base for inverse functional descriptive substrings that have a semantically opposite relationship to the functional descriptive substrings. The functional descriptive substrings originate from the functional descriptive substrings carried by the trait attributes marked as comparable attributes in step S2. For example, a functional descriptive substring might be "cold resistance level" or "roughage tolerance score." The common sense knowledge base is a general common sense knowledge graph constructed independently of the local livestock and poultry germplasm resource knowledge graph. It uses everyday objects, common concepts, and things familiar to the public as entity nodes, connected by semantic relationship edges. These semantic relationship edges include synonymous edges, antonymous edges, hierarchical edges, attribute association edges, and functional association edges. The data used to construct the common sense knowledge base comes from publicly available common sense knowledge graph datasets and manually verified corpora of everyday object attributes. Each entity node carries at least an item description field and an item category field. The item description field includes common sense descriptions across multiple dimensions, such as visual appearance attributes, functional attributes, typical size, and typical weight. The common sense knowledge base maintains a dedicated antonym tagging dictionary, stored in key-value pair format. The key in each key-value pair represents a positive term, and the value represents a semantically opposite antonym. The antonym tagging dictionary is constructed as follows: Name tags are extracted from all entity node pairs with antonym-annotated edges in the common sense knowledge base. The positive and negative concept words in each pair of name tags are then entered. An externally available antonym dictionary is used as a supplementary source. Antonym pairs in the externally available antonym dictionary are manually reviewed, and antonym pairs that are inapplicable in the context of livestock and poultry trait descriptions are removed before being entered into the dictionary. The antonym tagging vocabulary contains multiple sets of general antonym pairs, such as "strong" and "weak," "high" and "low," "thick" and "thin," "resistant" and "intolerant," "resistant" and "susceptible," "dense" and "sparse," "heavy" and "light," and "fast" and "slow." When querying semantic antonyms, the functional description string is mapped to a semantic vector. This mapping operation uses a pre-trained static word embedding model, which maps a word or phrase to a fixed-dimensional real-valued vector. The functional description string is input into the static word embedding model, which outputs the corresponding semantic vector. After obtaining the semantic vector of the functional descriptor substring, all key-value pairs in the antonym tagging vocabulary of the commonsense knowledge base are traversed. For each key-value pair in the antonym tagging vocabulary, the key is also mapped to a semantic vector through the same static word embedding model. The cosine distance between the semantic vector of the functional descriptor substring and the semantic vector of each key is calculated. The cosine distance is calculated by dividing the inner product of the two vectors by the product of their moduli. The value in the key-value pair corresponding to the key with the smallest cosine distance is taken as the reverse functional descriptor substring.For example, if the functional description substring is "cold resistance level", the static word embedding model maps the functional description substring to a semantic vector, and then calculates the cosine distance between it and the semantic vector of each key in the antonym tagging vocabulary. The key with the smallest cosine distance is "resistant", and the value corresponding to the key "resistant" is "susceptible". Therefore, the reverse functional description substring is "susceptible to cold". For example, if the functional description substring is "coarse feed tolerance score", the key with the smallest cosine distance is "tolerant", and the value corresponding to the key "tolerant" is "intolerant". Therefore, the reverse functional description substring is "intolerant to coarse feed score". If there are no words in the functional description substring that match the key in the antonym tagging vocabulary, it is considered that there is no reverse functional description substring with a semantic opposition in the common sense knowledge base, and the cognitive coverage is assigned the preset maximum default value.
[0063] This function retrieves the number of item entries directly associated with a functional description substring in the common knowledge base, and simultaneously retrieves the number of item entries directly associated with the reverse functional description substring in the common knowledge base. Each entity node in the common knowledge base carries a set of directly associated item description tags, which originate from the entity node's functional attribute field and the associated entity nodes pointed to by the attribute association edges. To retrieve the number of associated item entries, the functional description substring is used as the query string. A full-text search or exact match of the attribute field is performed in the common knowledge base. The number of entity nodes in the common knowledge base whose item description tags contain the functional description substring, or whose functional attribute fields contain the functional description substring, is counted. The resulting number of entity nodes is taken as the number of item entries directly associated with the functional description substring in the common knowledge base. The method for obtaining the number of item entries associated with a reverse functional description substring is the same as that for obtaining the number of item entries associated with a functional description substring. The reverse functional description substring is used as a query string, and a full-text search or exact match of attribute fields is performed in the common knowledge base. The number of entity nodes in the common knowledge base whose item description tags contain the reverse functional description substring, or the number of entity nodes in the common knowledge base whose functional attribute fields contain the reverse functional description substring, is counted. The counted number of entity nodes is taken as the number of item entries directly associated with the reverse functional description substring in the common knowledge base. For example, if the functional description substring is "cold resistance level", the common knowledge base is queried for entity nodes whose item description tags contain "cold resistance", or whose functional attribute fields contain "cold resistance", and the number of matched entity nodes is counted. Similarly, if the reverse functional description substring is "susceptibility to cold", the same query method is used to query for entity nodes whose item description tags contain "susceptibility to cold", or whose functional attribute fields contain "susceptibility to cold", and the number of matched entity nodes is counted. The number of item entries associated with the function description substring in the common sense knowledge base reflects the richness of the corresponding items that can be found in the common sense knowledge base for the function attribute described by the function description substring. The number of item entries associated with the reverse function description substring reflects the richness of the corresponding items that can be found in the common sense knowledge base for the function attribute described by the reverse function description substring.
[0064] The ratio of the number of item entries associated with the reverse functional description substring to the number of item entries associated with the functional description substring is calculated, and this ratio is used as the cognitive coverage. Specifically, the number of item entries associated with the reverse functional description substring is used as the numerator, and the number of item entries associated with the functional description substring is used as the denominator. A division operation is then performed to obtain the ratio. If the number of item entries associated with the functional description substring is zero, the denominator is zero, and the ratio is meaningless. In this case, the cognitive coverage is directly assigned a preset maximum default value, which is set to a value much larger than a preset coverage threshold. For example, if the preset coverage threshold is 1, the preset maximum default value is set to 999. Cognitive coverage reflects the proportional relationship between the public's clarity of understanding of the reverse attribute of the functional attribute described by the functional description substring in the common sense knowledge base and their clarity of understanding of the positive attribute. When the number of item entries associated with the reverse functional description substring is much larger than the number of item entries associated with the functional description substring, the ratio is greater than 1, indicating that the public's understanding of the reverse attribute is clearer than their understanding of the positive attribute, and the positive attribute lacks a stable basis of comparable items in the public's common sense.
[0065] The system determines whether the cognitive coverage is below a preset coverage threshold. If it is, the comparable attribute is removed from the comparable attribute set. The preset coverage threshold is set as follows: Multiple labeled comparable attributes of different breeds are selected from the local livestock and poultry germplasm resource knowledge graph as a calibration sample set. Step S3 is performed on each comparable attribute in the calibration sample set to calculate the cognitive coverage. The reasonableness of each comparable attribute in the calibration sample set for subsequent analogy generation is manually evaluated, and its suitability for analogy generation is marked. The pass rate of comparable attributes deemed suitable for analogy generation under different ratios is statistically analyzed. A graph showing the pass rate versus the ratio is plotted. The ratio corresponding to the start of a significant decrease in the pass rate curve is selected as the preset coverage threshold; for example, the preset coverage threshold is set to 1. If the cognitive coverage of a comparable attribute is lower than a preset coverage threshold, it indicates that the number of item items associated with the functional description substring is greater than the number of item items associated with the reverse functional description substring, or the two numbers are close. The item base corresponding to the functional description substring in the common sense knowledge base is relatively sufficient, making it suitable for participating in subsequent analogy generation, and the comparable attribute is retained. If the cognitive coverage of a comparable attribute is not lower than the preset coverage threshold, it indicates that the number of item items associated with the reverse functional description substring is greater than the number of item items associated with the functional description substring. The public's understanding of the reverse attribute is clearer than that of the positive attribute. It is difficult to find stable comparable items for the positive attribute in the common sense knowledge base. Forcibly generating an analogy may lead to a far-fetched or obscure analogy, and the comparable attribute is removed from the comparable attribute set. The removal operation is to delete the record corresponding to the comparable attribute in the comparable attribute set. The removed comparable attributes do not enter the processing flow of step S4, and the comparable attributes that are not removed continue to be passed to step S4 with the numerical substring and functional description substring generated in step S2.
[0066] The numerical substrings are mapped to physical units. The physical units are then used to retrieve the physical unit index from the common sense knowledge base to obtain the first item set. The items in the first item set are then sorted in descending order according to the similarity of their physical units, resulting in the first item set's sorting. The numerical substrings originate from the numerical substrings carried by the comparable attributes retained in step S3, for example, the numerical substring "530 grams" or "3.8%". The physical unit mapping is achieved by parsing the unit abbreviations at the end of the numerical substrings. A mapping table of unit abbreviations to physical units is pre-constructed, recording the correspondence between common unit abbreviations and physical units, such as grams corresponding to mass, centimeters to length, and percentages to dimensionless proportions. The numerical part and the unit part are separated from the numerical substring. The unit part is searched for its corresponding physical unit in the mapping table. If a corresponding physical unit is found, the numerical substring is mapped to that physical unit; otherwise, it is mapped to a default numerical unit. The physical dimension index of the common sense knowledge base is retrieved using physical dimensions. This index is an inverted index built based on the dimension of the physical attribute tags of all item entries in the knowledge base. It is pre-generated during the construction of the knowledge base. The index key is the physical dimension name, and the index value is a list of item entries carrying the corresponding physical attribute tags for each physical dimension name. During retrieval, the mapped physical dimension is used as the index key, and the corresponding list of item entries is directly retrieved from the physical dimension index, forming the first item set. The physical dimension approximation degree is calculated for each item in the first item set, calculated as: d = |NM|; where d represents the physical dimension approximation degree, N represents the numerical variable obtained after converting the numerical part of the numerical substring, and M represents the typical value recorded under the physical attribute tag for the item. The items in the first item set are sorted in descending order by physical dimension approximation degree, with items having smaller d values ranking higher. The first item is the one with the smallest d value. If the first item set is empty, no sorting of the first item set will be generated, and the corresponding comparable attributes will be considered as having no common items in the subsequent judgment of the common occurrence of candidate items.
[0067] The functional description substrings are mapped to functional semantic vectors. These functional semantic vectors are then used to retrieve the functional semantic index of the common sense knowledge base, resulting in a second item set. The items in the second item set are then sorted in descending order based on their functional semantic similarity, resulting in a sorted second item set. The functional description substrings originate from the comparable attributes retained in step S3, such as "cold resistance level" or "coarse feed tolerance score." Mapping the functional description substrings to functional semantic vectors uses the same static word embedding model as in step S3. The functional description substrings are input into the static word embedding model to obtain the corresponding functional semantic vectors. The functional semantic index of the common sense knowledge base is an approximate nearest neighbor retrieval index constructed based on semantic vectors from the functional attribute fields of all item entries in the common sense knowledge base. A hierarchical, navigable small-world graph structure is used to store the functional semantic vectors of all item entries. During retrieval, the functional semantic vector is input as the query vector into the functional semantic index of the common sense knowledge base. The functional semantic index of the common sense knowledge base returns the K item entries with the smallest cosine distance to the query vector. The value of K is determined based on the total number of item entries in the common sense knowledge base; for example, a value of K of 50 constitutes the second item set. For each item in the second item set, a functional semantic similarity score is calculated as: s = 1 - c; where s represents the functional semantic similarity score, and c represents the cosine distance between the query vector and the functional semantic vector of the item entry. The items in the second item set are sorted in descending order according to their functional semantic similarity scores, with items having a larger s value ranking higher. The first item is the one with the largest s value. If the second item set is empty, no ranking is generated, and the corresponding comparable attributes are considered as having no common items in subsequent candidate item co-occurrence judgments.
[0068] For each candidate item that appears in both the first and second item set sorting, extract its first ranking number in the first item set sorting and its second ranking number in the second item set sorting. A candidate item that appears in both item sets is defined as an item that exists in both sorted lists. Iterate through the first item set sorting list, performing a search and matching operation on each item in the first item set sorting list within the second item set sorting list. If a matching item is found, it is considered a candidate item. For each candidate item, record its position in the first item set sorting list as its first ranking number, starting from 1 and incrementing, with the first-ranked item having a first ranking number of 1. Record its position in the second item set sorting list as its second ranking number, with the first-ranked item having a second ranking number of 1. For example, if a candidate item is ranked 5th in the first item set sorting list, its first ranking number is 5; if it is ranked 3rd in the second item set sorting list, its second ranking number is 3. The first and second ranking numbers of all candidate items form a ranking pair sequence, which is used for subsequent Kendall rank correlation coefficient calculation and local significance level analysis.
[0069] Calculate the Kendall's rank correlation coefficient between the first and second ranking indices of all candidate items, and for each candidate item, calculate the local significance level of its ranking pair under the Kendall's rank correlation coefficient. The Kendall's rank correlation coefficient is calculated as: τ = (AB) / [n × (n-1) / 2]; where τ represents the Kendall's rank correlation coefficient, A represents the number of consistent ranking pairs in the first and second ranking sequences, B represents the number of inconsistent ranking pairs in the first and second ranking sequences, and n represents the number of candidate items. The value of τ ranges from -1 to 1. The closer τ is to 1, the stronger the positive correlation between the two rankings, meaning the more consistent the ranking order of the candidate items in the first and second item sets; the closer τ is to -1, the stronger the negative correlation between the two rankings. When calculating the local significance level for each candidate item, for the current candidate item, its first and second ranking numbers are paired. The probability that the pair will appear in the actual ranking under the current conditions τ and n is calculated. The reference distribution for probability calculation is the sampling distribution of τ. When n is less than a preset number, the exact distribution table is used for lookup; when n is not less than the preset number, a normal approximation is used. The preset number is 30. The local significance level is defined as the p-value of the one-tailed test of the ranking pair. The smaller the p-value, the more statistically significant the consistency of the ranking pair is, meaning that the situation where a candidate item ranks highly in both the first and second item sets is less likely to be caused by random factors. If n is less than 2, τ cannot be calculated, and the local significance level for each candidate item is assigned a value of 1.
[0070] Candidate analogies with local salience levels higher than a preset salience threshold are retained. The local salience levels of the retained candidate analogies are normalized, and the normalized local salience level is used as the analogy matching degree. The preset salience threshold is set as follows: Preliminary steps S2 to S4 are run on multiple breed samples in the local livestock and poultry germplasm resource knowledge graph to collect candidate items and their local salience levels under different comparable attributes. The appropriateness of the analogy between each candidate item and its corresponding comparable attribute is manually labeled, categorized as appropriate or inappropriate. The proportion of appropriate analogies among the retained candidate items under different salience thresholds is calculated, i.e., the precision rate. A curve showing the precision rate changing with the threshold is plotted. The lowest local salience level corresponding to the precision rate reaching the preset precision rate level is selected as the preset salience threshold, with a preset precision rate value of 0.8. For example, the preset salience threshold is set to 0.05. For candidate items with a local significance level higher than a preset significance threshold, if the candidate item is statistically significantly ranked high in both the first and second item sets, it is retained as a candidate analogy item. For candidate items with a local significance level not higher than the preset significance threshold, they are eliminated. Normalization is performed using maximum value normalization: the maximum local significance level pmax among all retained candidate analogy items is calculated, and the local significance level p of each retained candidate analogy item is divided by pmax to obtain the normalized local significance level. This normalized local significance level is used as the analogy matching degree. The closer the analogy matching degree is to 1, the higher the degree of analogy matching between the candidate analogy item and the comparable attribute. After step S4, each comparable attribute is associated with a set of candidate analogy items and their analogy matching degrees, which are then passed to step S5 to establish the analogy mapping relationship.
[0071] For each comparable attribute, select the candidate comparable item with the highest analogy matching degree from the candidate comparable items and their analogy matching degrees passed in step S4. The output of step S4 is a set of candidate comparable items associated with each comparable attribute. Each candidate comparable item is accompanied by an analogy matching degree, which is a normalized local significance level. The value of the analogy matching degree ranges from 0 to 1. The closer the analogy matching degree is to 1, the higher the degree of analogy matching between the candidate comparable item and the comparable attribute. When selecting the candidate comparable item with the highest analogy matching degree, iterate through all candidate comparable items associated with the comparable attribute, compare the analogy matching degree values of each candidate comparable item, retain the candidate comparable item with the largest analogy matching degree value, and discard the other candidate comparable items. If there is only one candidate comparable item associated with the comparable attribute, then that single candidate comparable item is the candidate comparable item with the highest analogy matching degree. If multiple candidate analogy items have the same and maximum analogy matching degree, one candidate analogy item is randomly selected from these multiple candidate analogy items with equal analogy matching degrees, or the candidate analogy item is selected by lexicographically sorting the candidate analogy items according to their item entry numbers in the common sense knowledge base. The selected candidate analogy item serves as the single analogy item used for the comparable attribute in subsequent analogy mappings, and each comparable attribute ultimately corresponds to one selected candidate analogy item.
[0072] The system retrieves the item description fields of candidate analogous items from the common sense knowledge base, extracting text fragments labeled as visual appearance attributes from these fields as visual appearance descriptions. Each item entry in the common sense knowledge base contains an item description field, which is a structured data block organized in attribute name-value pairs. The item description field contains multiple dimensions of descriptive attributes, such as functional attributes, visual appearance attributes, typical dimensions, typical weight, material attributes, and applicable scenario attributes. Visual appearance attributes are determined manually or automatically during the common sense knowledge base construction phase. The annotation method for visual appearance attributes is as follows: for each item entry in the common sense knowledge base, the corresponding item type is analyzed, and sentence fragments describing the item's shape, color, texture, and other visual features are extracted from the encyclopedia entries or product descriptions of the item type. These extracted sentence fragments are stored in the item description field, and the attribute name is labeled as a visual appearance attribute. The attribute name for visual appearance is uniformly identified by the string "visual appearance". The attribute value is natural language text describing the shape characteristics of the item. For example, for the item "rugby", the attribute value could be "an ellipsoid with pointed ends and a bulging middle", and for the item "down jacket", the attribute value could be "a fluffy and thick coat shape". During a query, the query interface provided by the common sense knowledge base is used, with the unique identifier of the selected candidate analogous items as the query condition. A query request is submitted to obtain the complete item description field of the item. In the obtained item description field, all attribute name-value pairs are iterated through, and the attribute name string is searched for that is equal to "visual appearance". The attribute value text in the found attribute name-value pair is used as the visual appearance description. If the item description field of a candidate analogy item does not contain an attribute named "visual appearance," then the attribute value most relevant to the appearance description is extracted from the item description field. The most relevant attribute is determined by checking if the attribute name contains keywords such as "shape," "color," "appearance," or "form." If it does, the attribute value corresponding to that keyword is used as the visual appearance description. If no attribute name containing the keyword exists, the item's name tag is used as the visual appearance description. The extracted visual appearance description is a natural language text fragment, which will be directly used in subsequent template filling to describe the appearance of the analogous object with comparable attributes.
[0073] The attribute names of comparable attributes are associated with the visual appearance descriptions of candidate comparable items, establishing an analogy mapping relationship between comparable attributes and visual appearance descriptions. The attribute names of comparable attributes are derived from the trait attributes combined in step S1, such as "intramuscular fat content," "back fat thickness," and "cold resistance level." The associated storage uses a key-value pair data structure, where the key is the string representing the attribute name of the comparable attribute, and the value is the text string representing the visual appearance description. These key-value pairs together constitute an analogy mapping relationship record. The analogy mapping relationship record corresponding to each comparable attribute is stored in an analogy mapping relationship set, organized as a list or mapping table. For example, for the comparable attribute named "cold resistance level," with a visual appearance description of "fluffy and thick coat shape," the generated analogy mapping relationship record would be: key "cold resistance level" corresponding to value "fluffy and thick coat shape." For example, an analogous attribute named "back fat thickness" has a visual appearance description of "an ellipsoid with pointed ends and a bulging middle." The generated analogy mapping record is: key "back fat thickness" corresponds to value "an ellipsoid with pointed ends and a bulging middle." For analogous attributes for which no visual appearance description was successfully extracted, the numerical substring of the analogous attribute is directly used as the visual appearance description for associated storage to ensure the integrity of the analogy mapping. After all analogous attributes are associated and stored, the resulting set of analogy mappings contains the mapping from each analogous attribute to the visual appearance description of the analogous item. This set of analogy mappings is passed to step S6 for filling the science popularization narrative template and generating science popularization content text with analogies.
[0074] The process involves analyzing a popular science narrative template and locating the template fragment corresponding to the description position marked as an analogous attribute. The popular science narrative template is a pre-written text template containing fixed introductory text about the target breed and placeholders reserved for analogous attributes. These placeholders are annotated using a specific markup syntax. This syntax involves embedding attribute name strings enclosed in double curly braces within the text. The attribute name strings are identical to the attribute names of the combined traits obtained in step S1. For example, a popular science narrative template might contain the text: “{breed name} is an excellent local livestock breed in my country. This breed has {intramuscular fat content}, {backfat thickness}, and {cold resistance level}.” Here, “{breed name}” is the breed name placeholder, “{intramuscular fat content}” is the description position marked as an analogous attribute, “{backfat thickness}” is the description position marked as an analogous attribute, and “{cold resistance level}” is the description position marked as an analogous attribute. When parsing a science popularization narrative template, regular expressions or a template parser are used to scan the entire text content of the template, searching for all marked fragments that conform to the placeholder syntax rules. These fragments are then marked as descriptive positions for comparable attributes. The smallest independent text unit containing each found marked fragment is used as a template fragment. This smallest independent text unit can be a complete sentence separated by periods or clauses separated by commas, depending on the granularity of the science popularization narrative template. The result is a list of template fragments, where each fragment records its start and end positions within the template and its text content. Template fragments that do not contain any placeholders are marked as fixed template fragments, and their text content remains unchanged in subsequent processing.
[0075] For each comparable attribute, extract the corresponding visual appearance description from the analogy mapping relationship and write the visual appearance description into the located template fragment. The analogy mapping relationship comes from the analogy mapping relationship set output in step S5, which contains the mapping from each comparable attribute to the visual appearance description. Iterate through each analogy mapping relationship record in the analogy mapping relationship set from step S5. For each record, extract the attribute name string of the comparable attribute and search the template fragment list for a template fragment where the attribute name string in the placeholder matches the attribute name string of the comparable attribute. The matching method between the attribute name string in the placeholder and the attribute name string of the comparable attribute is as follows: extract the text string within the double curly braces of the placeholder and perform a complete string equality comparison with the attribute name string of the comparable attribute. If a match is found, extract the corresponding visual appearance description from the analogy mapping relationship record and write the visual appearance description into the successfully matched template fragment, replacing the original placeholder text. When writing the visual appearance description, natural language processing is performed to connect the visual appearance description with the preceding and following texts in the template fragment. This natural language connection process includes adding connector words before and after the visual appearance description text. The connector words are selected from a pre-defined connector vocabulary list based on the existing sentence structure in the context of the template fragment. The pre-defined connector vocabulary list contains multiple conjunctions, such as "like," "as if," "as if," "like," "same," and "generally." If the visual appearance description text itself already contains a complete sentence expression, it is directly embedded without adding connector words. Simultaneously, the numerical substrings corresponding to the comparable attributes are also written into the template fragment. These numerical substrings originate from the data generated in step S2 and passed along with the comparable attributes to step S6. The numerical substrings are written either before or after the visual appearance description, with the writing order determined by the sentence structure of the template fragment, ensuring that the generated sentences conform to Chinese expression habits.
[0076] The template fragments containing the visual appearance description are merged with the remaining template fragments in the popular science narrative template to form a popular science content text with analogies. After writing the visual appearance descriptions for all template fragments corresponding to the comparable attributes, all template fragments in the template fragment list are reassembled in their original order in the popular science narrative template. During assembly, the fixed template fragments retain their original text content, while the template fragments containing the visual appearance descriptions use the newly generated text content. The template fragments are connected with the original punctuation marks or spaces to ensure the coherence and readability of the merged popular science content text. If there is a variety name placeholder in the popular science narrative template, the variety name of the target variety entity is filled into the variety name placeholder. The variety name of the target variety entity is obtained from the variety identifier of the target variety entity queried in step S1. The complete text obtained after assembly is the popular science content text with analogies. In the popular science content text with analogies, the descriptions of comparable attributes have been directly replaced from the original parameter values with popular expressions containing visual appearance descriptions of comparable items. The analogy-based popular science text, as the final output of the entire method, can be directly used for the typesetting and publication of popular science books, the narration scripts for popular science short videos, or for display in popular science exhibitions.
[0077] During the process of writing the visual appearance description into the located template fragment, if an existing visual appearance description of the same category and comparable attributes already exists in the located template fragment, it is determined whether the confidence level of the visual appearance description in the item description field of the candidate comparable item is higher than the confidence level of the original visual appearance description in the corresponding item description field. If it is higher, the original visual appearance description is replaced; otherwise, the original visual appearance description is retained. The confidence level of the visual appearance description is a value stored along with the visual appearance description during the common sense knowledge base construction phase. The confidence level represents the reliability and expressive strength of the visual appearance description in the common sense knowledge base. The initial confidence level is assigned as follows: For visual appearance descriptions automatically extracted from encyclopedia entries, the confidence level is assigned an initial value between 0 and 1 based on the authority level of the extraction source. For example, the initial confidence level for visual appearance descriptions from authoritative encyclopedias is set to 0.8, and the initial confidence level for visual appearance descriptions from open encyclopedias is set to 0.6. For visual appearance descriptions that have undergone manual review and correction, the confidence level is increased by a fixed increment based on the initial value, for example, by 0.1. For cases where the item entry name tag is used as the visual appearance description, the confidence level is directly set to 0.3. During comparison, the item description field of the new candidate analogy item is queried from the common sense knowledge base, and the confidence level value attached to the visual appearance description of the new candidate analogy item is read. At the same time, the item description field of the original candidate analogy item is queried, and the confidence level value attached to the original visual appearance description of the original candidate analogy item is read. The confidence scores of the new visual appearance description are compared with those of the original visual appearance description. If the confidence score of the new visual appearance description is higher than that of the original, the original visual appearance description in the template fragment is replaced with the new one. If the confidence score of the new visual appearance description is not higher than that of the original, the original visual appearance description is retained. This confidence score comparison ensures that the visual appearance descriptions ultimately written into the popular science narrative template are more reliable and expressive texts from the common knowledge base.
[0078] The calculations involved in the embodiments are all dimensionless numerical calculations, and the preset parameters and thresholds in the calculations are set by those skilled in the art according to the actual situation.
[0079] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, in the form of a computer program product.
[0080] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and inventive constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0081] In addition, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module.
[0082] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.
[0083] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0084] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for intelligently generating popular science content on local livestock and poultry germplasm resources based on knowledge graphs, characterized in that: The steps include the following: S1: Obtain the trait attributes and attribute value text associated with the target variety entity from the local livestock and poultry germplasm resource knowledge graph; S2: Perform pattern matching on the attribute value text. If it is found that it contains both a numeric substring and a functional description substring, then mark the trait attribute as a comparable attribute. S3: Use the functional description substring of each comparable attribute as a search term, query the reverse functional description substring in the common sense knowledge base that is semantically opposite to it, and obtain the ratio of the number of item items associated with each of the two substrings as the cognitive coverage. If it is lower than the preset coverage threshold, the comparable attribute is removed. S4: For each retained comparable attribute, retrieve the common sense knowledge base based on the numerical substring and the functional description substring to obtain the first item set ranking and the second item set ranking. Calculate the local significance level of the rank correlation coefficient of each candidate item in the two item set rankings. Only retain the candidate comparable items with significance higher than the preset significance threshold and use the normalized significance as the analogy matching degree. S5: Select the candidate analogous items with the highest analogy matching degree, extract their visual appearance descriptions, and establish an analogy mapping relationship between comparable attributes and visual appearance descriptions; S6: Fill the analogy mapping relationship into the description position corresponding to the comparable attribute in the popular science narrative template to generate popular science content text with analogy.
2. The intelligent generation method for popular science content on local livestock and poultry germplasm resources based on knowledge graphs according to claim 1, characterized in that, S1 includes: Extract all trait attribute triples associated with the target breed entity in the knowledge graph of local livestock and poultry germplasm resources; Filter attribute triples from all trait attribute triples to attribute triples whose attribute type is biological trait; The attribute value field in the filtered attribute triples is parsed into attribute value text, and the attribute name field in the filtered attribute triples is taken as the trait attribute. The trait attribute and its attribute value text are then combined to obtain the trait attribute.
3. The intelligent generation method for popular science content on local livestock and poultry germplasm resources based on knowledge graphs according to claim 1, characterized in that, S2 include: Attribute value text is segmented and part-of-speech tagged, and numerical segmented words are extracted as numerical substrings; Extract the description text other than the numeric substring from the attribute value text, perform dependency parsing on the description text, and extract the overlay text fragment of the syntactic subtree that plays the role of describing the attribute function as the function description substring. Determine whether the attribute value text contains both a numeric substring and a functional description substring. If both exist, mark the trait attribute as a comparable attribute.
4. The intelligent generation method for popular science content on local livestock and poultry germplasm resources based on knowledge graphs according to claim 1, characterized in that, S3 include: Using the functional description substring as a search term, query the common sense knowledge base for inverse functional description substrings that have a semantically opposite relationship with the functional description substring. Get the number of item entries directly associated with the function description substring in the common knowledge base; Get the number of item entries directly associated with the reverse function description substring in the common sense knowledge base; Calculate the ratio of the number of item items associated with the reverse functional description substring to the number of item items associated with the functional description substring, and use the ratio as the cognitive coverage. Determine whether the cognitive coverage is lower than a preset coverage threshold. If it is lower than the preset coverage threshold, remove the comparable attribute from the set of comparable attributes.
5. The intelligent generation method for popular science content on local livestock and poultry germplasm resources based on knowledge graphs according to claim 4, characterized in that, The process of querying the common sense knowledge base for inverse functional description substrings that have a semantic opposition to functional description substrings includes: mapping the functional description substring to a semantic vector, retrieving from the antonym tagging vocabulary of the common sense knowledge base the term with the smallest cosine distance to the semantic vector and labeled as antonym, and using the term as the inverse functional description substring.
6. The intelligent generation method for popular science content on local livestock and poultry germplasm resources based on knowledge graphs according to claim 1, characterized in that, S4 include: The numerical substrings are mapped to physical units, and the physical units index of the common sense knowledge base is retrieved using the physical units to obtain the first item set. The items in the first item set are sorted in descending order according to the similarity of the physical units to obtain the sorting of the first item set. The functional description substring is mapped to a functional semantic vector. The functional semantic vector is used to retrieve the functional semantic index of the common sense knowledge base to obtain the second item set. The items in the second item set are sorted in descending order according to the functional semantic similarity to obtain the sorting of the second item set. For each candidate item that appears in both the first item set sorting and the second item set sorting, extract the first ranking number of the candidate item in the first item set sorting and the second ranking number in the second item set sorting; Calculate the Kendall rank correlation coefficient between the first and second ranking numbers of all candidate items, and calculate the local significance level of the ranking pair under the Kendall rank correlation coefficient for each candidate item; Candidate analogies with local saliency levels higher than a preset saliency threshold are retained. The local saliency levels of the retained candidate analogies are normalized, and the normalized local saliency levels are used as the analogy matching degree.
7. The intelligent generation method for popular science content on local livestock and poultry germplasm resources based on knowledge graphs according to claim 6, characterized in that, Using physical dimensions to retrieve the physical dimension index of the common sense knowledge base, a first item set is obtained, including: matching the physical dimensions with the physical attribute tags of each item entry in the common sense knowledge base, obtaining item entries whose dimensions under the physical attribute tags are consistent with the physical dimensions and incorporating them into the first item set, calculating the absolute value of the difference between the value under the physical attribute tag and the value substring for each item in the first item set, and using the absolute value of the difference as the physical dimension approximation.
8. The intelligent generation method for popular science content on local livestock and poultry germplasm resources based on knowledge graphs according to claim 1, characterized in that, S5 include: For each comparable attribute, select the candidate comparable item with the highest analogy matching degree from the retained candidate comparable items; Query the item description field of candidate analogous items from the common sense knowledge base, and extract the text fragments marked as visual appearance attributes in the item description field as visual appearance descriptions. The attribute names of comparable attributes are associated with the visual appearance descriptions of candidate comparable items and stored together to establish an analogy mapping relationship between comparable attributes and visual appearance descriptions.
9. The intelligent generation method for popular science content on local livestock and poultry germplasm resources based on knowledge graphs according to claim 1, characterized in that, S6 include: Analyze the popular science narrative template and locate the template fragment corresponding to the description position marked as comparable attribute in the popular science narrative template; For each comparable attribute, extract the visual appearance description corresponding to the comparable attribute from the analogy mapping relationship, and write the extracted visual appearance description into the located template fragment. The template fragments written in the visual appearance description are merged with the remaining template fragments in the popular science narrative template to form popular science content text with analogies.
10. The intelligent generation method for popular science content on local livestock and poultry germplasm resources based on knowledge graphs according to claim 9, characterized in that, The extracted visual appearance description is written into the located template fragment, including: if the located template fragment already contains an original visual appearance description of the same category, then it is determined whether the confidence level of the visual appearance description in the item description field of the candidate analogous item is higher than the confidence level of the original visual appearance description in the corresponding item description field. If it is higher, the original visual appearance description is replaced; otherwise, the original visual appearance description is retained.