Nutritionally healthy food domain entity recognition method and apparatus

By combining a hybrid knowledge base architecture with a large language model, the accuracy and efficiency issues of entity recognition in the field of nutritional and health foods have been solved, achieving high-precision and efficient entity recognition and information extraction.

CN120706427BActive Publication Date: 2025-12-16SHANGHAI MENGNIU BIOTECHNOLOGY R & D CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511212017.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-28
Publication Date
2025-12-16
Estimated Expiration
2045-08-28

AI Technical Summary

Technical Problem

Existing named entity recognition technologies suffer from low accuracy and efficiency in the field of nutrition and health foods, especially in the inaccuracy of identifying technical terms, high cost of knowledge base construction and poor real-time performance, and serious ambiguity when applying biomedical tools to the field of nutrition and health.

Method used

Employing a hybrid knowledge base architecture and a large language model, combined with a structured database and a vector library, this approach combines preliminary recognition with enhanced recognition. It utilizes the large language model for context-aware enhanced verification and incorporates a domain-optimized entity recognition model to achieve high-precision and efficient entity recognition.

Benefits of technology

It improves the accuracy and efficiency of entity recognition in the field of nutritional and health foods, reduces the risk of misjudgment by large language models, and achieves high-quality, structured information extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120706427B_ABST
    Figure CN120706427B_ABST
Patent Text Reader

Abstract

The application provides a kind of entity recognition method and device for nutrition and health food field, it is related to food science and technology field, including: receiving the text to be processed containing the named entity of nutrition and health food field;Extract the preliminary recognition entity in the text to be processed;The preliminary recognition entity is input into large language model, and the enhanced recognition entity output by large language model is obtained;Large language model is based on candidate entity information and the context information of preliminary recognition entity in the text to be processed to enhance the verification of preliminary recognition entity, and generate enhanced recognition entity;Determine the named entity in the text to be processed based on enhanced recognition entity.The method and device provided by the application combine preliminary recognition and enhanced recognition, quickly extract preliminary recognition entity, and introduce large language model retrieval enhancement generation technology for context-aware enhancement verification, which greatly improves the accuracy and efficiency of entity recognition for nutrition and health food field.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of food science, and in particular to an entity recognition method and device for the field of nutrition and health food. BACKGROUND

[0002] With the rapid development of the nutrition and health food industry, it has become a core link to promote research and development innovation, ensure product compliance and safety, and understand market trends to accurately and efficiently extract key information from massive texts such as scientific research literature, product labels, regulations and standards, patent literature, and market information. Among them, the named entity recognition (NER) technology, especially the recognition of professional terms such as nutrients, bioactive ingredients, and functional ingredients, is the basis and key to realizing downstream knowledge graph construction, intelligent question answering, public opinion monitoring, and other applications.

[0003] However, the current named entity recognition technology applied in the field of nutrition and health food still faces multiple challenges. First, the named entity recognition tools in related technologies are based on general corpus training and cannot accurately recognize professional terms in the field of nutrition and health food. Second, although the recognition method based on static knowledge base or knowledge graph can achieve high accuracy on specific data sets, the construction and maintenance of the knowledge base rely on a large amount of manual participation, which is costly and time-consuming, resulting in insufficient knowledge coverage and poor real-time performance. Third, some tools that perform well in the biomedicine field (such as sciSpaCy) have training data that is biased towards genes, proteins, diseases, and drugs, which often leads to ambiguity when applied to the nutrition and health field, making it difficult to effectively distinguish based on context, and seriously affecting the accuracy of data extraction.

[0004] Therefore, how to improve the accuracy and efficiency of entity recognition in the field of nutrition and health food has become a technical problem to be solved in the industry. SUMMARY

[0005] The present application provides an entity recognition method and device for the field of nutrition and health food, which solves the technical problem of how to improve the accuracy and efficiency of entity recognition in the field of nutrition and health food.

[0006] The present application provides an entity recognition method for the field of nutrition and health food, comprising:

[0007] receiving a to-be-processed text containing named entities in the field of nutrition and health food;

[0008] extracting preliminary recognition entities in the to-be-processed text;

[0009] inputting the preliminary identified entity into a large language model to obtain an enhanced identified entity output by the large language model; the large language model performs enhanced verification on the preliminary identified entity based on candidate entity information and context information of the preliminary identified entity in the to-be-processed text in the large language model, and generates the enhanced identified entity; the candidate entity information is obtained based on retrieval of the preliminary identified entity in a knowledge base system;

[0010] determining the named entity in the to-be-processed text based on the enhanced identified entity.

[0011] In some embodiments, the knowledge base system includes a structured database and an entity vector library;

[0012] The structured database is used for structurally storing entities, synonyms of entities, and relationships between entities in an ontology library and a synonym library;

[0013] The entity vector library is used for storing representation vectors corresponding to entities in the ontology library and representation vectors corresponding to synonyms in the synonym library;

[0014] The ontology library is constructed based on a food science ontology and a unified medical language system;

[0015] The synonym library is constructed based on supplement terms, ingredient terms, and product terms.

[0016] In some embodiments, the candidate entity information is determined based on the following steps:

[0017] Based on the entity identifier, entity name, entity type, and synonym list of the preliminary identified entity, a query is performed in the structured database to obtain a first query result;

[0018] Based on the context semantic features of the preliminary identified entity in the to-be-processed text, a query is performed in the entity vector library to obtain a second query result;

[0019] Based on the first query result and the second query result, the candidate entity information is generated.

[0020] In some embodiments, the knowledge base system is updated based on the following steps:

[0021] obtaining the enhanced identified entity output by the large language model;

[0022] In the case that the enhanced identified entity does not exist in the knowledge base system, and the semantic similarity between the enhanced identified entity and any entity in the knowledge base system is greater than a preset threshold, the enhanced identified entity is added to the knowledge base system as a synonym.

[0023] In some embodiments, the knowledge base system is updated based on the following steps:

[0024] monitoring the ontology library and / or the synonym library;

[0025] in the case of adding new entities to the ontology library and / or the synonym library, adding the new entities to the knowledge base system.

[0026] In some embodiments, the inputting the preliminary identified entity into a large language model to obtain an enhanced identified entity output by the large language model comprises:

[0027] inputting a preset prompt word, the candidate entity information, and the context information of the preliminary identified entity in the to-be-processed text into the large language model, so that the large language model performs enhanced verification on the preliminary identified entity and outputs an enhanced identified entity;

[0028] The preset prompt word is used to guide the large language model to disambiguate any preliminary identified entity based on the context information in the case of the any preliminary identified entity corresponding to multiple candidate entity information.

[0029] In some embodiments, the preset prompt word is also used to guide the large language model to perform normalized entity representation on the enhanced identified entity.

[0030] The present application provides an entity recognition device for the field of nutritional health food, comprising:

[0031] a text receiving module for receiving to-be-processed text containing named entities in the field of nutritional health food;

[0032] a preliminary identification module for extracting preliminary identified entities in the to-be-processed text;

[0033] an enhanced verification module for inputting the preliminary identified entities into a large language model to obtain an enhanced identified entity output by the large language model; the large language model performs enhanced verification on the preliminary identified entities based on candidate entity information and context information of the preliminary identified entities in the to-be-processed text, and generates the enhanced identified entity; the candidate entity information is obtained based on a search of the preliminary identified entities in a knowledge base system;

[0034] an entity output module for determining named entities in the to-be-processed text based on the enhanced identified entity.

[0035] The application provides an electronic device, comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the entity recognition method for the field of nutrition and health food when executing the computer program.

[0036] The application provides a non-transitory computer-readable storage medium, which stores a computer program, wherein the computer program is executed by a processor to implement the entity recognition method for the field of nutrition and health food.

[0037] The application provides an entity recognition method and device for the field of nutrition and health food, which receives a to-be-processed text containing named entities in the field of nutrition and health food, extracts preliminary recognition entities in the to-be-processed text, inputs the preliminary recognition entities into a large language model to obtain enhanced recognition entities output by the large language model, and determines named entities in the to-be-processed text based on the enhanced recognition entities. Since the preliminary recognition and enhanced recognition are combined, the preliminary recognition entities can be quickly extracted by using a language processing tool in related technologies, and the enhanced recognition entities are generated by introducing a large language model retrieval and enhancement technology for context perception, so that the problems of complex entity terms and high ambiguity in the field of nutrition and health food can be effectively solved, and the accuracy and efficiency of the entity recognition for the field of nutrition and health food are greatly improved compared with a traditional entity recognition model. In addition, the preliminary recognition and retrieval in the knowledge base system provide a clear candidate range and judgment basis for the large language model, reduce the risk of hallucination of the large language model, and improve the processing efficiency, so that high-quality and structured information extraction of the text in the field of nutrition and health food is finally realized. BRIEF DESCRIPTION OF DRAWINGS

[0038] The accompanying drawings, which are incorporated into and form a part of the specification, illustrate an embodiment consistent with the present application and, together with the description, serve to explain the principles of the application.

[0039] In order to more clearly illustrate the technical solutions in the present application or the prior art, the accompanying drawings needed in the embodiments or prior art description will be briefly introduced. Obviously, the accompanying drawings in the following description are some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor.

[0040] Figure 1 is one of the flowcharts of the entity recognition method for the field of nutrition and health food provided by the present application.

[0041] Figure 2 is another flowchart of the entity recognition method for the field of nutrition and health food provided by the present application.

[0042] Figure 3 is a structural schematic diagram of the entity recognition device for the field of nutrition and health food provided by the present application.

[0043] Figure 4 is a structural schematic diagram of the electronic device provided by the present application. DETAILED DESCRIPTION

[0044] In order for those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should be within the scope of protection of the present application.

[0045] It should be noted that the terms "first", "second", etc. in the present application are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units or modules does not necessarily limit to those steps or units or modules clearly listed, but can include other steps or units or modules that are not clearly listed or inherent to these processes, methods, products or devices.

[0046] In view of the deficiencies in the related art, the present application provides an entity recognition method and system for the field of nutrition and health food, which builds an entity recognition system based on a hybrid knowledge base architecture and a large language model (LLM), utilizes a hybrid knowledge representation of a structured database and a vector library, combines a domain-optimized named entity recognition (NER) model and retrieval-augmented generation (RAG) technology of a large language model to realize a high-precision, efficient and dynamically updated entity recognition and normalization system, and is suitable for professional term recognition, normalization and dynamic knowledge base updating in the field of nutrition and health food.

[0047] Figure 1 is one of the flowcharts of the entity recognition method for the field of nutrition and health food provided by the present application, as shown in Figure 1 the method comprises steps 110, 120, 130 and 140.

[0048] Step 110, receiving a to-be-processed text containing named entities in the field of nutrition and health food.

[0049] Specifically, the entity recognition method provided by the embodiments of the present application is applied to the field of nutrition and health food, and the execution subject is an entity recognition device. The device can be implemented by software, such as an entity recognition program running in a computer, or by hardware, such as a computer, a server, or a cloud platform that executes the entity recognition method.

[0050] The named entity in the field of nutrition and health food refers to a word or phrase with a clear and independent meaning in the field of nutrition and health food. Such entities constitute the basic units of the knowledge system of the field. These named entities can include food, additives, supplements, nutrients, raw materials, bioactive molecules, nutritional ingredients, efficacy, health benefits, proteins, genes, and microorganisms.

[0051] The to-be-processed text refers to text data containing named entities in the field of nutrition and health food. The source of the text can be diverse, such as academic papers, patent documents, clinical trial reports, food safety standard documents, product manuals, online health forum discussions, or news reports.

[0052] The system or device that executes the method provided by the embodiments of the present application can first preprocess the to-be-processed text in different formats before execution, such as parsing and extracting the pure text content, to serve as the input for subsequent steps.

[0053] Step 120, extracting preliminary recognized entities from the to-be-processed text.

[0054] Specifically, after receiving the to-be-processed text, a quick scan and analysis of the text can be performed to identify the named entities that may exist in the text, which are referred to as preliminary recognized entities. It should be understood that "preliminary" means that the output of this step is a candidate result, which may have problems such as incomplete recognition, boundary division error, or inaccurate classification. The main purpose is to provide candidate targets for subsequent accurate verification, thereby improving the processing efficiency of the overall method.

[0055] The specific extraction method can use various natural language processing (NLP) techniques known to those skilled in the art.

[0056] In an optional embodiment, a dictionary and rule-based method can be used to perform string matching on the to-be-processed text by constructing a dictionary containing partial field terms.

[0057] In another optional embodiment, a statistical learning model such as Conditional Random Fields (CRF), Hidden Markov Models (HMM), or Support Vector Machines (SVM) can be used.

[0058] In a more preferred embodiment, a pre-trained deep learning model can be used, such as a bidirectional long short-term memory network-conditional random field (BiLSTM-CRF) model, or a NER model that is pre-trained on a general corpus and fine-tuned on a small-scale annotated corpus in the field of nutrition and health, to achieve rapid annotation and extraction of potential entities in the text.

[0059] For example, for the text to be processed "Study on the effect of GDCA on intestinal flora of diabetic patients", through the processing of this step, the word groups "GDCA", "diabetes", "intestinal flora" and the like in the text can be extracted as preliminary identified entities. At this time, the system may preliminarily mark "GDCA" as an entity according to the knowledge of the pre-trained model, but the specific category may not be clear or the marking may be wrong.

[0060] Step 130, input the preliminary identified entity into the large language model to obtain an enhanced identified entity output by the large language model; the large language model performs enhanced verification on the preliminary identified entity based on candidate entity information and context information of the preliminary identified entity in the text to be processed, and generates an enhanced identified entity; the candidate entity information is obtained based on a search of the preliminary identified entity in the knowledge base system.

[0061] Specifically, the deep semantic understanding and reasoning ability of the large language model can be used to perform enhanced verification on the preliminary identified entity obtained in the previous step. This step is not simply to directly give the preliminary identified entity to the large language model for processing, but to use the retrieval enhancement generation technology of the large language model to realize the closed-loop logic of "retrieval-verification-generation". The enhanced verification can specifically include verification, disambiguation, completion and standardization and the like.

[0062] In the retrieval stage, a knowledge base system can be pre-constructed. The knowledge base system can be a database or a knowledge graph that stores a large amount of professional knowledge in the field of nutrition and health food. The knowledge base system can include, but is not limited to, the standard name of an entity, synonyms, abbreviations, classification information (e.g., whether it belongs to a bioactive molecule or a gene), and the relationship between entities (e.g., a certain ingredient can treat a certain disease). For example, the knowledge base system can integrate multiple published authoritative databases, such as FoodON, UMLS, FooDB, DSLD, etc. When the preliminary identified entity "GDCA" is input, the system will search in the knowledge base system. The search method can include exact string matching, fuzzy matching or index-based search. The result of the search is candidate entity information, for example, the knowledge base system finds that "GDCA" is a common abbreviation for two different entities, so it returns two pieces of candidate entity information: Candidate Entity 1: Name "Glycodeoxycholic acid", Category "Bioactive molecule / Bile acid". Candidate Entity 2: Name "GNAT3", Category "Gene / Protein".

[0063] In the verification stage, the large language model refers to a deep learning model with large-scale parameters and strong text understanding and generation capabilities, such as the DeepSeek series of models, the LLaMA series of models, or other similar models known to those skilled in the art. The context information refers to the words, phrases or sentences before and after the position of the preliminary identified entity in the text to be processed. For "GDCA", the context information is "study... on the impact of intestinal flora in diabetic patients".

[0064] The large language model receives at least three aspects of information as input: (1) the primary identified entity itself (“GDCA”); (2) the candidate entity information retrieved from the knowledge base system (“glycochenodeoxycholic acid” and “GNAT3” and their respective categories); (3) the context information of this entity in the original text (“... diabetes... gut microbiota...”). The large language model will use its powerful semantic reasoning ability to analyze the semantic correlation between the context information and each candidate entity information. For example, the large language model can understand that “diabetes” and “gut microbiota” are highly related to the metabolic and digestive systems, while “glycochenodeoxycholic acid” is a bile acid whose function is closely related to this; in contrast, “GNAT3” is a gene related to taste perception, and its semantic correlation with this context is significantly lower. Based on this reasoning analysis, the large language model will make a judgment to determine that the most likely true meaning of “GDCA” in this context is “glycochenodeoxycholic acid”. Finally, the large language model outputs the enhanced identified entity. The enhanced identified entity is the result after verification and disambiguation, and its information is more accurate and rich. For example, the output result can be a structured data indicating that “GDCA” in the original text is confirmed as the entity “glycochenodeoxycholic acid”, its type is “bioactive molecule”, and it can be associated with a unique identifier in the knowledge base.

[0065] In the generation phase, the large language model can perform standardized entity representation on the enhanced identified entity, or perform synonym expansion or near-synonym association, etc.

[0066] Step 140, determining the named entity in the text to be processed based on the enhanced identified entity.

[0067] Specifically, the enhanced identified entity output by the large language model is taken as the named entity in the text to be processed, and is output after being arranged.

[0068] The final output result can be in various forms. For example, the identified named entity can be highlighted in the original text, and its standard name and category can be attached. Or a structured list can be generated to list all the named entities contained in the text, etc.

[0069] The embodiment of the present application provides the entity recognition method for the field of nutrition and health food, receives a to-be-processed text containing named entities in the field of nutrition and health food; extracts a preliminary recognition entity in the to-be-processed text; inputs the preliminary recognition entity into a large language model to obtain an enhanced recognition entity output by the large language model; determines the named entity in the to-be-processed text based on the enhanced recognition entity; since the preliminary recognition and the enhanced recognition are combined, the language processing tool in the related technology can be used to quickly extract the preliminary recognition entity, and the large language model retrieval and enhancement generation technology is introduced to perform context-aware enhancement checking, so that the problems of complex entity terms and high ambiguity in the field of nutrition and health food can be effectively solved, and compared with a traditional entity recognition model, the accuracy and efficiency of the entity recognition for the field of nutrition and health food are greatly improved. In addition, through the preliminary recognition and the retrieval in the knowledge base system, a clear candidate range and judgment basis are provided for the large language model, the risk of hallucination of the large language model is reduced, and the processing efficiency is improved, and finally high-quality and structured information extraction of the text in the field of nutrition and health food is realized.

[0070] It should be noted that each embodiment of the present application can be freely combined, the order can be changed or executed alone, and does not need to rely on or depend on a fixed execution order.

[0071] In some embodiments, the knowledge base system includes a structured database and an entity vector library;

[0072] The structured database is used for structurally storing entities, synonyms of the entities and relationships between the entities in the ontology library and the synonym library;

[0073] The entity vector library is used for storing representation vectors corresponding to the entities in the ontology library and representation vectors corresponding to the synonyms in the synonym library;

[0074] The ontology library is constructed based on a food science ontology and a unified medical language system;

[0075] The synonym library is constructed based on supplement terms, ingredient terms and product terms.

[0076] Specifically, the ontology library is constructed based on Food Science Ontology (FoodON) and Unified Medical Language System (UMLS). The ontology library provides a systematic and hierarchical knowledge framework, defining the core concepts in the field and the inheritance, composition, and other relationships between them. FoodON is chosen because it focuses on the food field and provides a detailed classification system from agricultural production to chemical ingredients. UMLS is a large-scale meta-knowledge base that integrates hundreds of biomedical vocabularies and ontologies. It introduces a wealth of medical and health-related concepts such as diseases, symptoms, genes, and drugs into the system, and provides standard mapping relationships between concepts. By integrating the two, the ontology library can provide a broad and rigorous knowledge framework for the field of nutrition, health, and food.

[0077] The synonym library is constructed based on supplement terms, ingredient terms, and product terms. Unlike the specification of the ontology library, the synonym library focuses more on collecting a variety of non-standard terms used in the real world. Its data sources can include but are not limited to: the Dietary Supplement Label Database (DSLD), which contains a large number of ingredient names labeled in commercial products; the Food Database (FooDB), which contains extremely detailed food chemical ingredients and their synonyms; and product nicknames, ingredient abbreviations, and other information extracted from related industry websites and literature. The establishment of the synonym library greatly enhances the system's ability to understand colloquial and informal texts, and is an important guarantee for improving the recall rate of entity recognition.

[0078] Entities, synonyms of entities, and relationships between entities in the ontology library and the synonym library can be extracted to construct entity tables, synonym tables, and relationship tables, respectively, and stored in a structured manner to obtain a structured database. The entity table is used to store core entities from the ontology library. The synonym table is used to store synonyms, aliases, abbreviations, and other information from the synonym library. The relationship table is used to store the relationships between entities, forming the basic structure of the knowledge graph. Structured storage refers to organizing and storing information according to a predefined data model with strict constraints (such as a relational model) to facilitate efficient, accurate querying, updating, and management. Structured databases can be implemented using relational databases such as PostgreSQL, MySQL, or Oracle. PostgreSQL is a preferred choice in this embodiment because of its good stability and scalability.

[0079] Meanwhile, an entity vector library can also be constructed to store the representation vectors of entities in the ontology library and the representation vectors of synonyms in the synonym library. A representation vector (also known as a word embedding) is a technique of converting text (in this scenario, entity names or synonyms) into low-dimensional, dense real number vectors. Such vectors can capture the semantic information of the text, so that semantically similar words are also close in the vector space. By mapping entities and their synonyms to representation vectors, efficient semantic similarity retrieval can be supported. The entity vector library can be implemented by pgVector.

[0080] In a preferred embodiment, the entity vector library can be integrated with the structured database. For example, when PostgreSQL is used as the structured database, the pgVector extension can be installed to enable the database itself to store and efficiently query vectors. In this way, entity representation vectors can be directly stored as a field in the entity table or synonym table, realizing unified management of structured data and unstructured semantic information.

[0081] The entity recognition method for the field of nutrition and health food provided by the embodiments of the present application can provide two retrieval query methods by constructing a structured database and an entity vector library, and can provide high-quality, high-coverage and various candidate entity information for the subsequent enhancement and verification steps of large language models, thereby ensuring that even for rare, ambiguous or non-standard entities, the system can still have a high probability of finding the correct candidate entity, and laying a solid foundation for the accuracy of the final recognition result.

[0082] In some embodiments, the candidate entity information is determined based on the following steps:

[0083] Based on the entity identifier, entity name, entity type and synonym list of the preliminary identified entity, a query is performed in the structured database to obtain a first query result;

[0084] Based on the context semantic features of the preliminary identified entity in the text to be processed, a query is performed in the entity vector library to obtain a second query result;

[0085] Based on the first query result and the second query result, candidate entity information is generated.

[0086] Specifically, the embodiments of the present application provide a dual-channel hybrid retrieval method combining structured precise query and vectorized semantic retrieval.

[0087] In one aspect, a query can be performed in the structured database according to the entity identifier, entity name, entity type and synonym list of the preliminary identified entity to obtain a first query result. For example, the text string of the preliminary identified entity (e.g., "GDCA") is used as a query keyword to search in multiple tables of the structured database. The target tables of the query include at least the entity table and the synonym table. The query is performed in the "entity name" field of the entity table. The query is also performed in the "synonym" or "abbreviation" field of the synonym table, which is the key to find abbreviations and aliases.

[0088] The query is an exact match or index-based fast lookup process, aiming to find all the entities that are literally related to the preliminary identified entity and have been explicitly recorded in the knowledge base. The first query result returned is one or more structured entity records. For example, for the preliminary identified entity "GDCA", a query is performed in the structured database, and two results can be obtained because "GDCA" is the abbreviation of both "glycochenodeoxycholic acid" and "GNAT3", which together constitute the first query result. The result is high-recall because it ensures that all the candidates with literal possibility are considered.

[0089] On the other hand, a query is performed in the entity vector library according to the contextual semantic features of the preliminary identified entity in the text to be processed to obtain a second query result.

[0090] The query is a vector retrieval based on semantic similarity. First, the contextual semantic features need to be extracted. The specific method is to concatenate the preliminary identified entity and its adjacent words (i.e., context) in the text to be processed to form a text segment containing context (e.g., "study the effect of GDCA on intestinal flora in diabetic patients"). Then, the same representation vector model as used when constructing the entity vector library is used to encode the text segment into a query vector. Subsequently, a similarity retrieval is performed in the entity vector library according to the query vector. The retrieval process usually calculates the cosine similarity or Euclidean distance between the query vector and each entity representation vector stored in the library. The system returns a list of entities sorted in descending order of similarity scores, which is the second query result. This result reflects which library entities are most semantically compatible with the current context.

[0091] Continuing with the example of "GDCA", the query vector formed by the context "diabetes" and "intestinal flora" will be closer to the vectors of concepts such as "bile acid", "metabolism", "digestion", etc. in the semantic space, and farther away from the vectors of concepts such as "taste receptor" and "gene". Therefore, the second query result may be ranked as: "glycochenodeoxycholic acid" (similarity 0.91), "bile acid" (similarity 0.88), etc. in the front, and "GNAT3" (similarity 0.12) in the very back.

[0092] Finally, the first query result and the second query result are fused to generate high-quality candidate entity information provided to the large language model. In a preferred embodiment, the first query result and the second query result can be cross-validated or screened. For example, the candidates in the first query result are re-ranked using the semantic similarity scores in the second query result. In the example of "GDCA", both "glycochenodeoxycholic acid" and "GNAT3" are in the first query result, but since the former has a much higher similarity score in the second query result than the latter, "glycochenodeoxycholic acid" will be ranked first in the fused list.

[0093] The entity recognition method for the field of nutrition and health food provided by the embodiments of the present application combines the accuracy of the structured database and the semantic flexibility of the entity vector library. The structured query ensures that no candidate entity that matches literally is missed, guaranteeing recall rate and basic accuracy. The vector semantic query greatly improves the relevance of the search results by using context information. This hybrid retrieval mechanism provides a high-quality candidate list that has been pre-screened and intelligently sorted for subsequent large language models, significantly reducing the decision-making difficulty of the large language model, enabling it to reason within a smaller and more relevant range, and thus improving the final accuracy and robustness of the entire entity recognition method.

[0094] In some embodiments, the knowledge base system is updated based on the following steps:

[0095] An enhanced recognition entity output by the large language model is obtained.

[0096] If the enhanced recognition entity does not exist in the knowledge base system and the semantic similarity between the enhanced recognition entity and any entity in the knowledge base system is greater than a preset threshold, the enhanced recognition entity is added to the knowledge base system as a synonym.

[0097] Specifically, the embodiments of the present application provide an incremental updating method, which enables the knowledge base system to have self-learning and dynamic evolution capabilities.

[0098] The enhanced recognition entity is a high-confidence entity recognition result after deep verification and disambiguation by the large language model. If the enhanced recognition entity does not exist in the knowledge base system, it means that the enhanced recognition entity is a new entity.

[0099] The enhanced recognition entity is compared with each entity in the knowledge base system in semantic similarity, and if the semantic similarity between the enhanced recognition entity and any entity is greater than a preset threshold (which can be set as needed), it is indicated that the enhanced recognition entity is highly consistent with the entity in semantics. The enhanced recognition entity can be added to the knowledge base system as a synonym while keeping a historical record to ensure data consistency.

[0100] The entity recognition method for the field of nutrition and health food provided by the embodiments of the present application can capture new entities appearing in the field from the processed data in real time, and automatically integrate them into the knowledge base system under the premise of meeting strict quality control. This greatly solves the problem of lag of traditional static knowledge base information, ensures the timeliness of the knowledge base system, reduces the cost and period of manual maintenance of the knowledge base, and enables the performance of the entire entity recognition method to continuously improve over time and with the increase of processed data, which has extremely high practical value.

[0101] In some embodiments, the knowledge base system is updated based on the following steps:

[0102] The ontology library and / or the synonym library are monitored;

[0103] In the case of adding new entities to the ontology library and / or the synonym library, the new entities are added to the knowledge base system.

[0104] Specifically, the embodiments of the present application provide a periodic alignment method to realize knowledge base system updating driven by external data.

[0105] The external data source corresponding to the ontology library and / or the synonym library can be monitored. The monitoring can be performed in two ways. One is to set a timing task to automatically trigger the monitoring according to the time interval. The other is to set a listening service to automatically trigger the monitoring when an update event of the ontology library or the synonym library is detected.

[0106] The monitoring mainly includes querying the latest version information or update log of the external data source through an interface call, or accessing the server of the external data source to check whether there is an updated data file.

[0107] In the case of determining that the ontology library and / or the synonym library add new entities, the new entities are automatically captured and added to the knowledge base system.

[0108] In order to facilitate data comparison, an update timestamp field (last_updated) can also be added to the knowledge base system, which is automatically updated by a database trigger, and the entity addition, deletion and modification operations and related information are recorded through a change log.

[0109] The entity recognition method for the field of nutrition and health food provided by the embodiment of the present application can realize the updating of the knowledge base system by monitoring the ontology library and / or the synonym library, and ensure the quick response capability to new entities and non-standard expressions. The periodic alignment method provided by the embodiment is combined with the incremental updating method in the above embodiment to construct a dynamic knowledge system that is stable and flexible and can continuously evolve, so that the whole entity recognition method can maintain high performance and high reliability for a long time.

[0110] In some embodiments, the preliminary recognition entity is input into a large language model to obtain an enhanced recognition entity output by the large language model, including:

[0111] The preset prompt word, the candidate entity information, and the context information of the preliminary recognition entity in the text to be processed are input into the large language model, so that the large language model performs enhanced verification on the preliminary recognition entity, and outputs the enhanced recognition entity.

[0112] The preset prompt word is used to guide the large language model to disambiguate any preliminary recognition entity based on the context information in the case that any preliminary recognition entity corresponds to multiple candidate entity information.

[0113] Specifically, the embodiment of the present application guides and restricts the behavior of the large language model through the preset prompt word (Prompt), thereby realizing efficient and reliable enhanced verification.

[0114] The preset prompt word is a pre-designed and structured instruction template. Its role is to clearly state the role it needs to play, the specific tasks it must complete, the structure of the input, and the expected output format to the large language model. By using the preset prompt word, a general large language model can be transformed into a behavior-controllable expert system that performs specific domain tasks, thereby significantly improving the stability and accuracy of its output and effectively suppressing its tendency to produce irrelevant content or "hallucinations".

[0115] In the embodiment of the present application, the preset prompt word is designed to be used for entity disambiguation. Its content clearly specifies that in the case that any preliminary recognition entity corresponds to multiple candidate entity information, the large language model is guided to disambiguate any preliminary recognition entity based on the context information.

[0116] In the above embodiments, the candidate entity information is a sorted high-quality candidate entity list generated after the structured query and vector query dual-channel retrieval. For example, for "GDCA", the candidate entity information can be a list containing [{ "name": "Glycodeoxycholic Acid", "type": "bioactive molecule"}, { "name": "GNAT3", "type": "gene"}]. This provides a clear, limited option for the large language model, narrowing its decision range from an infinite open space to a specific, highly relevant set.

[0117] In the above embodiments, the context information is the context of the preliminary identified entity in the original text. For example, for the preliminary identified entity "GDCA", the context information is "study the effect of GDCA on the intestinal flora of diabetic patients...". This is the basis for the large language model to make semantic judgments and inferences.

[0118] According to the guidance of the preset prompt word, the large language model analyzes the semantic association between the context information ("diabetes", "intestinal flora") and the candidate entity ("bile acid" and "gene"), and finally makes a judgment and outputs the enhanced identified entity in the required format, for example: {"standard_name": "Glycodeoxycholic Acid", "type": "BileAcid"}. The output result is then parsed by the system to determine the final named entity.

[0119] The entity recognition method for the field of nutritional health food provided by the embodiments of the present application greatly improves the controllability, stability and accuracy of the large language model in performing the enhanced verification task by introducing structured preset prompt words to organize and guide the input and output of the large language model. It converts an open generation task into a closed selection and judgment task with clear constraints, effectively avoiding problems such as inconsistent output format, content divergence, or inconsistency with facts. This method enables the powerful reasoning ability of the large language model to be precisely applied to solving entity disambiguation problems, while ensuring that the output results can be seamlessly and automatically processed by subsequent programs.

[0120] In some embodiments, the preset prompt word is also used to guide the large language model to perform standardized entity representation on the enhanced identified entity.

[0121] Specifically, the preset prompt word can also be used to guide the large language model to perform a new task of standardized entity representation on the enhanced identified entity, so that the structure, standardization and usability of the final output result are significantly improved.

[0122] The normalized entity representation refers to mapping an entity that can appear in various forms (such as abbreviations, colloquial names, and misspellings) in the text to a unique, standard, and information-rich structured object. The formats that can define the normalized entity representation include entity name, entity identifier, entity type, and synonym list.

[0123] The entity recognition method for the field of nutritional health food provided by the embodiment of the present application can solve the accuracy problem of entity recognition and greatly improve the standardization degree of the recognition result by extending the function of the preset prompt word. The output normalized entity representation can be a structured object. This format can be seamlessly integrated and utilized by downstream applications (such as knowledge graph construction, database filling, and data analysis system), which saves the additional data cleaning and format conversion steps, and significantly improves the automation level and end-to-end efficiency of the entire information extraction process.

[0124] Figure 2 is the second flowchart of the entity recognition method for the field of nutritional health food provided by the present application, as shown in Figure 2 The method comprises the following steps.

[0125] Step 210, constructing a hybrid knowledge representation and knowledge base architecture.

[0126] The hybrid knowledge representation is obtained through the combination of the ontology library and the synonym library. The hybrid knowledge representation is stored through the structured database and the entity vector library.

[0127] Step 220, constructing a field-adaptive dual entity recognition mechanism.

[0128] First stage preliminary recognition: a nutrition health food field customized entity recognition tool is constructed through a sciSpaCy-based en_core_sci_scibert pre-training model, which includes a text standardization component (processing special symbols, unifying term forms), an entity recognition component (recognizing food raw materials, nutritional components and other entity types), an abbreviation detection and expansion component, an EntityLinker component (linking to UMLS, MeSH and other standard term libraries to realize entity normalization), and a standard entity identifier (ID) for quickly extracting entities.

[0129] Second stage enhanced recognition: a "retrieve-verify-generate" three-layer enhanced recognition architecture is realized through a large language model RAG technology to perform context disambiguation and missing detection completion on the preliminary recognition result.

[0130] The retrieval layer implements keyword matching and vector similarity mixed retrieval through pgVector; the verification layer checks the sciSpaCy recognition result, and solves the problem of polysemy; the generation layer generates a standardized entity representation, performs synonym expansion and synonym association by using a large language model (such as DeepSeek).

[0131] By designing a structured prompt word, the large model is guided to generate a conclusion based on the mixed knowledge base retrieval result, the hallucination problem is reduced, and the entity recognition accuracy is improved.

[0132] Step 230, dynamically updating the knowledge base.

[0133] Incremental updating and periodic alignment can be used to update the knowledge base. Incremental updating refers to automatically including new entities recognized by the large model into the synonym library through semantic similarity comparison when the confidence exceeds the threshold, and keeping historical records to ensure data consistency. Periodic alignment is to monitor the update of external data sources regularly, automatically capture new entities and verify. Add the "last_updated" timestamp field in the structured knowledge base, use the database trigger to automatically update, and record the entity addition, deletion and modification operations and related information through the change log.

[0134] The entity recognition method for the field of nutritional health food provided by the embodiment of the application has the following technical effects: (1) The recognition ability of field terms is improved on the data set or literature set in the field of nutritional health food; (2) The knowledge base can be updated in real time, the period from recognition to storage of new terms is shortened, and the efficiency is improved compared with the knowledge graph scheme (which relies on manual review); (3) The mixed query reduces the memory occupation compared with the pure knowledge graph scheme, and reduces the resource consumption.

[0135] The device provided by the embodiment of the application will be described below, and the device described below can be correspondingly referred to the method described above.

[0136] Figure 3 The device provided by the embodiment of the application will be described below, and the device described below can be correspondingly referred to the method described above. Figure 3 As shown in the structural schematic diagram of the entity recognition device for the field of nutritional health food provided by the application, the device comprises:

[0137] The text receiving module 310 is configured to receive a to-be-processed text containing named entities in the field of nutritional health food.

[0138] The preliminary identification module 320 is configured to extract preliminary identified entities in the to-be-processed text.

[0139] The enhancement checking module 330 is configured to input the preliminary identified entity into a large language model to obtain an enhanced identified entity output by the large language model; the large language model performs enhancement checking on the preliminary identified entity based on candidate entity information and context information of the preliminary identified entity in the to-be-processed text to generate the enhanced identified entity; the candidate entity information is obtained based on a search of the preliminary identified entity in a knowledge base system;

[0140] The entity output module 340 is configured to determine the named entity in the to-be-processed text based on the enhanced identified entity.

[0141] The entity recognition device for the field of nutritional health food provided in the embodiment of the present application receives a to-be-processed text containing named entities in the field of nutritional health food; extracts a preliminary identified entity in the to-be-processed text; inputs the preliminary identified entity into a large language model to obtain an enhanced identified entity output by the large language model; and determines the named entity in the to-be-processed text based on the enhanced identified entity. Since the preliminary identification and the enhancement identification are combined, the language processing tool in the related technology can be used to quickly extract the preliminary identified entity, and the large language model retrieval enhancement generation technology is introduced to perform context-aware enhancement checking, which can effectively solve the problems of complex entity terms and high ambiguity in the field of nutritional health food. Compared with the traditional entity recognition model, the accuracy and efficiency of the entity recognition for the field of nutritional health food are greatly improved. In addition, through the preliminary identification and the search in the knowledge base system, the large language model is provided with a clear candidate range and judgment basis, which reduces the risk of hallucination of the large language model and improves the processing efficiency, and finally realizes high-quality and structured information extraction of the text in the field of nutritional health food.

[0142] Figure 4 is a structural schematic diagram of an electronic device provided by the present application, as Figure 4 shown, the electronic device can include: a processor (Processor) 410, a communications interface (Communications Interface) 420, a memory (Memory) 430 and a communications bus (Communications Bus) 440, wherein the processor, the communications interface, the memory complete mutual communication through the communications bus. The processor can call the logic command in the memory to execute the method described in the above embodiment, for example:

[0143] The method comprises the following steps: receiving a to-be-processed text containing a named entity in the field of nutrition and health food; extracting a primary identified entity in the to-be-processed text; inputting the primary identified entity into a large language model to obtain an enhanced identified entity output by the large language model; the large language model performs enhanced verification on the primary identified entity based on candidate entity information and context information of the primary identified entity in the to-be-processed text to generate the enhanced identified entity; the candidate entity information is obtained based on the primary identified entity in the knowledge base system; and determining the named entity in the to-be-processed text based on the enhanced identified entity.

[0144] In addition, the logic commands in the memory described above can be implemented in the form of a software function unit and sold or used as a standalone product, and can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the present application, in essence, or the parts that contribute to the prior art, or parts of the technical solutions can be embodied in the form of a software product, which is stored in a storage medium and includes a number of commands to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.

[0145] The processor in the electronic device provided by the embodiments of the present application can invoke the logic instructions in the memory to implement the above-mentioned method, and the specific implementation manners are consistent with the above-mentioned method implementation manners, and the same beneficial effects can be achieved, which will not be described here again.

[0146] The embodiments of the present application also provide a computer-readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the method provided by each of the above embodiments.

[0147] The specific implementation manners are consistent with the above-mentioned method implementation manners, and the same beneficial effects can be achieved, which will not be described here again.

[0148] The embodiments of the present application provide a computer program product, which includes a computer program, and the computer program is executed by a processor to implement the above-mentioned method.

[0149] The device embodiments described above are merely illustrative, wherein the units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, i.e., can be located in one place, or can be distributed to multiple network units. Part or all of the modules can be selected to achieve the purposes of the embodiments according to actual needs. Those skilled in the art can understand and implement without creative labor.

[0150] Through the description of the above embodiments, those skilled in the art can clearly understand that the embodiments can be realized by means of software and the necessary general hardware platform, and of course can also be realized by hardware. Based on such understanding, the above technical solutions can be embodied in the form of a software product, which can be stored in a computer readable storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in each embodiment or some parts of the embodiments.

[0151] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement to some technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for entity recognition in the field of nutritionally healthy food, characterized in that, The method comprises the following steps: receiving a to-be-processed text containing named entities in the field of nutrient health food; extracting preliminary identified entities in the to-be-processed text; inputting the preliminary identified entities into a large language model to obtain enhanced identified entities output by the large language model; the large language model performs enhanced verification on the preliminary identified entities based on candidate entity information and context information of the preliminary identified entities in the to-be-processed text to generate the enhanced identified entities; the candidate entity information is obtained by searching in a knowledge base system based on the preliminary identified entities; determining named entities in the to-be-processed text based on the enhanced identified entities; the knowledge base system comprises a structured database and an entity vector library; the structured database is used for structurally storing entities, synonyms of the entities and relationships between the entities in an ontology library and a synonym library; the entity vector library is used for storing representation vectors corresponding to entities in the ontology library and representation vectors corresponding to synonyms in the synonym library; the candidate entity information is determined based on the following steps: querying the structured database based on entity identifiers, entity names, entity types and synonym lists of the preliminary identified entities to obtain a first query result; querying the entity vector library based on context semantic features of the preliminary identified entities in the to-be-processed text to obtain a second query result; generating the candidate entity information based on the first query result and the second query result; the method further comprises the following steps: reordering candidates in the first query result based on semantic similarity scores of the second query result.

2. The method of claim 1, wherein the method is applied to the field of nutritionally healthy food. the ontology library is constructed based on a food science ontology and a unified medical language system; the synonym library is constructed based on supplement terms, ingredient terms and product terms.

3. The method of claim 1, wherein the method is applied to the field of nutritionally healthy food. the knowledge base system is updated based on the following steps: obtaining enhanced identified entities output by the large language model; in the case that the enhanced identified entities do not exist in the knowledge base system and the semantic similarity between the enhanced identified entities and any entity in the knowledge base system is greater than a preset threshold, adding the enhanced identified entities as synonyms to the knowledge base system.

4. The method of claim 1, wherein the method is applied to the field of nutritionally healthy food. the knowledge base system is updated based on the following steps: monitoring the ontology library and / or the synonym library; in the case that new entities are added to the ontology library and / or the synonym library, adding the new entities to the knowledge base system.

5. The method of claim 1, wherein the method is applied to the field of nutritionally healthy food. the step of inputting the preliminary identified entities into the large language model to obtain enhanced identified entities output by the large language model comprises the following steps: inputting preset prompt words, the candidate entity information and context information of the preliminary identified entities in the to-be-processed text into the large language model to enable the large language model to perform enhanced verification on the preliminary identified entities and output enhanced identified entities; the preset prompt words are used to guide the large language model to disambiguate any preliminary identified entity based on the context information in the case that the any preliminary identified entity corresponds to multiple candidate entity information.

6. The method of claim 5, wherein the method is applied to the field of nutritionally healthy food. The preset prompt word is also used to guide the large language model to perform normalized entity representation on the enhanced recognition entity.

7. A device for entity recognition in the field of nutritionally healthy food, characterized in that Comprise: A text receiving module is configured to receive a to-be-processed text containing a named entity in the field of nutrition and health food. A preliminary recognition module is configured to extract a preliminary recognition entity from the to-be-processed text. An enhanced verification module is configured to input the preliminary recognition entity into a large language model to obtain an enhanced recognition entity output by the large language model; the large language model performs enhanced verification on the preliminary recognition entity based on candidate entity information and context information of the preliminary recognition entity in the to-be-processed text to generate the enhanced recognition entity; the candidate entity information is obtained based on a search of the preliminary recognition entity in a knowledge base system; An entity output module is configured to determine a named entity in the to-be-processed text based on the enhanced recognition entity. The knowledge base system comprises a structured database and an entity vector library. The structured database is configured to store entities, synonyms of entities, and relationships between entities in an ontology library and a synonym library in a structured manner. The entity vector library is configured to store representation vectors corresponding to entities in the ontology library and representation vectors corresponding to synonyms in the synonym library. The candidate entity information is determined based on the following steps: Based on the entity identifier, entity name, entity type, and synonym list of the preliminary recognition entity, query the structured database to obtain a first query result; Based on the context semantic features of the preliminary recognition entity in the to-be-processed text, query the entity vector library to obtain a second query result; Based on the first query result and the second query result, generate the candidate entity information. Further comprising: Based on the semantic similarity score of the second query result, reorder the candidates in the first query result.

8. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to realize the entity recognition method for the field of nutrition and health food according to any one of claims 1 to 6. 9.A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to realize the entity recognition method for the field of nutrition and health food according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Entity standardization method and model based on large language model retrieval enhancement

    CN120471054A