Guide text generation method and system based on diabetes management strategy recommendation

By constructing a knowledge graph and aggregating entities and relationships using multiple attention layers, personalized diabetes management guidance texts are generated, solving the problems of insufficient real-time performance, personalization, and intelligence in existing methods, and achieving efficient and accurate personalized management guidance.

CN120809290AActive Publication Date: 2025-10-17CENT SOUTH UNIV
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510810038.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-17
Publication Date
2025-10-17
Estimated Expiration
2045-06-17

AI Technical Summary

Technical Problem

Existing diabetes management methods lack real-time, personalization, and intelligence. Traditional medical guidance lacks real-time and personalization, home monitoring devices lack intelligent decision support, and rule-based management systems lack flexibility and adaptability, failing to fully consider individual differences and dynamic changes in patients.

Method used

By acquiring text datasets of patient information, medical records, and lifestyle habits, entity recognition and relation extraction are performed to construct a knowledge graph. Multi-layer attention layers are used to aggregate entities and relations, generate text embedding representations, and align and fuse them. Personalized diabetes management guidance texts are then generated based on the target embedding representations.

Benefits of technology

It improves the real-time, personalized, and intelligent nature of diabetes management, enabling it to provide personalized management guidance based on the patient's specific situation. It is highly efficient, has good real-time performance, and generates highly accurate guidance texts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120809290A_ABST
    Figure CN120809290A_ABST
Patent Text Reader

Abstract

The invention discloses a guide text generation method and system based on diabetes management strategy recommendation, and the method comprises the steps: carrying out the entity recognition of each text, obtaining a plurality of entities, and extracting the relation between the entities from each text; constructing a knowledge graph according to the relationship between the plurality of entities; aggregating entities and relationships in the knowledge graph by adopting a plurality of attention layers to obtain a first embedded representation; generating text embedding for entities and relationships in the knowledge graph, and aggregating the text embedding into a second embedding representation by adopting a plurality of attention layers; aligning and fusing the first embedded representation and the second embedded representation to obtain a target embedded representation; determining a plurality of management strategy candidate vectors according to the target embedding representation and the target problem; and selecting a target management strategy from the plurality of management strategy candidate vectors, and generating a diabetes management guidance text according to the target management strategy. The real-time performance, individuation and intelligence of diabetes management can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data recommendation, and in particular to a method and system for generating guidance text based on diabetes management strategy recommendation. Background Art

[0002] Currently, diabetes management primarily relies on traditional medical guidance, home monitoring, and medication. Traditionally, patients with diabetes rely on regular follow-up visits and face-to-face educational guidance from their doctors. This guidance typically includes dietary recommendations, exercise plans, blood glucose monitoring methods, and insulin instructions. However, this approach lacks real-time and personalization, requiring patients to seek medical help only after symptoms develop. Furthermore, the guidance is generally generic and difficult to tailor to individual circumstances. With technological advancements, devices such as home blood glucose monitors and insulin pumps have become increasingly popular. These devices can monitor patients' blood glucose levels in real time and adjust insulin dosages as needed. While this approach improves monitoring convenience, it lacks intelligent decision support, requiring patients to interpret the data and make decisions independently, which can lead to inappropriate management or complications. Some existing diabetes management systems use a rule-based approach, providing management recommendations based on preset thresholds and algorithms. For example, when blood glucose levels exceed a certain range, the system prompts patients to adjust their diet or increase their exercise. However, this rule-based approach lacks flexibility and adaptability, and fails to fully account for individual differences and dynamic changes in patients.

[0003] In summary, traditional medical guidance lacks real-time and personalization; while home monitoring devices improve monitoring convenience, they lack intelligent decision-making support; and rule-based management systems lack flexibility and adaptability. Therefore, existing diabetes management methods are deficient in terms of real-time, personalization, and intelligence. Summary of the Invention

[0004] This application aims to propose a method and system for generating guidance text based on diabetes management strategy recommendations, which can improve the real-time, personalization and intelligence of diabetes management.

[0005] In a first aspect, an embodiment of the present application provides a method for generating a guidance text based on diabetes management strategy recommendations, the method comprising:

[0006] Obtain a text dataset containing patient information, medical records, and lifestyle habits;

[0007] Performing entity recognition on each text in the text dataset to obtain multiple entities, and extracting relationships between entities from each text;

[0008] Constructing a knowledge graph based on the multiple entities and the relationships between the entities;

[0009] aggregating the entities and the relations in the knowledge graph using a multi-layer attention layer to obtain a first embedding representation;

[0010] generating text embeddings for the entities and the relations in the knowledge graph, and aggregating the text embeddings into a second embedding representation using the multi-layer attention layer;

[0011] aligning and fusing the first embedding representation and the second embedding representation to obtain a target embedding representation;

[0012] determining a plurality of management policy candidate vectors according to the target embedding representation and a target question;

[0013] selecting a target management policy from the plurality of management policy candidate vectors, and generating a diabetes management guidance text according to the target management policy.

[0014] Compared with the prior art, the first aspect of the present application has the following beneficial effects:

[0015] The method obtains a text dataset containing patient information, medical records, and living habits; performs entity recognition on each text in the text dataset to obtain a plurality of entities, and extracts the relations between the entities from each text; constructs a knowledge graph according to the plurality of entities and the relations between the entities; aggregates the entities and the relations in the knowledge graph using a multi-layer attention layer to obtain a first embedding representation; generates text embeddings for the entities and the relations in the knowledge graph, and aggregates the text embeddings into a second embedding representation using the multi-layer attention layer; aligns and fuses the first embedding representation and the second embedding representation to obtain a target embedding representation; determines a plurality of management policy candidate vectors according to the target embedding representation and a target question; selects a target management policy from the plurality of management policy candidate vectors, and generates a diabetes management guidance text according to the target management policy. In this way, the entity information and the relation information in the knowledge graph are propagated and aggregated through three layers of attention layers, which can accurately learn the relevant features of the user and avoid the propagation of irrelevant noise. The text embeddings are also aggregated into a second embedding representation through three layers of attention layers, that is, the topological information of the knowledge graph is incorporated into the embedding representation, which helps to enhance the quality of the embedding representation. The high-quality first embedding representation and the second embedding representation are fused to obtain a high-quality target embedding representation, and a more personalized management policy that meets the patient's input target question can be selected according to the high-quality target embedding representation, so that a more accurate diabetes management guidance text can be generated for diabetes management guidance. Moreover, the method only requires the patient to input the question and the text data related to the patient, and can directly obtain the diabetes management guidance text, which is efficient, real-time, and intelligent. Therefore, the method can improve the real-time performance, personalization, and intelligence of diabetes management.

[0016] In some embodiments, the aggregating the entities and the relations in the knowledge graph by using the multi-layer attention layer to obtain the first embedding representation comprises:

[0017] The first attention score between the patient entity and each relation of the layer corresponding to the patient entity is calculated by using the first layer attention layer;

[0018] According to the first attention score, all relations of the layer corresponding to the patient entity are aggregated to obtain the relation representation of the current layer;

[0019] The head entity representation and the relation representation in the current layer are spliced to obtain a spliced feature representation, and the spliced feature representation is input into a multi-layer perception in the second layer attention layer to obtain a second attention score;

[0020] Based on the first attention score and the second attention score, all neighbor entities connected with the patient entity relation are aggregated to calculate the embedding representation of the current layer;

[0021] The relation representations of all layers and the embedding representations of all layers are aggregated by using the third layer attention layer to obtain the first embedding representation.

[0022] In some embodiments, the aggregating the entities and the relations in the knowledge graph by using the multi-layer attention layer to obtain the first embedding representation comprises:

[0023]

[0024] wherein, E (l) represents the embedding representation of the current layer, I represents the number of triples in the lth layer, β user_i represents the first attention score, β entity_i represents the second attention score, represents the i-th neighbor entity in the lth layer.

[0025] In some embodiments, the aggregating the entities and the relations in the knowledge graph by using the multi-layer attention layer to obtain the first embedding representation comprises:

[0026]

[0027] β l = (E (0) ||R (0) ) · (E (l) ||R (l) ) T

[0028] wherein, E odenotes a first embedding representation, o denotes a placeholder, agg(·) denotes an aggregation function, E (l) denotes an embedding representation of the l-th layer, R (l) denotes a relationship representation of the l-th layer, β l denotes a relationship representation of the l-th layer, L denotes an attention score, and T denotes a transpose.

[0029] In some embodiments, the aligning and fusing the first embedding representation and the second embedding representation to obtain a target embedding representation comprises:

[0030] mapping the first embedding representation and the second embedding representation to the same space using a mapping matrix, and aligning the first embedding representation and the second embedding representation using maximum cosine similarity to obtain an aligned first embedding representation and an aligned second embedding representation;

[0031] fusing the aligned first embedding representation and the aligned second embedding representation to obtain a target embedding representation.

[0032] In some embodiments, the determining a plurality of management policy candidate vectors according to the target embedding representation and a target question comprises:

[0033] converting the target question into a question vector representation;

[0034] fusing the question vector representation and the target embedding representation to obtain a query vector;

[0035] selecting a plurality of management policy candidate vectors from a management policy library according to the query vector.

[0036] In some embodiments, the selecting a target management policy from the plurality of management policy candidate vectors and generating a diabetes management guidance text according to the target management policy comprises:

[0037] if the target question is the same as one of a plurality of historical questions, obtaining a historical management policy corresponding to the historical question that is the same as the target question;

[0038] deleting the historical management policy from the plurality of management policy candidate vectors to obtain remaining management policy candidate vectors;

[0039] selecting a target management policy that is most relevant to the target question from the remaining management policy candidate vectors;

[0040] generating a diabetes management guidance text according to the target management policy.

[0041] In a second aspect, the embodiments of the present application further provide a guidance text generation system based on diabetes management strategy recommendation, the system comprising:

[0042] a text data acquisition unit configured to acquire a text dataset containing patient information, medical records, and living habits;

[0043] a text data processing unit configured to perform entity recognition on each text in the text dataset to obtain a plurality of entities and extract relationships between the entities from the each text;

[0044] a knowledge graph construction unit configured to construct a knowledge graph according to the plurality of entities and the relationships between the entities;

[0045] a first data aggregation unit configured to aggregate entities and relationships in the knowledge graph using a multi-layer attention layer to obtain a first embedding representation;

[0046] a second data aggregation unit configured to generate text embeddings of the entities and relationships in the knowledge graph and aggregate the text embeddings into a second embedding representation using the multi-layer attention layer;

[0047] a data alignment and fusion unit configured to align and fuse the first embedding representation and the second embedding representation to obtain a target embedding representation;

[0048] a management strategy determination unit configured to determine a plurality of management strategy candidate vectors according to the target embedding representation and a target problem;

[0049] a guidance text generation unit configured to generate a diabetes management guidance text according to the plurality of management strategy candidate vectors.

[0050] In a third aspect, the embodiments of the present application further provide an electronic device, comprising at least one control processor and a memory in communication connection with the at least one control processor; the memory stores instructions executable by the at least one control processor, and the instructions are executed by the at least one control processor to enable the at least one control processor to perform the guidance text generation method based on diabetes management strategy recommendation as described above.

[0051] In a fourth aspect, the embodiments of the present application further provide a computer readable storage medium, which stores computer executable instructions for causing a computer to perform the guidance text generation method based on diabetes management strategy recommendation as described above.

[0052] It can be understood that the beneficial effects of the second aspect to the fourth aspect compared with the related art are the same as the beneficial effects of the first aspect compared with the related art, and can be seen in the related description in the first aspect, which will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS

[0053] The above and / or additional aspects and advantages of the present application will become apparent and be readily appreciated from the following description, including the references to the figures, in which:

[0054] Figure 1 is a flow diagram of an embodiment of a guidance text generation method based on diabetes management strategy recommendation provided by the present application;

[0055] Figure 2 is a structural diagram of an embodiment of a guidance text generation system based on diabetes management strategy recommendation provided by the present application;

[0056] Figure 3 is a structural diagram of an embodiment of an electronic device provided by the present application. DETAILED DESCRIPTION

[0057] Embodiments of the present application are described in detail below with reference to the accompanying drawings, in which examples of the embodiments are shown, wherein the same or similar notations represent the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be understood as a limitation of the present application.

[0058] In the description of the present application, if there is a description to first, second, etc., it is only for the purpose of distinguishing technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features or the sequence of indicated technical features.

[0059] In the description of the present application, it should be understood that the position description, such as the position or location relationship indicated by up, down, etc., is based on the position or location relationship shown in the drawings, only for the purpose of facilitating the description of the present application and simplifying the description, and is not intended to indicate or imply that the device or element indicated must have a particular position, be constructed and operated in a particular position, and therefore cannot be understood as a limitation of the present application.

[0060] In the description of the present application, it should be noted that, unless otherwise explicitly limited, the words such as setting, installing, connecting, etc. should be broadly understood, and the person skilled in the art can reasonably determine the specific meaning of the above words in the present application in combination with the specific content of the technical solution.

[0061] Currently, the management of diabetes mainly relies on traditional medical guidance, home monitoring, and medication. Traditionally, diabetic patients rely on regular follow-up visits and face-to-face education guidance from doctors. These guidelines usually include dietary recommendations, exercise plans, blood glucose monitoring methods, and insulin usage instructions. However, this method lacks real-time and individualization, and patients often need to seek medical help after symptoms appear, and the guidance content is general and difficult to adjust to individual circumstances. With the development of technology, home blood glucose monitors, insulin pumps, and other devices have gradually become popular. These devices can monitor patients' blood glucose levels in real time and adjust insulin doses as needed. Although this method improves the convenience of monitoring, it lacks intelligent decision support, and patients still need to interpret the data and make decisions, which may lead to improper management or the occurrence of complications. Some existing diabetes management systems use a rule-based approach to provide management recommendations based on pre-set thresholds and algorithms. For example, when blood glucose levels exceed a certain range, the system will prompt the patient to adjust their diet or increase exercise. However, this rule-based approach lacks flexibility and adaptability and cannot fully consider individual differences and dynamic changes in patients.

[0062] In summary, traditional medical guidance lacks real-time and individualization; home monitoring devices improve the convenience of monitoring but lack intelligent decision support; rule-based management systems lack flexibility and adaptability.

[0063] To solve the above-mentioned problems of existing diabetes management methods in real-time, individualization, and intelligence, the present application proposes a guidance text generation method and system based on diabetes management strategy recommendation.

[0064] Reference Figure 1 The guidance text generation method based on diabetes management strategy recommendation provided by the embodiments of the present application. The guidance text generation method based on diabetes management strategy recommendation is applied to an electronic device, which can be a server or a mobile terminal, etc. As shown in Figure 1 The guidance text generation method based on diabetes management strategy recommendation can include the following steps:

[0065] Step S100, obtaining a text data set containing patient information, medical records, and living habits;

[0066] Step S200, performing entity recognition on each text in the text data set to obtain multiple entities and extracting the relationship between entities from each text;

[0067] Step S300, constructing a knowledge graph according to the multiple entities and the relationship between the entities;

[0068] In step S400, the multi-layer attention layer is used to aggregate the entities and relationships in the knowledge graph to obtain a first embedding representation.

[0069] In step S500, text embeddings are generated for the entities and relationships in the knowledge graph, and the multi-layer attention layer is used to aggregate the text embeddings into a second embedding representation.

[0070] In step S600, the first embedding representation and the second embedding representation are aligned and fused to obtain a target embedding representation.

[0071] In step S700, a plurality of management policy candidate vectors are determined according to the target embedding representation and the target question.

[0072] In step S800, a target management policy is selected from the plurality of management policy candidate vectors, and a diabetes management guidance text is generated according to the target management policy.

[0073] In this embodiment, a text dataset containing patient information, medical records, and lifestyle habits is obtained. Entity recognition is performed on each text in the text dataset to obtain a plurality of entities, and the relationships between the entities are extracted from each text. A knowledge graph is constructed according to the plurality of entities and the relationships between the entities. A multi-layer attention layer is used to aggregate the entities and relationships in the knowledge graph to obtain a first embedding representation. Text embeddings are generated for the entities and relationships in the knowledge graph, and the multi-layer attention layer is used to aggregate the text embeddings into a second embedding representation. The first embedding representation and the second embedding representation are aligned and fused to obtain a target embedding representation. A plurality of management policy candidate vectors are determined according to the target embedding representation and the target question. A target management policy is selected from the plurality of management policy candidate vectors, and a diabetes management guidance text is generated according to the target management policy. In this way, the entity information and relationship information in the knowledge graph are propagated and aggregated through the three-layer attention layer, which can accurately learn the relevant features of the user and avoid the propagation of irrelevant noise. The text embeddings are also aggregated into a second embedding representation through the three-layer attention layer, which can incorporate the topological information of the knowledge graph into the embedding representation, helping to enhance the quality of the embedding representation. The high-quality first embedding representation and the second embedding representation are fused to obtain a high-quality target embedding representation, which can select a more personalized management policy that meets the patient's input target question, thereby generating a more accurate diabetes management guidance text for diabetes management guidance. Moreover, this method only requires the patient to input the question and the text data related to the patient, and can directly obtain the diabetes management guidance text, which is efficient, real-time and intelligent. Therefore, this method can improve the real-time, personalization and intelligence of diabetes management.

[0074] The patient information can include the patient's (i.e., the user's) age, gender, duration of illness, and daily blood glucose fluctuation range, etc.

[0075] The medical record can include information such as past treatment plans, medication, and complications.

[0076] The lifestyle habit can include information such as eating preferences (sweet, salty, etc. taste, and roughly the amount of intake per meal, etc.), exercise (exercise frequency and exercise intensity, etc. text description), and work and rest regularity (daily sleep and wake-up time, etc. related text).

[0077] The entity recognition of each text in the text data set can be performed by using a named entity recognition (NER) model to recognize entities in each text in the text data set. For example, a BERT-based NER model.

[0078] The relationship extraction between entities in each text can be performed by using a relationship extraction model to extract relationships between entities in each text. For example, a deep learning-based relationship extraction network.

[0079] In some embodiments, the entities and relationships in the knowledge graph are aggregated using a multi-layer attention layer to obtain a first embedding representation, including:

[0080] The first attention score between the patient entity and each relationship corresponding to the patient entity in the corresponding layer is calculated using the first layer attention layer.

[0081] According to the first attention score, all relationships corresponding to the patient entity in the corresponding layer are aggregated to obtain a relationship representation of the current layer.

[0082] The head entity representation and the relationship representation in the current layer are concatenated to obtain a concatenated feature representation, and the concatenated feature representation is input into a multi-layer perceptron in the second layer attention layer to obtain a second attention score.

[0083] Based on the first attention score and the second attention score, all neighbor entities connected to the patient entity relationship are aggregated to calculate the embedding representation of the current layer.

[0084] The relationship representation of all layers and the embedding representation of all layers are aggregated using a third layer attention layer to obtain a first embedding representation.

[0085] In the embodiment, the first attention layer is adopted to calculate the first attention score between the patient entity and each relationship of the patient entity corresponding layer; all relationships of the patient entity corresponding layer are aggregated according to the first attention score to obtain the relationship representation of the current layer; the head entity representation and the relationship representation in the current layer are spliced to obtain the spliced feature representation, and the spliced feature representation is input into the multi-layer perception in the second attention layer to obtain the second attention score; all neighbor entities connected with the patient entity relationship are aggregated based on the first attention score and the second attention score to calculate the embedding representation of the current layer; and the third attention layer is adopted to aggregate the relationship representation of all layers and the embedding representation of all layers to obtain the first embedding representation. In this way, the entity and relationship in the knowledge graph are propagated and aggregated by adopting the multi-layer attention, the related features of the patient user can be accurately learned, and the propagation of irrelevant noise can be avoided. The first attention layer is adopted to calculate the attention score, which can be used to control the relevance between the patient user (i.e., the patient entity) and the neighbor entity and the relationship in the knowledge graph. If the attention score is higher (i.e., the relevance is higher), it indicates that the patient user has a higher interest in the neighbor entity connected with the relationship, and then the weight of the neighbor entity and the relationship is higher, which can avoid introducing irrelevant information of multiple users. The second attention layer is adopted to calculate the attention score, which can be used to measure the reliability of a triple (i.e., the comprehensive relevance between the neighbor entity and (head entity, relationship, user)), avoid learning unreliable triples and introducing information with small relevance to the user, and give a higher weight to reliable triples as much as possible. The third attention layer is adopted to calculate the attention score, which can be used to measure the similarity between the embedding representation of different propagation layers in the knowledge graph propagation process and the embedding representation of the 0th layer, solve the over-smoothing problem, and avoid introducing too much noise.

[0086] The third attention layer described above is a propagation layer, which can aggregate the relationship representation of all propagation layers and the embedding representation of all propagation layers to obtain the first embedding representation.

[0087] In some embodiments, based on the first attention score and the second attention score, all neighbor entities connected with the patient entity relationship are aggregated to calculate the embedding representation of the current layer, including:

[0088]

[0089] wherein E (l) represents the embedding representation of the current layer, I represents the number of triples in the lth layer, and β user_i represents the first attention score, β entity_i represents the second attention score, represents the i-th neighbor entity in the lth layer.

[0090] In the embodiment, the reliability of a triple (i.e., the comprehensive correlation between the neighbor entity and (the head entity, the relation, and the user)) can be measured by aggregating all neighbor entities connected with the patient entity based on the first attention score and the second attention score, avoiding learning unreliable triples and introducing information with less correlation with the user, and the reliable triples can be given higher weights as much as possible.

[0091] In some embodiments, the third layer attention layer is used to aggregate the relation representations of all layers and the embedding representations of all layers to obtain the first embedding representation, including:

[0092]

[0093] β l = (E (0) || R (0) ) · (E (l) || R (l) ) T

[0094] wherein E o represents the first embedding representation, o represents a placeholder, agg(·) represents an aggregation function, E (l) represents the embedding representation of the lth layer, R (l) represents the relation representation of the lth layer, β l represents the lth layer, and L represents the attention score, and T represents transposition.

[0095] In the embodiment, the third layer attention layer is used to aggregate the relation representations of all layers and the embedding representations of all layers to obtain the first embedding representation, which can measure the similarity between the embedding representations of different propagation layers in the propagation process of the knowledge graph and the embedding representation of the 0th layer, solve the over-smoothing problem, and avoid introducing too much noise.

[0096] It should be noted that the learning process of the second embedding representation is similar to that of the first embedding representation, and the difference lies in that the initial entity representation and the relation representation of the first embedding representation are randomly initialized, and the initial entity representation and the relation representation of the second embedding representation are its text representation.

[0097] In some embodiments, the first embedding representation and the second embedding representation are aligned and fused to obtain a target embedding representation, including:

[0098] The mapping matrix is used to map the first embedding representation and the second embedding representation to the same space, and the maximum cosine similarity is used to align the first embedding representation and the second embedding representation to obtain the aligned first embedding representation and the aligned second embedding representation.

[0099] The aligned first embedding representation and the aligned second embedding representation are fused by weighting to obtain a target embedding representation.

[0100] In this embodiment, the first embedding representation and the second embedding representation are mapped to the same space by using a mapping matrix, and the first embedding representation and the second embedding representation are aligned by maximizing cosine similarity, to obtain an aligned first embedding representation and an aligned second embedding representation; the aligned first embedding representation and the aligned second embedding representation are fused by weighting to obtain a target embedding representation. In this way, the two aligned embedding representations are combined into the final embedding representation (i.e., the target embedding representation) of the patient user by using the weighted fusion manner, so that the final embedding representation can not only retain the structured information of the knowledge graph, but also fuse the text semantic information, thereby providing a more comprehensive and accurate feature basis for subsequent recommendation management strategies and generation of diabetes management guidance texts.

[0101] In some embodiments, according to the target embedding representation and the target question, a plurality of management strategy candidate vectors are determined, including:

[0102] The target question is converted into a question vector representation;

[0103] The question vector representation and the target embedding representation are fused to obtain a query vector;

[0104] According to the query vector, a plurality of management strategy candidate vectors are selected from the management strategy library.

[0105] In this embodiment, the target question is converted into a question vector representation; the question vector representation and the target embedding representation are fused to obtain a query vector; and according to the query vector, a plurality of management strategy candidate vectors are selected from the management strategy library. In this way, the plurality of management strategy candidate vectors are selected from the management strategy library according to the question vector representation and the target embedding representation, which can select management strategies that are more in line with the specific individualization of the patient.

[0106] In some embodiments, a target management strategy is selected from the plurality of management strategy candidate vectors, and a diabetes management guidance text is generated according to the target management strategy, including:

[0107] If the target question is the same as one of the plurality of historical questions, a historical management strategy corresponding to the historical question identical to the target question is obtained;

[0108] The historical management strategy is deleted from the plurality of management strategy candidate vectors to obtain remaining management strategy candidate vectors;

[0109] The target management strategy most relevant to the target question is selected from the remaining management strategy candidate vectors;

[0110] The diabetes management guidance text is generated according to the target management strategy.

[0111] In the embodiment, if the target problem is the same as one of the plurality of historical problems, a historical management strategy corresponding to the historical problem identical to the target problem is obtained; the historical management strategy is deleted from the plurality of management strategy candidate vectors to obtain a remaining management strategy candidate vector; a target management strategy most relevant to the target problem is selected from the remaining management strategy candidate vector; and a diabetes management guidance text is generated according to the target management strategy. In this way, by selecting the target management strategy most relevant to the target problem from the remaining management strategy candidate vector, the diversity of the management strategy support can be improved, and the same reply for the same problem can be avoided.

[0112] The above obtaining the historical management strategy corresponding to the historical problem identical to the target problem can be that the similarity between the target problem and the historical problem is calculated, and the historical management strategy corresponding to the historical problem identical to the target problem is obtained when the similarity is greater than a preset value. It should be noted that the text sentences corresponding to the target problem and the historical problem in the embodiment do not need to be completely consistent.

[0113] In order for those skilled in the art to better understand the technical solutions of the present application, a set of best embodiments is provided as follows:

[0114] Currently, the management of diabetes mainly relies on traditional medical guidance, family monitoring and drug treatment. Traditionally, diabetic patients rely on regular follow-up and face-to-face education guidance from doctors. These guidelines usually include dietary recommendations, exercise plans, blood glucose monitoring methods and insulin usage instructions. However, this method lacks real-time and individualization, and patients often need to seek medical help after symptoms appear, and the guidance content is general and difficult to adjust to individual circumstances. With the development of technology, home blood glucose monitors, insulin pumps and other devices have gradually become popular. These devices can monitor patients' blood glucose levels in real time and adjust insulin doses as needed. Although this method improves the convenience of monitoring, it lacks intelligent decision support, and patients still need to interpret the data and make decisions themselves, which may lead to improper management or the occurrence of complications. Some existing diabetes management systems now use a rule-based approach to provide management recommendations based on preset thresholds and algorithms. For example, when the blood glucose level exceeds a certain range, the system will prompt the patient to adjust their diet or increase their exercise. However, this rule-based approach lacks flexibility and adaptability, and cannot fully consider individual differences and dynamic changes in patients.

[0115] In summary, traditional medical guidance lacks real-time and individualization; family monitoring devices improve the convenience of monitoring, but lack intelligent decision support; rule-based management systems lack flexibility and adaptability.

[0116] In view of the limitations of the prior art, the present embodiment proposes a method for real-time support for self-management of children and adolescents with type 1 diabetes based on a large language model. This method uses advanced large language model technology to provide personalized self-management guidance and recommendations to patients, aiming to improve the self-management ability and quality of life of children and adolescents with type 1 diabetes.

[0117] Self-management can refer to an individual taking proactive measures to manage their own health condition in daily life, including diet control, exercise, blood glucose monitoring, and medication, etc. For children and adolescents with type 1 diabetes, self-management is of great importance in controlling the disease and preventing complications.

[0118] Real-time support system can refer to a system that can provide information, recommendations or guidance in real time. In this embodiment, the real-time support method is based on a large language model, which can provide personalized self-management guidance and support according to the specific circumstances and needs of children and adolescents with type 1 diabetes.

[0119] This embodiment uses the powerful text generation and understanding capabilities of the large language model to provide personalized self-management guidance and support for children and adolescents with type 1 diabetes. The technical solution of this embodiment specifically includes the following contents:

[0120] 1. Data collection phase.

[0121] First, collect various text data, such as:

[0122] (1) Patient basic information text, such as age, gender, duration of illness, and daily blood glucose fluctuation range, etc. These text information will be used to extract key parameters for analysis later.

[0123] (2) Medical record text: past diagnosis and treatment plan, medication, and presence or absence of complications, etc. Extract key numerical information such as specific drug dosage, insulin use frequency, etc. from it (this step may involve simple text parsing, extracting corresponding numerical values through set keyword matching rules, such as finding the specific numerical content after "insulin dosage is").

[0124] (3) Lifestyle text: dietary preferences (e.g. love sweet, salty, etc. taste, approximate intake per meal, etc. description), exercise (e.g. exercise frequency, exercise intensity, etc. textual representation), work and rest schedule (e.g. daily sleep and wake-up time, etc. related text).

[0125] 2. Text preprocessing phase.

[0126] (1) Cleaning and Standardization: The text collected in step 1 is cleaned to remove irrelevant punctuation, extra spaces, and incorrect words, and some content with multiple expressions is standardized, such as "every day" and "every day" are unified into one expression, to facilitate subsequent processing.

[0127] (2) Classification and Annotation: According to the nature of the text content, it is classified and annotated, such as basic information, medical related and life habits, etc., to facilitate the model to distinguish different content of the board.

[0128] 3. Constructing patient knowledge graph.

[0129] Entity recognition: Identify entities such as patients, age, gender, duration of illness, blood glucose fluctuation range, related diet and management recommendations from preprocessed text. You can use a named entity recognition (NER) model, such as a BERT-based NER model.

[0130] Relationship extraction: Determine the relationship between entities, such as "patient-age-17" and "patient-illness-disease". You can use a relationship extraction model, such as a deep learning-based relationship extraction network.

[0131] Graph construction: Combine the identified entities and relationships into a knowledge graph in the form of triples.

[0132] 4. Multi-modal recommendation algorithm embedding learning stage.

[0133] First, use an id-based embedding method to learn the relevant feature representation of the user and the embedding representation of the relevant management strategy (project). Specifically, it includes:

[0134] In this part, the embodiment proposes a recommendation framework based on multi-layer attention, in which the entity and relationship information of the knowledge graph is propagated and aggregated through the three-layer attention layer proposed in the embodiment to accurately learn the relevant features of the user and avoid the propagation of irrelevant noise. The embedding of all ids in this layer is randomly initialized, and then meaningful id representation is learned.

[0135] Most existing knowledge-aware methods usually perform recursive embedding propagation by enumerating all neighbors in each layer. However, as the number of propagation layers increases, the number of neighbors of a node increases exponentially, resulting in learned node representations that cannot be distinguished from each other. To alleviate this problem, the embodiment proposes a three-layer attention layer combined with information propagation to control the propagation of neighbor entity information and relationship information in each layer, avoiding the learned node representations to be similar. The three-layer attention layer includes the user layer (i.e. the first layer attention layer), the entity layer (i.e. the second layer attention layer), and the propagation layer (i.e. the third layer attention layer). Specifically:

[0136] (1) The user-level attention score is used to control the relevance between the knowledge graph neighbor entities and users, avoiding the introduction of irrelevant information from multiple users. The attention score β user By calculating the i-th relationship r between the user (ie, patient entity) and the current layer (assuming it is the l-th layer) i (l) The inner product between them can be used to measure the similarity or association strength between two vectors. The core idea is that if the inner product score is high, it means that the user has a good understanding of the neighboring entity connected to this relationship. Have a higher interest. user One of the weights that can be used for weighted aggregation of neighbor entity information, and β user It can also be used as the weight of the relationship (i.e., the first attention score). All the relationship representations of the lth layer are weighted and aggregated to obtain a total relationship representation of the lth layer: Where I represents the number of triplets in the lth layer.

[0137] (2) The entity-level attention score is used to control the correlation between neighbor entities and head entities and relations. A feature representation is obtained by concatenating the head entity representation and the relation representation, and this feature representation is input into a three-layer multi-layer perceptron (MLP) to obtain the entity-level attention score β ebtity (i.e., the second attention score), the user-level attention score and the entity-level attention score are added together to get the final attention score of the neighbor entity. This attention score measures the comprehensive relevance between the neighbor entity and (head entity, relationship, and user), avoiding learning unreliable triples and introducing information with less relevance to the user. The current layer embedding representation of the entity can be obtained through this attention score.

[0138] (3) The third attention layer measures the contribution of the embedding representations of different layers to the final embedding representation. Since the high-order information is relatively far away from the user and the central entity, when the number of layers increases, the average aggregation of the representations of each layer will not only cause over-smoothing problems, but also introduce noise, resulting in suboptimal recommendation results. Therefore, this embodiment designs attention scores for the entity representation and relationship representation of each layer to avoid introducing too much noise. The user or item representation learned by the ID-based method can be expressed as:

[0139]

[0140] Where agg(·) represents an aggregation function and o represents a placeholder, which can represent a user or a project. l =(E (0) ||R (0) )·(E(l) ||R (l) ) T The attention score of the first layer is to be learned.

[0141] The embodiment can effectively filter noise and improve the quality of user representation and item representation by adding multi-layer attention. In addition, the embodiment not only transmits entity information, but also transmits and aggregates relationship information in the information transmission process, further utilizes auxiliary information of the knowledge graph to improve the accuracy of recommendation.

[0142] The natural language processing method such as Bert is used to learn the text embedding of each entity and relationship in the knowledge graph, and then the attention aggregation method is used to aggregate the text embedding into user representation and item representation (i.e., the second embedding representation). This step adopts a similar aggregation process as the id-based embedding method. However, unlike the random initialization of the embedding based on the id-based method, this step is a text-based method to use the text embedding of the user and the knowledge graph as the initial embedding, and then the topological information of the knowledge graph is introduced into the embedding representation through the recommendation framework based on the three-layer attention layer, which helps to enhance the quality of the embedding representation.

[0143] Then, the id-based patient representation E o and the text-based patient representation are aligned and combined to obtain the final embedding representation of the patient. In order to fully exert the advantages of the two methods, the embodiment aligns and combines the id-based patient representation E o and the text-based patient representation . By mapping based on cosine similarity, the difference between the two representations in the semantic space is eliminated, that is, the mapping matrix is used to map E o and to the same space to obtain and W id and W t are the corresponding mapping matrices of E o and , and then the two representations are aligned by maximizing the cosine similarity, wherein the mapping matrix can be known. Then, the weighted fusion method is used to combine the two aligned embedding representations into the final embedding representation of the patient, so that the representation can not only retain the structured information of the knowledge graph, but also integrate the text semantic information, providing a more comprehensive and accurate feature basis for subsequent applications. The formula definition of the final embedding representation (i.e., the target embedding representation) is as follows:

[0144]

[0145] 5, Intervention stage of large language model.​

[0146] Embedding technology converts the user input question (i.e. target question) into a vector representation (i.e. question vector representation). The user embedding representation containing the user's personalized features Combined with the question vector representation to obtain the query vector, and then use the inner product to calculate the query vector and the candidate strategy vector in the management strategy library (which can be a database constructed manually based on historical data or historical experience) The top-k management strategies are then recalled as candidate vectors for the large language model (i.e., multiple management strategy candidate vectors). Inner product similarity is a method for measuring the similarity between two vectors. It reflects the degree of similarity between them by calculating the inner product of the two vectors. Inner product similarity is particularly effective in high-dimensional spaces, where the importance of a particular dimension is relatively low.

[0147] The large language model further analyzes the question and selects the most relevant strategy from the top-k candidate vectors. It then organizes the answer based on the most relevant strategy to obtain the self-management guidance text (i.e., diabetes management guidance text). This step includes:

[0148] Feature extraction and parameter generation: The pre-processed text is input into the large language model, and the model uses natural language understanding capabilities to identify key features in the text. For example, the approximate daily carbohydrate intake can be analyzed from the text describing dietary preferences and daily intake (this can be achieved by combining the text on the types and portions of staple foods mentioned with the corresponding nutrient composition table of common foods to obtain specific parameters such as the number of grams, which involves simple numerical calculations of corresponding nutrients). The standard can be measured from the text on exercise conditions combined with the standard exercise intensity to determine the metabolic equivalent value corresponding to the exercise intensity (the corresponding parameters are generated by matching the general exercise intensity and metabolic equivalent correspondence table), etc.

[0149] Historical Question Retrieval: This function checks whether the user has previously asked the question. If the question has been asked, the relevant management strategies for the previous answers are displayed and marked in the candidate strategy library. The large model then selects the most relevant strategy from the top k management strategies that have not been answered and uses it to answer the question, thus improving the diversity of management strategy support. If the question has not been asked, the model only needs to select the most relevant strategy from the top k management strategies to answer the question.

[0150] Personalized strategy generation: Based on the extracted feature parameters and candidate diabetes self-management strategies (such as different age groups, reasonable diet structure corresponding to blood glucose range, and exercise duration recommendations, etc. Rule knowledge, this part of knowledge can be embedded in model training in the form of text or as a reference basis when calling), the large language model generates personalized self-management guidance text, such as for a 12-year-old, exercise-loving but blood glucose fluctuating patient, generate "Given that you have high-intensity exercise for about 1 hour every day, it is recommended to increase the intake of 10-15 grams of carbohydrates before exercise to prevent hypoglycemia, and monitor blood glucose after exercise. If the blood glucose is higher than 10 mmol / L, you can supplement water and rest for 15 minutes before measuring again" and other guidance content texts containing specific recommendations and corresponding parameter ranges.

[0151] 6. Feedback and optimization phase.

[0152] Patients or medical staff can provide feedback on the management strategy results obtained in the large language model intervention stage. These feedback texts are also collected and analyzed, and the large language model continuously adjusts the generation of management strategies based on feedback to optimize the accuracy of feature extraction and guidance generation for other patients in subsequent services. This process may involve statistical analysis of the proportion of positive and negative evaluation keywords in feedback texts, etc. Simple mathematical statistics methods are used to measure the generation effect and make targeted improvements.

[0153] Overall, text analysis, feature extraction and matching, simple nutrition and exercise-related numerical conversion, and text generation logic are mainly used to create personalized self-management support services for children and adolescents with type 1 diabetes, combining the capabilities of knowledge graphs and large language models. During the process, some basic mathematical calculations are involved to generate practical parameter assistance guidance text output according to specific professional knowledge associations.

[0154] 7. Dynamic information knowledge base update and retrieval.

[0155] The information knowledge base not only contains comprehensive information about children and adolescents with type 1 diabetes, but also can be dynamically updated to ensure that the text data information obtained by users is the latest and most accurate. This is particularly important for medical technology, as medical knowledge and best practices are constantly evolving.

[0156] 8. Conversation history-driven intent recognition.

[0157] This embodiment method recognizes the user's intent by storing and analyzing the user's conversation history, thereby providing more relevant and timely responses. This context-based conversation management can improve user experience and satisfaction.

[0158] 9. Multi-modal information output.

[0159] The method of this embodiment can convey information and suggestions to users through various means such as graphical interface, voice, and short message, etc., improving the efficiency and flexibility of information transmission.

[0160] 10. Modular design.

[0161] The system constructed by the method of this embodiment adopts modular design, including user information configuration, knowledge base retrieval, dialogue record, and intention recommendation module units, etc., making the system easy to extend and maintain.

[0162] 11. Real-time feedback and interaction.

[0163] The method of this embodiment can provide real-time feedback and interaction, which is particularly important for medical management scenarios that require quick response, and can respond to user needs and changes in a timely manner.

[0164] 12. Improvement of user participation.

[0165] Through the interactivity and interest of the large language model, the participation and interest of the child in self-management education are improved, thereby improving the effect of self-management.

[0166] Compared with the prior art, the method of this embodiment has the following advantages:

[0167] 1. Personalized and precise user information configuration.

[0168] This embodiment can provide more personalized and precise self-management recommendations for users by collecting detailed information such as user's case, treatment, eating habits, and exercise preferences. This configuration not only improves the relevance of recommendations, but also adjusts management strategies according to the user's specific situation, thereby improving the effect of self-management.

[0169] 2. Comprehensive and updated information knowledge base retrieval.

[0170] The information knowledge base contains comprehensive information about children and adolescents with type 1 diabetes, including disease information, treatment plans, common problems, and drug recommendations. This comprehensive information ensures that users can obtain the latest and most accurate medical information, which helps to improve the scientificity and effectiveness of treatment.

[0171] 3. Efficient dialogue record and history matching.

[0172] This embodiment stores all dialogue history between the user and the large model system, and can match the last 30 dialogue records of the current user. This efficient dialogue record and history matching function allows users to quickly review previous communication content, helping to maintain the coherence and consistency of the dialogue, while also facilitating the system to better understand user needs and preferences.

[0173] 4. Flexible intent recommendation module.

[0174] The recommendation algorithm in the intent recommendation module of the present embodiment (i.e., the multi-modal recommendation algorithm) can not only recall relevant management strategies according to the personalized features of the user and different user dialogue needs, but also use different prompt words to further drive the large model to select appropriate management strategies for reply. In addition, it can also avoid giving the same reply to the same question according to the historical dialogue, and improve the possibility of the user contacting diversified management strategies. This flexibility enables the system to quickly adapt to various needs of the user, providing more accurate and timely responses, thereby improving user experience and satisfaction.

[0175] 5. Real-time and interactivity.

[0176] The real-time support system based on large language models can provide real-time information, suggestions or guidance. This real-time and interactivity is not possessed by the prior art. Users can obtain feedback in real time, which is particularly important for medical management scenarios that require quick response.

[0177] 6. Improve self-management ability and quality of life.

[0178] Through the above advantages, the technical solution of the present embodiment can significantly improve the self-management ability of children and adolescents with type 1 diabetes, help them better control the disease, prevent complications, and thus improve the quality of life.

[0179] With reference to Figure 2 The present embodiment also provides a guidance text generation system based on diabetes management strategy recommendation. The system can include a text data acquisition unit 100, a text data processing unit 200, a knowledge graph construction unit 300, a first data aggregation unit 400, a second data aggregation unit 500, a data alignment and fusion unit 600, a management strategy determination unit 700, and a guidance text generation unit 800, wherein:

[0180] The text data acquisition unit 100 is configured to acquire a text data set containing patient information, medical records, and living habits.

[0181] The text data processing unit 200 is configured to perform entity recognition on each text in the text data set to obtain a plurality of entities and extract the relationships between the entities from each text.

[0182] The knowledge graph construction unit 300 is configured to construct a knowledge graph according to the plurality of entities and the relationships between the entities.

[0183] The first data aggregation unit 400 is configured to aggregate the entities and relationships in the knowledge graph using a multi-layer attention layer to obtain a first embedding representation.

[0184] The second data aggregation unit 500 is configured to generate text embedding of entities and relationships in the knowledge graph, and aggregate the text embedding into a second embedding representation by using a multi-layer attention layer.

[0185] The data alignment and fusion unit 600 is configured to align and fuse the first embedding representation and the second embedding representation to obtain a target embedding representation.

[0186] The management policy determination unit 700 is configured to determine a plurality of management policy candidate vectors according to the target embedding representation and a target question.

[0187] The guidance text generation unit 800 is configured to generate a diabetes management guidance text according to the plurality of management policy candidate vectors.

[0188] It should be noted that, since the diabetes management policy recommendation based guidance text generation system in the embodiment and the diabetes management policy recommendation based guidance text generation method described above are based on the same inventive concept, the corresponding content in the method embodiment is also applicable to the system embodiment, which will not be described in detail here.

[0189] Referring to Figure 3 The embodiments of the present application also provide an electronic device, and the electronic device comprises:

[0190] at least one memory;

[0191] at least one processor;

[0192] at least one program;

[0193] The program is stored in the memory, and the processor executes the at least one program to implement the diabetes management policy recommendation based guidance text generation method described above.

[0194] The electronic device can be any intelligent terminal including a mobile phone, a tablet computer, a personal digital assistant (PDA), a vehicle-mounted computer, etc.

[0195] The electronic device of the embodiments of the present application will be described in detail below.

[0196] The processor 1600 can be implemented in a general central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), or one or more integrated circuits, etc., and is configured to execute a related program to implement the technical solutions provided by the embodiments of the present application.

[0197] The memory 1700 can be implemented in the form of a Read Only Memory (ROM), a static storage device, a dynamic storage device, or a Random Access Memory (RAM), etc. The memory 1700 can store an operating system and other application programs. When the technical solutions provided by the embodiments of the present disclosure are implemented by software or firmware, the related program codes are stored in the memory 1700 and are invoked and executed by the processor 1600 to implement the guidance text generation method based on diabetes management strategy recommendation provided by the embodiments of the present disclosure.

[0198] The input / output interface 1800 is configured to realize information input and output.

[0199] The communication interface 1900 is configured to realize the communication interaction between the device and other devices. The communication can be realized by a wired manner (for example, a USB, a network cable, etc.) or a wireless manner (for example, a mobile network, WIFI, Bluetooth, etc.).

[0200] The bus 2000 is configured to transmit information between various components (for example, the processor 1600, the memory 1700, the input / output interface 1800, and the communication interface 1900) of the device.

[0201] The processor 1600, the memory 1700, the input / output interface 1800, and the communication interface 1900 are connected to each other through the bus 2000 to realize the communication connection between them in the device.

[0202] The present disclosure further provides a storage medium, which is a computer readable storage medium, and stores computer executable instructions for causing a computer to execute the guidance text generation method based on diabetes management strategy recommendation.

[0203] The memory is a non-transitory computer readable storage medium, which can be used to store non-transitory software programs and non-transitory computer executable programs. In addition, the memory can include a high-speed random access memory and can also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state memory device. In some embodiments, the memory can optionally include a memory remotely arranged relative to the processor, and these remote memories can be connected to the processor through a network. Examples of the above network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0204] The embodiments described in the present disclosure are to more clearly illustrate the technical solutions of the present disclosure, and do not constitute a limitation on the technical solutions provided by the present disclosure. Those skilled in the art can know that, as technology evolves and new application scenarios appear, the technical solutions provided by the present disclosure are also applicable to similar technical problems.

[0205] Those skilled in the art can understand that the technical solutions shown in the figures do not constitute a limitation on the present disclosure, and can include more or fewer steps than shown in the figures, or combine certain steps, or different steps.

[0206] The device embodiments described above are merely illustrative, and units described as separate components can or can not be physically separated, that is, can be located in one place, or can be distributed on multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the present embodiment.

[0207] Those skilled in the art can understand that all or some steps in the above disclosed method, the functions of the modules / units in the system and the device can be implemented as software, firmware, hardware and their appropriate combinations.

[0208] The terms "first", "second", "third", "fourth" and the like (if any) in the specification of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily have to describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present 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 including a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0209] It should be understood that, in the application, "at least one" refers to one or more, and "multiple" refers to two or more. "And / or" is used to describe the association relationship of the associated objects, which means that there can be three relationships, for example, "A and / or B" can represent three cases of only A, only B and A and B existing at the same time, wherein A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects before and after it. "At least one of the following" or similar expressions means any combination of these items, including any combination of single or multiple items. For example, at least one of a, b or c can represent a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b and c can be single or multiple.

[0210] In several embodiments provided in the application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative, for example, the division of units is only a logical function division, and actual implementation can have another division manner, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed units can be indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0211] The units described as separate components can or can not be physically separated, and the components displayed as units can or can not be physical units, that is, they can be located in one place, or they can be distributed on multiple network units. According to actual needs, part or all of the units can be selected to achieve the purpose of the embodiment scheme.

[0212] In addition, the functional units in each embodiment of the application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.

[0213] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or say the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes multiple instructions for causing an electronic device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, and various program storage media. The above embodiments of the present application are described in detail in combination with the drawings, but the present application is not limited to the above embodiments, and various changes can be made within the knowledge range of ordinary skilled persons in the art without departing from the purpose of the present application.

[0214] The above embodiments of the present application are described in detail in combination with the drawings, but the present application is not limited to the above embodiments, and various changes can be made within the knowledge range of ordinary skilled persons in the art without departing from the purpose of the present application.

Claims

1. A method for generating guidance text based on diabetes management strategy recommendation, characterized in that: The method comprises: Obtain a text dataset containing patient information, medical records, and lifestyle habits; Performing entity recognition on each text in the text dataset to obtain multiple entities, and extracting relationships between entities from each text; Constructing a knowledge graph based on the multiple entities and the relationships between the entities; Aggregating entities and relationships in the knowledge graph using multiple attention layers to obtain a first embedding representation; Generating text embeddings for entities and relationships in the knowledge graph, and aggregating the text embeddings into a second embedding representation using the multi-layer attention layer; Aligning and fusing the first embedding representation and the second embedding representation to obtain a target embedding representation; Determining a plurality of management strategy candidate vectors based on the target embedding representation and the target problem; A target management strategy is selected from the multiple management strategy candidate vectors, and a diabetes management guidance text is generated according to the target management strategy.

2. The method for generating guidance text based on diabetes management strategy recommendation according to claim 1, characterized in that: The multi-layer attention layer is used to aggregate the entities and relationships in the knowledge graph to obtain a first embedding representation, including: Calculating a first attention score between a patient entity and each relationship of the patient entity corresponding to the layer using a first attention layer; Aggregating all relationships of the layer corresponding to the patient entity according to the first attention score to obtain a relationship representation of the current layer; Concatenate the head entity representation and the relationship representation in the current layer to obtain a concatenated feature representation, and input the concatenated feature representation into the multi-layer perceptron in the second attention layer to obtain a second attention score; Based on the first attention score and the second attention score, all neighbor entities connected to the patient entity relationship are aggregated to calculate the embedding representation of the current layer; The third attention layer is used to aggregate the relation representations of all layers and the embedding representations of all layers to obtain the first embedding representation.

3. The method for generating guidance text based on diabetes management strategy recommendation according to claim 2, characterized in that: The step of aggregating all neighbor entities connected to the patient entity relationship based on the first attention score and the second attention score to calculate the embedding representation of the current layer includes: Among them, E (l) represents the embedding representation of the current layer, I represents the number of triplets in the lth layer, and β user_i represents the first attention score, β entity_i represents the second attention score, represents the i-th neighbor entity in the l-th layer.

4. The method for generating guidance text based on diabetes management strategy recommendation according to claim 2, characterized in that: The third attention layer is used to aggregate the relationship representations of all layers and the embedding representations of all layers to obtain a first embedding representation, including: β l (E (0) ||R (0) )·(E (l) ||R (l) ) T Among them, E o represents the first embedding representation, o represents a placeholder, agg(·) represents an aggregation function, E (l) represents the embedding representation of the lth layer, R (l) represents the relationship representation of the lth layer, β l represents the lth layer, L represents the attention score, and T represents the transpose.

5. The method for generating guidance text based on diabetes management strategy recommendation according to claim 1, characterized in that: The aligning and fusing the first embedding representation and the second embedding representation to obtain a target embedding representation includes: Mapping the first embedding representation and the second embedding representation to the same space using a mapping matrix, and aligning the first embedding representation and the second embedding representation by maximizing cosine similarity to obtain an aligned first embedding representation and an aligned second embedding representation; The aligned first embedding representation and the aligned second embedding representation are weightedly fused to obtain a target embedding representation.

6. The method for generating guidance text based on diabetes management strategy recommendation according to claim 1, characterized in that: The step of determining a plurality of management strategy candidate vectors based on the target embedding representation and the target problem includes: Converting the target problem into a problem vector representation; Fusing the question vector representation and the target embedding representation to obtain a query vector; According to the query vector, multiple management policy candidate vectors are selected from a management policy library.

7. The method for generating guidance text based on diabetes management strategy recommendation according to claim 1, characterized in that: The step of selecting a target management strategy from the plurality of management strategy candidate vectors and generating a diabetes management guidance text according to the target management strategy includes: If the target problem is the same as one of the multiple historical problems, obtaining a history management strategy corresponding to the historical problem that is the same as the target problem; Deleting the historical management policy from the multiple management policy candidate vectors to obtain remaining management policy candidate vectors; Selecting the target management strategy most relevant to the target problem from the remaining management strategy candidate vectors; Generate diabetes management guidance text based on the target management strategy.

8. A guidance text generation system based on diabetes management strategy recommendation, characterized in that: The system comprises: A text data acquisition unit, used to acquire a text data set containing patient information, medical records, and living habits; a text data processing unit, configured to perform entity recognition on each text in the text data set to obtain a plurality of entities, and extract relationships between the entities from each text; A knowledge graph construction unit, configured to construct a knowledge graph based on the plurality of entities and the relationships between the entities; A first data aggregation unit, configured to aggregate entities and relationships in the knowledge graph using multiple attention layers to obtain a first embedding representation; a second data aggregation unit, configured to generate text embeddings for entities and relationships in the knowledge graph, and aggregate the text embeddings into a second embedding representation using the multi-layer attention layer; a data alignment and fusion unit, configured to align and fuse the first embedding representation and the second embedding representation to obtain a target embedding representation; a management strategy determination unit, configured to determine a plurality of management strategy candidate vectors based on the target embedding representation and the target problem; The guidance text generating unit is configured to generate a diabetes management guidance text according to the plurality of management strategy candidate vectors.

9. An electronic device, characterized in that: It includes at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions that can be executed by the at least one control processor, and the instructions are executed by the at least one control processor to enable the at least one control processor to execute the method for generating guidance text based on diabetes management strategy recommendation as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the method for generating a guidance text based on diabetes management strategy recommendation according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Knowledge graph completion method based on multi-semantic learning

    CN112667824A

  • Diabetes auxiliary diagnosis system, text processing method and map construction method

    CN116110570A

  • Knowledge graph multi-hop reasoning method for diabetes text

    CN116610822A

  • Large language model question and answer generation method based on knowledge graph enhancement

    CN118227769A

  • Neurogenic bladder personalized health management method and system based on knowledge enhancement

    CN119446415A